Tables: a search that matches nothing forgets the sort, and live narrowing on Companies drops the grouping #647
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#647
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 on 2026-10-01 while reviewing #313 at
0e789674a. Both are older than #313 and belong with #622 and #623: state that lives outside what a live filter swaps, or outside the form it sends.1. A search that matches nothing forgets the sort
The hidden
sortfield is in the table's header (cotton/table/head.html:154), and the header is drawn only when there are rows. So are the header's filter boxes. When a narrowing leaves no rows, the next request has nosort.Seen: at
?sort=-name, typing "zzzz" and then "aperture" left an address with nosort, and the table in its default order.Fix: carry
sort(and the header's filter values) somewhere that is drawn with or without rows, such as the filter form itself.2.
?group=is dropped by any live narrowing on Companies#company-filtershas nogroupfield, so a live filter, sort or search sends the request without it and the grouped view is lost. With scripts off, the masthead search of #313 does keep it (Table.search_keeps), so the two modes disagree.Fix: a hidden
groupin the filter form, asviewandstateare carried on the other two pages.Done when
Each case has a test, with scripts on and off: the sort survives an empty result and comes back with the rows, and
groupsurvives a live narrowing.