Skip to content

feat(react): auto-save message drafts per room and thread (#1370) - #1385

Open
Tisya-Gupta wants to merge 1 commit into
RocketChat:developfrom
Tisya-Gupta:feat/auto-save-message-drafts
Open

Tisya-Gupta wants to merge 1 commit into
RocketChat:developfrom
Tisya-Gupta:feat/auto-save-message-drafts

Conversation

@Tisya-Gupta

Copy link
Copy Markdown

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

@Tisya-Gupta
Tisya-Gupta force-pushed the feat/auto-save-message-drafts branch from 85b3236 to 6e83fd3 Compare October 15, 2026 17:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] feat: Auto-save message drafts per room

1 participant