[Bug]: Touched file in the editor causes that file to never be updated by in UI again
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Describe the bug and reproduction steps
On the latest main, let's say the workspace has a files with content.
- Ask the bot to
do nothing, and then open the test file. - Make some line edits in the file, then switch to another file.
- In UI, switch back to the edited file, it will show the previous edits.
- Check in the workspace file system, the content of the actual file will not have changed.
- Check what the UI is doing with HTTP request, and it is calling
api/select-file?...and the response is correctly matching actual workspace content
UI editor though is still stuck rendering incorrect content. I think there's a bug somewhere with how the react state is caching the file content.
OpenHands Installation
Docker command in README
OpenHands Version
main
Operating System
None
Logs, Errors, Screenshots, and Additional Context
No response
@diwu-sf , after you change the contents of the file in the UI, do you save the file by pressing Ctrl + s or Cmd + s , as you would on an IDE?
I do believe we should make this more clear but if you save it, it will work.
Okay i see what's happening:
- if the user has modified a file, it's tainted in the UI and backend state doesn't overwrite the UI un-saved state
- switching away from a modified file in the UI (without ctrl+s on the tainted file) doesn't reset that file, the state is still kept around in UI
- from then on, even clicking the refresh file-tree button doesn't reset the in-memory unsaved state
Here's potential suggestions:
- for "tainted" UI files with unsaved state, mark them in the UI explorer tree with a "orange dot" next to the name, with hover tooltip clarifying that it's got unsaved state
- have a way to re-sync that file, perhaps "double clicking" on an unsaved file in the file tree will re-load it
- or just have a full blown "right click context menu" or a file status bar at the top of the editor area
amanape will be discussing this with the UI designer to see how to move forward on this. Thanks for bringing this up and writing out potential solutions!
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for over 30 days with no activity.
This is solved in main because the UI does not allow you to modify files anymore.
Fixed in 0.18.0.