From d3429b8aa8ca8c178ab285b6db8f83661172cff1 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Mon, 28 Sep 2026 21:42:56 -0700 Subject: [PATCH] Lists page on without a total, and don't keep a stale one --- src/components/lists/DynamicList.tsx | 15 +++++++++------ src/i18n/en.json | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/lists/DynamicList.tsx b/src/components/lists/DynamicList.tsx index b399d28..ec79ee7 100644 --- a/src/components/lists/DynamicList.tsx +++ b/src/components/lists/DynamicList.tsx @@ -499,9 +499,9 @@ export function DynamicList({ viewName }: DynamicListProps) { list: Record[]; }; - if (queryData.total != null) { - setTotal(queryData.total); - } + // inbuxa: a server that can't count (logs past the first page) leaves + // total out; the last page's total must not stand in for it + setTotal(queryData.total ?? null); setItems(getData.list ?? []); setSelectedIds(new Set()); @@ -887,7 +887,8 @@ export function DynamicList({ viewName }: DynamicListProps) { const pageStart = anchorStack.length * PAGE_SIZE; const rangeStart = pageStart + 1; const rangeEnd = pageStart + items.length; - const hasNextPage = total !== null && rangeEnd < total; + // inbuxa: without a total, a full page means there may be more + const hasNextPage = total !== null ? rangeEnd < total : items.length === PAGE_SIZE; const hasPrevPage = anchorStack.length > 0; function renderFilter(filterDef: FilterDef): React.ReactNode { @@ -1401,8 +1402,10 @@ export function DynamicList({ viewName }: DynamicListProps) { total, name: list.pluralName, }) - : t('list.showingItems', 'Showing {{count}} items', { - count: items.length, + : t('list.showingRange', 'Showing {{from}}-{{to}} {{name}}', { + from: rangeStart, + to: rangeEnd, + name: list.pluralName, })}
diff --git a/src/i18n/en.json b/src/i18n/en.json index 23e863b..2713d1e 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -302,10 +302,10 @@ "selectFilterPlaceholder": "Select {{label}}...", "selectItem": "Select item", "showing": "Showing {{from}}-{{to}} of {{total}} {{name}}", - "showingItems": "Showing {{count}} items", "sort": "Sort", "unknownError": "Unknown error", - "emptyTitle": "Nothing here yet" + "emptyTitle": "Nothing here yet", + "showingRange": "Showing {{from}}-{{to}} {{name}}" }, "login": { "continue": "Continue", -- 2.54.0