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): hide inactive Explorer explanation tray

Martin Vogel31cb56498169
diff --git a/graph-ui/src/App.tsx b/graph-ui/src/App.tsx
index 71718e470..5dfd2d2d8 100644
--- a/graph-ui/src/App.tsx
+++ b/graph-ui/src/App.tsx
@@ -4950,7 +4950,7 @@ export default function App(): JSX.Element {
splitTwin={galaxyOn
? splitter('twinHeight', 'atlas-split-twin', 'horizontal', messages.layout.splitter.twin)
: undefined}
- explain={
+ explain={explainOpen ? (
<ExplainZone
tabs={explainTabList}
active={explainTab}
@@ -4964,7 +4964,7 @@ export default function App(): JSX.Element {
>
{explainPanel}
</ExplainZone>
- }
+ ) : undefined}
>
{/*
* Die Frage und der Einstiegsdialog liegen UEBER dem Editor statt
diff --git a/graph-ui/src/app/AtlasChrome.test.tsx b/graph-ui/src/app/AtlasChrome.test.tsx
index 4e161eadf..7fb34a40b 100644
--- a/graph-ui/src/app/AtlasChrome.test.tsx
+++ b/graph-ui/src/app/AtlasChrome.test.tsx
@@ -460,4 +460,23 @@ describe('AtlasChrome', () => {
await render(props());
expect(testId('atlas-reader')?.querySelector('[data-testid="fake-reader"]')).not.toBeNull();
});
+
+ it('only reserves an explanation splitter while a tool is open, preserving the reader', async () => {
+ const reader = <input data-testid="preserved-reader" defaultValue="selected source" />;
+ const next = props({ children: reader, splitExplain: <div data-testid="explanation-splitter" /> });
+ await render(next);
+ const mountedReader = testId('preserved-reader');
+ expect(testId('explanation-splitter')).toBeNull();
+
+ await render({ ...next, explain: <section data-testid="opened-tool">Flow</section> });
+ expect(testId('explanation-splitter')).not.toBeNull();
+ expect(testId('opened-tool')).not.toBeNull();
+ expect(testId('preserved-reader')).toBe(mountedReader);
+
+ await render(next);
+ expect(testId('explanation-splitter')).toBeNull();
+ expect(testId('opened-tool')).toBeNull();
+ expect(testId('preserved-reader')).toBe(mountedReader);
+ expect((mountedReader as HTMLInputElement).value).toBe('selected source');
+ });
});
diff --git a/graph-ui/src/app/AtlasChrome.tsx b/graph-ui/src/app/AtlasChrome.tsx
index 66200923a..faf00dde8 100644
--- a/graph-ui/src/app/AtlasChrome.tsx
+++ b/graph-ui/src/app/AtlasChrome.tsx
@@ -794,8 +794,10 @@ export default function AtlasChrome(props: AtlasChromeProps): JSX.Element {
{props.truncationNote}
</p>
)}
- {props.splitExplain}
- {props.explain}
+ {props.explain != null && <>
+ {props.splitExplain}
+ {props.explain}
+ </>}
</main>
{hasSide && (
<>