diff --git a/ui/src/components/ExecutionDiagram/DetailPanel.tsx b/ui/src/components/ExecutionDiagram/DetailPanel.tsx index 4b9d027f..1b2b9771 100644 --- a/ui/src/components/ExecutionDiagram/DetailPanel.tsx +++ b/ui/src/components/ExecutionDiagram/DetailPanel.tsx @@ -90,7 +90,7 @@ export function DetailPanel({
{/* Header bar */}
- Details + {selectedProcessor ? 'Processor Details' : 'Exchange Details'}
{/* Tab bar */} diff --git a/ui/src/components/ExecutionDiagram/ExecutionDiagram.tsx b/ui/src/components/ExecutionDiagram/ExecutionDiagram.tsx index 28e2e7e3..53bb2a9c 100644 --- a/ui/src/components/ExecutionDiagram/ExecutionDiagram.tsx +++ b/ui/src/components/ExecutionDiagram/ExecutionDiagram.tsx @@ -20,15 +20,46 @@ interface ExecutionDiagramProps { className?: string; } +const ITERATION_WRAPPER_TYPES = new Set([ + 'loopIteration', 'splitIteration', 'multicastBranch', +]); + +function wrapperIndex(proc: ProcessorNode): number | undefined { + return proc.loopIndex ?? proc.splitIndex ?? proc.multicastIndex ?? undefined; +} + +/** + * Find a processor in the tree, respecting iteration filtering. + * Only recurses into the selected iteration wrapper so the returned + * ProcessorNode has data from the correct iteration. + */ function findProcessorInTree( nodes: ProcessorNode[] | undefined, processorId: string | null, + iterationState?: Map, + parentId?: string, ): ProcessorNode | null { if (!nodes || !processorId) return null; for (const n of nodes) { + if (!n.processorId) continue; + + // Iteration wrapper: only recurse into the selected iteration + if (ITERATION_WRAPPER_TYPES.has(n.processorType)) { + if (parentId && iterationState?.has(parentId)) { + const info = iterationState.get(parentId)!; + const idx = wrapperIndex(n); + if (idx != null && idx !== info.current) continue; + } + if (n.children) { + const found = findProcessorInTree(n.children, processorId, iterationState, n.processorId); + if (found) return found; + } + continue; + } + if (n.processorId === processorId) return n; if (n.children) { - const found = findProcessorInTree(n.children, processorId); + const found = findProcessorInTree(n.children, processorId, iterationState, n.processorId); if (found) return found; } } @@ -204,7 +235,11 @@ export function ExecutionDiagram({ {/* Detail panel */}