From 36858bcf1d7712f64b4ee40388faf6130aca3716 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Mon, 5 Oct 2026 15:52:40 +0200 Subject: [PATCH] docs(devlog): #71 session log --- AGENTS.md | 1 + .../20261005-issue71-reading-toggle_log.md | 42 +++++++++++++++++++ docs/devlog/INDEX.md | 1 + 3 files changed, 44 insertions(+) create mode 100644 docs/devlog/20261005-issue71-reading-toggle_log.md diff --git a/AGENTS.md b/AGENTS.md index 65c5a49..251983c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -178,6 +178,7 @@ Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Fu | Date | Log | |------|-----| +| 2026-10-05 | [20261005-issue71-reading-toggle_log.md](docs/devlog/20261005-issue71-reading-toggle_log.md) | | 2026-10-03 | [20261003-issue19-editor-core_log.md](docs/devlog/20261003-issue19-editor-core_log.md) | | 2026-10-03 | [20261003-issue18-post-lifecycle_log.md](docs/devlog/20261003-issue18-post-lifecycle_log.md) | | 2026-10-01 | [20261001-issue17-home-posts-list_log.md](docs/devlog/20261001-issue17-home-posts-list_log.md) | diff --git a/docs/devlog/20261005-issue71-reading-toggle_log.md b/docs/devlog/20261005-issue71-reading-toggle_log.md new file mode 100644 index 0000000..116d39f --- /dev/null +++ b/docs/devlog/20261005-issue71-reading-toggle_log.md @@ -0,0 +1,42 @@ +# Issue 71 — Task: land the reading toggle build (S1.2) + +> **Date:** 2026-10-05 +> **Type:** issue +> **Reference:** [Wayfinder map #20](https://git.babylondreams.de/AlexKucera/Museion/issues/20) · decisions [#68](https://git.babylondreams.de/AlexKucera/Museion/issues/68) · [#69](https://git.babylondreams.de/AlexKucera/Museion/issues/69) · [#70](https://git.babylondreams.de/AlexKucera/Museion/issues/70) + +## What landed + +Branch `wayfinder/71-reading-toggle`, commits `4c91733` (feature) + `c4555ed` (DOX). + +**New files** +- `Museion/ReadingPresenter.swift` — block-aware reading renderer (ADR-0010 stance): blank-line split → one block per chunk; classification HR → list run → quote run → flow. Lists (bullets + ordered + nesting + auto-renumber) are one rendering path; headings h1/h2/`###`/floor per #69/#70; `QuoteTextBlock` hairline, `RuleTextBlock` HR, `NSTextTable` tables with delimiter-row alignment; images as hover-payload blocks; footnotes the one fallback. `document(for:resolvingImagesIn:)` builds the single storage with per-block `Bound{docRange, sourceRange, imageURL}`. +- `Museion/ReadingSurface.swift` — `ReadingCanvasView`: read-only selectable NSTextView. Tap-to-edit runs after `super.mouseDown` returns (NSTextView's tracking loop consumes the mouse-up — `mouseUp` overrides never fire); ⌘-click opens links; scroll tracking feeds the flip-back caret; image hover NSPopover loads off-main. +- `Museion/ProseTypography.swift` — the #70 three role slots (Body/Headings/Code, {face,size} each, UserDefaults six values, member-based font resolution, silent system fallback). +- `MuseionTests/ReadingPresenterTests.swift` — 15 renderer tests (inline fixtures). +- `spike/prose/kitchen-sink.md` + `assets/kitchen-sink.png` — the #69 calibration piece. + +**Modified** +- `PostEditorView.swift` — Read⇄Edit toolbar button (far left), View menu + ⌘R via `.toggleReadingMode` notification; transient reading state; drafts included (draft mirror); flip-back caret hint (location + token) applied once per token. +- `ProsePresenter.swift` — headings/dimmed-syntax/body rewired through the shared slots (both prose surfaces read the same tokens, #70). +- `SettingsPaneView.swift` — Typography section: three `SlotRow`s (family picker + size field). +- `MuseionApp.swift` — View CommandMenu; `ProseTypography.registerDefaults()` in `AppGateState.init`. +- `EditorSession.swift` — `folderURL` for image resolution. + +## Verification + +- Build + full test suite green: 94 unit + UI smoke (`xcodebuild … test`). +- Runtime probe (temporary hosted test, deleted): kitchen-sink 24 blocks/11.3 ms; PERF-3k 128 blocks/17.2 ms, ×10 in 165.8 ms; zero marker leakage across all three corpus files. +- Live-app probe (System Events): post opens, Read renders (markers hidden, `1. 1. 1.` → 1/2/3 verified via AX value), ⌘R menu toggles back, click-on-paragraph flips to editing with caret in-document, file byte-identical (`cmp`) after the full round-trip. +- Typography pixel-verified on screenshot: heading ink 20px vs body 15-16px at 1× — the 26/20/17 ladder renders. + +## Deviations from the decisions + +- **Font resolution** (#70 said family+weight lookup): `font(withFamily:traits:weight:)` misresolves Concourse OT — Thin and Book both advertise weight 4 and the manager picks Thin. Faces resolve through the member list instead (prefer Book/Regular style, else closest to weight 5). The #70-pinned PS names (ConcourseOT3Book etc.) fall out of the same path. +- **Heading bold**: the first build lost heading weight (member resolution returns Book); `headingFont(size:)` now bolds — matching #19's weight 8/9 stance and #70's "Iowan Old Style bold". +- **Table alignment**: honored (not left-defaulted) — the delimiter row is parsed anyway; alignment was ~4 lines. +- **Click-to-edit discrimination**: implemented as single-click (`clickCount == 1`) + no selection + <4pt move, checked after `super.mouseDown` returns. The time-window check from the plan was dropped — the click is complete when the tracking loop exits, making it redundant. + +## Notes for calibration (#72) + +- The map's fog item "curated shortlist" now has a home: Settings → Typography lists all families with current faces prepended (Iowan Old Style is not in `availableFontFamilies` — the prepend is load-bearing). +- Mapping (entry scroll + flip-back caret) shipped in full; no jank fallback was needed at build time — #72 arbitrates. diff --git a/docs/devlog/INDEX.md b/docs/devlog/INDEX.md index 5336884..1c1c95c 100644 --- a/docs/devlog/INDEX.md +++ b/docs/devlog/INDEX.md @@ -5,6 +5,7 @@ Complete history of session logs in this directory, newest first. One-line summa | Date | Type | File | Summary | |------|------|------|---------| +| 2026-10-05 | issue | [20261005-issue71-reading-toggle_log.md](20261005-issue71-reading-toggle_log.md) | #71 reading toggle: block-aware renderer, tap-to-edit canvas, typography slots, kitchen-sink — 94 tests green | | 2026-10-03 | issue | [20261003-issue19-editor-core_log.md](20261003-issue19-editor-core_log.md) | #19 editor core: TextKit2 surface lifted, debounced autosave, save dot, cursor sidecar, conflict alert — 81 tests green | | 2026-10-03 | issue | [20261003-issue18-post-lifecycle_log.md](20261003-issue18-post-lifecycle_log.md) | #18 shipped + audits: Post write side, FSEvents watcher, editor stub — 75 tests green | | 2026-10-01 | issue | [20261001-issue17-home-posts-list_log.md](20261001-issue17-home-posts-list_log.md) | #17 shipped + finish-audit: workspace shell, Posts mirror, Home repoint — 56 tests green |