diff --git a/understand-anything-plugin/packages/dashboard/src/store.ts b/understand-anything-plugin/packages/dashboard/src/store.ts index a8cfdf1..ec833d4 100644 --- a/understand-anything-plugin/packages/dashboard/src/store.ts +++ b/understand-anything-plugin/packages/dashboard/src/store.ts @@ -387,7 +387,17 @@ export const useDashboardStore = create()((set, get) => ({ expandedContainers: new Set(), }), - setFocusNode: (nodeId) => set({ focusNodeId: nodeId, selectedNodeId: nodeId }), + setFocusNode: (nodeId) => + set({ + focusNodeId: nodeId, + selectedNodeId: nodeId, + // Focus mode narrows filteredGraphNodes to focus + 1-hop; the + // surviving containers have a subset of their original children, + // and the cache must not return positions for filtered-out ids. + containerLayoutCache: new Map(), + containerSizeMemory: new Map(), + expandedContainers: new Set(), + }), setSearchMode: (mode) => set({ searchMode: mode }), setSearchQuery: (query) => { const engine = get().searchEngine; diff --git a/understand-anything-plugin/packages/dashboard/src/utils/layout.ts b/understand-anything-plugin/packages/dashboard/src/utils/layout.ts index cd73fb6..b35328c 100644 --- a/understand-anything-plugin/packages/dashboard/src/utils/layout.ts +++ b/understand-anything-plugin/packages/dashboard/src/utils/layout.ts @@ -21,6 +21,11 @@ export const PORTAL_NODE_HEIGHT = 80; /** * Synchronous dagre layout — used for small graphs. + * + * @deprecated The dashboard's structural views all use ELK now + * (`applyElkLayout` from `./elk-layout`). This helper is kept for one + * release to allow a quick fallback if ELK has a regression. Slated for + * removal in the version after layout migration is verified stable. */ export function applyDagreLayout( nodes: Node[],