-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: unsaved file content #3358
Conversation
I still need to add specs for this
…nDevin/OpenDevin into feature-unsaved-file-content
Sorry for the delay, I'll give it a full review tomorrow! LGTM though from a quick skim if you're in a rush |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Consider extending the test cases to serve as another form of documentation for newcomers (if you have the time of course!)
Added a few more minimal test cases. TBH I think we need more test cases around editing |
Before Changes
When you make changes in the code editor, if you click into a different file, the changes are lost.
e.g.:
I write some changes:
But if I click into a different file, they are lost! (There is no dialog or warning to prevent this!)
After Changes
We store changes even after you click out of a file. Files with unsaved changes are marked with a "*", and a cancel button was added to clear changes. (My original idea was to use local storage / indexed db to store changes, but I have not implemented this for this iteration - so a page refresh will still clear edits)
I can click to a different file and make changes there too:
Clicking back to the original displays the unsaved changes:
Changes are only saved / cancelled when the page is refreshed or the button is clicked.
Under the hood
I added an array of fileStates to the redux state - this allows for determining whether there is unsavedContent, and displaying different UI states in the file explorer
Open Questions
I think some UI review is in order - making sure this is consistent with where we want the product to go, and that this UI is intuitive.