diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 8d0376b..40792fd 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -118,11 +118,23 @@ function loadInitialPage(): Page { // the account isn't known yet (first load, before the tab is pinned), start from defaults; the // post-login effect loads the real ones once the id arrives. function loadAccountFilters(id: number | null): FeedFilters { + // Your last-applied filters win, so a reload keeps whatever view you're on (a saved view you + // picked, or manual tweaks) — setFilters persists them under LS.filters on every change. The + // starred default view only SEEDS a fresh account that has never stored filters: it drives the + // very first load, after which that state persists like any other. (Re-apply the default view + // from the sidebar to return to it.) + const fKey = accountKey(LS.filters, id); + let hasStored = false; + try { + hasStored = !!fKey && localStorage.getItem(fKey) != null; + } catch { + /* localStorage may be unavailable */ + } + if (hasStored && fKey) return readMerged(fKey, DEFAULT_FILTERS); const dvKey = accountKey(LS.defaultViewFilters, id); const def = dvKey ? readJSON(dvKey, null) : null; if (def) return { ...DEFAULT_FILTERS, ...def }; - const fKey = accountKey(LS.filters, id); - return fKey ? readMerged(fKey, DEFAULT_FILTERS) : { ...DEFAULT_FILTERS }; + return { ...DEFAULT_FILTERS }; } // URL wins over localStorage so a pasted link reproduces the exact view.