Skip to content

Add style options for lists, task boxes, quotes, inline code and table headers - #33

Merged
servercimen merged 13 commits into
feature/ios-view-testsfrom
feature/style-options
Nov 24, 2026
Merged

servercimen merged 13 commits into
feature/ios-view-testsfrom
feature/style-options

Conversation

@servercimen

Copy link
Copy Markdown
Owner

Part 3 of a stack of 13 pull requests. The base is #32 (feature/ios-view-tests). #31 (part 1) tells how to merge the stack.

On this stacked branch, swift test passes (209 tests), and the iOS build and build-for-testing pass.

Summary

An app often must match a Markdown look that it already has. This change adds style fields to TranscriptStyle for lists, task boxes, block quotes, inline code and table headers. Each default keeps the look of today, so an app that sets none of the fields sees no change.

  • List numbers: listNumberFormat (a TranscriptListNumberFormat: .asWritten, .period, .parenthesis or .custom(prefix:suffix:)), listNumberWeight and listNumberColor.
  • Bullets: bullets and bulletColors, one value for each list level. Levels past the end use the last value.
  • Task boxes: taskCheckedColor, taskCheckmarkColor and taskUncheckedColor.
  • Block quotes: quoteBarColor, quoteBarWidth and quoteTextColor. The quote text color also applies to list markers, task box outlines and formulas in the quote. Links, code colors and custom tags' colors win over it.
  • Inline code: inlineCodeBackgroundColor and inlineCodeCornerRadius. The fill does not change the line breaks. A custom tag's highlight wins over it.
  • Table headers: tableHeaderBackgroundColor and tableHeaderWeight. The column widths use the header weight.
  • A weight uses the TranscriptFont.weight scale. For a named body font, a weight of 0.3 or more uses its bold face.
  • The doc comments and the Styling section of the README describe the new fields. The doc comment of taskCheckedColor gives no color value for the default.

Tests

  • swift test on macOS: 193 tests pass. The new tests in StyleOptionsTests.swift check the marker text, the font weights and the colors. They count the pixels of the new fills, also in dark.
  • xcodebuild build -scheme TranscriptKit -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO: passes.

Checked on an iPhone 12 mini

A check screen in a local test app ran on main first (2 runs). There, the new fields do not exist, and a live change of the style does nothing. Then it ran on this branch (5 runs). Stand-ins: dark mode is a trait override on the window. The check reads the accessibility labels from the view, and does not hear them.

  • Default style: main and the branch are pixel-identical in light and in dark. The device screenshots have 0 different pixels in the text area. The default checked box draws as sRGB (0, 145, 255) on both.
  • Main: the numbers are "1)", the quote bar is 9 px and gray, inline code has no fill, and the table header is gray and semibold.
  • Branch, with each field set: a red bold "1.", a green "–" and a blue "→" bullet, and a red box with a black check. The quote bar is 18 px and red, and turns green in dark. The quote text is blue, and the link keeps its color. Inline code has a yellow rounded fill with the same line breaks. The table header is green and not bold.
  • Branch, live change: the view draws again with no stale tile, also where the header row crosses a tile line.

Not checked

  • VoiceOver speech, by ear.
  • A switch to dark mode in the system settings.

Known limits

  • With listNumberFormat = .period, VoiceOver still reads "1)". The screen shows "1.", but the accessibility label of the item is "1) first".

🤖 Generated with Claude Code

servercimen and others added 12 commits November 23, 2026 17:06
An app can now set the format, the weight and the color of the numbers
of ordered list items. The defaults keep the numbers as the Markdown
wrote them, in the body font and the text color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the bullet text and the bullet color for each list
level. Levels past the end of a list use its last value. The defaults
keep the bullets of today in the text color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the fill of a checked task box, its check mark, and
the outline of an unchecked task box. The defaults keep the blue box,
the white check mark and the text-colored outline of today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the color and the width of the quote bar, and the
color of the text in a quote. The quote text color also applies to list
markers, task box outlines and formulas inside the quote. Links, code
colors and custom tags' colors win over it. The defaults keep the
3-point bar in the accent color and the text color of today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set a fill behind inline code, and its corner radius.
The fill is drawn like a custom tag's highlight, and a tag's highlight
wins over it. The fill does not change the line breaks. The default
draws no fill, as today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the fill behind the header row of a table, and the
weight of its text. The column widths are measured with that weight.
The defaults keep the code background fill and the bold body font of
today. Table cells still wrap as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A table header weight of 0.3 or more now makes inline code in the
header bold. Before, the code font replaced the weighted system font,
so the code span was lighter than with the default weight.

Other changes:
- A negative quoteBarWidth draws no bar. Before, the bar drew to the
  left of its quote.
- The doc comments and the README say that list numbers, bullets and
  unchecked task boxes use quoteTextColor in a block quote.
- The default bullets are in one place.
- The style fields are in the README order: lists, task boxes, quotes,
  inline code, table headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The doc comment of taskCheckedColor gave the default as red 0, green
0.478, blue 1. That TranscriptColor draws in a different blue than the
default fill. The comment now says only that the default is a
system-like blue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@servercimen
servercimen added this pull request to stack #44 November 24, 2026 20:57
@servercimen
servercimen removed this pull request from stack #44 November 24, 2026 21:01
@servercimen
servercimen added this pull request to stack #45 November 24, 2026 21:01
@servercimen
servercimen merged commit e3e106d into main Nov 24, 2026
0 of 6 checks passed
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