Skip to content

feat(ui): size table columns by their text and let wide tables use all the room - #466

Merged
vite-hub[bot] merged 5 commits into
mainfrom
feat/table-column-widths
Nov 18, 2026
Merged

vite-hub[bot] merged 5 commits into
mainfrom
feat/table-column-widths

Conversation

@onmax

@onmax onmax commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

A wide table with prose columns of different lengths wraps its longest column every few words. In a Drop report of open PRs, a 7-column table with Summary, Status, three link columns and Working now, Status got 213px at 1480px and its first row ran 13 lines. Summary got 193px, and Preview, Drop and Airtable together took 420px for one chip each. The table also stopped at 72em with about 90px unused on its left.

The browser sizes auto columns from each column's longest cell, so a column with twice the text gets about the same width. data-short sets nowrap, so a chip column never gives width back. One cell with two chips made Preview 183px wide.

This PR sets the widths while parsing, still with no script:

  • When two or more columns hold more than short values, the table is a grid. Short columns are min-content. The long ones share the rest in fr, by data-w<n> weights from 1 to 12, chosen to make the table as short as it can be. Each row counts as tall as its longest cell's characters over its column's width, and the tallest row counts twice.
  • A cell with two chips or more is data-short="chips". It may break between chips, never inside one, and never inside portal #1596.
  • A wide table grows up to its own width, now in steps up to 96em, and to the room the page gives it. Compares and diagrams keep their 72rem. A page's --comark-wide-max still wins.
  • A table stacks its prose below data-fold, the width where its narrowest prose column would drop under 9.5em, instead of below 85% of its own width.
  • A table with prose that fits the column gets a data-fit wrapper, so on a phone it becomes one card per row like a stacked table. data-width is still only on wide tables, since Drop reads it to place its outline.

I measured it in Drop's document frame, Drop main with the outline open, on a stand-in for the report with the same cell lengths and on seven regression tables:

main this PR
Report table at 1480px: height, first row 1603px, 13 lines 1220px, 9 lines
Report table at 1280px: height, first row 2120px, 19 lines 1429px (stacked), 5 lines
Report table at 1480px: width 1080px, 91px unused left 1171px, none unused
One prose column, phone description 118px wide, 32 lines one card per row, 7 lines
Option + description, phone description 130px wide, 11 lines one card per row, 3 lines

The other tables are the same height or shorter at every width, and no page scrolls sideways. Tables of numbers with no prose still scroll on a phone, as on GitHub. The narrow, all-short, numeric and even two-prose tables don't change. Chromium on Linux, with Liberation Sans for Drop's system font. On a Mac with SF Pro the report table goes from 1760px to 1310px at 1480px. Firefox and WebKit pick the same layouts, with column widths within about 4% of Chromium's.

e2e/table-layout.ts now runs in Chromium, Firefox and WebKit. The new tests for growing past 72rem, widths following text, chip wrapping and the one-prose phone card fail on main. I haven't tried it in Safari on a device.

Before/after: on Drop

Related: #451. Drop follows with a PR that bumps comark-ui to this build.

…l the room

Long columns share the room by weights chosen at parse time to make the
table as short as it can be; short and chip columns take min-content, and
a cell of two chips may break between them. A wide table grows past the
wide blocks' 72rem default up to its own width, and stacks only where its
narrowest prose column would fall under 9.5em. A table with prose that
fits the column gets a data-fit wrapper so it becomes one column per row
on a phone. data-width stays on wide tables only, as Drop reads it.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-18T13:42:04.421156Z
We couldn’t complete this review. Comment @codex review to try again.
12bb0ba PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@466

comark-badge

pnpm add https://pkg.pr.new/comark-badge@466

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@466

comark-cards

pnpm add https://pkg.pr.new/comark-cards@466

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@466

comark-cast

pnpm add https://pkg.pr.new/comark-cast@466

comark-charts

pnpm add https://pkg.pr.new/comark-charts@466

comark-chat

pnpm add https://pkg.pr.new/comark-chat@466

comark-chips

pnpm add https://pkg.pr.new/comark-chips@466

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@466

comark-code

pnpm add https://pkg.pr.new/comark-code@466

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@466

comark-colors

pnpm add https://pkg.pr.new/comark-colors@466

comark-comments

