Skip to content

fix(Table): web grid cells take their column's width and the body is not clipped - #37

Merged
thinkclay merged 1 commit into
mainfrom
fix/web-grid-widths
Sep 17, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/web-grid-widths

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Fixes Scaffald/SaaS#799. None of it is a #794 regression: with the pre-#794 Table/ restored, the same page measured worse (body 84 px, header 255 px below the search box).

Three faults

  1. Undeclared columns had no width. Header cells sized to title + sort glyph, data cells to their text, the row wrapper to 150 px per column. New columnSizing() gives an undeclared column flex: 1 with a 150 px minimum, applied identically to header and cells; rows are laid out at the measured body width so the slack is shared.
  2. Non-pressable cells lost their whole container style. TableCell passed a function style to a plain View (it is only valid on Pressable), so every cell without onPress had no height, padding, border, direction, or width. The function form is now used only when the container is a Pressable.
  3. flex: 1 container and body inside a content-sized Card. Yoga resolved it to zero on native (#768); Chrome resolved it to 116 px and clipped the grid to a row and a half. Both are content-sized now, and grid rows are a plain map like the stacked rows (a FlatList needs a bounded height to be worth having). A consumer that wants a bounded, internally scrolling table passes style={{ flex: 1 }}; none does today.

Measured

before after
/office/storage header "Total Usage" 124 px at x 405 194 px at x 515
data cell "65.0 MB" 54 px at x 382 194 px at x 515
body scroller 116 px holding 232 px none, 4 rows rendered
/office/cms/workers columns uneven four at 204 px

Native is unaffected: the stacked branch does not use TableCell or styles.body, and stackedContainer is unchanged.

Tests: Table.grid.test.ts pins the sizing rule and the content-sized containers. Full ui suite 709/709, tsc clean, pnpm build clean.

🤖 Generated with Claude Code

…not clipped

Three faults, all older than #794 (the same table measured worse with the
pre-#794 Table restored: body 84px, header 255px below the search box):

1. A column with no declared width got no width at all. The header sized
   to its title and sort glyph, each data cell to its own text, and the
   row wrapper to 150px per column — a 124px "Total Usage" heading over a
   54px "65.0 MB" cell, every row's values running together. `columnSizing`
   now gives an undeclared column `flex: 1` with a 150px minimum, applied
   identically to header and cells, and the rows are laid out at the
   measured body width so the slack is shared instead of left empty.

2. Cells without `onPress` were handed a function style, which a plain
   View ignores. Every non-pressable text cell — most of them — rendered
   with no height, padding, border, direction or width. The function form
   is used only when the container is a Pressable.

3. The container and body were `flex: 1` inside a content-sized Card.
   Yoga resolved that to zero on native (#768); Chrome resolved it to
   116px and clipped the grid to a header and a row and a half. Both are
   content-sized now, and the grid's rows are a plain map like the stacked
   rows, since a FlatList needs a bounded height to earn its keep. A
   consumer that wants a bounded, internally scrolling table passes
   `style={{ flex: 1 }}` itself; none does today.

Measured on /office/storage at 1700px: header and cell both 194px wide at
the same x, four rows rendered, no inner scroller; /office/cms/workers
shows four even 204px columns.

Scaffald/SaaS#799

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@thinkclay
thinkclay merged commit 6574499 into main Sep 17, 2026
@thinkclay
thinkclay deleted the fix/web-grid-widths branch September 17, 2026 11:57
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 17, 2026
…th, body not clipped (#804)

* fix(ui): bump @scaffald/ui — web grid cells take their column's width, body not clipped (#799)

Pulls Scaffald/ui#37. The Office storage table on desktop web rendered
data cells at their text width under headers of another width and clipped
its body to 116px; the same held for every Table without declared column
widths. Measured after: header and cell both 194px at the same x on
/office/storage, four rows rendered, no inner scroller; /office/cms/workers
shows four even 204px columns.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(office): the storage page title row fits a phone — Refresh no longer pushed off the right edge

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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.

Web: the Office storage table renders cells without column widths and clips the body to ~116 px on desktop

1 participant