Skip to content

fix(preview-ui): render table cells (read columns from row contents) - #131

Merged
ompugao merged 1 commit into
masterfrom
fix/preview-table-cells
Aug 20, 2026
Merged

fix(preview-ui): render table cells (read columns from row contents)#131
ompugao merged 1 commit into
masterfrom
fix/preview-table-cells

Conversation

@ompugao

@ompugao ompugao commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Problem

Tables were invisible in patto-preview in the browser.

Root cause

The parser stores a table row's columns as contents of the TableRow node (src/parser.rs:1012row.add_contents(columns)), which is what the Rust HTML renderer iterates (src/renderer.rs:360-366). Serialized AST for a [@table] doc:

{ "kind": {"type": "TableRow"}, "contents": [ ...TableColumn... ], "children": [] }

VirtualRenderer.tsx read the cells from row.value.children, which is always empty, so every table rendered as <table><tbody><tr></tr>…</tbody></table> — rows with zero cells, i.e. a zero-height, invisible table. (Rows themselves come from the Table node's children, which the UI already had right; only the column level was wrong.)

Fix

One-line change in patto-preview-ui/src/components/VirtualRenderer.tsx: read columns from row.value.contents.

npx tsc --noEmit passes. build.rs rebuilds the frontend from patto-preview-ui/src/, so a cargo build picks this up — no committed dist to regenerate.

🤖 Generated with Claude Code

Table columns are stored as `contents` of a TableRow node (see
`row.add_contents(columns)` in the parser, and the HTML renderer which
iterates `contents`), but VirtualRenderer read them from `children`,
which is always empty. Every table rendered as rows with zero cells,
i.e. an invisible zero-height table.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ompugao
ompugao merged commit fff7c04 into master Aug 20, 2026
10 checks passed
@ompugao
ompugao deleted the fix/preview-table-cells branch August 20, 2026 13:00
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