feat(ux): unify "Ask Claude to Edit" + inline prompt at selection; fix keybindings (#62)
This commit was merged in pull request #62.
This commit is contained in:
@@ -174,16 +174,22 @@ suite("F11 preview toolbar (host E2E — message → seam wiring, no LLM)", () =
|
||||
assert.strictEqual(api.proposalController.listProposals(doc).length, 0, "no proposals left pending");
|
||||
});
|
||||
|
||||
// SLICE-3: the document-scoped command exists for #42 reuse, guarded on markdown.
|
||||
test("cowriting.editDocument is a registered command, palette-guarded on markdown", async () => {
|
||||
// SLICE-3: the document-scoped command stays registered for #42 reuse (now behind
|
||||
// the unified `cowriting.edit`). editDocument is hidden from the palette; the
|
||||
// markdown-guarded user-facing palette command is `cowriting.edit`.
|
||||
test("cowriting.editDocument stays registered; cowriting.edit is the markdown-guarded palette command", async () => {
|
||||
const all = await vscode.commands.getCommands(true);
|
||||
assert.ok(all.includes("cowriting.editDocument"), "editDocument command registered");
|
||||
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "../../../../package.json"), "utf8"));
|
||||
const entry = (pkg.contributes.menus.commandPalette as Array<{ command: string; when?: string }>).find(
|
||||
(m) => m.command === "cowriting.editDocument",
|
||||
);
|
||||
assert.ok(entry, "editDocument has a commandPalette entry");
|
||||
assert.match(entry!.when ?? "", /editorLangId == markdown/, "guarded on markdown");
|
||||
assert.ok(all.includes("cowriting.edit"), "unified edit command registered");
|
||||
const palette = JSON.parse(fs.readFileSync(path.join(__dirname, "../../../../package.json"), "utf8")).contributes
|
||||
.menus.commandPalette as Array<{ command: string; when?: string }>;
|
||||
// editDocument is hidden (routed via cowriting.edit).
|
||||
const docEntry = palette.find((m) => m.command === "cowriting.editDocument");
|
||||
assert.strictEqual(docEntry?.when, "false", "editDocument hidden from the palette");
|
||||
// cowriting.edit is the user-facing, markdown-guarded entry.
|
||||
const editEntry = palette.find((m) => m.command === "cowriting.edit");
|
||||
assert.ok(editEntry, "cowriting.edit has a commandPalette entry");
|
||||
assert.match(editEntry!.when ?? "", /editorLangId == markdown/, "guarded on markdown");
|
||||
});
|
||||
|
||||
// SLICE-5: the minimal right-click gateway lives in editor/title (markdown only).
|
||||
|
||||
Reference in New Issue
Block a user