fix: drill-down uses route-based fetch instead of pre-loaded layout

When drilled into a sub-route, the pre-fetched diagramLayout (loaded by
content hash for the root execution) doesn't contain the sub-route's
diagram. Only use the pre-loaded layout for the root route; fall back to
useDiagramByRoute for drilled-down sub-routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-27 19:40:20 +01:00
parent 3027e9b24f
commit 0b8efa1998

View File

@@ -69,8 +69,12 @@ export function ProcessDiagram({
const currentRouteId = routeStack[routeStack.length - 1]; const currentRouteId = routeStack[routeStack.length - 1];
// Only use the pre-fetched diagramLayout for the root route.
// When drilled down into a sub-route, fetch the sub-route's diagram by route ID.
const effectiveLayout = currentRouteId === routeId ? diagramLayout : undefined;
const { sections, totalWidth, totalHeight, isLoading, error } = useDiagramData( const { sections, totalWidth, totalHeight, isLoading, error } = useDiagramData(
application, currentRouteId, direction, diagramLayout, application, currentRouteId, direction, effectiveLayout,
); );
// Collect ENDPOINT node IDs — these are always "traversed" when overlay is active // Collect ENDPOINT node IDs — these are always "traversed" when overlay is active