-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat: save input text draft into local storage #9809
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
base: main
Are you sure you want to change the base?
Conversation
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.
No issues found across 3 files
RomneyDa
left a comment
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.
@uinstinct it looks like this only works for the main input. I think it's an improvement but can we think of a simple way to have this work across conversations and in any tip tap editor when going to settings and back?
- On closing/reopening vs code it's okay to lose drafts in any editor but would be nice if main editor was saved (already works on this branch) and great if all were saved (in a way that doesn't leak local storage etc memory)
- On going to settings and back any editor's content is preserved, as well as the scroll position of the chat history in case I was editing message number 2 in a 5 message sequence
If too many tradeoffs we can merge this but let's brainstorm on full solution first. There might be a simple solution where we don't unmount the component at all when switching to settings (router level fix).
and scroll to position when going back
It currently saves all - there would not be any memory leakage, as far as I think, because there can only be 2 drafts be saved: inputDraft_chat or inputDraft_edit which get cleared during submission
I did a simple implementation for this to save the editing draft and scroll back to chat history position. feat.mp4 |
Description
Save the unsubmitted input text into local storage so that it persists between reloads and page changes.
resolves CON-5281
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
before.mp4
after.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Continue Tasks:▶️ 2 queued — View all
Summary by cubic
Persist unsubmitted drafts for both the main input and per-message edits in local storage so text and position survive reloads and navigation. Drafts auto-load per chat/message, restore scroll and focus, and clear on submit or when empty. Resolves CON-5281.
New Features
Refactors
Written for commit d090ce5. Summary will update on new commits.