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 on one row

Bernhard Jackiewicz01cc2c0c289c
diff --git a/graph-ui/src/galaxy/GalaxyPanel.stability.test.tsx b/graph-ui/src/galaxy/GalaxyPanel.stability.test.tsx
index 1b72cec6c..08f05fcc0 100644
--- a/graph-ui/src/galaxy/GalaxyPanel.stability.test.tsx
+++ b/graph-ui/src/galaxy/GalaxyPanel.stability.test.tsx
@@ -77,6 +77,9 @@ it('keeps one scene mounted through selection and expansion and fits once per se
await settle(() => expect(seam().nodes).toBe(5));
expect(scene.mounts).toBe(1);
const fitsBefore = seam().fits;
+ // The whole graph keeps its render limits in the toolbar row.
+ expect(host.querySelector('.atlas-graph-limits')).toBeNull();
+ expect(host.querySelector('select[aria-label="Rendered node limit"]')).not.toBeNull();
await act(async () => { seam().clickNode('sample.n1'); });
await settle(() => {
@@ -85,6 +88,9 @@ it('keeps one scene mounted through selection and expansion and fits once per se
});
expect(scene.mounts).toBe(1); expect(scene.unmounts).toBe(0);
expect(seam().fits).toBe(fitsBefore + 1);
+ // In a scope the limits step back into a compact menu so the row does not wrap.
+ expect(host.querySelector('details.atlas-graph-limits select[aria-label="Rendered node limit"]')).not.toBeNull();
+ expect(host.querySelector('details.atlas-graph-limits select[aria-label="Rendered edge limit"]')).not.toBeNull();
// The root is marked, sits at the origin and the fit is centred on it.
expect([...scene.roots ?? []]).toEqual([1]);
expect(seam().lastFit?.center?.map(value => value + 0)).toEqual([0, 0, 0]);
diff --git a/graph-ui/src/galaxy/GalaxyPanel.tsx b/graph-ui/src/galaxy/GalaxyPanel.tsx
index b2f6eef28..5b5f90a35 100644
--- a/graph-ui/src/galaxy/GalaxyPanel.tsx
+++ b/graph-ui/src/galaxy/GalaxyPanel.tsx
@@ -139,7 +139,7 @@ import GalaxyNavigator from './GalaxyNavigator';
import { TraceEdgeFilter } from './TraceEdgeFilter';
import { PathPicker, PathSteps } from './ScopePathControls';
import { callOrder, pathNodes, shortestScopePath, type ScopePathStep } from './scope-path';
-import { galaxyPathText } from './galaxy-strings';
+import { galaxyPathText, galaxyToolbarText } from './galaxy-strings';
import { useOrganicLayout } from './use-organic-layout';
import RenderProgress from './RenderProgress';
import { useGraphScope } from './use-graph-scope';
@@ -1188,6 +1188,15 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
});
}, [props.workspaceExpanded, scope.scope, traceTypes, kinds, changeTraceTypes]);
+ const renderLimits = <>
+ <label>Nodes <select aria-label="Rendered node limit" value={nodeBudget} onChange={event => setViewPreferences({ galaxyNodes: Number(event.target.value) })}>
+ {GALAXY_NODE_LIMITS.map(value => <option key={value} value={value}>{value.toLocaleString()}</option>)}
+ </select></label>
+ <label>Edges <select aria-label="Rendered edge limit" value={edgeBudget} onChange={event => setViewPreferences({ galaxyEdges: Number(event.target.value) })}>
+ {GALAXY_EDGE_LIMITS.map(value => <option key={value} value={value}>{value.toLocaleString()}</option>)}
+ </select></label>
+ </>;
+
/*
* Der Pfad und die Aufrufreihe (Review-Befund G5, nach dem Vorbild von
* Graphify).
@@ -2330,15 +2339,22 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {
: 'Partial preview'}</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 title="Groups reflect connections in this trace, not inferred architecture components.">{organic.groups.length} connection groups</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>}
</> : null}
{props.workspaceExpanded && <>
- <label>Nodes <select aria-label="Rendered node limit" value={nodeBudget} onChange={event => setViewPreferences({ galaxyNodes: Number(event.target.value) })}>
- {GALAXY_NODE_LIMITS.map(value => <option key={value} value={value}>{value.toLocaleString()}</option>)}
- </select></label>
- <label>Edges <select aria-label="Rendered edge limit" value={edgeBudget} onChange={event => setViewPreferences({ galaxyEdges: Number(event.target.value) })}>
- {GALAXY_EDGE_LIMITS.map(value => <option key={value} value={value}>{value.toLocaleString()}</option>)}
- </select></label>
+ {/*
+ * Im Scope tritt der Deckel in ein Aufklappfeld zurueck
+ * (Review-Befund G7): die Leiste traegt dort Pfad,
+ * Aufrufreihe und Zaehler, und bei 1600 Pixeln brach die
+ * 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>
+ </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
diff --git a/graph-ui/src/galaxy/galaxy-strings.ts b/graph-ui/src/galaxy/galaxy-strings.ts
index 6920f38ec..0538dd323 100644
--- a/graph-ui/src/galaxy/galaxy-strings.ts
+++ b/graph-ui/src/galaxy/galaxy-strings.ts
@@ -33,3 +33,11 @@ export const galaxyPathText = {
clearTitle: 'Return to the whole scope (Esc)',
position: (index: number, total: number) => `${index} of ${total}`,
};
+
+/** Compact toolbar words, so the scoped toolbar keeps to one row at 1600 px. */
+export const galaxyToolbarText = {
+ groups: (count: number) => `${count.toLocaleString()} groups`,
+ 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',
+};
diff --git a/graph-ui/src/galaxy/graph-exploration.css b/graph-ui/src/galaxy/graph-exploration.css
index cbec96aa6..6b5451398 100644
--- a/graph-ui/src/galaxy/graph-exploration.css
+++ b/graph-ui/src/galaxy/graph-exploration.css
@@ -1,5 +1,5 @@
.atlas-graph-exploration { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; padding:.4rem .75rem; border-bottom:1px solid var(--border, #29423b); font-size:.8rem; }
-.atlas-galaxy-search-container { position:relative; flex:1 1 18rem; min-width:12rem; max-width:32rem; }
+.atlas-galaxy-search-container { position:relative; flex:1 1 12rem; min-width:9rem; max-width:32rem; }
.atlas-galaxy-search-container > input { box-sizing:border-box; width:100%; min-height:2rem; padding:.4rem .65rem; border:1px solid #29473a; border-radius:6px; background:rgba(7,17,12,.65); color:var(--atlas-fg,#cbdbd0); font:inherit; }
.atlas-galaxy-search-container > input:focus { outline:1px solid #6d9a84; border-color:#6d9a84; }
.atlas-galaxy-search-results { position:absolute; top:calc(100% + .4rem); left:0; z-index:35; width:min(34rem, calc(100vw - 2rem)); padding:.5rem; border:1px solid #355246; border-radius:8px; background:rgba(13,25,19,.98); box-shadow:0 8px 24px #0005; }
@@ -11,8 +11,13 @@
.atlas-graph-exploration button:hover:not(:disabled) { background:rgba(68, 112, 86, .24); border-color:#517d65; }
.atlas-graph-exploration button:focus-visible, .atlas-galaxy-selection-details > summary:focus-visible { outline:2px solid #75ac94; outline-offset:2px; }
.atlas-graph-exploration button:disabled { opacity:.4; cursor:not-allowed; }
-.atlas-graph-scope-name { max-width:22rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
-.atlas-graph-scope-count { color:#93b2a1; margin-inline-start:auto; font-variant-numeric:tabular-nums; }
+.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; }
+/* Der Deckel im Scope: dieselbe Bauform wie die Kantenarten (Review-Befund G7). */
+.atlas-graph-limits { position:relative; }
+.atlas-graph-limits > summary { padding:.25rem .5rem; border:1px solid #29473a; border-radius:6px; cursor:pointer; color:#b5c9bc; white-space:nowrap; }
+.atlas-graph-limits-menu { position:absolute; top:calc(100% + .35rem); right:0; z-index:30; display:flex; flex-direction:column; align-items:flex-end; gap:.45rem; padding:.6rem; border:1px solid #355246; border-radius:8px; background:rgba(13,25,19,.98); box-shadow:0 8px 24px #0005; }
.atlas-graph-scope-warning { width:100%; color:#c6aa82; }
.atlas-trace-edge-filter { position:relative; }
.atlas-trace-edge-filter > summary { padding:.25rem .5rem; border:1px solid #29473a; border-radius:6px; cursor:pointer; color:#b5c9bc; }
@@ -68,9 +73,9 @@
.atlas-galaxy-path-label[data-active=true] { color:#ffffff; outline:1px solid #80ac96; }
.atlas-galaxy-path-step { position:relative; display:block; width:0; height:0; pointer-events:none; }
.atlas-galaxy-path-step > i { position:absolute; left:-12px; top:-12px; width:24px; height:24px; box-sizing:border-box; border:2px solid #9fe0bd; border-radius:50%; box-shadow:0 0 12px rgba(159, 224, 189, .55); }
+.atlas-galaxy-path-step > b { position:absolute; bottom:15px; left:0; transform:translateX(-50%); padding:1px 6px; border-radius:4px; background:rgba(13, 15, 18, .84); color:#cfeedd; font:600 12px/1.4 var(--atlas-ui-font, system-ui, sans-serif); white-space:nowrap; }
/* Die Wurzel eines Scopes: ein Ring auf dem Punkt und ihr Name darunter, immer sichtbar. */
.atlas-galaxy-root-marker { position:relative; display:block; width:0; height:0; pointer-events:none; }
.atlas-galaxy-root-marker > i { position:absolute; left:-15px; top:-15px; width:30px; height:30px; box-sizing:border-box; border:2px solid #f0cf73; border-radius:50%; box-shadow:0 0 0 4px rgba(240, 207, 115, .16), 0 0 16px rgba(240, 207, 115, .5); }
.atlas-galaxy-root-marker > b { position:absolute; top:19px; left:0; transform:translateX(-50%); padding:1px 6px; border-radius:4px; background:rgba(13, 15, 18, .84); color:#f5e2a6; font:600 12px/1.4 var(--atlas-ui-font, system-ui, sans-serif); white-space:nowrap; }
-.atlas-galaxy-path-step > b { position:absolute; bottom:15px; left:0; transform:translateX(-50%); padding:1px 6px; border-radius:4px; background:rgba(13, 15, 18, .84); color:#cfeedd; font:600 12px/1.4 var(--atlas-ui-font, system-ui, sans-serif); white-space:nowrap; }