Trail list: #50 newest-first default never applies to browsers with a pre-deploy trailListFilter #67

Closed
opened 2026-11-05 19:19:00 +00:00 by maximus · 1 comment
Member

Found in the live acceptance test of deploy-676a7c62 (2026-11-05), user claude_test.

Problem: the new default sort from #50 (creation date, newest first) never reaches a browser that opened /trails before this deploy. Such browsers keep seeing the oldest trails first.

Why: the previous build wrote the whole filter to localStorage.trailListFilter on every visit, which included sort: "created", sortOrder: "+" (the old default). On load, restoreStoredFilter() → sanitizeTrailFilter() accepts that stored "+" as if the user had picked it. trail_list.svelte only overrides it when the separate sort / sort_order keys 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):

  1. Log in. In the browser, set localStorage.trailListFilter to the filter the old build stored, i.e. the current one with "sort":"created","sortOrder":"+". Make sure no sort / sort_order keys exist. This is the state of every browser that visited /trails before the deploy.
  2. Open /trails in a new tab.
  3. Expected: "Creation date" with the down arrow (newest first). Actual: "Creation date" ascending, oldest first.

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 / sortOrder win when the explicit sort / sort_order keys exist. Alternatively, run a one-off migration that drops sort / sortOrder from a stored trailListFilter that has no explicit keys. Add a test for "legacy trailListFilter with created/+ and no explicit keys → created/-".

🤖 Generated with Claude Code

Found in the live acceptance test of `deploy-676a7c62` (2026-11-05), user `claude_test`. **Problem:** the new default sort from #50 (creation date, newest first) never reaches a browser that opened `/trails` before this deploy. Such browsers keep seeing the **oldest trails first**. **Why:** the previous build wrote the whole filter to `localStorage.trailListFilter` on every visit, which included `sort: "created", sortOrder: "+"` (the old default). On load, `restoreStoredFilter()` → `sanitizeTrailFilter()` accepts that stored `"+"` as if the user had picked it. `trail_list.svelte` only overrides it when the separate `sort` / `sort_order` keys 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):** 1. Log in. In the browser, set `localStorage.trailListFilter` to the filter the old build stored, i.e. the current one with `"sort":"created","sortOrder":"+"`. Make sure no `sort` / `sort_order` keys exist. This is the state of every browser that visited `/trails` before the deploy. 2. Open `/trails` in a new tab. 3. **Expected:** "Creation date" with the down arrow (newest first). **Actual:** "Creation date" ascending, oldest first. 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` / `sortOrder` win when the explicit `sort` / `sort_order` keys exist. Alternatively, run a one-off migration that drops `sort` / `sortOrder` from a stored `trailListFilter` that has no explicit keys. Add a test for "legacy trailListFilter with created/+ and no explicit keys → created/-". 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member

Fixed in batch PR #72 (deploy 5577c715), live since 2026-11-05 ~22:10 CET in wanderer-web:deploy-5577c715 (homelab-flux #857). Verified with the live e2e suite and acceptance re-runs as claude_test.

🤖 Generated with Claude Code

Fixed in batch PR #72 (`deploy` 5577c715), live since 2026-11-05 ~22:10 CET in `wanderer-web:deploy-5577c715` (homelab-flux #857). Verified with the live e2e suite and acceptance re-runs as `claude_test`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/wanderer#67
No description provided.