AutoGPT
AutoGPT copied to clipboard
fix(frontend): Fix text area input not updating input field
Background
Detailed Textbox modal is not updating the input text value, because the change is only triggered by inputBox unblur.
https://github.com/user-attachments/assets/ee07e592-6022-4cfc-b8c9-3d5b101ee22d
Problem:
- We can't use
onChange& HTMLvaluecontrolled combination, because this will make cursor keep change on each change, making us unable to type in the middle of the text. - We uses onBlur and make the input uncontrolled to circumvent the issue, but this makes the changing the input outside the box unusable.
Solution:
- We keep creating a new ref on each render / statechange with the state value, it will allow flexible change, the inputbox will still be uncontrolled, but it will still be up to date on each state change.
Changes ๐๏ธ
Each node-input-component will pass a HTML input ref that will always match the state value. Side Changes: Fix linting errors, latest master introduced stricter linting rules.
Testing ๐
[!NOTE] Only for the new autogpt platform, currently in autogpt_platform/
- Create from scratch and execute an agent with at least 3 blocks
- Import an agent from file upload, and confirm it executes correctly
- Upload agent to marketplace
- Import an agent from marketplace and confirm it executes correctly
- Edit an agent from monitor, and confirm it executes correctly
PR Reviewer Guide ๐
| โฑ๏ธย Estimated effort to review: 2 ๐ต๐ตโชโชโช |
| ๐งชย No relevant tests |
| ๐ย No security concerns identified |
| โกย Key issues to review Potential Performance Issue Possible Bug |
Deploy Preview for auto-gpt-docs canceled.
| Name | Link |
|---|---|
| Latest commit | b54bd5ebc0eeeecea598fe2a8ea9ce910e20f678 |
| Latest deploy log | https://app.netlify.com/sites/auto-gpt-docs/deploys/66fb2499d6cc3c0008b1b8f3 |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Superseded by https://github.com/Significant-Gravitas/AutoGPT/pull/8190