Skip to content

Clear the composer when switching bots - #39

Merged
milind-soni merged 2 commits into
milind-soni:mainfrom
guilimasp:fix/clear-composer-on-bot-switch
Aug 13, 2026
Merged

Clear the composer when switching bots#39
milind-soni merged 2 commits into
milind-soni:mainfrom
guilimasp:fix/clear-composer-on-bot-switch

Conversation

@guilimasp

Copy link
Copy Markdown
Contributor

Composer owns its text state 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 App would work too; this is the smaller change and matches what the UI implies today.

pnpm typecheck && pnpm test pass.

guilimasp and others added 2 commits August 12, 2026 21:37
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.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@milind-soni, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba55ada4-6081-4ba1-9a5c-bb3ccf50e3aa

📥 Commits

Reviewing files that changed from the base of the PR and between 1e36a89 and 0dc14a2.

📒 Files selected for processing (1)
  • src/components/ChatView.tsx

Comment @coderabbitai help to get the list of available commands.

@milind-soni
milind-soni merged commit 4ad098b into milind-soni:main Aug 13, 2026
4 checks passed
guilimasp added a commit to guilimasp/OpenMausBot that referenced this pull request Aug 13, 2026
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
milind-soni pushed a commit that referenced this pull request Aug 14, 2026
#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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 15, 2026
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
guilimasp added a commit to guilimasp/OpenMausBot that referenced this pull request Aug 18, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 19, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 20, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 21, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 22, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 23, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 24, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 25, 2026
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
github-actions Bot pushed a commit to guilimasp/OpenMausBot that referenced this pull request Aug 26, 2026
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
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.

2 participants