diff --git a/ui/src/components/ProcessDiagram/ProcessDiagram.tsx b/ui/src/components/ProcessDiagram/ProcessDiagram.tsx index 30fa88f1..05b47e94 100644 --- a/ui/src/components/ProcessDiagram/ProcessDiagram.tsx +++ b/ui/src/components/ProcessDiagram/ProcessDiagram.tsx @@ -69,8 +69,12 @@ export function ProcessDiagram({ 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( - application, currentRouteId, direction, diagramLayout, + application, currentRouteId, direction, effectiveLayout, ); // Collect ENDPOINT node IDs — these are always "traversed" when overlay is active