Skip to content

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

Merged
ymichael merged 2 commits into
get-bb:mainfrom
davidondrej:esc-cancels-inline-message-edit
Aug 21, 2026
Merged

ymichael merged 2 commits into
get-bb:mainfrom
davidondrej:esc-cancels-inline-message-edit

Conversation

@davidondrej

@davidondrej davidondrej commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

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 verify that Escape calls onEscape without blurring, omission retains the default blur behavior, and an open typeahead consumes the first Escape before the host callback.
  • A new FollowUpPromptBox.test.tsx regression test verifies that the composer forwards its host Escape action to PromptBoxInternal.
  • The sent-message edit test in ThreadDetailPromptArea.test.tsx verifies that Escape calls onCancel while the bottom composer receives no onEscape.
  • pnpm exec turbo run test --filter=@bb/app --force -- src/components/promptbox/PromptBoxInternal.test.tsx src/components/promptbox/FollowUpPromptBox.test.tsx src/views/thread-detail/ThreadDetailPromptArea.test.tsx passes all 162 tests across the three focused files, including the existing voice-recording Escape-priority coverage.
  • pnpm exec turbo run typecheck --filter=@bb/app --force passes.
  • Browser QA with sawyerhood/dev-browser reproduces the pre-fix behavior on main (Escape leaves the edit frame open after blurring) and confirms the fixed behavior (Escape closes the edit frame and restores the sent message).

🤖 Generated with Claude Code

AGENT GENERATED: by Claude Fable 5

davidondrej and others added 2 commits August 21, 2026 13:22
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.
@ymichael
ymichael force-pushed the esc-cancels-inline-message-edit branch from ebb946a to 09bc72d Compare August 21, 2026 20:24
@ymichael
ymichael merged commit 7d1f805 into get-bb:main Aug 21, 2026
12 checks passed
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