Skip to content

TableStyle.verticalRules: horizontal-only interior table rules (opt-in) - #137

Closed
dylandeheer wants to merge 4 commits into
nodes-app:mainfrom
GetWeeve:feature/table-rule-orientation
Closed

TableStyle.verticalRules: horizontal-only interior table rules (opt-in)#137
dylandeheer wants to merge 4 commits into
nodes-app:mainfrom
GetWeeve:feature/table-rule-orientation

Conversation

@dylandeheer

Copy link
Copy Markdown

What

Adds TableStyle.verticalRules (default true). When false, the rendered table drops interior column separators: only the outer border (all four sides, still following the rounded-corner path when cornerRadius is set) and the horizontal rules between rows draw, with the row rules spanning the full inner width. Column sizing and cell padding are unchanged. The knob joins the table image cache key so flipping it renders fresh.

Why

Row-separated tables (outer border + horizontal rules only) are a common editorial style — several design systems reserve vertical grid lines for dense data tables. Embedders that theme tables (#129) and round their corners (#135) also need to control rule orientation. The default preserves today's full-grid rendering exactly.

Also fixes

Interior rules were silently stroking in the drawing context's default black instead of MarkdownEditorTheme.tableRule: the rounded-wrapper change (#135) moved the outer border's setStroke below the separator pass. The separator pass now sets the rule color explicitly; a regression test pins it.

Tests

TableRuleOrientationTests (6): default preserved, no interior vertical-rule pixels with the knob off, horizontal rules present and spanning edge to edge, outer border intact on all four sides, themed (non-black) interior rule color, and cache invalidation on knob change. The color test fails on the unfixed renderer.

Stacked on #135 (feature/table-corner-radius).

Made with Cursor

dylandeheer and others added 4 commits August 3, 2026 22:59
The theme can recolor every element except heading text (it inherits
bodyText), and the heading config covers every metric except the face —
so an embedder that wants serif display headings over a sans body has
to fork. HeadingStyle.fontName picks a PostScript face for headings,
honored exactly so the chosen weight survives; an unresolvable name
falls back to the stock bold base font, like TaskCheckboxStyle's symbol
fallback. MarkdownEditorTheme.headingText colors heading text while the
`#` glyphs stay on headingMarker and inline constructs inside a heading
keep their own ink. Emphasis inside a heading still composes on top of
the configured face (traits added, family and per-level size kept).
Both knobs default to nil, which keeps styling identical to before.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds two additive theme slots for the rendered table image:

- MarkdownEditorTheme.tableHeaderBackground fills the header row;
  nil (the default) keeps the historical mutedText at 8% alpha.
- MarkdownEditorTheme.tableRule strokes the outer border and the
  internal rules; nil keeps the historical mutedText at 50% alpha.

Both slots participate in the table image cache key (identity prefix
and resolved-component key), so a theme differing only in a table
slot renders fresh instead of reusing a stock cached image.

Co-authored-by: Cursor <cursoragent@cursor.com>
The rendered GFM table image can now clip its wrapper to a rounded
shape: interior painting (header-row fill, separator-rule ends) clips
to the rounded path and the outer border rule strokes along it, so the
rules stay crisp at the corners. The radius joins the render-cache key
like every other pixel-affecting input. 0 (the default) keeps the
historical square-cornered rendering exactly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Tables can now drop interior column separators: with verticalRules false
only the outer border and the horizontal rules between rows draw, with the
row rules spanning the full inner width. Default true preserves the
historical full-grid rendering exactly. The knob joins the table image
cache key.

Also fixes interior rules silently stroking in default black: the rounded
wrapper change moved the outer border's setStroke below the separator
pass, so separators lost the themed rule color.

Co-authored-by: Cursor <cursoragent@cursor.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.

2 participants