Skip to content

feat: cache input draft per session across thread switches#421

Open
furoxr wants to merge 1 commit intoop7418:mainfrom
furoxr:furoxr/input-cache-per-thread
Open

feat: cache input draft per session across thread switches#421
furoxr wants to merge 1 commit intoop7418:mainfrom
furoxr:furoxr/input-cache-per-thread

Conversation

@furoxr
Copy link
Copy Markdown

@furoxr furoxr commented Apr 2, 2026

When switching between threads in the sidebar, any unsent text in the input box was lost because MessageInput remounts with a new key={sessionId}. This adds a module-level Map that caches draft text per session ID, restoring it when the user switches back. The cache is automatically cleared when a message is sent.

Related:

Add module-level Map to store unsent draft text keyed by sessionId.
When MessageInput remounts after switching threads, the draft is
restored from cache instead of resetting to empty.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

Someone is attempting to deploy a commit to the op7418's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant