agent pane: the prompt menu offers Undo, Redo and Select All (recut of #20903)

Merged
TE
18d ago
+568-4

Recut of #20903 onto current feat-cmux-next.

The prompt's right-click menu now starts with Undo and Redo and has Select All after the edit items, like a native text field and like Claude desktop's composer. Undo and Redo use the prompt editor's own history (ProseMirror undo/redo). They are disabled when there is nothing to undo or redo, read when the menu opens. In shell mode the field is a plain text area whose history the page can't read, so both stay offered there and run the text area's own undo/redo command. Select All selects the whole prompt.

Testing

  • CMUX_BROWSER_TESTS=1 bun test test/composer-field-menu.test.ts (new browser-lane test: open the menu, check the items and their disabled states, undo, redo, select all): 1 fail with only the test committed (68f9e092b7f), 1 pass with the fix.
  • composer-menu-dismiss, composer-menu-width (browser lane), home-composer-menu and pane-english pass. bun run typecheck, check:type-scale and fmt are clean.

Localization

Three new strings, composer.menu.undo, composer.menu.redo and composer.menu.selectAll, are in Localizable.xcstrings for all 21 locales (the same set as the existing composer.menu.copy); generated/strings.json is build output since #21970.

Changelog

Added: the agent chat prompt's right-click menu has Undo, Redo and Select All.

🤖 Generated with Claude Code


Summary by cubic

The prompt's right-click menu now offers Undo, Redo, and Select All in the order a native text field does: Undo and Redo first, then the edit items, then Select All. Undo and Redo use the prompt editor's own history and are disabled when there is nothing to undo or redo; in shell mode both stay enabled and run the text area's own commands, since its history can't be read from the page.

This is a recut of #20903 onto feat-cmux-next. Three new strings (composer.menu.undo, composer.menu.redo, composer.menu.selectAll) are localized in all 21 locales. A new browser test checks the menu items, their disabled states, and that Undo, Redo, and Select All act on the prompt.