TableStyle.verticalRules: horizontal-only interior table rules (opt-in) - #137
Closed
dylandeheer wants to merge 4 commits into
Closed
TableStyle.verticalRules: horizontal-only interior table rules (opt-in)#137dylandeheer wants to merge 4 commits into
dylandeheer wants to merge 4 commits into
Conversation
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>
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.
What
Adds
TableStyle.verticalRules(defaulttrue). Whenfalse, the rendered table drops interior column separators: only the outer border (all four sides, still following the rounded-corner path whencornerRadiusis 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'ssetStrokebelow 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