feat(#41): Open Cowriting Review Panel from markdown file/tab right-click

The review preview (`cowriting.showTrackChangesPreview`) was only reachable from
the command palette and `ctrl+alt+r` — neither where a writer's hand naturally
goes. Add the obvious right-click entry points to the plugin's central surface:

- `explorer/context` + `editor/title/context` menu items gated on
  `resourceLangId == markdown`, both invoking `showTrackChangesPreview`.
- The command now resolves the *clicked* document: it opens the passed Uri if
  it isn't already an open document (the Explorer case), instead of falling back
  to the active editor. No-arg invocation (palette / keybinding) is unchanged.
- Retitle the command to "Open Cowriting Review Panel" so the menus read the
  operator's wording (palette shows "Cowriting: Open Cowriting Review Panel").

E2E: clicked-doc resolution (open + not-yet-open + no-arg fallback), both menu
contributions present + markdown-gated, title, and keybinding unchanged.

Closes #41.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-12 16:04:02 -07:00
parent de53305a08
commit 695b51f903
4 changed files with 145 additions and 5 deletions
+15 -1
View File
@@ -76,7 +76,7 @@
},
{
"command": "cowriting.showTrackChangesPreview",
"title": "Cowriting: Open Review Preview",
"title": "Open Cowriting Review Panel",
"category": "Cowriting"
},
{
@@ -119,6 +119,20 @@
"group": "navigation@9"
}
],
"editor/title/context": [
{
"command": "cowriting.showTrackChangesPreview",
"when": "resourceLangId == markdown",
"group": "1_cowriting"
}
],
"explorer/context": [
{
"command": "cowriting.showTrackChangesPreview",
"when": "resourceLangId == markdown",
"group": "navigation@9"
}
],
"editor/context": [
{
"command": "cowriting.editSelection",