F3 polish: active-editor status bar + E2E for command wrapper and toggle (PUC-5) (#6)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -131,4 +131,32 @@ suite("F3 live attribution (host E2E — seam-driven, no LLM)", () => {
|
||||
assert.ok(!spans.some((s) => s.authorKind === "agent"), "mangled agent span not rendered");
|
||||
assert.ok(api.attributionController.getOrphanCount(DOC_REL) >= 1, "…it is orphaned instead (INV-1)");
|
||||
});
|
||||
|
||||
test("the applyAgentEdit command wrapper and the toggle command work end-to-end", async () => {
|
||||
const doc = await openDoc();
|
||||
const api = await getApi();
|
||||
const anchor = "stable first paragraph";
|
||||
const start = doc.getText().indexOf(anchor);
|
||||
const ok = await vscode.commands.executeCommand<boolean>("cowriting.applyAgentEdit", {
|
||||
uri: doc.uri.toString(),
|
||||
start,
|
||||
end: start + anchor.length,
|
||||
newText: "stable COMMAND-EDITED paragraph",
|
||||
model: "sonnet",
|
||||
sessionId: "e2e-cmd",
|
||||
turnId: "turn-e2e-cmd",
|
||||
});
|
||||
assert.strictEqual(ok, true, "command wrapper applies via the seam");
|
||||
await settle();
|
||||
const spans = api.attributionController.getSpans(DOC_REL);
|
||||
const agent = spans.find((s) => s.turnId === "turn-e2e-cmd");
|
||||
assert.ok(agent, "command-driven agent span exists");
|
||||
assert.strictEqual(agent!.authorKind, "agent");
|
||||
|
||||
assert.strictEqual(api.attributionController.isVisible(), true);
|
||||
await vscode.commands.executeCommand("cowriting.toggleAttribution");
|
||||
assert.strictEqual(api.attributionController.isVisible(), false, "toggle hides (PUC-5)");
|
||||
await vscode.commands.executeCommand("cowriting.toggleAttribution");
|
||||
assert.strictEqual(api.attributionController.isVisible(), true, "toggle restores");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user