feat(quick-pane): promote chats into full sessions
This commit is contained in:
@@ -13,6 +13,14 @@ test("Quick Pane polls snapshots, renders answers, and promotes runtime without
|
||||
assert.match(source, /className="quick-pane-notice escalation"/);
|
||||
assert.match(source, /className="quick-pane-assistant-footer"/);
|
||||
assert.match(source, /Continue in full session/);
|
||||
const toolbar = source.slice(
|
||||
source.indexOf('<header className="quick-pane-toolbar">'),
|
||||
source.indexOf(
|
||||
"</header>",
|
||||
source.indexOf('<header className="quick-pane-toolbar">'),
|
||||
),
|
||||
);
|
||||
assert.doesNotMatch(toolbar, /continueFull|Continue/);
|
||||
assert.match(
|
||||
source,
|
||||
/await invoke<\{ runtime: Runtime \}>\("promote_quick_runtime", \{\s+runtimeId: current\.runtimeId,/,
|
||||
@@ -174,15 +182,24 @@ test("Quick Pane dismiss and mutually exclusive window visibility stay native-se
|
||||
test("native promotion owns visibility and Main consumes pending runtime after startup refresh", async () => {
|
||||
const [nativeSource, workspaceSource] = await Promise.all([
|
||||
readFile(new URL("../ui/src-tauri/src/lib.rs", import.meta.url), "utf8"),
|
||||
readFile(new URL("../ui/src/workspace/useWorkspace.ts", import.meta.url), "utf8"),
|
||||
readFile(
|
||||
new URL("../ui/src/workspace/useWorkspace.ts", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
]);
|
||||
const promotion = nativeSource.slice(
|
||||
nativeSource.indexOf("fn show_main_for_promoted_runtime"),
|
||||
nativeSource.indexOf("fn toggle_quick_pane"),
|
||||
);
|
||||
assert.match(promotion, /get_or_create_main_with_visibility\(app, false\)/);
|
||||
assert.ok(promotion.indexOf("quick_pane\n .hide()") < promotion.indexOf("window\n .show()"));
|
||||
assert.ok(promotion.indexOf('visibility.hidden("quick-pane")') < promotion.indexOf("window\n .show()"));
|
||||
assert.ok(
|
||||
promotion.indexOf("quick_pane\n .hide()") <
|
||||
promotion.indexOf("window\n .show()"),
|
||||
);
|
||||
assert.ok(
|
||||
promotion.indexOf('visibility.hidden("quick-pane")') <
|
||||
promotion.indexOf("window\n .show()"),
|
||||
);
|
||||
assert.match(promotion, /\*pending = Some\(runtime_id\)/);
|
||||
assert.match(nativeSource, /fn get_pending_promoted_runtime/);
|
||||
assert.match(nativeSource, /fn consume_pending_promoted_runtime/);
|
||||
@@ -329,15 +346,38 @@ test("Quick Pane uses native dimensions and request-first compact layout", async
|
||||
);
|
||||
assert.match(
|
||||
stylesheet,
|
||||
/\.quick-pane-toolbar-control\s*\{[\s\S]*?height:\s*27px[\s\S]*?padding:\s*0 8px[\s\S]*?border:[\s\S]*?border-radius:[\s\S]*?background:[\s\S]*?font:/,
|
||||
/\.quick-pane button\.quick-pane-toolbar-control,[\s\S]*?height:\s*27px[\s\S]*?min-width:\s*48px[\s\S]*?padding:\s*0 8px[\s\S]*?border:[\s\S]*?border-radius:[\s\S]*?background:[\s\S]*?font:/,
|
||||
);
|
||||
assert.match(
|
||||
stylesheet,
|
||||
/\.quick-pane \.quick-pane-toolbar-control:hover:not\(:disabled\)/,
|
||||
);
|
||||
assert.match(
|
||||
stylesheet,
|
||||
/\.quick-pane \.quick-pane-toolbar-control:focus-visible/,
|
||||
);
|
||||
assert.match(
|
||||
stylesheet,
|
||||
/\.quick-pane \.quick-pane-toolbar-control:disabled/,
|
||||
);
|
||||
assert.match(
|
||||
stylesheet,
|
||||
/\.quick-pane-thinking\s*\{[\s\S]*?flex:\s*0 0 143px[\s\S]*?grid-template-columns:\s*auto minmax\(84px, 1fr\)/,
|
||||
);
|
||||
assert.match(
|
||||
stylesheet,
|
||||
/\.quick-pane-toolbar\s*\{[\s\S]*?flex-wrap:\s*nowrap/,
|
||||
);
|
||||
assert.match(stylesheet, /\.quick-pane-toolbar-control:hover:not\(:disabled\)/);
|
||||
assert.match(stylesheet, /\.quick-pane-toolbar-control:focus-visible/);
|
||||
assert.match(stylesheet, /\.quick-pane-toolbar-control:disabled/);
|
||||
assert.match(source, /triggerClassName="quick-pane-toolbar-control"/);
|
||||
assert.match(source, /controlClassName="quick-pane-toolbar-control"/);
|
||||
assert.match(source, /className="quick-pane-toolbar-control quick-pane-action"/);
|
||||
assert.match(source, /className="quick-pane-toolbar-control quick-pane-close"/);
|
||||
assert.match(
|
||||
source,
|
||||
/className="quick-pane-toolbar-control quick-pane-action"/,
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/className="quick-pane-toolbar-control quick-pane-close"/,
|
||||
);
|
||||
assert.match(stylesheet, /#f0a347/);
|
||||
assert.doesNotMatch(stylesheet, /#8aa9d6|#46494f|#23252a/);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user