fix(quick-pane): preserve lifecycle and answer history

This commit is contained in:
2026-08-25 23:08:45 +02:00
parent 1b0b34fad8
commit 4fc9c60ade
8 changed files with 506 additions and 65 deletions
+17 -3
View File
@@ -9,7 +9,7 @@ test("Quick Pane polls snapshots, renders answers, and gates handoff", async ()
);
assert.match(source, /get_session_runtime_snapshot/);
assert.match(source, /setInterval\(\(\) => void refresh\(\), 800\)/);
assert.match(source, /\{answer && <pre>\{answer\}<\/pre>\}/);
assert.match(source, /\{displayedAnswer && <pre>\{displayedAnswer\}<\/pre>\}/);
assert.match(source, /const canContinue = !!escalation \|\| \(!!runtime && !!error\)/);
assert.match(source, /\{canContinue && \(/);
});
@@ -40,7 +40,11 @@ test("main Settings uses shared catalog selectors with provider derived from mod
assert.match(pane, /set_thinking_level/);
assert.doesNotMatch(pane, /showSettings/);
assert.doesNotMatch(pane, /Save Quick Pane settings/);
assert.doesNotMatch(pane, /setRequest\(""\)/);
assert.match(pane, /isStreaming === false/);
assert.match(pane, /current === submitted\.request \? "" : current/);
assert.match(pane, /\.slice\(0, 5\)/);
assert.match(pane, /aria-label="Answer history"/);
assert.doesNotMatch(pane, /localStorage|sessionStorage|save_ui_state/);
assert.match(persistence, /quickPane: current\.quickPane/);
});
@@ -75,7 +79,7 @@ test("Quick Pane routes extension responses through existing bridge command", as
});
test("Quick Pane uses native dimensions and request-first compact layout", async () => {
const [source, stylesheet, configSource] = await Promise.all([
const [source, stylesheet, configSource, nativeSource, capabilitySource] = await Promise.all([
readFile(
new URL("../ui/src/quick-pane/QuickPane.tsx", import.meta.url),
"utf8",
@@ -85,8 +89,11 @@ test("Quick Pane uses native dimensions and request-first compact layout", async
"utf8",
),
readFile(new URL("../ui/src-tauri/tauri.conf.json", import.meta.url), "utf8"),
readFile(new URL("../ui/src-tauri/src/lib.rs", import.meta.url), "utf8"),
readFile(new URL("../ui/src-tauri/capabilities/default.json", import.meta.url), "utf8"),
]);
const config = JSON.parse(configSource);
const capability = JSON.parse(capabilitySource);
const quickPane = config.app.windows.find((window) => window.label === "quick-pane");
assert.deepEqual(
@@ -97,11 +104,18 @@ test("Quick Pane uses native dimensions and request-first compact layout", async
},
{ width: 640, height: 440, transparent: true },
);
assert.ok(capability.windows.includes("quick-pane"));
assert.match(nativeSource, /WindowEvent::CloseRequested/);
assert.match(nativeSource, /api\.prevent_close\(\)/);
assert.match(nativeSource, /WebviewWindowBuilder::from_config\(app, config\)/);
assert.match(nativeSource, /get_or_create_quick_pane/);
assert.doesNotMatch(source, /onCloseRequested/);
assert.match(source, /className="quick-pane-request"/);
assert.match(source, /className="quick-pane-output"/);
assert.match(source, /<footer className="quick-pane-controls">/);
assert.match(source, /ref=\{inputRef\}/);
assert.match(source, /focusInput\(\)/);
assert.doesNotMatch(source, /if \(!event\.payload\)[\s\S]*?hide\(/);
assert.match(
source,
/event\.key === "Enter" &&\s*!event\.shiftKey &&\s*!event\.nativeEvent\.isComposing/,