pnpm add https://pkg.pr.new/comark-comments@466

comark-critic

pnpm add https://pkg.pr.new/comark-critic@466

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@466

comark-details

pnpm add https://pkg.pr.new/comark-details@466

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@466

comark-diff

pnpm add https://pkg.pr.new/comark-diff@466

comark-embed

pnpm add https://pkg.pr.new/comark-embed@466

comark-fields

pnpm add https://pkg.pr.new/comark-fields@466

comark-figure

pnpm add https://pkg.pr.new/comark-figure@466

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@466

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@466

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@466

comark-github

pnpm add https://pkg.pr.new/comark-github@466

comark-icon

pnpm add https://pkg.pr.new/comark-icon@466

comark-include

pnpm add https://pkg.pr.new/comark-include@466

comark-keys

pnpm add https://pkg.pr.new/comark-keys@466

comark-links

pnpm add https://pkg.pr.new/comark-links@466

comark-linter

pnpm add https://pkg.pr.new/comark-linter@466

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@466

comark-mark

pnpm add https://pkg.pr.new/comark-mark@466

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@466

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@466

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@466

comark-media

pnpm add https://pkg.pr.new/comark-media@466

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@466

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@466

comark-outline

pnpm add https://pkg.pr.new/comark-outline@466

comark-properties

pnpm add https://pkg.pr.new/comark-properties@466

comark-qr

pnpm add https://pkg.pr.new/comark-qr@466

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@466

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@466

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@466

comark-sources

pnpm add https://pkg.pr.new/comark-sources@466

comark-steps

pnpm add https://pkg.pr.new/comark-steps@466

comark-table

pnpm add https://pkg.pr.new/comark-table@466

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@466

comark-tests

pnpm add https://pkg.pr.new/comark-tests@466

comark-time

pnpm add https://pkg.pr.new/comark-time@466

comark-ui

pnpm add https://pkg.pr.new/comark-ui@466

comark-xref

pnpm add https://pkg.pr.new/comark-xref@466

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@466

commit: 6e3af44

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Folded tables can paint numeric values over prose, and the phone layout can hide the headers of tables with no prose. Both are reproducible with ordinary Markdown tables.

Approach: Parse-time column weights and CSS container queries are a good fit for a script-free layout, but the grid needs to preserve readable columns and table semantics, and estimating weights should not dominate parse time.

Reviewed changes Reviewed the table parser, typeset CSS, preset contract, documentation, and regression tests.

  • Column sizing: Checked how the parser measures short cells and chips, weights long columns, and chooses when to stack.
  • Responsive layout: Checked block width overrides, folded and phone layouts, and table accessibility.
  • Verification: The workspace build passed, 438 UI tests passed with one skipped, and all 20 Chromium and Firefox table tests passed. WebKit could not launch because the runner lacks libgtk-4.so.1 and other host libraries. Additional fixtures reproduced the findings inline.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/ui/src/typeset-css.ts Resolved
Comment thread packages/ui/src/typeset-css.ts Resolved
Comment thread packages/ui/src/table-layout.ts Resolved
Comment thread packages/ui/src/table-layout.ts Resolved
Comment thread packages/ui/src/table-layout.ts Resolved
@vite-hub

vite-hub Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-18T20:52:21.266Z 1m 53s
View session Completed 2026-11-18T20:33:35.830Z 8m 39s
View session Completed 2026-11-18T18:31:01.231Z 6m 23s
View session Cancelled 2026-11-18T14:00:06.123Z 22m 17s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Merged 6e3af44 directly: required checks passed and review threads were resolved.

View session

PR #466 is ready to merge. All hosted checks passed, including Chromium, Firefox, and WebKit. The 17 focused table-layout tests passed locally, and lint passed with warnings. All review threads are resolved. The PR description and contributor notes still describe the superseded width algorithm (P2 documentation); no further code push was needed.

View session

Pushed `6e3af44` to fix the folded-table test and resolved the review thread. Playwright’s serializer reproduced the missing cell bounds before the patch and preserved them afterward. Lint passed with warnings, and formatting passed. The sandbox blocked the local test server, and the previous hosted run was canceled during WebKit dependency installation, so cross-browser verification awaits CI on the new commit.

Session

