fix(preview-ui): render table cells (read columns from row contents) - #131
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tables were invisible in
patto-previewin the browser.Root cause
The parser stores a table row's columns as contents of the
TableRownode (src/parser.rs:1012—row.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.tsxread the cells fromrow.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 theTablenode'schildren, 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 fromrow.value.contents.npx tsc --noEmitpasses.build.rsrebuilds the frontend frompatto-preview-ui/src/, so acargo buildpicks this up — no committeddistto regenerate.🤖 Generated with Claude Code