From 3c310e1d79674fdda4eb497d1c8c524d71c5ef45 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 22 Apr 2026 21:31:24 +0200 Subject: [PATCH] Update Tasks documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Docs/Tasks.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/Docs/Tasks.md b/Docs/Tasks.md index 18e4840..99fb5b7 100644 --- a/Docs/Tasks.md +++ b/Docs/Tasks.md @@ -1,29 +1,3 @@ -### TASK-BUG-03 — MapPage Pagination Resets on Every Data Refresh - -**Where found** -`frontend/src/pages/MapPage.tsx` lines ~350–352: -```ts -useEffect(() => { - setPage(1); -}, [range, originFilter, selectedCountry, bans, pageSize]); -``` -`bans` is the array returned by `useMapData`. Every time `useMapData` completes a fetch it produces a new array reference. This causes `setPage(1)` to fire after every single background refresh, not just when the user changes a filter. - -**Goal** -Remove `bans` from the dependency array. Page should only reset to 1 when the user changes a *filter* (range, originFilter, selectedCountry, pageSize), not when the underlying data refreshes. - -**Possible traps and issues** -- After removing `bans`, if `bans.length` shrinks below the current page offset (e.g. the user is on page 3, data refreshes with fewer results), the pagination will show an empty page. Add a separate effect that clamps `page` to `totalPages` when `totalPages` changes: `if (page > totalPages) setPage(totalPages)`. -- `visibleBans` is already derived from `bans` via `useMemo`, so the table stays correct without `bans` in the reset effect. - -**Docs changes needed** -None required. - -**Why this is needed** -Users browsing the per-country ban table on MapPage are returned to page 1 every time the background auto-refresh fires (typically every 30 seconds), which makes the table unusable for pagination beyond the first page. - ---- - ### TASK-BUG-04 — `autoSavePayload` Silently Drops Intentional Zero Values **Where found**