Repository navigation
feat(react): auto-save message drafts per room and thread (#1370) - #1385
Open
Tisya-Gupta wants to merge 1 commit into
Open
Tisya-Gupta wants to merge 1 commit into
Tisya-Gupta wants to merge 1 commit into
Conversation
Tisya-Gupta
force-pushed
the
feat/auto-save-message-drafts
branch
from
October 15, 2026 17:14
85b3236 to
6e83fd3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds automatic saving and restoration of unsent message drafts across channel switches and page reloads. While typing in the chat input, the message content is automatically saved to local storage with a 300-millisecond debounce, and any unsent text is also immediately saved when switching rooms or closing the page. Saved drafts are cleanly separated by server host, logged-in user ID, channel ID, and thread ID, ensuring that drafts from different rooms or threads never overwrite each other and are kept private to the current user. When returning to a channel or thread with a saved draft, the input field automatically restores the text, enables the send button, and displays an informative banner indicating that a draft has been restored, which can be quickly cleared by pressing the Escape key. The stored draft is automatically deleted when the message is sent, converted to an attachment, executed as a slash command, or cleared from the input. Message editing mode is preserved without conflict because drafts are not saved during an active edit, and any pending draft is safely restored once editing is finished or canceled. The feature has been tested locally with passing unit tests covering all storage logic, zero lint errors, and successful production builds across the repository.
Closes #1370