diff --git a/ui/src/pages/Exchanges/ExchangeHeader.tsx b/ui/src/pages/Exchanges/ExchangeHeader.tsx index cee38a37..746745ff 100644 --- a/ui/src/pages/Exchanges/ExchangeHeader.tsx +++ b/ui/src/pages/Exchanges/ExchangeHeader.tsx @@ -11,6 +11,7 @@ import styles from './ExchangeHeader.module.css'; interface ExchangeHeaderProps { detail: ExecutionDetail; onCorrelatedSelect?: (executionId: string, applicationName: string, routeId: string) => void; + onClearSelection?: () => void; } type StatusVariant = 'success' | 'error' | 'running' | 'warning'; @@ -39,7 +40,7 @@ function formatDuration(ms: number): string { return `${ms}ms`; } -export function ExchangeHeader({ detail, onCorrelatedSelect }: ExchangeHeaderProps) { +export function ExchangeHeader({ detail, onCorrelatedSelect, onClearSelection }: ExchangeHeaderProps) { const navigate = useNavigate(); const { data: chainResult } = useCorrelationChain(detail.correlationId ?? null); const chain = chainResult?.data; @@ -69,10 +70,10 @@ export function ExchangeHeader({ detail, onCorrelatedSelect }: ExchangeHeaderPro )} - - diff --git a/ui/src/pages/Exchanges/ExchangesPage.tsx b/ui/src/pages/Exchanges/ExchangesPage.tsx index e58f1597..e4f70187 100644 --- a/ui/src/pages/Exchanges/ExchangesPage.tsx +++ b/ui/src/pages/Exchanges/ExchangesPage.tsx @@ -26,6 +26,10 @@ export default function ExchangesPage() { setSelected({ executionId, applicationName, routeId }); }, []); + const handleClearSelection = useCallback(() => { + setSelected(null); + }, []); + const handleSplitterDown = useCallback((e: React.PointerEvent) => { e.currentTarget.setPointerCapture(e.pointerId); const container = containerRef.current; @@ -62,6 +66,7 @@ export default function ExchangesPage() { routeId={selected.routeId} exchangeId={selected.executionId} onCorrelatedSelect={handleCorrelatedSelect} + onClearSelection={handleClearSelection} /> @@ -75,9 +80,10 @@ interface DiagramPanelProps { routeId: string; exchangeId: string; onCorrelatedSelect: (executionId: string, applicationName: string, routeId: string) => void; + onClearSelection: () => void; } -function DiagramPanel({ appId, routeId, exchangeId, onCorrelatedSelect }: DiagramPanelProps) { +function DiagramPanel({ appId, routeId, exchangeId, onCorrelatedSelect, onClearSelection }: DiagramPanelProps) { const navigate = useNavigate(); const { timeRange } = useGlobalFilters(); const timeFrom = timeRange.start.toISOString(); @@ -107,7 +113,7 @@ function DiagramPanel({ appId, routeId, exchangeId, onCorrelatedSelect }: Diagra if (detail) { return ( <> - +