Skip to content

feat(Table): add configurable column widths - #2682

Merged
Lisa18289 merged 8 commits into
mainfrom
claude/table-column-width-741d0d
Jul 23, 2026
Merged

feat(Table): add configurable column widths#2682
Lisa18289 merged 8 commits into
mainfrom
claude/table-column-width-741d0d

Conversation

@Lisa18289

@Lisa18289 Lisa18289 commented Jul 22, 2026

Copy link
Copy Markdown
Member

What & why

Users want to give Table columns a fixed width. This was not possible with the previous React Aria wiring: RAC's <Column width> only takes effect inside a ResizableTableContainer. But React Aria already renders a native <table>, so we now simply apply the width as CSS on the column — React Aria stays in place.

Changes

  • Table: new layout="auto" | "fixed" prop (default "auto") → controls table-layout.
  • TableColumn: new width and minWidth props (CSSProperties[...]), applied as inline CSS on the rendered column (not forwarded to RAC's resize-only width props).
  • Fully backwards compatible: only additive / widened prop types; the consumer API and structure are unchanged. The remote contract stays consistent (only layout added).
  • FixedColumnWidths story, docs example + overview section (neutral content), and a Table Column Widths visual test (fixed widths + minWidth) including darwin baselines.
  • Agent guides: documented the visual-test requirement for new behavior, and that docs examples must not use Star Wars / pop-culture content.

Intentionally omitted

maxWidth — browsers ignore max-width on table cells, so it has no effect and is not part of the API.

Screenshots

layout="fixed" with width={80} / width="40%" / no width; a long name wraps inside the 40% column. Second table: minWidth keeps a column with short content wide.

To do before merge

  • Generate the linux visual baselines via the update-screenshots label (darwin baselines are committed locally).

🤖 Generated with Claude Code

Lisa18289 and others added 2 commits July 22, 2026 08:14
Add a `layout` prop ("auto" | "fixed", default "auto") to Table and CSS-based
`width` / `minWidth` props to TableColumn. React Aria already renders a native
table, so widths are applied as plain CSS on the column instead of relying on
ResizableTableContainer. The consumer API and remote contract stay backwards
compatible.

Includes a story, a docs example + overview section, and a visual test
(with darwin baselines) covering fixed widths and minWidth.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… docs

Document two conventions in the agent guides: new or changed rendered behavior
must come with a visual test in remote-react-components (runs Local + Remote),
and docs example content must use neutral mittwald-domain data instead of
pop-culture / Star Wars references.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.09% 328 / 420
🔵 Statements 78.08% 335 / 429
🔵 Functions 81.72% 76 / 93
🔵 Branches 66.81% 151 / 226
File CoverageNo changed files found.
Generated in workflow #5723 for commit c9411c3 by the Vitest Coverage Report Action

@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
@Lisa18289 Lisa18289 linked an issue Jul 22, 2026 that may be closed by this pull request
@Lisa18289 Lisa18289 self-assigned this Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-2682.docs.review.flow-components.de
storybook pr-2682.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-2682
  • storybook: ghcr.io/mittwald/flow/storybook:pr-2682

github-actions Bot and others added 2 commits July 22, 2026 06:29
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
Add a `minWidth` prop to Table. When space is tight the table keeps this
width and the container scrolls horizontally instead of squeezing its
columns. The width is applied to an inner block wrapper inside the scroll
container, since `min-width` is honored reliably on a block element but not
on the `<table>` element itself.

Column `width`/`minWidth` are typed as `number | string` (instead of indexed
CSSProperties access) to avoid a csstype portability error in the inferred
type of List's `typedList`.

Includes a docs example update, an overview note, and a visual test with
darwin baselines. Linux baselines are produced in CI via the
update-screenshots label.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
Warn that the Remote visual-test environment resolves the built dist of the
remote packages, so changing @flr-generate props requires rebuilding the
remote chain before updating snapshots — otherwise the Remote render silently
uses a stale dist and produces a misleading baseline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
Widen the ID column to 110px and add minWidth=550 so the story demonstrates
horizontal scrolling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 22, 2026
github-actions Bot and others added 2 commits July 22, 2026 08:24
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289
Lisa18289 merged commit c0b9a45 into main Jul 23, 2026
5 checks passed
@Lisa18289
Lisa18289 deleted the claude/table-column-width-741d0d branch July 23, 2026 10:43
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.

Reduce spacing between left table headers and columns

2 participants