Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

fix(ui): keep the scoped Galaxy toolbar to one row with the chat open

Bernhard Jackiewiczcbeed8bdc107
diff --git a/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsx b/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsx
index 22e613f27..25432074b 100644
--- a/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsx
+++ b/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsx
@@ -85,7 +85,7 @@ it('K8: a layer past the render limit stops there, says it is partial and cannot
expect(button('Expand +1').title).toContain('Load layer 2: 1 node to expand');
await act(async () => button('Expand +1').click());
- await settle(() => expect(status()?.textContent).toBe('602 nodes · 601 edges · partial'));
+ await settle(() => expect(status()?.textContent).toBe('Partial: 602 nodes · 601 edges'));
expect(status()?.getAttribute('data-state')).toBe('partial');
expect(status()?.getAttribute('title')).toBe('Layer 2 stopped at the render limit of 500 nodes. Raise the limit under Limits or trace fewer edge types to load all of it.');
expect(button('Expand +1').disabled).toBe(true);
diff --git a/graph-ui/src/galaxy/GalaxyPanel.toolbar.test.tsx b/graph-ui/src/galaxy/GalaxyPanel.toolbar.test.tsx
new file mode 100644
index 000000000..59acccdd6
--- /dev/null
+++ b/graph-ui/src/galaxy/GalaxyPanel.toolbar.test.tsx
@@ -0,0 +1,60 @@
+// @vitest-environment jsdom
+/*
+ * Handtest K3: die Leiste eines Ausschnitts bleibt auch bei offenem Chat
+ * einzeilig. jsdom misst keine Breiten; hier steht der Aufbau, der das
+ * moeglich macht (die Messung selbst steht in tools/handtest-fixes-galaxy.mjs):
+ * die Wurzel ist zugleich der Knopf zur Quelle, Limits, Gruppen und der
+ * Hinweis auf abgeschnittene Knoten stehen im Menue "⋯", und die Zeile bricht
+ * nicht um.
+ */
+import { act } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import GalaxyPanel from './GalaxyPanel';
+import { scopeFetch, scopeNode } from './test-scope-fetch';
+
+vi.mock('./GraphScene', async importOriginal => ({
+ ...await importOriginal<typeof import('./GraphScene')>(),
+ GraphScene: () => <output data-testid="scene" />,
+}));
+
+let host: HTMLDivElement, root: Root;
+beforeEach(() => {
+ (globalThis as unknown as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;
+ host = document.createElement('div'); document.body.append(host); root = createRoot(host);
+});
+afterEach(async () => { await act(async () => root.unmount()); host.remove(); globalThis.__atlasGalaxy = undefined; });
+
+const seam = () => globalThis.__atlasGalaxy!;
+const settle = (check: () => void) => vi.waitFor(async () => {
+ await act(async () => { await new Promise(resolve => setTimeout(resolve, 0)); });
+ check();
+});
+
+it('K3: the scoped toolbar keeps one row: root name opens the source, limits and groups sit in the ⋯ menu', async () => {
+ const nodes = [1, 2, 3].map(id => scopeNode(id));
+ const edges = [{ id: 1, source: 1, target: 2, type: 'CALLS' }, { id: 2, source: 3, target: 1, type: 'CALLS' }];
+ const onOpenNode = vi.fn();
+ await act(async () => root.render(<GalaxyPanel project="sample" visible workspaceExpanded onOpenNode={onOpenNode} fetch={scopeFetch({ nodes, edges }).fetch} />));
+ await settle(() => expect(seam().nodes).toBe(3));
+ await act(async () => { seam().clickNode('sample.n1'); });
+ await settle(() => expect(host.querySelector('.atlas-graph-scope-count')?.textContent).toBe('3 nodes · 2 edges'));
+
+ const bar = host.querySelector<HTMLElement>('.atlas-graph-exploration')!;
+ expect(bar.dataset.scoped).toBe('true');
+ // The root is the way to its source; no separate "Open source" button in the row.
+ const name = bar.querySelector<HTMLButtonElement>('button.atlas-graph-scope-name')!;
+ expect(name.textContent).toBe('n1');
+ expect(name.title).toBe('Open the source of n1 in Explore: src/n1.ts:1');
+ expect([...bar.querySelectorAll(':scope > button')].map(entry => entry.textContent)).not.toContain('Open source');
+ await act(async () => name.click());
+ expect(onOpenNode).toHaveBeenCalledWith(expect.objectContaining({ id: 1 }));
+ // Limits live in the ⋯ menu, and so does the open-source action for keyboard users.
+ const more = bar.querySelector<HTMLDetailsElement>('details.atlas-graph-more')!;
+ expect(more.querySelector('select[aria-label="Rendered node limit"]')).not.toBeNull();
+ expect(more.querySelector('select[aria-label="Rendered edge limit"]')).not.toBeNull();
+ expect(bar.querySelector(':scope > .atlas-graph-scope-groups')).toBeNull();
+ // The trace direction keeps its accessible name without the visible word.
+ expect(bar.querySelector('select[aria-label="Trace direction"]')).not.toBeNull();
+ expect(bar.textContent).not.toContain('Trace');
+});
diff --git a/graph-ui/src/galaxy/GalaxyPanel.tsx b/graph-ui/src/galaxy/GalaxyPanel.tsx
index b5c5737cc..eafee75af 100644
--- a/graph-ui/src/galaxy/GalaxyPanel.tsx
+++ b/graph-ui/src/galaxy/GalaxyPanel.tsx
@@ -1973,7 +1973,7 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
{history.recent.length > 1 && <details className="atlas-graph-recent" onKeyDown={event => {
if (event.key === 'Escape') { event.stopPropagation(); event.currentTarget.open = false; }
}}>
- <summary title={galaxyHistoryText.recentTitle}>{galaxyHistoryText.recent}</summary>
+ <summary title={galaxyHistoryText.recentTitle} aria-label={galaxyHistoryText.recent}>{galaxyHistoryText.recentGlyph}</summary>
<ul className="atlas-graph-recent-menu" aria-label={galaxyHistoryText.recentList}>{history.recent.map((entry) => {
const current = galaxyHistoryOptions.recentKey?.(entry) === (scope.scope ? scopeIdentity(scope.scope) : undefined);
return <li key={galaxyHistoryOptions.recentKey?.(entry)}>
@@ -1987,10 +1987,24 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
</details>}
</span> : null;
+ /* Was die Leiste sonst noch braucht (K3): Quelle der Wurzel, Gruppen und was ausserhalb der Limits liegt. */
+ const openRoot = props.workspaceExpanded && scopedRoot?.file_path
+ ? () => props.onOpenNode(layoutNodeForSelection(layout, scopedRoot) ?? scopedRoot) : undefined;
+ const groupCount = mode === 'galaxy' && organic ? organic.groups.length : 0;
+ const groupsText = groupCount > 1 ? galaxyToolbarText.groupsTitle(groupCount) : undefined;
+ const outsideLimits = props.workspaceExpanded && data && shown && (shown.nodes.length < data.nodes.length || shown.edges.length < data.edges.length)
+ ? galaxyToolbarText.outsideLimits(data.nodes.length - shown.nodes.length, data.edges.length - shown.edges.length) : undefined;
+
/* Was die Leiste ueber das Laden der Ebenen sagt (Handtest K8). */
const partial = scope.complete ? scope.result?.partial : undefined;
const scopeState = scope.validating ? 'checking' : scope.loading ? 'loading' : organicTask.loading ? 'arranging'
: partial ? 'partial' : scope.complete ? 'complete' : 'preview';
+ const scopeStatus = scope.validating ? galaxyLayerText.checking
+ : scope.loading ? scope.progress ? galaxyLayerText.loadingProgress(scope.progress.layer, scope.progress.nodes, scope.progress.edges) : galaxyLayerText.loading(scope.depth)
+ : organicTask.loading ? galaxyLayerText.arranging
+ : scope.complete ? partial ? galaxyLayerText.partial(galaxyLayerText.counts(data?.nodes.length ?? 0, data?.edges.length ?? 0))
+ : `${galaxyLayerText.counts(data?.nodes.length ?? 0, data?.edges.length ?? 0)}${scope.result?.exhausted ? galaxyLayerText.endOfTrace : ''}`
+ : galaxyLayerText.partialPreview;
const estimate = scope.complete ? nextLayerEstimate(scope.result) : undefined;
const expandWarning = Boolean(estimate && props.workspaceExpanded && (data?.nodes.length ?? 0) + estimate.estimate > nodeBudget);
const expandTitle = partial ? galaxyLayerText.expandPartial : scope.result?.exhausted ? galaxyLayerText.expandEnd
@@ -2474,17 +2488,26 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
</span>
)}
</header>
- {(props.workspaceExpanded || scope.scope) && <div className="atlas-graph-exploration" aria-label="Graph scope">
+ {(props.workspaceExpanded || scope.scope) && <div className="atlas-graph-exploration" aria-label="Graph scope"
+ data-scoped={props.workspaceExpanded && scope.scope ? 'true' : undefined}>
{historyControls}
{props.workspaceExpanded && <GalaxyNavigator embedded nodes={layout?.nodes ?? []} project={project} fetch={fetchImpl} onSelect={handleNodeClick} onSelectScope={next => { props.onClearSelection?.(); setBackgroundCleared(false); clearTrail(); scope.select(next); }} />}
{scope.scope ? <>
{props.workspaceExpanded && <button type="button" onClick={leaveScope}>{galaxyHistoryText.allGraph}</button>}
- <strong className="atlas-graph-scope-name" title={scope.scope.name}>{scope.scope.name}</strong>
- {props.workspaceExpanded && scopedRoot?.file_path && <button type="button" onClick={() => props.onOpenNode(layoutNodeForSelection(layout, scopedRoot) ?? scopedRoot)}>Open source</button>}
- {props.workspaceExpanded && <label>Trace <select aria-label="Trace direction" value={scope.direction}
+ {/*
+ * Handtest K3: die Wurzel ist zugleich der Weg zu ihrer
+ * Quelle. Ein eigener Knopf "Open source" daneben kostete die
+ * Zeile bei offenem Chat rund hundert Pixel; er steht fuer
+ * die Tastatur weiter im Menue "⋯".
+ */}
+ {props.workspaceExpanded && openRoot
+ ? <button type="button" className="atlas-graph-scope-name" onClick={openRoot}
+ title={galaxyToolbarText.openRootTitle(scope.scope.name, scopedRoot?.file_path ?? '', scopedRoot?.start_line)}>{scope.scope.name}</button>
+ : <strong className="atlas-graph-scope-name" title={scope.scope.name}>{scope.scope.name}</strong>}
+ {props.workspaceExpanded && <select aria-label="Trace direction" title={galaxyToolbarText.traceTitle} value={scope.direction}
onChange={event => scope.setDirection(event.target.value as 'both' | 'inbound' | 'outbound')}>
<option value="both">Both directions</option><option value="inbound">Incoming</option><option value="outbound">Outgoing</option>
- </select></label>}
+ </select>}
{props.workspaceExpanded && <TraceEdgeFilter kinds={traceKinds} availableTypes={kinds.map(kind => kind.type)} selected={traceTypes} onChange={changeTraceTypes} />}
{/*
* Handtest K8: waehrend eine Ebene laedt, ist "−" der Weg
@@ -2506,15 +2529,11 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
{galaxyPathText.callOrder}</button>
</>}
<span className="atlas-graph-scope-count" role="status" data-state={scopeState}
- title={partial ? galaxyLayerText.partialTitle(partial.layer, partial.limit === 'nodes' ? nodeBudget : edgeBudget, partial.limit) : undefined}>
- {scope.validating ? galaxyLayerText.checking
- : scope.loading ? scope.progress ? galaxyLayerText.loadingProgress(scope.progress.layer, scope.progress.nodes, scope.progress.edges) : galaxyLayerText.loading(scope.depth)
- : organicTask.loading ? galaxyLayerText.arranging
- : scope.complete ? `${galaxyLayerText.counts(data?.nodes.length ?? 0, data?.edges.length ?? 0)}${partial ? galaxyLayerText.partial : scope.result?.exhausted ? galaxyLayerText.endOfTrace : ''}`
- : galaxyLayerText.partialPreview}</span>
+ title={partial ? galaxyLayerText.partialTitle(partial.layer, partial.limit === 'nodes' ? nodeBudget : edgeBudget, partial.limit)
+ : [scopeStatus, groupsText].filter(Boolean).join('. ')}>{scopeStatus}</span>
{scope.error && <span className="atlas-graph-scope-warning" title={scope.error}>Some relationships could not be loaded. <button type="button" onClick={scope.retry}>Retry</button></span>}
{!props.workspaceExpanded && scope.complete && <small>All indexed direct dependencies included.</small>}
- {mode === 'galaxy' && organic && organic.groups.length > 1 && <small className="atlas-graph-scope-groups" title={galaxyToolbarText.groupsTitle(organic.groups.length)}>{galaxyToolbarText.groups(organic.groups.length)}</small>}
+ {!props.workspaceExpanded && groupCount > 1 && <small className="atlas-graph-scope-groups" title={groupsText}>{galaxyToolbarText.groups(groupCount)}</small>}
</> : null}
{props.workspaceExpanded && <>
{/*
@@ -2524,18 +2543,24 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
* Zeile sonst um. Ein Scope liegt fast immer unter dem
* Deckel; im ganzen Graphen bleibt er in der Zeile.
*/}
- {scope.scope ? <details className="atlas-graph-limits" title={galaxyToolbarText.limitsTitle} onKeyDown={event => {
- if (event.key === 'Escape') { event.stopPropagation(); event.currentTarget.open = false; }
- }}>
- <summary>{galaxyToolbarText.limits}</summary>
- <div className="atlas-graph-limits-menu">{renderLimits}</div>
+ {/* K3: im Ausschnitt stehen Quelle, Limits, Gruppen und abgeschnittene Knoten im Menue "⋯". */}
+ {scope.scope ? <details className="atlas-graph-limits atlas-graph-more" title={galaxyToolbarText.moreTitle}
+ data-attention={outsideLimits ? 'true' : undefined} onKeyDown={event => {
+ if (event.key === 'Escape') { event.stopPropagation(); event.currentTarget.open = false; }
+ }}>
+ <summary aria-label={galaxyToolbarText.more}>{galaxyToolbarText.moreGlyph}</summary>
+ <div className="atlas-graph-limits-menu">
+ {openRoot && <button type="button" onClick={openRoot}>{galaxyToolbarText.openSource}</button>}
+ {renderLimits}
+ {groupCount > 1 && <small className="atlas-graph-scope-groups" title={groupsText}>{galaxyToolbarText.groups(groupCount)}</small>}
+ {outsideLimits && <small>{outsideLimits}</small>}
+ </div>
</details> : renderLimits}
{mode === 'galaxy' && !scope.scope && <label className="atlas-graph-coverage-filter" title="Show files and folders with indexing gaps">
<input type="checkbox" aria-label="Show coverage graph" checked={showCoverage} onChange={event => setViewPreferences({ coverageShadow: event.target.checked })} />
Coverage
</label>}
- {data && shown && (shown.nodes.length < data.nodes.length || shown.edges.length < data.edges.length) &&
- <small>{data.nodes.length - shown.nodes.length} nodes · {data.edges.length - shown.edges.length} edges outside render limits</small>}
+ {!scope.scope && outsideLimits && <small>{outsideLimits}</small>}
</>}
</div>}
{legendOpen && (
diff --git a/graph-ui/src/galaxy/galaxy-strings.ts b/graph-ui/src/galaxy/galaxy-strings.ts
index d25e68d25..fe10dd3eb 100644
--- a/graph-ui/src/galaxy/galaxy-strings.ts
+++ b/graph-ui/src/galaxy/galaxy-strings.ts
@@ -45,6 +45,7 @@ export const galaxyHistoryText = {
noBack: 'Nothing to go back to yet',
noForward: 'Nothing to go forward to',
recent: 'Recent',
+ recentGlyph: '▾',
recentTitle: 'Jump straight to a recently visited root with its last depth, direction and edge types',
recentList: 'Recently visited roots',
allGraph: 'All graph',
@@ -68,7 +69,8 @@ export const galaxyLayerText = {
arranging: 'Arranging nodes…',
counts: (nodes: number, edges: number) => `${count(nodes, 'node', 'nodes')} · ${count(edges, 'edge', 'edges')}`,
endOfTrace: ' · end of trace',
- partial: ' · partial',
+ // "Partial" leads, so a narrow toolbar that cuts the end never cuts the warning.
+ partial: (counts: string) => `Partial: ${counts}`,
partialPreview: 'Partial preview',
previewLoading: (layer: number) => `Partial preview while layer ${layer} loads`,
partialTitle: (layer: number, limit: number, kind: 'nodes' | 'edges') =>
@@ -90,4 +92,11 @@ export const galaxyToolbarText = {
groupsTitle: (count: number) => `${count.toLocaleString()} connection groups. Groups reflect connections in this trace, not inferred architecture components.`,
limits: 'Limits',
limitsTitle: 'Rendered node and edge limits',
+ more: 'More',
+ moreGlyph: '⋯',
+ moreTitle: 'More: open the source, rendered node and edge limits, connection groups',
+ openSource: 'Open source',
+ openRootTitle: (name: string, path: string, line?: number) => `Open the source of ${name} in Explore: ${path}${line ? `:${line}` : ''}`,
+ traceTitle: 'Trace direction: incoming, outgoing or both',
+ outsideLimits: (nodes: number, edges: number) => `${nodes.toLocaleString()} nodes · ${edges.toLocaleString()} edges outside render limits`,
};
diff --git a/graph-ui/src/galaxy/graph-exploration.css b/graph-ui/src/galaxy/graph-exploration.css
index 78b6e13c1..6bf498a9b 100644
--- a/graph-ui/src/galaxy/graph-exploration.css
+++ b/graph-ui/src/galaxy/graph-exploration.css
@@ -14,6 +14,27 @@
.atlas-graph-scope-name { max-width:14rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.atlas-graph-scope-count { color:#93b2a1; margin-inline-start:auto; font-variant-numeric:tabular-nums; white-space:nowrap; }
.atlas-graph-scope-groups { white-space:nowrap; }
+/*
+ * Handtest K3: im Ausschnitt eine Zeile, auch bei offenem Chat (rund 1.170 px
+ * bei 1600). Die Zeile bricht nicht um; was schrumpfen darf, sind das Suchfeld
+ * (es waechst beim Tippen wieder), der Name der Wurzel und der Zaehler, jeweils
+ * mit dem vollen Text im Tooltip.
+ */
+.atlas-graph-exploration[data-scoped=true] { flex-wrap:nowrap; gap:.3rem; padding-inline:.6rem; }
+.atlas-graph-exploration[data-scoped=true] > * { flex:none; }
+.atlas-graph-exploration[data-scoped=true] .atlas-galaxy-search-container { flex:0 1 9rem; min-width:5rem; transition:flex-basis .15s ease; }
+.atlas-graph-exploration[data-scoped=true] .atlas-galaxy-search-container:focus-within { flex-basis:18rem; }
+.atlas-graph-exploration[data-scoped=true] .atlas-graph-scope-name { flex:0 1 auto; min-width:3.5rem; max-width:11rem; }
+/* Der Zaehler gibt zuletzt nach: der Name steht auch am Ring in der Szene, die Zahl nur hier. */
+.atlas-graph-exploration[data-scoped=true] .atlas-graph-scope-count { flex:none; max-width:12rem; overflow:hidden; text-overflow:ellipsis; }
+.atlas-graph-exploration[data-scoped=true] .atlas-graph-scope-warning { flex:0 1 auto; width:auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
+.atlas-graph-exploration button.atlas-graph-scope-name { position:relative; padding-right:1.2rem; font-weight:600; border-color:transparent; background:transparent; text-align:left; }
+.atlas-graph-exploration button.atlas-graph-scope-name::after { content:'↗'; position:absolute; right:.35rem; color:#7fa592; font-weight:400; }
+.atlas-graph-exploration button.atlas-graph-scope-name:hover { text-decoration:underline; }
+.atlas-graph-more > summary, .atlas-graph-recent > summary { min-width:1.1rem; text-align:center; list-style:none; }
+.atlas-graph-more > summary::-webkit-details-marker, .atlas-graph-recent > summary::-webkit-details-marker { display:none; }
+.atlas-graph-more[data-attention=true] > summary { border-color:#9b7b4a; }
+.atlas-graph-more .atlas-graph-limits-menu small { color:#95a89e; white-space:nowrap; }
/* Handtest K8: eine Ebene, die am Render-Limit anhielt, und ein Expand, das vermutlich dorthin fuehrt. */
.atlas-graph-scope-count[data-state=partial] { color:#d8b27a; cursor:help; }
.atlas-graph-exploration button[data-warning=true] { border-color:#9b7b4a; }
diff --git a/graph-ui/tools/handtest-fixes-galaxy.mjs b/graph-ui/tools/handtest-fixes-galaxy.mjs
index 8c4c84d5a..89d6cd164 100644
--- a/graph-ui/tools/handtest-fixes-galaxy.mjs
+++ b/graph-ui/tools/handtest-fixes-galaxy.mjs
@@ -364,9 +364,68 @@ async function checkK8(page) {
{ frames, done });
}
+/* ------------------------------------------------------------------ */
+/* K3: eine Zeile, auch bei offenem Chat */
+
+async function toolbarRows(page) {
+ return page.evaluate(() => {
+ const bar = document.querySelector('.atlas-graph-exploration');
+ if (!bar) return null;
+ const box = bar.getBoundingClientRect();
+ const items = [...bar.children].filter((el) => el.getBoundingClientRect().height > 0);
+ const centres = items.map((el) => { const r = el.getBoundingClientRect(); return Math.round((r.top + r.bottom) / 2); });
+ const rows = [...new Set(centres.map((centre) => Math.round(centre / 16)))].length;
+ const clipped = items.filter((el) => el.scrollWidth > el.clientWidth + 1 && getComputedStyle(el).textOverflow === 'ellipsis')
+ .map((el) => el.textContent?.trim().slice(0, 40));
+ return { width: Math.round(box.width), height: Math.round(box.height), rows, overflow: bar.scrollWidth > bar.clientWidth + 1, clipped,
+ items: items.map((el) => `${(el.getAttribute('aria-label') || el.textContent || el.tagName).trim().slice(0, 18)}:${Math.round(el.getBoundingClientRect().width)}`) };
+ });
+}
+
+async function checkK3(page) {
+ await section(page, 'K3', 'The scoped Galaxy toolbar stays one row at 1600 px, with the chat closed and open');
+ await open(page);
+ const chatToggle = async (open) => {
+ const button = page.getByRole('button', { name: open ? 'Open chat' : 'Hide chat' }).first();
+ if (await button.count()) { await button.click(); await wait(1500); }
+ };
+ const rows = [];
+ const measure = async (label, caption) => {
+ const value = await toolbarRows(page);
+ rows.push({ label, ...value });
+ await shot(page, 'K3', label, `${caption}: toolbar ${value?.width} x ${value?.height} px, ${value?.rows} row(s)`);
+ await page.locator('.atlas-graph-exploration').first().screenshot({ path: join(OUT, 'K3', `${label}-toolbar.png`) }).catch(() => {});
+ };
+ await select(page, ROOT);
+ await settled(page);
+ await measure('closed-root', `Chat closed, ${ROOT} at 1 layer`);
+ await chatToggle(true);
+ await measure('open-root', `Chat open, ${ROOT} at 1 layer`);
+ await expand(page);
+ await measure('open-two-layers', 'Chat open, 2 layers');
+ const child = await qualifiedName('test_jsonb_agg_jsonfield_order_by');
+ await page.evaluate((qn) => globalThis.__atlasGalaxy?.clickNode(qn), child);
+ await settled(page);
+ await measure('open-long-root', 'Chat open, long root name test_jsonb_agg_jsonfield_order_by');
+ const back = page.getByRole('button', { name: 'Back', exact: true });
+ // Ohne Zurueck (Stand vor K2) fuehrt die Suche zur selben Lage.
+ if (await back.count()) await back.click(); else { await select(page, ROOT); await settled(page); await expand(page); }
+ await settled(page);
+ await page.getByRole('button', { name: 'Expand +1' }).click();
+ await wait(600);
+ await measure('open-loading', 'Chat open while layer 3 loads');
+ await page.waitForFunction(() => ['complete', 'partial'].includes(document.querySelector('.atlas-graph-scope-count')?.getAttribute('data-state') ?? ''), null, { timeout: 120000 }).catch(() => {});
+ await wait(1500);
+ await measure('open-partial', 'Chat open, layer 3 stopped at the render limit');
+ await chatToggle(false);
+ await measure('closed-partial', 'Chat closed again, layer 3 partial');
+ const pass = rows.length === 7 && rows.every((row) => row.rows === 1 && row.height < 60 && !row.overflow);
+ await check('K3', 'One toolbar row in every state, chat open (bar about 1170 px) and closed (1600 px)', pass, { rows });
+}
+
/* ------------------------------------------------------------------ */
-const CHECKS = { K9: checkK9, K2: checkK2, K8: checkK8 };
+const CHECKS = { K9: checkK9, K2: checkK2, K8: checkK8, K3: checkK3 };
await mkdir(OUT, { recursive: true });
const context = await chromium.launchPersistentContext(PROFILE, {