Trail list: #50 newest-first default never applies to browsers with a pre-deploy trailListFilter #67
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/wanderer#67
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the live acceptance test of
deploy-676a7c62(2026-11-05), userclaude_test.Problem: the new default sort from #50 (creation date, newest first) never reaches a browser that opened
/trailsbefore this deploy. Such browsers keep seeing the oldest trails first.Why: the previous build wrote the whole filter to
localStorage.trailListFilteron every visit, which includedsort: "created", sortOrder: "+"(the old default). On load,restoreStoredFilter()→sanitizeTrailFilter()accepts that stored"+"as if the user had picked it.trail_list.svelteonly overrides it when the separatesort/sort_orderkeys exist, and those are written only on an explicit choice. As a result, the "explicit choice wins" rule treats the old default as an explicit choice.Repro (headless Chromium, 1440 px):
localStorage.trailListFilterto the filter the old build stored, i.e. the current one with"sort":"created","sortOrder":"+". Make sure nosort/sort_orderkeys exist. This is the state of every browser that visited/trailsbefore the deploy./trailsin a new tab.A fresh browser (no
trailListFilter) is correct: newest first. Explicit choices also persist correctly, both across reloads and in a new tab.Evidence:
/root/tools/wanderer-shots/acceptance/out/t1e-trails-legacy-trailListFilter.png(legacy state, ascending) vs/root/tools/wanderer-shots/acceptance/out/t1a-trails-default-desktop-light.png(fresh browser, descending). Script:/root/tools/wanderer-shots/acceptance/t1_sort.mjs(step 1e).Fix idea: only let
trailListFilter.sort/sortOrderwin when the explicitsort/sort_orderkeys exist. Alternatively, run a one-off migration that dropssort/sortOrderfrom a storedtrailListFilterthat has no explicit keys. Add a test for "legacy trailListFilter with created/+ and no explicit keys → created/-".🤖 Generated with Claude Code
Fixed in batch PR #72 (
deploy5577c715), live since 2026-11-05 ~22:10 CET inwanderer-web:deploy-5577c715(homelab-flux #857). Verified with the live e2e suite and acceptance re-runs asclaude_test.🤖 Generated with Claude Code