Skip to content

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

Draft
thomasbeaudry wants to merge 2 commits into
mainfrom
feat/sortable-table-columns
Draft

thomasbeaudry wants to merge 2 commits into
mainfrom
feat/sortable-table-columns

Conversation

@thomasbeaudry

Copy link
Copy Markdown
Collaborator

Warning

Not ready to merge. Draft for review. Open items are listed under "Before merging".

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.

Before merging

  • Full e2e run: repeat it on this head; CI has not run yet.
  • WalkthroughProvider.test.tsx: fails on clean main too, and blocks pnpm test:coverage. It is the only file under 100%.
  • subject-detail.spec.ts:53: fails intermittently, also on clean main.
  • Flaky on one run: admin-instruments.spec.ts:23 and datahub.spec.ts:35 failed once in the full run and passed on re-run.
  • record-file-deletion.spec.ts: known local-only failure (needs S3); confirm on CI.
  • Performance: sorting the audit log by User or Group uses a relation sort with no supporting index, and has not been tried on a large log. Where rows with no user or group land is also unchecked.
  • Remaining plain Tables: decide whether the wizard's results table should sort. Permission editors, column mapping, timepoints and the demo banner are unchanged.

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 2 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>

This branch has not been deployed

No deployments
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