suitedaces / computer-agent

Desktop app powered by Claude’s computer use capability to control your computer
Other
268 stars 21 forks source link

Bug: Input Field Does Not Display Typed Text #5

Closed Philomath88 closed 2 weeks ago

Philomath88 commented 2 weeks ago

Description: When running the computer-agent project, text typed into the input field does not appear. Key presses are registered, but the input_area does not display any text, resulting in an unusable input field.

Steps to Reproduce:

Clone the repository and set up the environment as described in the README. Run the application using python run.py. Attempt to type into the input field. Expected Behavior: Text should appear in the input field as it is typed.

Observed Behavior: Key presses are detected, but no text is displayed in the input_area.

Cause: The issue is caused by the custom keyPressEvent handler in window.py, which overrides the default handling for QTextEdit. Commenting out the following line allows the input field to function as expected:

python Copy code

self.input_area.keyPressEvent = self.handle_input_keypress

Workaround: Commenting out or removing the line above restores normal text display in the input field.

Suggested Fix: Review and potentially refactor handle_input_keypress to avoid overriding default text handling in QTextEdit, or add conditions to selectively process only specific key events without affecting general text input.

System Information:

Device: MacBook Pro M2 macOS Version: 15.0.1 (24A348) Python version: 3.x PyQt version: [Specify if known] Additional Notes: This fix may require additional review to ensure that other key press functionalities (such as shortcuts) are not affected.

suitedaces commented 2 weeks ago

Pushing a fix for this today! Introduced this in my previous commit :p

suitedaces commented 2 weeks ago

https://github.com/suitedaces/computer-agent/commit/82c0d9fe8bbabf242cd4313fbfa51a9e294bd941

Fixed!

suitedaces commented 2 weeks ago

@Philomath88 lmk if it worked for you?

Philomath88 commented 2 weeks ago

@suitedaces Amazingly fast response! This works!