Skip to content

Cancel an inline sent-message edit with Escape - #1940

Open
davidondrej wants to merge 1 commit into
get-bb:mainfrom
davidondrej:esc-cancels-inline-message-edit
Open

Cancel an inline sent-message edit with Escape#1940
davidondrej wants to merge 1 commit into
get-bb:mainfrom
davidondrej:esc-cancels-inline-message-edit

Conversation

@davidondrej

Copy link
Copy Markdown

What was wrong

Pressing Escape inside the sent-message inline editor only blurred the composer — the standard Escape-to-release behavior every composer shares. The editor could only be closed with its X button, so an edit opened by mistake could not be dismissed from the keyboard.

What changed

  • PromptBoxInternal gains an optional onEscape prop that replaces the default Escape-to-blur when provided. Higher-priority Escape consumers are unchanged: the typeahead menu still dismisses itself first, and voice recording still cancels from its window capture listener.
  • FollowUpComposerProps carries onEscape through to the internal box.
  • ThreadDetailPromptArea passes the sent-message editor's existing cancel action as onEscape, so Escape now cancels the edit exactly like the frame's X button. The queued-message inline editor and the bottom composer are unchanged (no onEscape → blur as before).

No wire changes; no CLI/guide surfaces affected.

How you verified

  • New tests in PromptBoxInternal.test.tsx (fail before, pass after): Escape calls onEscape without blurring the editor; an open typeahead consumes the first Escape and only the second one reaches onEscape.
  • Extended the sent-message edit test in ThreadDetailPromptArea.test.tsx: Escape in the edit composer calls onCancel, and the bottom composer receives no onEscape.
  • pnpm exec turbo run typecheck --filter=@bb/app passes. All 156 tests across the three touched test files pass, including the pre-existing voice-recording Escape-priority tests.

🤖 Generated with Claude Code

AGENT GENERATED: by Claude Fable 5

Escape in the sent-message inline editor now cancels the edit (same as
the frame's X button) instead of only blurring the composer. The
composer gains an optional onEscape that replaces the Escape-to-blur
default; typeahead dismissal and voice-recording cancel keep their
higher priority. The queued-message inline editor is unchanged.
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.

1 participant