Migrate the shared table to TanStack Table - #35
Merged
Merged
Conversation
Rewrite the shared DataTable on @tanstack/react-table v8 with a columns/data API, keeping PaginatedTable as the card and pagination wrapper. Column meta carries minWidthPx and sticky hints, the scroll area is an opt-in scrollAreaClassName forwarded to the table container, and clickable rows guard against interactive descendants. Drop the striped rows and the colgroup width handling, and convert the drug, medication history, and dashboard tables to column defs.
Apply the same interactive-descendant guard to Enter and Space that row clicks already use, so activating an in-cell link with the keyboard no longer also triggers the row navigation.
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.
Summary
DataTableon @tanstack/react-table v8 with acolumns/dataAPI (useReactTable+flexRender,manualPagination)PaginatedTableas the card + pagination wrapper; its external pagination props are unchanged, so page components need no changesminWidthPx/stickyhints (module augmentation intypes/reactTable.d.ts); internal scroll is an opt-inscrollAreaClassNameforwarded to the table container (Tablegains an additivecontainerClassNameprop)role="button"with keyboard support and guard against interactive descendants (links, buttons, inputs)colgroupwidth handling; uniform rows with hover highlightColumnDef; cell rendering (note icon, link cells, hyphen fallbacks) is preservedBehavior notes
DashboardPageconsumed the old table API directly, so its recent-history table moved to the new API (max-h-[500px]scroll preserved viascrollAreaClassName)Verification
react-hooks/incompatible-libraryonuseReactTable, non-failing)DataTablestories (Default / Empty / Loading / ClickableWithLink) plus existing table and page stories verified with Playwright screenshots in light and dark