Repository navigation
Chat composer: Backspace at the prompt's start removes the last attached image - #23889
Conversation
Backspace with the caret at the start of the prompt should take back the last staged attachment (a pasted image) in the chat composer and the New Tab field; today only the chip's x removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the chat composer and the New Tab field, Backspace with an empty caret at the start of the prompt removes the last attachment chip, one per press, as Claude's composer does. A held key's repeat does not, and a heading or list item at the start still takes Backspace to lift itself (MarkdownFieldHandle.atStart). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Passes: CI passes on CI passes on Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 3b82593 to compare; do not merge until green; see lane-rules Tour of Gallery before/after for
States
Pick other states with a |
|
Review (Claude subagent, correctness first): SHIP at 7552e7c
Tests on the AWS Macs: red at |
|
Found 8 test failures on Blacksmith runners: Failures
|
|
Bead |
|
CI on c142e4a (the head after the
Dev build of 7552e7c (the fix before the merge): job |
…ext-chat-image-backspace # Conflicts: # webviews/src/agent-session/acpmux/newtab/NewTabScreen.tsx
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
…ext-chat-image-backspace # Conflicts: # webviews/src/agent-session/acpmux/composer/attachmentIntake.tsx # webviews/src/agent-session/acpmux/newtab/NewTabScreen.tsx
|
Merge conflicts with
The PR diff is still the same 6 webviews files. CI at this head:
|
…ext-chat-image-backspace # Conflicts: # webviews/src/agent-session/acpmux/Composer.tsx
The Classic template (NewTabPage.tsx) took the Backspace chip removal in the merge with feat-cmux-next. A prefix it switched to is undone first, then the last image goes, one per press. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged by Last conflict resolution:
Review (Claude subagent, correctness first): SHIP at bc0fff8. The only gap it raised, the missing Classic test, was added in f1bf9e4. CI at f1bf9e4:
|
|
Shipped in:
|
|
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/39913961585 at a62351d failed: cmux-next fast tier, cmux-next perf gate. |
|
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/39922732738 at ab42b3c failed: cmux-next fast tier. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
In the agent chat composer and on the New Tab page, Backspace with the caret at the very start of the prompt now removes the last staged attachment chip (a pasted or dropped image, a file, a pasted-text chip), one per press. Before, only the chip's × removed it.
backspacedAttachmentinwebviews/src/agent-session/acpmux/composer/attachmentIntake.tsx.MarkdownFieldHandle.atStart()): an empty caret at the start of a plain first paragraph. A heading, list item or quote at the start still takes Backspace to lift itself, and the chips stay.Testing
Regression tests were committed before the fix (
035e6410b7c9b953e2c263844a170131afe0faad):webviews/test/composer-paste-text.test.tsx(jsdom, the real Milkdown composer).webviews/test/new-tab-paste-attachments.test.ts(browser lane, real Chromium and WebKit key presses).Command:
cmux-ci run --class light --script scripts/ci/run-webviews-tests.sh --env CMUX_WEB_TEST_FILES=<file> [--env CMUX_BROWSER_TESTS=1] --ref <sha>035e641)7552e7c)d21a02e0306bb44c6f7eab68)0b5b7ffdeb4ddfb057787d91)3217df91f69a352148b26d8d)ecbaa60d31f5069b4fc6f562)Observed / Not run
scripts/web-lint.shandscripts/cmux-next/prepush-gate.pyboth pass.No capture: a keyboard behavior change with no visual change.
Review
A correctness review subagent ran on the first version. It found that Backspace at the start of a heading or list item would remove a chip instead of lifting the block; fixed with
atStart(), and covered by the heading test. It also flagged an unmounted-editor fallback that read as "at start" (atStart()returns false there) and racy negative checks in the browser test (a frame is now awaited before counting). A re-review on this head follows in a comment.Changelog
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Backspace with the caret at the very start of the prompt now removes the last staged attachment chip (a pasted or dropped image, a file, or pasted text) in the chat composer and on both New Tab templates, one per press. Previously only the chip's × removed it.
backspacedAttachment; the chat composer uses a newMarkdownFieldHandle.atStart()so a heading, list item, or quote at the start still takes Backspace to lift itself and keeps the chips.!to terminal), then removes the last image, which the default template removes directly.Written for commit f1bf9e4. Summary will update on new commits.