From d505a957bdc542d0d8a82a15bb1a6a70f8b79007 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Tue, 6 Oct 2026 17:15:38 +0200 Subject: [PATCH 01/15] docs(adr): ADR-0011 apex HTML reading pipeline (#75) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Records the #73 pivot: reading = apex → HTML → WKWebView + our CSS; ADR-0010's reading stance superseded, editing stance stands; ADR-0001 boundary ruled (native-only governs editing, reading is presentation). Bundling: prebuilt binary in resources, signed + notarized. TextKit reading machinery deleted, not fallback. --- docs/adr/0011-apex-html-reading-pipeline.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docs/adr/0011-apex-html-reading-pipeline.md diff --git a/docs/adr/0011-apex-html-reading-pipeline.md b/docs/adr/0011-apex-html-reading-pipeline.md new file mode 100644 index 0000000..c1e0bb9 --- /dev/null +++ b/docs/adr/0011-apex-html-reading-pipeline.md @@ -0,0 +1,15 @@ +# 0011 — Apex HTML reading pipeline + +Reading mode renders markdown through apex (MIT, unified dialect) as an HTML fragment loaded into a single WKWebView styled by our CSS — typography slots become CSS custom properties, and a blank-line-chunked `data-source-line` stamp (sentinel HTML comments, applied post-conversion; apex emits no source positions) carries the click-to-edit and scroll-sync map at paragraph granularity. Proven live in the #74 spike (PERF-3k: ~18 ms apex, 33 ms end-to-end, zero mis-stamps corpus-wide); ruled in #73. Supersedes ADR-0010's reading stance — its editing stance (TextKit2 mode B) stands — and records ADR-0001's boundary as ruled: native-only governs the editing side; reading is presentation, so WKWebView is allowed. + +## Considered Options + +- **TextKit reading renderer (#71 build)** — deleted, not kept as fallback: fallbacks rot, and its stale-flow defect dies unfixed by design. The decoupling obligation (editing side up to par as a plain-text surface) is ticketed separately (#77). +- **`loadFileURL` instead of `loadHTMLString`** — 4× first paint (255 ms vs ~67 ms) from sandbox negotiation; `--embed-images` base64 inlining needs no file access at all and writes nothing into the vault. + +## Consequences + +- **Bundling:** the prebuilt apex binary ships in app resources, signed + notarized. No source build in CI, no user install gate — a renderer must not grow a gate. +- **One WKWebView, reloaded in place.** Remounting per document (`.id(sel)`) was the dominant switch cost — hundreds of ms of web-process respawn; `loadHTMLString` on a retained view feels instant. +- **`--no-mixed-lists` is required**, not tuning: apex's default merges an ordered list following a bullet list into one `