fix(quick-pane): refresh runtime model catalog
This commit is contained in:
+40
-10
@@ -30,19 +30,21 @@ test("main Settings uses shared catalog selectors with provider derived from mod
|
||||
"utf8",
|
||||
),
|
||||
]);
|
||||
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(catalog, /get_model_catalog/);
|
||||
assert.match(app, /create_quick_runtime/);
|
||||
assert.match(app, /get_session_runtime_snapshot/);
|
||||
assert.match(app, /close_quick_runtime/);
|
||||
assert.match(app, /label="Quick model"/);
|
||||
assert.match(app, /label="Follow-up model"/);
|
||||
assert.match(app, /<ModelSelector/);
|
||||
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, /getModelCatalog\(\)/);
|
||||
assert.match(pane, /snapshot\.models\?\.data\?\.models/);
|
||||
assert.match(pane, /preparedRuntimeRef/);
|
||||
assert.doesNotMatch(pane, /get_model_catalog/);
|
||||
assert.match(pane, /set_thinking_level/);
|
||||
assert.doesNotMatch(pane, /showSettings/);
|
||||
assert.doesNotMatch(pane, /Save Quick Pane settings/);
|
||||
@@ -68,7 +70,7 @@ test("Quick Pane keeps slash-containing model IDs atomic and reloads catalog on
|
||||
assert.match(pane, /provider: submittedModel\.provider/);
|
||||
assert.match(pane, /modelId: submittedModel\.modelId/);
|
||||
assert.doesNotMatch(pane, /selectedModel\.split/);
|
||||
assert.match(pane, /onFocusChanged[\s\S]*?void loadModelCatalog\(\)/);
|
||||
assert.match(pane, /onFocusChanged[\s\S]*?void prepareRuntime\(\)/);
|
||||
assert.match(
|
||||
catalog,
|
||||
/JSON\.stringify\(\[identity\.provider, identity\.modelId\]\)/,
|
||||
@@ -87,7 +89,10 @@ test("Quick Pane dismiss and mutually exclusive window visibility stay native-se
|
||||
assert.match(pane, /invoke\("dismiss_quick_pane"\)/);
|
||||
assert.doesNotMatch(pane, /getCurrentWindow\(\)\.hide\(\)/);
|
||||
assert.match(nativeSource, /fn dismiss_quick_pane\(/);
|
||||
assert.match(nativeSource, /dismiss_quick_pane,[\s\S]*create_session_runtime/);
|
||||
assert.match(
|
||||
nativeSource,
|
||||
/dismiss_quick_pane,[\s\S]*create_session_runtime/,
|
||||
);
|
||||
assert.match(
|
||||
nativeSource,
|
||||
/struct WindowVisibility\(Mutex<ManagedWindowVisibility>\)/,
|
||||
@@ -195,6 +200,31 @@ test("Quick Pane uses native dimensions and request-first compact layout", async
|
||||
);
|
||||
assert.match(stylesheet, /\.quick-pane-send[\s\S]*?position: absolute/);
|
||||
assert.match(stylesheet, /@media \(max-width: 400px\)/);
|
||||
assert.match(stylesheet, /\.quick-pane\s*\{[\s\S]*?overflow: visible/);
|
||||
assert.doesNotMatch(
|
||||
stylesheet,
|
||||
/\.quick-pane-primary-controls\s*\{[^}]*overflow:\s*(?:hidden|clip)/,
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
stylesheet,
|
||||
/\.quick-pane-header-actions\s*\{[^}]*overflow:\s*(?:hidden|clip)/,
|
||||
);
|
||||
assert.match(stylesheet, /#f0a347/);
|
||||
assert.doesNotMatch(stylesheet, /#8aa9d6|#46494f|#23252a/);
|
||||
|
||||
const [selectorSource, selectorStylesheet] = await Promise.all([
|
||||
readFile(
|
||||
new URL("../ui/src/components/ModelSelector.tsx", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
readFile(
|
||||
new URL("../ui/src/components/ModelSelector.css", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
]);
|
||||
assert.match(selectorSource, /import "\.\/ModelSelector\.css";/);
|
||||
assert.match(
|
||||
selectorStylesheet,
|
||||
/\.model-trigger\s*>\s*span\s*\{[\s\S]*?overflow:\s*hidden;[\s\S]*?text-overflow:\s*ellipsis/,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user