Skip to content

feat(web): make every table column sortable - #1869

Merged
joshunrau merged 4 commits into
mainfrom
feat/sortable-table-columns
Nov 9, 2026
Merged

joshunrau merged 4 commits into
mainfrom
feat/sortable-table-columns

Conversation

@thomasbeaudry

@thomasbeaudry thomasbeaudry commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Tables behaved differently: some sorted every column, some one column, some none. Every data column now sorts through the shared SortableHeader, matching /datahub/subjects.

  • Newly sortable: groups, permission sets, admin instruments (forms and series), instrument repos, subject records.
  • Users: its private header copy is replaced with the shared one.
  • Audit log, sync log: these are server-paginated and only sorted by date. Both endpoints now take sortBy, so a sort covers every page. A trailing id keeps tied rows from repeating or skipping between pages.
  • Subject assignments: moved from a plain Table to DataTable, so it now also paginates.
  • Instrument repos: "Last Synced" sorted as a formatted string and "Failed" had no value, so both now sort real values. Values from separately loaded queries are held in the row data, because Tanstack caches column values per row object.
  • Headers: long labels now cut off with a hover title rather than wrapping. To fit the English labels, the repo URL column shrinks from 210px to 165px; Spanish and French labels can still cut off.

Left unsortable: checkbox and row-action columns, the sync log's Messages column (a View button), and the wizard's Email input, where sorting could move a row during typing.

Verification

  • Unit: data-table.test.ts, SortableHeader.test.tsx, the page tests for each table, and audit.service.test.ts / instrument-repos.service.test.ts.
  • E2e: new table-sorting.spec.ts, including every sync log ordering against a real database, plus additions to admin-instrument-repos.spec.ts.
  • Lint: 34/34, last run before one final column-width change.
  • Unit run: 5447 passed, 1 failed (see below).
  • Full e2e (serial, both browsers): 364 passed, 6 failed, before the final fixes. Not repeated since. Targeted re-runs of the affected specs pass, except as listed below.

Known behaviour

  • Audit Action and Entity, and sync log Action, sort by stored code rather than translated label, so the order can look off in Spanish or French.
  • Sync log status sorts success, partial, failed.
  • The audit log download ignores the current sort.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

thomasbeaudry and others added 4 commits November 5, 2026 09:48
Both endpoints sorted only by date, so a table could not offer any other
column without sorting just the current page. Add a `sortBy` parameter,
with a trailing id so tied rows cannot repeat or skip across pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tables differed: some sorted every column, some one, some none. Use the
shared SortableHeader on every data column, ask the server to order the
audit and sync logs, and move subject assignments onto DataTable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… requires

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thomasbeaudry
thomasbeaudry marked this pull request as ready for review November 9, 2026 19:23
@joshunrau
joshunrau merged commit 130fac1 into main Nov 9, 2026
6 checks passed
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.

2 participants