Clear the composer when switching bots - #39
Conversation
The composer keeps its own text state and stays mounted across bot switches, so a half-written message follows the user into the next conversation — and can be sent to the wrong bot. Key it by bot id. Switching remounts it, which drops the draft and also resets the mention picker; the dictation effect already stops the helper on unmount, so an in-flight recording ends cleanly too. Co-Authored-By: Claude <noreply@anthropic.com>
Both sides changed the same Composer render: main passes onEditLast (milind-soni#45), this branch keys it by bot.id. Kept both — the key still remounts on switch so drafts don't follow you between conversations.
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
#39 keyed the composer by bot id so a half-written message stops following the user into the next conversation. That fixed the wrong-bot send, but it throws the draft away: leave a thread mid-sentence, come back, and the text is gone. Keep the draft instead of dropping it. lib/drafts stores the unsent text per bot (and per room) in localStorage, and the composer reads it on mount — so remounting still isolates threads from each other, but the message you were writing is waiting when you return, even after a restart. Sending or emptying the box clears the entry. Storage is best-effort: a full quota or an unreadable value reads as "no drafts" rather than costing a keystroke. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Upstream clears the composer on every bot switch (milind-soni#39), which also throws away half-typed text you meant to come back to. Drafts now live per bot (and per room) in localStorage, so leaving a thread and returning finds the message still there — and sending still empties it. Drops 060-composer-per-bot.patch: upstream owns that behavior now, so the patch had stopped applying. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197wYuWWpF21iBeNgHZ8n3X
Composerowns itstextstate and stays mounted across bot switches, so a half-written message follows you into the next conversation — and pressing Enter there sends it to the wrong bot.Keying it by bot id remounts it on every switch, which drops the draft and resets the mention picker with it. The dictation effect already stops the helper in its cleanup, so a recording in flight ends cleanly rather than leaking into another thread.
No visual change to capture — the difference is an empty input where the previous bot's text used to be. Happy to add a recording if you'd like one.
If you would rather keep drafts than drop them, per-bot drafts in
Appwould work too; this is the smaller change and matches what the UI implies today.pnpm typecheck && pnpm testpass.