Render org READMEs natively instead of in a web view !34

merged merged by cmc on 2026-08-31 18:42 UTC · krz/gitbay-ios:org-native-rendering into main

Discussion

cmc

ReadmeView now renders .org content with OrgSwiftUI.OrgView instead of OrgReadmeWebView. Selectable text, Dynamic Type and VoiceOver, and no WKWebView per README — which also removes the document.body.scrollHeight round-trip that sized it and the full re-render on every theme change.

OrgSyntaxStyler replaces the old Highlightr bridge. Highlightr already returns an NSAttributedString, so flattening it to color-styled <span>s and wrapping the result in a hand-written stylesheet are both gone — 239 lines deleted for 59.

Dependency

org-swift moves from branch: main to the 0.2.0 tag. Worth noting the revision it pinned before (47ac630) no longer exists: main was rewritten, which orphaned it, and Xcode's cached clone had to be cleared before it would resolve. hutch pins that same dead revision and will need the same treatment.

Verified

Built and run on the simulator against krz/gitbay's README.org in both light and dark: headings, nested lists, inline verbatim, links, and syntax-highlighted src blocks that scroll horizontally. App unit tests pass.

Two bugs turned up during that check and are fixed in org-swift 0.2.0 — headings rendering at body size, and highlighted code keeping its light theme after switching to dark.

Known gap

=ssh.mode = "system"= in that README renders as two verbatim spans rather than one. The inline parser closes a verbatim at the first = instead of honoring org's rule that the content may not end with whitespace. It predates this change and affects the HTML renderer identically.