diff --git a/frontend/src/routes/dashboards/+page.svelte b/frontend/src/routes/dashboards/+page.svelte
index 19b670ba..39c269bf 100644
--- a/frontend/src/routes/dashboards/+page.svelte
+++ b/frontend/src/routes/dashboards/+page.svelte
@@ -25,9 +25,9 @@
import DashboardMaintenanceBadge from "$lib/components/DashboardMaintenanceBadge.svelte";
import { environmentContextStore, initializeEnvironmentContext, setSelectedEnvironment } from "$lib/stores/environmentContext.svelte.js";
- import { Button, Skeleton } from "$lib/ui";
+ import { Button, Pagination, Skeleton } from "$lib/ui";
import ColumnFilterPopover from "./ColumnFilterPopover.svelte";
- import { formatDate, getPaginationRange, getSortIndicator } from "./dashboard-helpers.js";
+ import { formatDate, getSortIndicator } from "./dashboard-helpers.js";
import { DashboardHubModel } from "$lib/models/DashboardHubModel.svelte.ts";
import MigrateDashboardModal from "./MigrateDashboardModal.svelte";
import BackupDashboardModal from "./BackupDashboardModal.svelte";
@@ -52,6 +52,26 @@
setSelectedEnvironment(envId);
}
+ // ── Pagination bridge (0-indexed ↔ 1-indexed) ──
+ let pageZero = $state(m.currentPage - 1);
+
+ $effect(() => {
+ if (pageZero + 1 !== m.currentPage) {
+ m.setPage(pageZero + 1);
+ }
+ });
+
+ $effect(() => {
+ if (m.currentPage - 1 !== pageZero) {
+ pageZero = m.currentPage - 1;
+ }
+ });
+
+ function handlePageSizeChange(size: number) {
+ m.pageSize = size;
+ m.currentPage = 1;
+ }
+
// Store-derived values (must stay in page — legacy store not reactive in Model)
let environments = $derived($environmentContextStore?.environments || []);
let shouldShowEnvironmentWizard = $derived(
@@ -656,81 +676,14 @@ class="inline-flex h-8 w-8 items-center justify-center rounded-md border border-
{#if m.totalPages > 1}
-
-
- {($t.dashboard?.showing ?? '')
- .replace("{start}", String((m.currentPage - 1) * m.pageSize + 1))
- .replace("{end}", String(Math.min(m.currentPage * m.pageSize, m.total)))
- .replace("{total}", String(m.total))}
-
-
- m.setPage(1)}
- disabled={m.currentPage === 1}
- >
- {$t.common?.first}
-
- m.setPage(m.currentPage - 1)}
- disabled={m.currentPage === 1}
- >
- {$t.dashboard?.previous}
-
- {#each getPaginationRange(m.currentPage, m.totalPages) as pageNum}
- {#if pageNum === "..."}
- ...
- {:else}
- m.setPage(pageNum)}
- >
- {pageNum}
-
- {/if}
- {/each}
- m.setPage(m.currentPage + 1)}
- disabled={m.currentPage === m.totalPages}
- >
- {$t.dashboard?.next}
-
- m.setPage(m.totalPages)}
- disabled={m.currentPage === m.totalPages}
- >
- {$t.common?.last}
-
-
-
- m.setPageSize(e)}
- >
-
- {($t.dashboard?.per_page_option ?? '{count} per page').replace("{count}", "5")}
-
-
- {($t.dashboard?.per_page_option ?? '{count} per page').replace("{count}", "10")}
-
-
- {($t.dashboard?.per_page_option ?? '{count} per page').replace("{count}", "25")}
-
-
- {($t.dashboard?.per_page_option ?? '{count} per page').replace("{count}", "50")}
-
-
- {($t.dashboard?.per_page_option ?? '{count} per page').replace("{count}", "100")}
-
-
-
-
+
{/if}
diff --git a/frontend/src/routes/datasets/DatasetList.svelte b/frontend/src/routes/datasets/DatasetList.svelte
index 0ccebb65..a7c7ac5c 100644
--- a/frontend/src/routes/datasets/DatasetList.svelte
+++ b/frontend/src/routes/datasets/DatasetList.svelte
@@ -10,7 +10,7 @@
@@ -167,18 +182,11 @@
{#if totalPages > 1}
-
-
- {($t.datasets?.showing ?? 'Showing {start}-{end} of {total}').replace('{start}', String((page - 1) * pageSize + 1)).replace('{end}', String(Math.min(page * pageSize, total))).replace('{total}', String(total))}
-
-
- onpagechange?.(1)} disabled={page <= 1}>«
- onpagechange?.(page - 1)} disabled={page <= 1}>‹
- {page} / {totalPages}
- onpagechange?.(page + 1)} disabled={page >= totalPages}>›
- onpagechange?.(totalPages)} disabled={page >= totalPages}>»
-
-
+
{/if}
{/if}
\ No newline at end of file
diff --git a/frontend/src/routes/validation-tasks/+page.svelte b/frontend/src/routes/validation-tasks/+page.svelte
index b491ef4e..a3d7989d 100644
--- a/frontend/src/routes/validation-tasks/+page.svelte
+++ b/frontend/src/routes/validation-tasks/+page.svelte
@@ -10,7 +10,7 @@
@@ -178,16 +187,11 @@
{#if m.totalPages > 1}
-
-
{($t.validation?.showing || 'Showing {count} of {total}').replace('{count}', String(m.tasks.length)).replace('{total}', String(m.total))}
-
- m.goToPage(m.currentPage - 1)} disabled={m.currentPage <= 1} class="px-3 py-1.5 text-sm border border-border rounded-lg disabled:opacity-40 disabled:cursor-not-allowed hover:bg-surface-muted text-text-muted transition-colors">{$t.validation?.previous}
- {#each Array.from({ length: Math.min(m.totalPages, 7) }, (_, i) => { if (m.totalPages <= 7) return i + 1; const half = 3; const start = Math.max(1, m.currentPage - half); const end = Math.min(m.totalPages, start + 6); const adj = Math.max(1, end - 6); return adj + i; }) as p (p)}
- m.goToPage(p)} class={pageBtnClass(p)}>{p}
- {/each}
- m.goToPage(m.currentPage + 1)} disabled={m.currentPage >= m.totalPages} class="px-3 py-1.5 text-sm border border-border rounded-lg disabled:opacity-40 disabled:cursor-not-allowed hover:bg-surface-muted text-text-muted transition-colors">{$t.validation?.next}
-
-
+
{/if}
{/if}