fix(quick-pane): restore model catalog controls
This commit is contained in:
+39
-15
@@ -9,32 +9,34 @@ 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,
|
||||
/<pre style=\{\{ whiteSpace: "pre-wrap" \}\}>\{answer\}<\/pre>/,
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/\{\(escalation \|\| error\) && \(\s*<button onClick=\{continueFull\}>Continue in full session<\/button>\s*\)\}/,
|
||||
);
|
||||
assert.match(source, /\{answer && <pre>\{answer\}<\/pre>\}/);
|
||||
assert.match(source, /const canContinue = !!escalation \|\| \(!!runtime && !!error\)/);
|
||||
assert.match(source, /\{canContinue && \(/);
|
||||
});
|
||||
|
||||
test("main Settings owns Quick Pane configuration while pane keeps request controls", async () => {
|
||||
const [pane, app, persistence] = await Promise.all([
|
||||
test("main Settings uses shared catalog selectors with provider derived from models", async () => {
|
||||
const [pane, app, catalog, persistence] = await Promise.all([
|
||||
readFile(
|
||||
new URL("../ui/src/quick-pane/QuickPane.tsx", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
readFile(new URL("../ui/src/App.tsx", import.meta.url), "utf8"),
|
||||
readFile(new URL("../ui/src/model-catalog.ts", import.meta.url), "utf8"),
|
||||
readFile(
|
||||
new URL("../ui/src/workspace/persistence.ts", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
]);
|
||||
assert.match(app, /load_ui_state/);
|
||||
assert.match(app, /save_ui_state/);
|
||||
assert.match(catalog, /invoke<\{ models\?: Model\[\] \}>\("get_model_catalog"\)/);
|
||||
assert.match(app, /getModelCatalog\(\)/);
|
||||
assert.match(app, /Quick model[\s\S]*?<select/);
|
||||
assert.match(app, /Follow-up model[\s\S]*?<select/);
|
||||
assert.doesNotMatch(app, /Quick provider\s*<input/);
|
||||
assert.doesNotMatch(app, /Follow-up provider\s*<input/);
|
||||
assert.match(app, /provider: identity\.provider/);
|
||||
assert.match(app, /followUpProvider: identity\.provider/);
|
||||
assert.match(app, /Save Quick Pane settings/);
|
||||
assert.match(pane, /get_model_catalog/);
|
||||
assert.match(pane, /getModelCatalog\(\)/);
|
||||
assert.match(pane, /set_thinking_level/);
|
||||
assert.doesNotMatch(pane, /showSettings/);
|
||||
assert.doesNotMatch(pane, /Save Quick Pane settings/);
|
||||
@@ -42,6 +44,23 @@ test("main Settings owns Quick Pane configuration while pane keeps request contr
|
||||
assert.match(persistence, /quickPane: current\.quickPane/);
|
||||
});
|
||||
|
||||
test("Quick Pane keeps slash-containing model IDs atomic and reloads catalog on focus", async () => {
|
||||
const [pane, catalog] = await Promise.all([
|
||||
readFile(
|
||||
new URL("../ui/src/quick-pane/QuickPane.tsx", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
readFile(new URL("../ui/src/model-catalog.ts", import.meta.url), "utf8"),
|
||||
]);
|
||||
assert.match(pane, /useState<ModelIdentity>/);
|
||||
assert.match(pane, /provider: selectedModel\.provider/);
|
||||
assert.match(pane, /modelId: selectedModel\.modelId/);
|
||||
assert.doesNotMatch(pane, /selectedModel\.split/);
|
||||
assert.match(pane, /onFocusChanged[\s\S]*?void loadModelCatalog\(\)/);
|
||||
assert.match(catalog, /JSON\.stringify\(\[identity\.provider, identity\.modelId\]\)/);
|
||||
assert.match(catalog, /JSON\.parse\(value\)/);
|
||||
});
|
||||
|
||||
test("Quick Pane routes extension responses through existing bridge command", async () => {
|
||||
const source = await readFile(
|
||||
new URL("../ui/src/quick-pane/QuickPane.tsx", import.meta.url),
|
||||
@@ -55,7 +74,7 @@ test("Quick Pane routes extension responses through existing bridge command", as
|
||||
assert.match(source, /requestId: extension\.id/);
|
||||
});
|
||||
|
||||
test("Quick Pane uses native quick dimensions and keyboard-first controls", async () => {
|
||||
test("Quick Pane uses native dimensions and request-first compact layout", async () => {
|
||||
const [source, stylesheet, configSource] = await Promise.all([
|
||||
readFile(
|
||||
new URL("../ui/src/quick-pane/QuickPane.tsx", import.meta.url),
|
||||
@@ -78,6 +97,9 @@ test("Quick Pane uses native quick dimensions and keyboard-first controls", asyn
|
||||
},
|
||||
{ width: 640, height: 440, transparent: true },
|
||||
);
|
||||
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.match(
|
||||
@@ -85,7 +107,9 @@ test("Quick Pane uses native quick dimensions and keyboard-first controls", asyn
|
||||
/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, /\.quick-pane-request[\s\S]*?flex: 1 1 auto/);
|
||||
assert.match(stylesheet, /\.quick-pane-output[\s\S]*?max-height: 108px[\s\S]*?overflow: auto/);
|
||||
assert.match(stylesheet, /\.quick-pane-controls[\s\S]*?display: flex/);
|
||||
assert.match(stylesheet, /#f0a347/);
|
||||
assert.doesNotMatch(stylesheet, /#8aa9d6|#46494f|#23252a/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user