fix(web): block enter send while running#1471
fix(web): block enter send while running#1471BeckWangthumboon wants to merge 2 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
apps/web/src/components/ChatView.tsx
Outdated
| if ( | ||
| !api || | ||
| !activeThread || | ||
| phase === "running" || |
There was a problem hiding this comment.
Enter key blocked for pending user input during running
Medium Severity
The new phase === "running" guard returns early before the activePendingProgress check is reached. When the AI asks the user a question (pending user input) during a running turn, the session stays in "running" phase. This means pressing Enter to advance or submit answers to those questions no longer works — the early return prevents onAdvanceActivePendingUserInput() from ever being called via the Enter key path. The UI button still works since it calls onAdvanceActivePendingUserInput directly, but keyboard behavior is broken.
Additional Locations (1)
|
Closing this PR because the original approach (blocking Enter while running) conflicted with current steer behavior on main. Sorry for misunderstanding |


What Changed
Prevented Enter from sending a new message while a thread is already running. The composer already showed a stop button instead of a send button during active turns, but pressing Enter still submitted a new turn. This change makes Enter follow the same rule as the UI.
Also added a browser test to prevent this from regressing.
Why
Pressing Enter during a running turn should not behave differently from the visible composer controls.
Before this change, the composer showed a stop button, but Enter still sent a new message. This fix makes active-turn behavior consistent and easier to understand.
Note: The before video also shows the composer entering a weird temporary state (send button is loading) after Enter forces a send during a running turn. That happens because Enter is incorrectly allowed to trigger the normal send flow while the thread is already running.
UI Changes
Before:
before.mp4
After:
after.mp4
In "after", I was pressing the enter button.
Checklist
Validation
bun fmt
bun lint
bun typecheck
bun run test
Note
Low Risk
Low risk: adds a single guard to
onSendwhenphase === "running"plus a targeted browser test; main risk is inadvertently blocking sends in edge-case session states.Overview
Prevents starting a new
thread.turn.startwhile the thread session is already running by makingonSendearly-return whenphase === "running", aligning Enter-to-send behavior with the visible Stop button.Adds a
ChatView.browser.tsxregression test that simulates pressing Enter during a running session and asserts no additionalthread.turn.startdispatch occurs and the Stop button remains shown.Written by Cursor Bugbot for commit d9cea94. This will update automatically on new commits. Configure here.
Note
Block Enter key from starting a new turn while thread session is running
Adds an early-return guard in the
onSendhandler in ChatView.tsx that no-ops when the thread phase is'running'. A browser test in ChatView.browser.tsx verifies that pressing Enter during a running session does not dispatch athread.turn.startcommand.📊 Macroscope summarized d9cea94. 2 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues