fix(ui): exchange selection uses state, not URL navigation
Row click no longer navigates to /exchanges/:app/:route/:id which was changing the search scope. Instead, Dashboard calls onExchangeSelect callback and ExchangesPage manages the selected exchange as local state. The search criteria and scope are preserved when selecting an exchange. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -176,7 +176,17 @@ function buildBaseColumns(): Column<Row>[] {
|
||||
|
||||
// ─── Dashboard component ─────────────────────────────────────────────────────
|
||||
|
||||
export default function Dashboard() {
|
||||
export interface SelectedExchange {
|
||||
executionId: string;
|
||||
applicationName: string;
|
||||
routeId: string;
|
||||
}
|
||||
|
||||
interface DashboardProps {
|
||||
onExchangeSelect?: (exchange: SelectedExchange) => void;
|
||||
}
|
||||
|
||||
export default function Dashboard({ onExchangeSelect }: DashboardProps = {}) {
|
||||
const { appId, routeId } = useParams<{ appId: string; routeId: string }>()
|
||||
const navigate = useNavigate()
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
@@ -228,8 +238,13 @@ export default function Dashboard() {
|
||||
|
||||
function handleRowClick(row: Row) {
|
||||
setSelectedId(row.id)
|
||||
// Navigate to the split view with diagram
|
||||
navigate(`/exchanges/${row.applicationName}/${row.routeId}/${row.executionId}`)
|
||||
if (onExchangeSelect) {
|
||||
onExchangeSelect({
|
||||
executionId: row.executionId,
|
||||
applicationName: row.applicationName ?? '',
|
||||
routeId: row.routeId,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function handleRowAccent(row: Row): 'error' | 'warning' | undefined {
|
||||
|
||||
Reference in New Issue
Block a user