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) <noreply@anthropic.com>
This commit is contained in:
@@ -90,7 +90,7 @@ export function DetailPanel({
|
|||||||
<div className={styles.detailPanel}>
|
<div className={styles.detailPanel}>
|
||||||
{/* Header bar */}
|
{/* Header bar */}
|
||||||
<div className={styles.processorHeader}>
|
<div className={styles.processorHeader}>
|
||||||
<span className={styles.processorName}>Details</span>
|
<span className={styles.processorName}>{selectedProcessor ? 'Processor Details' : 'Exchange Details'}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tab bar */}
|
{/* Tab bar */}
|
||||||
|
|||||||
@@ -20,15 +20,46 @@ interface ExecutionDiagramProps {
|
|||||||
className?: string;
|
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(
|
function findProcessorInTree(
|
||||||
nodes: ProcessorNode[] | undefined,
|
nodes: ProcessorNode[] | undefined,
|
||||||
processorId: string | null,
|
processorId: string | null,
|
||||||
|
iterationState?: Map<string, import('./types').IterationInfo>,
|
||||||
|
parentId?: string,
|
||||||
): ProcessorNode | null {
|
): ProcessorNode | null {
|
||||||
if (!nodes || !processorId) return null;
|
if (!nodes || !processorId) return null;
|
||||||
for (const n of nodes) {
|
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.processorId === processorId) return n;
|
||||||
if (n.children) {
|
if (n.children) {
|
||||||
const found = findProcessorInTree(n.children, processorId);
|
const found = findProcessorInTree(n.children, processorId, iterationState, n.processorId);
|
||||||
if (found) return found;
|
if (found) return found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,7 +235,11 @@ export function ExecutionDiagram({
|
|||||||
{/* Detail panel */}
|
{/* Detail panel */}
|
||||||
<div className={styles.detailArea} style={{ height: `${100 - splitPercent}%` }}>
|
<div className={styles.detailArea} style={{ height: `${100 - splitPercent}%` }}>
|
||||||
<DetailPanel
|
<DetailPanel
|
||||||
selectedProcessor={findProcessorInTree(detail.processors, selectedProcessorId || null)}
|
selectedProcessor={
|
||||||
|
selectedProcessorId && overlay.has(selectedProcessorId)
|
||||||
|
? findProcessorInTree(detail.processors, selectedProcessorId, iterationState)
|
||||||
|
: null
|
||||||
|
}
|
||||||
executionDetail={detail}
|
executionDetail={detail}
|
||||||
executionId={executionId}
|
executionId={executionId}
|
||||||
onSelectProcessor={setSelectedProcessorId}
|
onSelectProcessor={setSelectedProcessorId}
|
||||||
|
|||||||
Reference in New Issue
Block a user