cx-ncc.60: edit and resend a past prompt (Claude parity)
Summary
Adds Claude desktop's edit and resend to cmux-next's agent chat (Claude parity, cx-ncc.60).
Hovering a prompt now shows Copy and Edit under its bubble. Edit opens the prompt in place: Enter sends, Shift-Enter adds a line, and Escape or Cancel puts the bubble back. Send forks the chat through the turn before that prompt, opens the fork and sends the edited text there with the original attachments. The original chat is kept as it was, as Claude keeps the earlier branch. Switching between branches with arrows is cx-ncc.61.
Edit appears only where the fork can happen. acpmux forks a Claude chat through any completed turn (hub/fork_at.rs, the same path session replay's Continue uses). Other agents fork only at a chat's end, and a chat's first prompt has no turn before it, so neither offers Edit. Copy shows on every prompt.
Testing
New webviews/test/edit-resend.test.tsx, run by hosted web / react-apps-check:
- Red on
b9b9dd050bfe(test plus stubs):FAIL test/edit-resend.test.tsx; the first prompt had no Copy button (edit-resend.test.tsx:68,Received: undefined). run 38155996959 - Green on
a217b9b73e20:PASS test/edit-resend.test.tsx. That covers a refused resend keeping the draft open, a successful one closing it, Escape, and Codex chats offering no Edit. Gallery coverage passes with the newagent-pane.user-bubbleentry. - Locally:
bun run check,bunx tsc --noEmit -p .,bun test test/ui-rules.test.ts,bun test test/gallery-coverage.test.ts. - The only remaining red is the base red
composer-send-stop.test.ts("stops a running turn…", a 31 s timeout). It fails on every PR's react-apps-check and is unrelated.
Review fixes, from a review subagent: a resend sends only while the fork is still the open chat; a refused fork or a switched chat leaves the draft open; Enter ignores IME keyCode 229. A user-added Claude ACP profile also reports family claude, but acpmux forks through a turn only for the built-in Claude harness. There the fork is refused with its notice and the draft stays open. Known limit, the same as Retry today: after a page reload, a resend loses the original prompt's image attachments.
Not dogfooded on a DEV build (no DEV builds as proof for this lane). The fork path is acpmux's existing acp.session.fork through-turn path (fork_through.rs).
Changelog
- Added: edit a past prompt in a Claude agent chat and resend it as a new branch.
🤖 Generated with Claude Code