Persist page filters in the URL query params #36

Open
opened 2026-07-19 23:45:52 +02:00 by Sirttas · 0 comments
Owner

Summary

List/table filters are currently held in local component refs, so they reset on reload and
navigation and can't be bookmarked or shared. Move the user-facing filters on applicable pages
into the route's query params so filter state is reflected in the URL and survives reloads.

Scope

  • Drive each applicable page's filters from route.query (read on load, write on change) instead
    of standalone refs. Candidate pages/components:
    • Market → Scan (ScanResultTable + Scan.vue): text filter, onlyCheap, threshold,
      trackedTrends (TrendFilter), days.
    • Market → Acquisitions / Ledger → Acquisitions (AcquisitionResultTable): text
      filter, unlistedOnly, threshold.
  • Keep controls two-way bound to the query (a change updates the URL; opening a URL with query
    params pre-populates the controls).
  • Omit defaults from the URL (don't serialise a filter that's at its default value) to keep URLs clean.
  • Use router.replace (not push) for filter edits so typing in a filter doesn't spam browser
    history — final call during refinement.

Explicitly out of scope

  • Persisting non-filter view state (sort order, column toggles) unless trivially covered.
  • Server-side/query-param API changes in mammon — this is purely frontend URL state.

Acceptance criteria

  • On each applicable page, changing a filter updates the URL query params.
  • Loading a URL with filter query params restores those filters in the UI.
  • Reloading the page preserves the active filters; default values stay out of the URL.
  • Editing filters does not flood browser history.

Related

Depends on the final page/filter list agreed during refinement.

## Summary List/table filters are currently held in local component `ref`s, so they reset on reload and navigation and can't be bookmarked or shared. Move the user-facing filters on applicable pages into the route's query params so filter state is reflected in the URL and survives reloads. ## Scope - Drive each applicable page's filters from `route.query` (read on load, write on change) instead of standalone `ref`s. Candidate pages/components: - **Market → Scan** (`ScanResultTable` + `Scan.vue`): text `filter`, `onlyCheap`, `threshold`, `trackedTrends` (TrendFilter), `days`. - **Market → Acquisitions** / **Ledger → Acquisitions** (`AcquisitionResultTable`): text `filter`, `unlistedOnly`, `threshold`. - Keep controls two-way bound to the query (a change updates the URL; opening a URL with query params pre-populates the controls). - Omit defaults from the URL (don't serialise a filter that's at its default value) to keep URLs clean. - Use `router.replace` (not `push`) for filter edits so typing in a filter doesn't spam browser history — final call during refinement. ## Explicitly out of scope - Persisting non-filter view state (sort order, column toggles) unless trivially covered. - Server-side/query-param API changes in mammon — this is purely frontend URL state. ## Acceptance criteria - [ ] On each applicable page, changing a filter updates the URL query params. - [ ] Loading a URL with filter query params restores those filters in the UI. - [ ] Reloading the page preserves the active filters; default values stay out of the URL. - [ ] Editing filters does not flood browser history. ## Related Depends on the final page/filter list agreed during refinement.
Sirttas added the Kind/Enhancement
Priority
Medium
3
Status
To Refine
labels 2026-07-19 23:45:52 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eveal/gemory#36