Skip to content

feat: add horizontal scrolling to DataView tables - #2603

Draft
aaronlee777 wants to merge 2 commits into
mainfrom
feat/datatable-horizontal-scroll
Draft

feat: add horizontal scrolling to DataView tables#2603
aaronlee777 wants to merge 2 commits into
mainfrom
feat/datatable-horizontal-scroll

Conversation

@aaronlee777

Copy link
Copy Markdown
Contributor

Context

Data tables had no overflow handling. The table rendered at width: 100% with table-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)

  • Cells hug their content via 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.
  • Moved the bordered frame (border, radius, shadow, background) from the <table> onto the fixed scroll container, so the box stays put while the content scrolls inside it (previously the right border scrolled away).
  • Bumped cell horizontal padding for more breathing room.
  • Added a HorizontalScroll Storybook story.

Per-column wrap escape hatch

  • New optional wrap?: boolean on DataViewColumn and TableData. A wrap column drops out of the nowrap default and wraps within a bounded (~320px) width instead of forcing a wide scroll — for columns holding long free-form text.
  • Applied to the at-risk columns: payroll blocker title/description, contractor & employee document titles/descriptions, common DocumentList, employee garnishment/deduction descriptions, payroll reimbursement memo, and recovery-case error messages.

Payroll list

  • Lowered breakAt from large (64rem) to small (40rem) so the table renders and scrolls from tablet up rather than collapsing to the card layout at 1024px. Renamed the coupled isDesktop flag to isTableLayout to 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.
  • Affected component test suites pass (Table, DataView, DocumentList, PayrollBlocker, Deductions, Documents, PayrollList).
  • Verified in the SDK dev app at 1024px: payroll table scrolls horizontally with the frame fixed; date columns no longer wrap.

Notes / open questions

  • The wrap cap is a single shared 320px; could be promoted to a per-column maxWidth if any column needs a different width.
  • Medium-risk columns (addresses, job titles, tax descriptions, business names) were left on the nowrap default — easy one-line wrap: true follow-ups if desired.

🤖 Generated with Claude Code

aaronlee777 and others added 2 commits August 20, 2026 11:57
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>
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