fix(audit): H15 (saved-view sort) + H14 (back/forward URL resync) in usePaginatedQuery

H15: new applyView({filters,sort}) atomic mutator (one URL write) restores a
saved view's sort, threaded through all six list components instead of being
discarded. H14: a guarded effect resyncs page/sort/filters FROM the URL on
Back/Forward; the resync setStates carry a scoped, justified
set-state-in-effect disable (loop-guarded external-URL sync).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-02 12:26:10 +02:00
parent 808e80744b
commit 29fb882478
7 changed files with 152 additions and 27 deletions

View File

@@ -83,7 +83,7 @@ export function ResidentialInterestsList() {
setPageSize,
filters,
setFilter,
setAllFilters,
applyView,
clearFilters,
} = usePaginatedQuery<ResidentialInterestRow>({
queryKey: ['residential-interests'],
@@ -193,7 +193,9 @@ export function ResidentialInterestsList() {
<div className="ml-auto flex flex-wrap items-center gap-2">
<SavedViewsDropdown
entityType="residential_interests"
onApplyView={(savedFilters) => setAllFilters(savedFilters)}
onApplyView={(savedFilters, savedSort) =>
applyView({ filters: savedFilters, sort: savedSort })
}
/>
<ColumnPicker
columns={RESIDENTIAL_INTEREST_COLUMN_OPTIONS}