Preserve temporary message in Studio Code UI#3824
Conversation
📊 Performance Test ResultsComparing 5d179b6 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
sejas
left a comment
There was a problem hiding this comment.
Thanks for implementing this improvement. The happy path works great. I just noticed that, in an existing conversation, when clicking “New conversation,” it leaves the draft message in localStorage. It would be great to remove that item as well.
Also, I wonder if it makes sense to keep the text input populated with the existing value when clearing the conversation, although trunk behaves the same way and clears the text input too.
Happy Path
happy-path-keep-draft-input.mp4
New conversation left over
leaving-draft-saved-in-localstorage.mp4
Great catch 👍 Addressed
I don’t see specific advantages to either approach. So for now, I would propose to leave things as they are. |
I was expecting it to be reset when I tested this but I find a bit of a strange flow, especially when I am using the templates provided:
Screen.Recording.2026-06-16.at.10.17.28.AM.mov |
sejas
left a comment
There was a problem hiding this comment.
The issue of leaving the draft in local storage after starting a new conversation is fixed. Thanks!
The issue that Kat mentions seems to be related to this change. I see an inconsistent behaviour when:
- Typing text in the text input
- Click on start a new conversation
- Observe the text input is still in the text input
- Change sites or tabs
- Come back to previous conversation
- Observe your draft text input is gone
Yeah, fixed |
There was a problem hiding this comment.
I confirm now that it’s consistent, and clicking “New conversation” always removes the text input immediately. I think it's open for discussion if that's the expected behaviour but at least is consistent. I think we can merge this PR and decide if we want to keep the value in the text input or not.
Also, I wonder if it makes sense to keep the text input populated with the existing value when clearing the conversation, although trunk behaves the same way and clears the text input too.
I don’t see specific advantages to either approach. So for now, I would propose to leave things as they are.
new-conversatio-removes-input.mp4
I confirmed that Claude resets the text input when clicking on a new chat within existing conversations, although it keeps the text input if your chat didn't start yet.
Related issues
How AI was used in this PR
AI wrote the code, I reviewed and made a few manual adjustments.
Proposed Changes
I had a case where I was writing a prompt, then needed to switch to the site Settings tab and come back — and as a result, I lost my prompt draft.
AFAIK, it’s a common UX expectation to preserve drafts when the app state changes or when the user temporarily leaves the form.
Testing Instructions