From 30e9b553794c97dc31143f9d35cad6ee72ea53e9 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:25:28 +0200 Subject: [PATCH] fix: detail panel respects iteration filtering - findProcessorInTree now skips non-selected iteration wrappers so the returned ProcessorNode has data from the correct iteration - Gate selectedProcessor on overlay presence so processors not executed in the current iteration don't show in the detail panel - Header shows "Exchange Details" or "Processor Details" contextually Co-Authored-By: Claude Opus 4.6 (1M context) --- .../ExecutionDiagram/DetailPanel.tsx | 2 +- .../ExecutionDiagram/ExecutionDiagram.tsx | 39 ++++++++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) 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 */}