feat(ux): unify "Ask Claude to Edit" + inline prompt at selection; fix keybindings

Operator feedback on the Ask-Claude ergonomics (relates to #42/#43/#60):

- One user-facing command `cowriting.edit` ("Ask Claude to Edit") routes to the
  selection or whole-document flow at runtime via the pure `routeEdit` helper
  (selection → editSelection; none / tab right-click → editDocument). The two
  underlying commands stay registered for the seams + E2E but are hidden from the
  palette, and the split menu pairs collapse to one entry.
- Keybindings with `mac` variants (the missing variant is why ⌃⌥R "didn't work"
  on macOS — Option combos are unreliable there): `cmd+alt+e`/`ctrl+alt+e` for
  Ask-Claude-to-Edit, `cmd+alt+r`/`ctrl+alt+r` for the review panel.
- The instruction prompt now renders INLINE at the selection/cursor via a
  dedicated Comments-API controller (`InlineAskController`, `cowriting.askClaude`)
  instead of the top-center QuickInput — VS Code's Inline-Chat-style placement.
  Both Ask-Claude entry points (editSelection + the preview's askClaude) share it.

Tests: routeEdit unit tests; E2E menu/palette assertions updated for the unified
command; E2E drives the inline prompt by stubbing `api.inlineAsk.prompt`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BenStullsBets
2026-06-26 05:00:35 -07:00
parent a42e5f145d
commit d6b3c6fa5f
9 changed files with 285 additions and 80 deletions
@@ -28,7 +28,10 @@ suite("no-workspace authoring (F8 — real folder-less, #8 lineage)", () => {
"cowriting.reply",
"cowriting.resolveThread",
"cowriting.reopenThread",
"cowriting.edit",
"cowriting.editSelection",
"cowriting.askClaude.submit",
"cowriting.askClaude.cancel",
"cowriting.applyAgentEdit",
"cowriting.proposeAgentEdit",
]) {