fix(ai-toolbar): gate paste capture on AI availability

This commit is contained in:
2026-04-22 17:54:49 -04:00
parent e817fb52cf
commit bfb29d3986
2 changed files with 17 additions and 4 deletions

View File

@@ -323,6 +323,19 @@ describe("Keyboard shortcuts toolbar integration contract", () => {
});
});
describe("Global paste capture AI availability gate", () => {
test("document-level paste handlers only arm when AI is actually usable", () => {
const source = readToolbarSource();
expect(source).toContain(
"if (!isAuthenticated || isPending || !canUseAi || aiLoading) return;",
);
expect(source).toContain(
"}, [isAuthenticated, isPending, canUseAi, aiLoading]);",
);
});
});
// ─── Cycle 8: Multi-image thumbnail strip ────────────────────────────────────
//
// When multiple images are attached, they render as a horizontal scrollable