Skip to content

fix(web): block enter send while running#1471

Closed
BeckWangthumboon wants to merge 2 commits intopingdotgg:mainfrom
BeckWangthumboon:fix/block-enter-send-while-running
Closed

fix(web): block enter send while running#1471
BeckWangthumboon wants to merge 2 commits intopingdotgg:mainfrom
BeckWangthumboon:fix/block-enter-send-while-running

Conversation

@BeckWangthumboon
Copy link
Copy Markdown
Contributor

@BeckWangthumboon BeckWangthumboon commented Mar 27, 2026

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

  • This PR is small and focused
  • I explained what changed and why
  • I included a video for animation/interaction changes

Validation

bun fmt
bun lint
bun typecheck
bun run test


Note

Low Risk
Low risk: adds a single guard to onSend when phase === "running" plus a targeted browser test; main risk is inadvertently blocking sends in edge-case session states.

Overview
Prevents starting a new thread.turn.start while the thread session is already running by making onSend early-return when phase === "running", aligning Enter-to-send behavior with the visible Stop button.

Adds a ChatView.browser.tsx regression test that simulates pressing Enter during a running session and asserts no additional thread.turn.start dispatch 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 onSend handler 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 a thread.turn.start command.

📊 Macroscope summarized d9cea94. 2 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 774c5474-e2f4-4c44-8696-2a9d0fd166e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 27, 2026
@BeckWangthumboon BeckWangthumboon marked this pull request as ready for review March 27, 2026 21:15
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

if (
!api ||
!activeThread ||
phase === "running" ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

@BeckWangthumboon BeckWangthumboon marked this pull request as draft March 27, 2026 21:20
@BeckWangthumboon BeckWangthumboon marked this pull request as ready for review March 27, 2026 21:28
@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Mar 27, 2026
@BeckWangthumboon BeckWangthumboon marked this pull request as draft March 28, 2026 01:50
@BeckWangthumboon
Copy link
Copy Markdown
Contributor Author

BeckWangthumboon commented Mar 28, 2026

Closing this PR because the original approach (blocking Enter while running) conflicted with current steer behavior on main. Sorry for misunderstanding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant