From 1d07c467db9994e4a44c54c1fcfebf41b1b1af62 Mon Sep 17 00:00:00 2001 From: esubaalew Date: Thu, 12 Feb 2026 10:03:14 +0300 Subject: [PATCH 1/2] fix tables route fallback when query table is missing --- ui/src/routes/tables.tsx | 55 +++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/ui/src/routes/tables.tsx b/ui/src/routes/tables.tsx index a1a5e37..08efdd2 100644 --- a/ui/src/routes/tables.tsx +++ b/ui/src/routes/tables.tsx @@ -47,27 +47,46 @@ function Tables() { ); - const tab = table - ? data.tables.findIndex(({ name }) => name === table).toString() - : "0"; + const requestedTableMissing = + !!table && !data.tables.some(({ name }) => name === table); + + const tab = (() => { + if (!table) return "0"; + const index = data.tables.findIndex(({ name }) => name === table); + return (index >= 0 ? index : 0).toString(); + })(); return ( - - - {data.tables.map((n, i) => ( - - - {n.name} [{n.count.toLocaleString()}] - - + <> + {requestedTableMissing && ( + + + Table not found + + Could not find "{table}". Showing the first available table + instead. + + + + )} + + + + {data.tables.map((n, i) => ( + + + {n.name} [{n.count.toLocaleString()}] + + + ))} + + {data.tables.map(({ name }, i) => ( + + + ))} - - {data.tables.map(({ name }, i) => ( - -
- - ))} - + + ); } From 17b51e9327aef1a293ed36df7cb985265baf1c6c Mon Sep 17 00:00:00 2001 From: esubaalew Date: Thu, 12 Feb 2026 10:29:16 +0300 Subject: [PATCH 2/2] address PR feedback on tables tab sync --- ui/src/routes/tables.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/src/routes/tables.tsx b/ui/src/routes/tables.tsx index 08efdd2..6483410 100644 --- a/ui/src/routes/tables.tsx +++ b/ui/src/routes/tables.tsx @@ -47,14 +47,12 @@ function Tables() { ); - const requestedTableMissing = - !!table && !data.tables.some(({ name }) => name === table); + const requestedTableIndex = table + ? data.tables.findIndex(({ name }) => name === table) + : -1; - const tab = (() => { - if (!table) return "0"; - const index = data.tables.findIndex(({ name }) => name === table); - return (index >= 0 ? index : 0).toString(); - })(); + const requestedTableMissing = !!table && requestedTableIndex < 0; + const tab = String(Math.max(requestedTableIndex, 0)); return ( <> @@ -70,7 +68,7 @@ function Tables() { )} - + {data.tables.map((n, i) => (