feat: add horizontal scrolling to DataView tables - #2603
Draft
aaronlee777 wants to merge 2 commits into
Draft
Conversation
Data tables had no overflow handling: the table rendered at width 100% with table-layout auto, so dense/multi-column tables crushed columns and wrapped text. Add horizontal scrolling so columns hug their content and the table scrolls sideways instead. - Move the bordered frame (border, radius, shadow, background) onto the fixed scroll container so it stays put while the table scrolls inside it. - Cells hug their content via white-space: nowrap; the container scrolls when the columns exceed its width. - Add a per-column `wrap` opt-in (DataViewColumn / TableData) so columns with long free-form text wrap within a bounded width instead of forcing a wide scroll. Applied to blocker, document, deduction, reimbursement, and recovery error columns. - Lower the payroll list breakpoint from `large` to `small` so the table shows and scrolls from tablet up rather than collapsing to cards at 1024px. - Bump cell horizontal padding for more breathing room; add a Table story demonstrating overflow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Context
Data tables had no overflow handling. The table rendered at
width: 100%withtable-layout: auto, so dense/multi-column tables crushed columns together and wrapped text mid-value (e.g. "Fri, Aug 28, 2026" breaking onto two lines). This adds horizontal scrolling: columns hug their content and the table scrolls sideways when it's wider than its container.Changes
Table primitive (
Common/UI/Table)white-space: nowrap; the wrapper (.root) is now a keyboard-focusable, labeled scroll region (overflow-x: auto,role="region",tabIndex=0) so the table scrolls horizontally instead of crushing.<table>onto the fixed scroll container, so the box stays put while the content scrolls inside it (previously the right border scrolled away).HorizontalScrollStorybook story.Per-column
wrapescape hatchwrap?: booleanonDataViewColumnandTableData. A wrap column drops out of thenowrapdefault and wraps within a bounded (~320px) width instead of forcing a wide scroll — for columns holding long free-form text.Payroll list
breakAtfromlarge(64rem) tosmall(40rem) so the table renders and scrolls from tablet up rather than collapsing to the card layout at 1024px. Renamed the coupledisDesktopflag toisTableLayoutto match; the Run/Submit button stays in the row actions when the table shows and drops to the stacked button only in the card layout.Testing
npx tsc --noEmit, ESLint, and Prettier clean.Notes / open questions
320px; could be promoted to a per-columnmaxWidthif any column needs a different width.nowrapdefault — easy one-linewrap: truefollow-ups if desired.🤖 Generated with Claude Code