Skip to content

feat(ui): lay out Markdown tables from their cells - #451

Merged
vite-hub[bot] merged 4 commits into
mainfrom
feat/wide-tables
Nov 17, 2026
Merged

vite-hub[bot] merged 4 commits into
mainfrom
feat/wide-tables

Conversation

@onmax

@onmax onmax commented Nov 17, 2026

Copy link
Copy Markdown
Owner

A Markdown table with short ids and links next to two prose columns breaks its ids letter by letter: portal #1596 renders as port, al, #15, 96, and a preview chip as previe, w. It showed up in a Drop report of open PRs.

The chips allow it. .cp sets overflow-wrap: anywhere, and the typeset's img { max-width: 100% } lets a chip's icon count for nothing in the cell's minimum width. So the table squeezes the short columns to give the prose more room.

This adds a tableLayout plugin, on by default and separate from typeset so Drop, which turns typeset off, still gets it. It reads each top-level Markdown table's cells while parsing and writes data attributes that the typeset styles, with no script:

  • A column whose longest cell is 24 characters or fewer stays on one line, and its chips keep their labels whole.
  • A table wider than a readable column goes in a data-wide div and grows into the room beside the text like a compare does, up to its estimated width.
  • A table with two or more prose columns stacks the later ones under the first, in muted text, once it gets less than 85% of that width. Below 32em each row becomes one column. Stacked tables carry ARIA roles, since display: grid can drop table semantics.

There's nothing to opt into. tableLayout: false turns it off.

e2e/table-layout.e2e.ts checks the three layouts in Chromium. Its three tests fail on main, as do three of the five unit tests. I haven't tried it in Safari or Firefox.

Related: the Drop side, which lets wide blocks use the room left of the text, comes in a follow-up PR on vite-hub/drop.

🤖 Generated with Claude Code

A table with ids, links, and two prose columns squeezed its short columns
until `portal #1596` broke into `#159` and `6`, chips included, since a
chip may break anywhere and its icon added nothing to the cell's minimum
width.

The new tableLayout plugin, on by default, reads each top-level table
while parsing. Short columns stay on one line. A table wider than a
readable column goes in a data-wide div and grows into the room beside
the text. A table with two or more prose columns stacks the later ones
under the first when it gets under 85% of its width, and becomes one
column per row on a phone. It's data attributes and container queries
in the typeset, with no script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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-17T10:48:45.120794Z
We couldn’t complete this review. Comment @codex review to try again.
a484fed 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.

@onmax

onmax commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Before/after on Drop

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

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

comark-badge

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

comark-bundle

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

comark-cards

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

comark-carousel

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

comark-cast

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

comark-charts

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

comark-chat

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

comark-chips

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

comark-cjk

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

comark-code

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

comark-code-notes

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

comark-colors

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

comark-comments

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

comark-critic

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

comark-deflist

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

comark-details

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

comark-diagrams

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

comark-diff

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

comark-embed

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

comark-fields

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

comark-figure

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

comark-file-tree

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

comark-footnotes

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

comark-git-graph

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

comark-github

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

comark-icon

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

comark-include

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

comark-keys

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

comark-links

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

comark-linter

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

comark-magic-move

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

comark-mark

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

markdown-it-to-comark

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

marked-to-comark

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

comark-mathml

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

comark-media

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

comark-metrics

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

migrate-to-comark

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

comark-outline

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

comark-properties

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

comark-qr

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

comark-quiz

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

comark-reading-time

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

remark-to-comark

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

comark-sources

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

comark-steps

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

comark-table

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

comark-tabs

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

comark-tests

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

comark-time

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

comark-ui

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

comark-xref

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

comark-zoom

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

commit: af08c87

@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

Table layout stops working when the document contains comments, and short numeric columns can now force unnecessary horizontal scrolling. These should be addressed before merging; a separate span-table edge case is noted inline.

Reviewed changes Reviewed the content-aware table parser, its preset integration, responsive CSS, chip behavior, documentation, and regression tests.

  • Content-aware layout: Adds the default-on tableLayout plugin, column classification, width estimates, wrappers, and accessibility roles.
  • Responsive presentation: Preserves short chip labels, expands wide tables, and folds prose columns into stacked layouts.
  • Documentation and verification: Documents the automatic behavior and opt-out; the workspace build, 406 UI tests, and seven Chromium layout tests passed, with one UI test skipped. Additional browser fixtures reproduced the inline findings.

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

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
@vite-hub

vite-hub Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-17T13:13:34.436Z 8m 11s
View session Cancelled 2026-11-17T11:07:51.110Z 26m 20s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

Pushed af08c87 to fix the stale wide-block CSS assertion and resolved its review thread. Reproduced the original failure; all 33 focused UI/table-layout tests and repository lint pass after refreshing dependencies. No valid findings remain. Awaiting checks and automated review.

@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 runtime fixes pass, but the changed wide-block selector leaves an existing regression test failing and CI red. No P0 or P1 findings remain.

Reviewed changes Reviewed 69952d2 against the prior review at a484fed.

  • Preserved comment-wrapper layouts: Extended table traversal and CSS matching to static and deferred comment wrappers.
  • Corrected column measurement: Included headers when deciding column widths and no-wrap behavior, while retaining body-based prose classification.
  • Preserved native spans: Left tables containing colspan or rowspan unchanged.
  • Added regression coverage: Verified the new public-render and browser cases; the workspace build and ten Chromium tests passed, while the focused unit run passed 67 tests and exposed the one stale assertion noted inline.

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

Comment thread packages/ui/src/typeset-css.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. No P0 or P1 findings remain.

Reviewed changes Reviewed the assertion fix in af08c87 since the prior substantive review at 69952d2; the intervening merge introduced no changes to the reviewed table-layout behavior.

  • Updated wide-block regression coverage: Aligned the expected selector with the comments-aware document root while retaining the wide-block sizing checks.

The workspace build, all 33 focused UI/table-layout tests, and lint on the changed file passed.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@vite-hub
vite-hub Bot merged commit b9609b3 into main Nov 17, 2026
6 checks passed
@vite-hub
vite-hub Bot deleted the feat/wide-tables branch November 17, 2026 13:34
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026
vite-hub Bot added a commit to vite-hub/drop that referenced this pull request Nov 17, 2026
Tables from comark-ui's new tableLayout plugin (onmax/comark-ui#451) are
wide blocks. Drop gave a wide block the same room on both sides, the
smaller of the two, so with the outline open a table stayed centred and
never reached the empty space left of the text.

Each side now gets its own room: --comark-wide-start is the space left of
the column and --comark-wide-end the space right of it, less the panel
and the outline. A doc with comment cards in the margin zeroes both. The
outline counts a table as wide when comark-ui's width estimate passes the
text, and lets it stack rather than give up its column, as a compare
does.

Bumps comark-ui, comark-chips, comark-comments and comark-linter to the
PR's build.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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