fix(quick-pane): polish spotlight lifecycle

This commit is contained in:
2026-08-25 21:53:00 +02:00
parent bab754714e
commit a204eea7da
5 changed files with 213 additions and 47 deletions
+35
View File
@@ -54,3 +54,38 @@ test("Quick Pane routes extension responses through existing bridge command", as
assert.match(source, /invoke\("respond_to_extension"/);
assert.match(source, /requestId: extension\.id/);
});
test("Quick Pane uses native quick dimensions and keyboard-first controls", async () => {
const [source, stylesheet, configSource] = await Promise.all([
readFile(
new URL("../ui/src/quick-pane/QuickPane.tsx", import.meta.url),
"utf8",
),
readFile(
new URL("../ui/src/quick-pane/quick-pane.css", import.meta.url),
"utf8",
),
readFile(new URL("../ui/src-tauri/tauri.conf.json", import.meta.url), "utf8"),
]);
const config = JSON.parse(configSource);
const quickPane = config.app.windows.find((window) => window.label === "quick-pane");
assert.deepEqual(
{
width: quickPane.width,
height: quickPane.height,
transparent: quickPane.transparent,
},
{ width: 640, height: 440, transparent: true },
);
assert.match(source, /ref=\{inputRef\}/);
assert.match(source, /focusInput\(\)/);
assert.match(
source,
/event\.key === "Enter" &&\s*!event\.shiftKey &&\s*!event\.nativeEvent\.isComposing/,
);
assert.match(source, /event\.preventDefault\(\);\s*void run\(\);/);
assert.match(source, /Could not load model catalog:/);
assert.match(stylesheet, /#f0a347/);
assert.doesNotMatch(stylesheet, /#8aa9d6|#46494f|#23252a/);
});