Cancel an inline sent-message edit with Escape - #1940
Open
davidondrej wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
PromptBoxInternalgains an optionalonEscapeprop 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.FollowUpComposerPropscarriesonEscapethrough to the internal box.ThreadDetailPromptAreapasses the sent-message editor's existing cancel action asonEscape, so Escape now cancels the edit exactly like the frame's X button. The queued-message inline editor and the bottom composer are unchanged (noonEscape→ blur as before).No wire changes; no CLI/guide surfaces affected.
How you verified
PromptBoxInternal.test.tsx(fail before, pass after): Escape callsonEscapewithout blurring the editor; an open typeahead consumes the first Escape and only the second one reachesonEscape.ThreadDetailPromptArea.test.tsx: Escape in the edit composer callsonCancel, and the bottom composer receives noonEscape.pnpm exec turbo run typecheck --filter=@bb/apppasses. All 156 tests across the three touched test files pass, including the pre-existing voice-recording Escape-priority tests.🤖 Generated with Claude Code