Repository navigation
fix(web): return a list to the page and sort it was left on - #1924
Merged
Merged
Conversation
thomasbeaudry
force-pushed
the
fix/return-to-list-page
branch
from
November 18, 2026 17:33
dbe24c0 to
96a111a
Compare
The Return link on a row's page, such as /admin/users/$userId, always reopened its list on page one, because libui's DataTable forgets its pagination when it unmounts. Every table now goes through @/components/DataTable, which remembers each table's page and sort by name for the session, keeps the page across refetches, and returns to page one only when the search, a filter or the sort changes. An eslint rule rejects importing libui's DataTable anywhere else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e list shows them The subjects list shows nine characters of an id, and every id from createSubject starts subject_, so two pages could read alike and the spec could not tell it had changed page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thomasbeaudry
force-pushed
the
fix/return-to-list-page
branch
from
November 18, 2026 18:33
96a111a to
0b77c47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following a Return link from a row's page now reopens the list on the page and sort the user left, instead of page one. Before, opening a user from page 2 of
/admin/usersand clicking Return landed back on page 1. The same was true of/admin/permission-sets/$id,/datahub/subjects/$idand/datahub/instruments/$id.Changes
DataTableanywhere inapps/weboutside@/components/DataTableis now a lint error, so a new table cannot bring the bug back.Decisions
initialStatetakes nopagination, so the wrapper reaches the Tanstack table through a column header renderer, the one place every table renders, including underdisableSearch. It then setsautoResetPageIndex: falseand resets on filter and sort changes itself. Adding the missing API to libui would be cleaner, but it takes a cross-repo PR and a release first.pageResetKeyprop. The wrapper cannot otherwise tell such a change ofdatafrom a refetch of the same rows.Map(src/services/table-views.ts) rather than the Zustand store. Many unit tests mock@/storewith partial state, and this state has no other reader.Risks
list-return.spec.ts) rather than corrupt anything.Notes
list-return.spec.tsfails all three of its cases againstmainand passes on this branch. The permission-sets page object now searches for a set before acting on it, because the list is shared across specs and can run past one page.Adversarial review
Reviewed at commit dbe24c0. pnpm check: green.
Follow-up 0b77c47: rebased onto main (after #1923 and #1917, resolving one import conflict in
admin/users/index.tsx), and the list-return subjects case now seeds ids that differ within the nine characters the list shows, which CI exposed; no new code outside that spec.Findings
autoResetPageIndex: falsekeeps the page whendatachanges because of a filter applied outside the table or a group switch, leaving the user mid-way through a different row set — reset to page one when the caller's selection changestableNameof the first render, so a table renamed in place (subjects list on a group switch) saves and restores under the wrong key — remount the client table keyed bytableNametableNamefor a table whose rows depend ongroupId(andSourceStep's likewise) carries a page across groups — key them by groupFixed
pageResetKeyprop, passed by the subjects list (minimum records), subject records (instrument and date) and instrument-hub records (URL filters); group switches are covered by 2.ClientDataTableis keyed bytableName, and group-scoped tables carry the group in their name.datais empty.!List Return <id> NN, which the name-ordered list puts first.Attestation
I, Claude Opus 5.5, attest that the review block above reports the adversarial review as it ran on the commit named, with every finding it returned.
🤖 Generated with Claude Code