Skip to content

Sort from the filter panel, and say which way - #286

Merged
yorickdewid merged 1 commit into
mainfrom
feat/explorer-sort-panel
Jul 27, 2026
Merged

Sort from the filter panel, and say which way#286
yorickdewid merged 1 commit into
mainfrom
feat/explorer-sort-panel

Conversation

@yorickdewid

Copy link
Copy Markdown
Contributor

Sorting joins the filter popover on Rapportages. Requested because the panel is where people already go to shape the list.

What

  • SORTEREN OP section in FilterBuilder, below a hairline rule — a different verb from filtering, and single-choice, because GET /inquiry sorts one column. Click a column to sort it descending, click it again to switch it off.
  • Direction labels come from the column: nieuwste eerst / oudste eerst on a date, A → Z / Z → A on a name, rather than a shared "oplopend / aflopend" that you have to translate before you can use it. The direction row only appears once a column is picked.
  • The sort gets a chip next to the filter chips (sortering: datum · nieuwste eerst ×). A sort that lives only inside a dropdown is a sort people forget they set — and it matters more here than for the filters, because Opsteller has no column in the table to carry an arrow.
  • Saved views remember sort + order, so "te controleren, oudste eerst" is one saved question instead of a filter plus a setting you reapply by hand.
  • Column headers now start at desc (desc → asc → default) to match the panel. Two controls writing one piece of state should not disagree about which way the first click points.
  • Opener relabelled Filteren & sorteren, otherwise nobody finds it.

Two things the UI says out loud

Per the honesty rules in CLAUDE.md:

  • With no sort chosen, the API keeps its own ordering — coalesce(update_date, create_date) DESC. Not called "nieuwste eerst", because update_date was bulk-stamped onto 79% of inquiries and is fiction for four rows in five.
  • Sorting on Type or Status follows the PostgreSQL enum's declaration order. That groups the rows, but the order between groups means nothing: in report.audit_status, rejected precedes pending_review. The caveat renders only when one of those two is the active sort.

Verification

No test runner here, so: vue-tsc --build + eslint clean, pnpm build green, plus two throwaway harnesses (deleted before commit, per the SSR recipe in CLAUDE.md):

  • Logic — all 7 columns round-trip query → URL → query → list opts; chip text and clearing; ?sort=drop%20table falls back to the default instead of reaching the API; a saved view keeps its sort.
  • SSR render — popover renders the section, the direction row appears only with a column chosen, the enum caveat only for type/status.

Not in scope

Herstel still has no sort: GET /recovery takes q/limit/offset and nothing else, which is why that view has no panel at all. The fix is ~10 lines in FunderMapsApi/src/routes/recovery.ts mirroring the inquiry endpoint's LIST_SORT_COLUMNS — happy to open that separately.

🤖 Generated with Claude Code

The table headers could already sort, but only on the six columns that
happen to be on screen and only by cycling asc -> desc -> off. "Op
opsteller, Z naar A" was three clicks and an invisible column.

Sorting now sits in the filter popover under a rule of its own:
single-choice, because the API sorts one column. Each column carries its
own words for the two directions -- "nieuwste eerst" rather than
"aflopend", since translating a control is how you end up clicking it
twice to find out what it does.

The active sort becomes a chip beside the filter chips. Same reason the
filters have one: a sort that lives only inside a dropdown is a sort
people forget they set. It matters more here, because Opsteller has no
column in the table to hang an arrow on.

Two things said out loud rather than dressed up: with no sort chosen the
API keeps its own order (coalesce(update_date, create_date) DESC), and
Type/Status sort on the PostgreSQL enum's declaration order -- which
groups the rows but does not rank them (in report.audit_status,
'rejected' precedes 'pending_review').

Saved views now carry sort + order, so "te controleren, oudste eerst" is
one saved question instead of a filter plus a setting to reapply. And
the column headers start at desc like the panel does; two controls
writing one piece of state should not disagree about which way the first
click points.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@yorickdewid
yorickdewid merged commit ae9f687 into main Jul 27, 2026
1 check passed
@yorickdewid
yorickdewid deleted the feat/explorer-sort-panel branch July 27, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant