From bb7e456aff216364e2e9d4968457a77146918c5b Mon Sep 17 00:00:00 2001 From: Dawson Toth Date: Fri, 10 Jul 2026 14:49:56 -0400 Subject: [PATCH] fix(databases): reset to page 1 when the table filter changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The database/table browser keeps its current page (offset) when a column filter is applied or cleared. On page 3+ (offset >= 40) a filter that matches fewer rows than the offset returns an empty page, so the list looks empty even though matches exist on page 1 (#1463). Add `appliedSearchConditions` to the `pageIndex` useEffectedState deps so the page resets to 0 whenever the applied filter changes — the same reset-on-dependency-change pattern the file already uses for sort, selectedIds, and pageIndex-on-table-change. This covers both the apply and clear paths (and any future path that mutates the applied filter). Co-Authored-By: Claude Opus 4.8 --- .../instance/databases/components/DatabaseTableView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/features/instance/databases/components/DatabaseTableView.tsx b/src/features/instance/databases/components/DatabaseTableView.tsx index 68392a34d..4fe793180 100644 --- a/src/features/instance/databases/components/DatabaseTableView.tsx +++ b/src/features/instance/databases/components/DatabaseTableView.tsx @@ -155,7 +155,10 @@ export function DatabaseTableView({ instanceDatabaseMap, databaseName, tableName allParams, ); - const [pageIndex, setPageIndex] = useEffectedState(0, [databaseName, tableName]); + // Reset to the first page when the table changes OR the applied filter changes. Without the + // filter dependency a stale page (e.g. page 3 -> offset 40) would be sent with the new filter, + // and a filter that matches fewer rows than that offset comes back empty (#1463). + const [pageIndex, setPageIndex] = useEffectedState(0, [databaseName, tableName, appliedSearchConditions]); const [pageSize, setPageSize] = useState(20); // The count comes from whichever describe carries it: the map when the server still returns counts