Pushed `231ab276` to fix the column mix-up that failed the folded-table test in all three browsers, and resolved the review thread. The corrected test checks that Summary and Status stack without overlapping the first numeric column. Lint, formatting, and a focused render check passed. The local sandbox blocked Playwright’s web server and browser downloads, so cross-browser verification is pending in hosted CI.

View session

Pushed `231ab276` to fix the column mix-up that failed the folded-table test in all three browsers, and resolved the review thread. The corrected test checks that Summary and Status stack without overlapping the first numeric column. Lint, formatting, and a focused render check passed. The local sandbox blocked Playwright’s web server and browser downloads, so cross-browser verification is pending in hosted CI.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Fix the new folded-table assertion before merging: it fails in Chromium and Firefox even though the prose cells stack correctly.

Approach: The simpler per-column estimate removes the repeated row scans, and data-prose keeps phone layout separate from accessibility roles.

Reviewed changes Re-reviewed 8f4bd15 against 12bb0ba.

  • Replaced the iterative width search with proportional weights and used those weights to calculate the fold threshold.
  • Reserved room for folded prose, gated phone cards on data-prose, and kept captioned HTML tables native.
  • Verified the workspace build and 440 passing UI tests (one skipped). Chromium and Firefox passed 22 of 24 table cases; both failures are the assertion noted inline. WebKit could not launch locally because libgtk-4.so.1 and other host libraries are missing.

No new P0 or P1 product defects remain.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread e2e/table-layout.ts Resolved
onmax added a commit to vite-hub/drop that referenced this pull request Nov 18, 2026
Pins comark-ui and the six comark packages Drop imports directly to
onmax/comark-ui#466's build. A wide table now sizes its columns by their
text, grows past the wide blocks' 72rem to its own width (up to 96em),
and stacks its prose under the short columns where the room runs out.

The cache revision goes to drop.27, since preview builds share
comark-ui's version. The wide-table browser test now reads stacking from
where a row's cells sit, because comark-ui lays a table with prose out
as a grid even side by side, and checks the table at 1480px.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The updated regression still fails in Chromium and Firefox before it reaches the layout assertions.

Reviewed changes Reviewed the test-only delta from b90adb9 to 231ab27.

  • Corrected the fixture’s column order and added checks for vertical stacking, minimum prose width, and separation from the first numeric column.
  • Verified the failure in both Chromium and Firefox: 22 of 24 table-layout tests passed. All six assertions in the failing fixture passed in both browsers when the measurement helper returned plain coordinate objects. WebKit could not launch locally because host libraries were missing, including libgtk-4.so.1.

No P0 or P1 findings remain.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread e2e/table-layout.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes Re-reviewed the test-only delta from 231ab27 to 6e3af44.

  • Serialized table bounds as plain objects. Playwright now preserves the coordinates in both the named fields and rowCells, so the folded-table regression reaches its layout assertions.
  • Verified the fix in Chromium and Firefox. All 24 table-layout tests passed. WebKit could not launch on this runner because it lacks libgtk-4.so.1 and other system libraries.

No P0 or P1 findings remain.

Pullfrog  | View workflow run | Using gpt-6.2-sol(high) | 𝕏

@vite-hub
vite-hub Bot merged commit 3f4b7f0 into main Nov 18, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/table-column-widths branch November 18, 2026 20:57
This was referenced Nov 18, 2026
vite-hub Bot added a commit to vite-hub/drop that referenced this pull request Nov 18, 2026
…66) (#238)

* feat(docs): wide tables size their columns by their text (comark-ui#466)

Pins comark-ui and the six comark packages Drop imports directly to
onmax/comark-ui#466's build. A wide table now sizes its columns by their
text, grows past the wide blocks' 72rem to its own width (up to 96em),
and stacks its prose under the short columns where the room runs out.

The cache revision goes to drop.27, since preview builds share
comark-ui's version. The wide-table browser test now reads stacking from
where a row's cells sit, because comark-ui lays a table with prose out
as a grid even side by side, and checks the table at 1480px.

* fix(docs): keep section links visible when wide tables displace the outline

* fix(docs): preserve stacked chart zoom and wrap outline links

* fix(docs): keep responsive wide tables readable

* fix(docs): keep folded table prose tracks readable

---------

Co-authored-by: vite-hub[bot] <320448255+vite-hub[bot]@users.noreply.github.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