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): shorten "All graph" in a narrow scoped Galaxy toolbar

Bernhard Jackiewiczb4340375386a
diff --git a/graph-ui/src/galaxy/GalaxyPanel.toolbar.test.tsx b/graph-ui/src/galaxy/GalaxyPanel.toolbar.test.tsx
index 114050971..dcd1534b0 100644
--- a/graph-ui/src/galaxy/GalaxyPanel.toolbar.test.tsx
+++ b/graph-ui/src/galaxy/GalaxyPanel.toolbar.test.tsx
@@ -97,6 +97,11 @@ it('K3: the scoped toolbar measures its fit and carries a short label for each w
expect(narrow(bar.querySelector('.atlas-graph-path-picker > summary'))).toBe('Path…');
expect(narrow(bar.querySelector('.atlas-trace-edge-filter > summary'))).toBe('Types · All');
expect(narrow([...bar.querySelectorAll('button')].find(entry => entry.textContent === 'Call order'))).toBe('Calls');
+ // At 1,494 px with the chat open and the recent list shown, the short "All" keeps the count whole.
+ const allGraph = [...bar.querySelectorAll('button')].find(entry => entry.textContent === 'All graph');
+ expect(narrow(allGraph)).toBe('All');
+ expect(allGraph?.getAttribute('aria-label')).toBe('All graph');
+ expect(allGraph?.title).toBe('Leave the scope and show the whole graph (Esc)');
// The short label is drawn by CSS only: the text of each control stays what it was.
expect(bar.querySelector('.atlas-trace-edge-filter > summary')?.textContent).toBe('Edge types · All');
// Out of the scope the toolbar wraps as before and is not measured.
diff --git a/graph-ui/src/galaxy/GalaxyPanel.tsx b/graph-ui/src/galaxy/GalaxyPanel.tsx
index 5daf12b51..72991c028 100644
--- a/graph-ui/src/galaxy/GalaxyPanel.tsx
+++ b/graph-ui/src/galaxy/GalaxyPanel.tsx
@@ -2573,7 +2573,8 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
{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>}
+ {props.workspaceExpanded && <button type="button" onClick={leaveScope} aria-label={galaxyHistoryText.allGraph} title={galaxyHistoryText.allGraphTitle}>
+ <FitLabel wide={galaxyHistoryText.allGraph} narrow={galaxyHistoryText.allGraphNarrow} /></button>}
{/*
* Handtest K3: die Wurzel ist zugleich der Weg zu ihrer
* Quelle. Ein eigener Knopf "Open source" daneben kostete die
diff --git a/graph-ui/src/galaxy/galaxy-strings.ts b/graph-ui/src/galaxy/galaxy-strings.ts
index 0b4c258aa..bde9cbcb8 100644
--- a/graph-ui/src/galaxy/galaxy-strings.ts
+++ b/graph-ui/src/galaxy/galaxy-strings.ts
@@ -54,6 +54,8 @@ export const galaxyHistoryText = {
/** The accessible name of the Back, Forward and Recent group. */
group: 'History',
allGraph: 'All graph',
+ allGraphNarrow: 'All',
+ allGraphTitle: 'Leave the scope and show the whole graph (Esc)',
layers: (depth: number) => (depth === 1 ? '1 layer' : `${depth} layers`),
direction: { inbound: 'incoming', outbound: 'outgoing' } as Record<'inbound' | 'outbound', string>,
noTypes: 'no edge types',
diff --git a/graph-ui/src/galaxy/toolbar-fit.tsx b/graph-ui/src/galaxy/toolbar-fit.tsx
index 99dc1b8c0..4c64751b4 100644
--- a/graph-ui/src/galaxy/toolbar-fit.tsx
+++ b/graph-ui/src/galaxy/toolbar-fit.tsx
@@ -9,8 +9,9 @@
* verweist. Jetzt wird gemessen, in drei Stufen:
*
* - `full`: alle Beschriftungen ausgeschrieben.
- * - `compact`: knappe Beschriftungen ("+1" statt "Expand +1", "Path…",
- * "Types · All", "Calls"); so passt sie bei offenem Chat und 1.494 px.
+ * - `compact`: knappe Beschriftungen ("+1" statt "Expand +1", "All",
+ * "Path…", "Types · All", "Calls"); so passt sie bei offenem Chat und
+ * 1.494 px, auch mit der Liste der letzten Wurzeln.
* - `tight`: dazu wird der Zaehler kuerzer, nie unter 8,5rem und mit vollem
* Text im Tooltip; "Partial:" steht vorn und bleibt. So passt sie bis rund
* 1.440 px.
diff --git a/graph-ui/src/galaxy/use-graph-scope.ts b/graph-ui/src/galaxy/use-graph-scope.ts
index 0c73f881d..b5a2106b5 100644
--- a/graph-ui/src/galaxy/use-graph-scope.ts
+++ b/graph-ui/src/galaxy/use-graph-scope.ts
@@ -105,9 +105,9 @@ export function useGraphScope({ project, layout, filePath, range, fetch: fetchIm
const complete = result?.key === key ? result.value : undefined;
const error = failure?.key === key ? failure.message : undefined;
/*
- * Die Aufrufe am Rand, sobald eine Ebene fertig ist (Review zu K8): eine
- * kurze Zaehlabfrage, damit "Expand +1" vor einer Explosion warnt und nicht
- * erst das Render-Limit sie anhaelt. Je Ausschnitt und Tiefe einmal.
+ * The calls at the edge, once a layer is complete (review of K8): one short
+ * count query, so "Expand +1" warns before a layer explodes instead of the
+ * render limit stopping it later. Once per scope and depth.
*/
const edgeCallsCache = useRef(new Map<string, number>());
const [edgeCalls, setEdgeCalls] = useState<{ key: string; calls: number }>();
@@ -121,7 +121,7 @@ export function useGraphScope({ project, layout, filePath, range, fetch: fetchIm
if (abort.signal.aborted || calls === undefined) return;
if (edgeCallsCache.current.size >= 16) edgeCallsCache.current.delete(edgeCallsCache.current.keys().next().value!);
edgeCallsCache.current.set(key, calls); setEdgeCalls({ key, calls });
- }).catch(() => { /* Ohne Zahl bleibt es bei der Schaetzung aus dem Wachstum. */ });
+ }).catch(() => { /* Without a count the estimate from the growth remains. */ });
return () => abort.abort();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [complete, key]);