Wayfinder map: M1 markdown presentation layer (S1.2) #20
Notifications
Due Date
No due date set.
Depends on
#19 Wayfinder map: M1 editor core — open, edit, autosave (S1.2)
AlexKucera/museion
Reference: AlexKucera/museion#20
Reference in new issue
Block a user
Destination
The M1 markdown presentation layer is landed and judged calm: reading toggle + renderer + typography decisions all resolved, the build executed once, and Alexander's calibration pass (corpus read in-app, first visual look at the editor surface) returns a calm ruling. Decisions-only map plus bounded execution children (#71's TextKit build, superseded by the #73 pivot chain: spike #74 → ADR-0011 #75 → rebuild #76) and the calibration gate; on a not-calm ruling, polish tickets graduate from fog and the map iterates.
Notes
• Execution override (bounded): unlike a pure decisions map, this map carries the build children and the calibration loop — the destination includes the ruled-calm surface, not just the decisions. Amended by #73: the apex pivot chain (#74 spike, #75 ADR-0011, #76 rebuild) and the editing-side spacing fix #77 join the execution set; #72 calibrates the HTML surface.
• Domain: CONTEXT.md (Post, Pass State, Fix Card, anchor); ADR-0010 fixes the renderer stance — reading toggle is block-aware (blank-line split, per-paragraph inline parse, headings fonted by level; single-Text .full flatten is the anti-pattern). Typography stance: variable heading sizes + real paragraph spacing are required, not nice-to-have. ADR-0011 supersedes the reading stance: reading = apex HTML pipeline.
• Skills: grilling + domain-modeling for every decision ticket; swiftui + swift6-concurrency for the build task; the build IS the prototype — no separate prototype tickets.
• Corpus (pinned, on main since
14fb2eb): spike/prose/ — eight posts; calibration piece = "The expected value of showing"; perf gate = PERF-3k.md (3452 words) renders without hitch. Calibration inventory fact (corrected in #69): italics present (emphasis, 3 of 9 files incl. calibration piece + PERF-3k), 26 ### headings in the calibration piece; no blockquotes/ordered lists/fenced code/tables/footnotes/images in the corpus — kitchen-sink.md (built in #71) covers those; the epigraph is plain prose in curly quotes.• Surface facts: #19 landed ProsePresenter.swift (line-kind → attribute map, Iowan Old Style 17 body, 26/20 headings, dimmed syntax mono 13), EditorSession (debounce/flush/conflict), PostEditorView (toolbar + ProseTextView, 640pt measure). Spike reading-mode code lives in spike/textkit2/ (readingBlocks @
d836083): blank-line split + per-paragraph AttributedString(markdown:) + heading level. Anchor search deliberately NOT lifted — #25 (M2).• Fonts (probed): Concourse OT installed at weights 2 Thin / 3 Book / 4 Medium / 6 Semibold / 7 Bold / 8 Black (+ italics, Tab widths) in
/Library/Fonts — no Regular. No Equity. System serifs: Iowan Old Style (current), Charter, Georgia. UbuntuMono Nerd Font Mono (PostScript UbuntuMonoNFM) installed — the fixed-width variant. DesignTokens today: system .serif / .monospaced designs only./Library/Fonts), licensing question deferred.• Typography mechanism (decided in #70): Settings type selector with three role slots — Body / Headings / Code — each {face, size}, full family list in each picker while defaults are being auditioned. No fonts bundle into the app in v1 — faces are machine-local (
• Tie-breaker: calm > effort > everything else; PERF-3k is pass/fail, not a ranking.
• No new ADRs unless a resolution genuinely surprises (hard-to-reverse + surprising + real trade-off); decisions live in their tickets, this map indexes them.
Decisions so far
• Grilling: reading-toggle interaction model #68: Read⇄Edit toolbar button + View menu "Toggle Reading Mode" + ⌘R; drafts included; no persistence (fresh open = editing); click-in-text flips to editing at the clicked paragraph (tap-without-selection = intent, caret at paragraph start); position mapping attempted with a jank fallback — build-time judgment, calibration arbitrates; #67 conflict alert shows while reading and Yes-reload re-renders.
• Grilling: reading renderer scope v1 #69: rendered = real form, fallback = editing-treated source text. Rendered: bullets + ordered lists with indent nesting and auto-renumbering (byte-stable — glyphs only), ### third heading level (#### floors at bold body), HR via the existing syntaxOnly matcher, fenced code (mono block), blockquotes (left hairline rule), pipe tables (NSTextTable, 1px border), images as hover popover, links styled + ⌘-click opens. Fallback: footnotes only. Frontmatter invisible. #71 adds spike/prose/kitchen-sink.md (constructs absent from corpus); calibration reads it; PERF gate stays PERF-3k.
• Grilling: type selector — slots, roles, v1 defaults #70: three role-named slots — Body / Headings / Code — each {face, size}, Picker listing ALL font families while defaults are auditioned; fixed role assignment; defaults Body=Concourse OT Book (weight 4), Headings=Iowan Old Style bold, Code=UbuntuMono Nerd Font Mono, sizes 17/26/13 with h2 derived at 0.77×; both prose surfaces read the tokens, chrome stays system; UserDefaults six values, missing face → silent system fallback; machine-local faces, nothing bundled.
• Task: land the reading toggle build #71: landed on wayfinder/71-reading-toggle (local, unpushed) — ReadingPresenter (block-aware, one list path, tables/quotes/HR/code/images/links per #69), ReadingSurface (tap-to-edit canvas, ⌘-click links, hover popover), ProseTypography slots + Settings section, kitchen-sink.md; 94 tests green, PERF-3k 17 ms/render, live-app probe verified round-trip byte-stability + renumbering + typography ladder. Deviations: font resolution via member list (family+weight lookup picks Thin over Book in Concourse), heading bold restored, table alignment honored. #72 unblocked.
• Grilling: pivot reading renderer to apex HTML pipeline #73: PIVOT — reading = apex (bundled MIT binary) → HTML → WKWebView + our CSS; editing stays TextKit. ADR-0001 native-only governs editing only (reading is presentation). TextKit reading machinery DELETED, stale-flow defect dies unfixed (fallbacks rot). Source mapping via blank-line chunker
data-source-linestamp (paragraph granularity, matches #68 contract); apex emits no source positions in any format (probed). Apex probed: MIT, 17–19 ms incl. spawn on corpus. Chain: #74 spike → #75 ADR-0011 → #76 rebuild; #72 calibrates the HTML surface; #77 editing-side line-spacing fix born from the decoupling.Prototype: apex HTML reading-surface spike: PROVEN live. Sentinel
<!--S:N-->pre-pass, apex passes comments through, regex-stamp todata-source-line— 0 mis-stamps corpus-wide, click+scroll maps verified in-app. Flags:--no-mixed-lists(default merges ordered-after-bullet into one<ul>— kills1. 1. 1.renumbering),--embed-images --base-dir(base64 →loadHTMLStringfast path, no file access, no vault writes;loadFileURL= 4x paint). apex stdout EOF ~18 ms = conversion done; ~65 ms teardown reaped async. Dominant switch cost was the WKWebView remount, not apex — one view reloaded in place feels instant. Typo'ed image fix, flash fix, early handoff all landed; Alexander: "much better. approved." Spike: branchspike/apex-html@7afd1a0(throwaway,--check/--pipelineself-tests). #75 has its facts; kill-list empty.ADR-0011: apex HTML reading pipeline: written —
docs/adr/0011-apex-html-reading-pipeline.md, branchwayfinder/75-adr-0011@b8a9ea7(ADRd505a95+ DOX pass: ADR range → 0011, supersede pointer on 0010). Reading = apex prebuilt binary (resources, signed+notarized, no gate) → HTML → one WKWebView in place + CSS; ADR-0010 reading stance superseded, editing stands; loadHTMLString+base64 over loadFileURL;--no-mixed-listsrequired. #76 unblocked.Task: build the apex HTML reading surface: landed on
wayfinder/76-apex-html-reading@f1c915f(local, unpushed) — ReadingPresenter = chunker sentinels → bundled apex (--no-mixed-lists --embed-images, binary ships via fs-sync at Museion/Resources/apex, no pbxproj edit) →data-source-linerestamp → CSS-var page; ReadingSurface = one WKWebView reloaded in place (click-to-edit, ⌘-click links, scroll-sync, entry-scroll after paint); TextKit reading machinery deleted (fallback = escaped source<pre>; footnotes now native apex). 94 tests green (pipeline tests run the real binary), lint clean, DOX passed (reading-mode section rewritten, native-only line rescoped to editing). Live-verified in-app: kitchen-sink + PERF-3k render, toggle instant (apex ~20 ms), click-to-edit lands at the clicked paragraph. #72 unblocked — calibrates the HTML surface.Grilling: calibration pass — rule calm or not: not-calm surface, calm pipeline. Apex/HTML+CSS judged "works very well" — renderer chain settled, no gaps named. Not-calm = typography values, spacing, tables/quotes styling. Directed path: impeccable critique → polish, run same-session. Critique scored the surface 26/40 (dual-agent; detector 192 tight-leading findings) → polish landed in-session on
wayfinder/76-apex-html-reading: leading 1.5 + para gap ~20px, rescaled heading ladder with cling margins (hN+hN suppressed), confident blockquote (near-ink, 3px rail), booktabs tables, tinted code panel + relative inline code, link-underline contrast fix, ::selection/:focus-visible; 93 tests green, detector clean, screenshots verified. #78 (re-calibration) re-rules the polished surface.Grilling: re-calibration — rule calm or not: CALM. Pipeline + polished surface both ruled calm (leading 1.5→1.8, para ~17px ladder per reading.css landed in #72's session; second critique scored static prose craft top-tier). Reading polish is DONE as map work — further CSS refinement is regular maintenance, not tickets. The open frontier is #77 alone (editing-side parity, expanded same-day).
Task: fix + expand — editing-side reading parity: RESOLVED (HITL approved). Scope expanded from the line-spacing defect to full writing-surface parity: heading ladder 30/22/19-bold/bold-body, leading calibrated to CSS 1.8 via font metrics, inline bold/italic/code/link traits (marks dimmed), quote secondary-ink + indent, fence interiors mono, half-height blanks, 66ch measure, heading spacing 75/30, overlay scrollbar; reviewer-fanout fixes (fence-delimiter staleness, font caching). Landed on main 8fe5f48→49fab56 (branch merged mid-session
fefdd9a), 104 tests green, 12 new pinning tests.Not yet specified
(none — the way to the destination is clear)
Out of scope
• Typography value tuning + font pickers as map work — #72's rework hardcoded the constants (single-user app, Settings sections deleted); #78 ruled the result calm. Further refinement = edit reading.css / ProseTypography.swift as regular maintenance.
• Frontmatter editing (Obsidian-style custom fields, popup or in-editor surface) — parked per #69; future effort, builds on #59's write-side vocabulary.
• Focus mode itself (#21) — downstream, blocked by this map issue; its session works the interplay.
• Fix-Card anchor mechanics (#25 / M2) — spike-proven, deliberately unlifted; separate milestone.
• Substrate questions — ADR-0010 closed them; CodeEdit is out of Museion.
• iOS/iPadOS presentation — v1 is macOS only.
• Import/external markdown (#22) — S1.1 track, independent of presentation.
[Generated by AI]
M1: Markdown presentation layer (S1.2)to Wayfinder map: M1 markdown presentation layer (S1.2)