Commit Graph
10 Commits
Author SHA1 Message Date
AlexKucera d7fd11cf0d chore(lint): repo-wide green becomes the contract
CI / ci (push) Canceled after 0s
Close the lint arc #194-#197: deliberate-style rule disables with
rationales (#194), filter-safe test renames + --test-case-name-format
preserve (#195), every surviving warning fixed through the sanctioned
lint-stable shapes (#196), and the docs now state the true contract
(#197): bare swiftlint . reports zero violations and swiftformat .
reformats nothing, while push gates stay scoped to the push's own
files (settled #190 design) — the pre-push hook's stale 'pre-existing
violations' rationale blocks refreshed, gate logic untouched.

Also in the sweep: quiesce the FSEvent-burst watcher race in
LibrarySearchTests (two rescans double-count one shared PostScanCache
miss; benign revision over-bump), pin the learnings scan's symlink-skip
contract (flip-verified — defended in depth by the lstat guard AND
contentsOfDirectory's own symlink refusal), reorder that scan's guard
so cheap rejections precede the directory listing, and park the roster
chmod window with a ceiling comment.

Finish-audit: 3 reviewers, 0 blocking; the one code finding was
disproved by probe (&& out-binds ?? — the guard was correct). Suite
693/693 via scripts/full-test.sh; swiftlint 0 violations; swiftformat
0/141; hook rig 23/23.

Closes #197
2026-11-17 16:29:46 +01:00
AlexKucera d722820fc8 chore: swiftformat drift + xcode 27 settings leftovers
Format-only pass over spikes, the gate prototype, and three app
files (brace style, wrapping — no semantic change), plus the 4-line
pbxproj alignment finishing the Xcode 27 settings pass (test-target
deployment target parity with 8e70f69).

[Generated by AI]
2026-10-16 14:49:26 +02:00
AlexKucera 4cb753d17f feat(reading): polish typography, externalize CSS
Critique-directed polish of the reading surface (#72 ruling: pipeline
calm, surface not-calm) plus the single-user typography rework:

- Flow: leading 1.5, paragraph gap tightened; heading ladder rescaled
  (h1 1.15x / h2 0.85x / h3 body-face semibold) with cling margins,
  hN+hN suppression, no title dead space
- Constructs: confident blockquote (near-ink text, 3px rail, nesting
  degrades), booktabs tables, tinted code panels, relative inline code
- Fonts hardcoded for Alexander's faces: Valkyrie OT B 17 body,
  Concourse OT Semibold headings, UbuntuMono 14 code; 66ch measure
- Stylesheet moved to Museion/Resources/reading.css, read fresh per
  page build — Debug builds load the repo copy (#filePath), so CSS
  edits hot-reload on the next reading toggle
- Settings Typography/Text Flow sections and all flow-key plumbing
  deleted (56 insertions, 417 deletions)

Refs #72, #78. Detector: 192 findings -> 0. Build + 93 tests green.

[Generated by AI]
2026-10-07 17:02:10 +02:00
AlexKucera f1c915fed1 chore(reading): lint-clean lift — local renames, tab escape, DOX pass (#76)
Spike-locals renamed at lift time (identifier_name), literal tab in a
string escape fixed (unprintable-ASCII build error), swiftlint
force_try disable for the static regex. AGENTS.md reading-mode section
rewritten for the apex HTML pipeline; native-only Work Guidance line
rescoped to the editing side per ADR-0011.
2026-10-06 18:30:21 +02:00
AlexKucera cc04ec236e feat(reading): swap reading surface to apex HTML pipeline (#76)
ReadingPresenter becomes markdown -> bundled apex -> HTML fragment with
data-source-line stamps (chunker sentinels + regex restamp, #74-proven);
ReadingSurface becomes one WKWebView reloaded in place (no remount), CSS
vars from ProseTypography slots + flow knobs. TextKit reading machinery
deleted (ADR-0011: no fallbacks; stale-flow defect dies unfixed).
Footnotes now render natively (apex upgrade over #69's fallback). Tests
re-targeted at HTML string asserts incl. real-bundled-binary pipeline runs.

Closes-nothing: wayfinder #76 on map #20; branch wayfinder/76-apex-html-reading.
2026-10-06 18:26:22 +02:00
AlexKucera 6d7d1411a2 feat(editor): configurable text flow — line height + spacing knobs (#71 follow-up 7)
Three UserDefaults-backed knobs in ProseTypography (line-height multiple,
space-after-¶ and space-after-heading in body lines, clamped), surfaced
in Settings → Text Flow. Also fixes two real bugs from the last commit:
paragraphSpacing was set to 1.25 POINTS (now lines × linePoints), and
reading-mode body paragraphs never received the rhythm at all (they rode
the editing surface's fixed 10pt) — both surfaces now share one rhythm.
2026-10-06 13:43:43 +02:00
AlexKucera 2d4e2563f7 feat(editor): reading polish — inline images, rhythm, table padding, margins (#71 follow-up 6)
- Images render inline via NSTextAttachment (scaled to 480pt, alt as
  caption); the hover popover and its ImagePopoverView are gone.
- Vertical rhythm per the author's measurements: lineHeightMultiple 1.25,
  1 line after paragraphs, 2 after headings (all block styles).
- Table cells breathe: mono pad 2→3 per side; decoration offsets measure
  with the same pad so the grid still lands on the text.
- Margins: lineFragmentPadding 12→24 (reading + editing), inset height 24.
- Image URL resolution hoisted into blocks(for:) — the attachment loads
  the resolved path, document() no longer re-resolves.
2026-10-06 12:49:04 +02:00
AlexKucera 4138bf22dd fix(editor): draw quote/HR/table decorations on the canvas (#71 follow-up 2)
NSTextBlock/NSTextTable layout is broken on this TextKit build regardless
of engine: textBlocks zero-width the line rect (quotes wrapped one
character per line), NSTextTable rows stack vertically with no grid
(tables rendered as concatenated text with a stray outline). The TextKit1
bridge attempt failed live too. Stop fighting the API:

- Presenter emits plain content: quotes indent-only, HR a thin invisible
  line, tables mono-space-padded grid text with alignment honored.
- Each Block/Bound carries a Decoration payload (quote indent, rule,
  table column offsets); ReadingCanvasView.draw renders hairlines,
  rules, and table grids from measured layoutManager geometry.
- Tests assert decorations + column alignment instead of textBlocks.

Full suite green; lint clean.
2026-10-05 18:05:16 +02:00
AlexKucera c410c99bf8 fix(editor): reading-mode layout + stale-reload defects (#71 follow-up)
Five root causes behind Alexander's calibration findings:

- Wrap to column: both canvases had a fixed 640pt text container —
  clipped instead of wrapping when the editor column is narrower
  (library + mentor open). widthTracksTextView = true now; measure
  polish can return with calibration.
- Tables: TextKit2 stacks NSTextTable rows vertically (each row its
  own content-width fragment — no grid). The reading canvas forces
  the TextKit1 bridge (replaceLayoutManager); probe-verified grid +
  column borders. Read-only canvas — nothing editing-grade lost.
- Heading-tail: a chunk like "# Title" followed by body lines (single
  newline, legal markdown) dropped everything after line one. The
  heading now renders, then the remaining lines as a soft-joined
  paragraph.
- Stale reload (data-loss vector): ProseTextView seeded from
  session.loadText (open-time snapshot) — after a reading⇄editing
  swap the recreated editor showed the pre-paste text, and a keystroke
  there flushed stale content over the user's real edits. Seeds from
  session.text (live) now.
- Quote one-char-per-line: did not reproduce after the layout fixes;
  root cause was the broken layout state above.

EditorSessionTests debounce flake (50ms margin under parallel load)
passed on both re-runs — timing margin, not a regression.

Full suite green (94 unit + UI smoke); lint clean.
2026-10-05 17:41:34 +02:00
AlexKucera 4c91733e78 feat(editor): land reading toggle — render, interact, typography slots (S1.2 #71)
Map #20 execution child, built per decisions #68/#69/#70:

- ReadingPresenter: block-aware renderer (ADR-0010 stance) — blank-line
  split, one block per chunk; lists (bullets + ordered + nesting +
  auto-renumber via per-level counters — one rendering path), headings
  by level (h1 = slot size, h2 = 0.77x, ### = body+1, #### floors at
  bold body), HR via the editing syntaxOnly predicate, fenced code,
  blockquotes (QuoteTextBlock hairline), tables (NSTextTable 1px
  border, delimiter-row alignment), images (hover payload), links
  styled + retained. Footnotes stay fallback. Source ranges ride every
  block (click→edit map).
- ReadingSurface: read-only selectable NSTextView canvas (#68: a
  presentation of the same TextKit2 document). Tap with no selection
  after mouseDown returns = edit intent at the clicked block (the
  tracking-loop fix); ⌘-click opens links; scroll tracking feeds the
  flip-back caret; image hover NSPopover loads off-main.
- ProseTypography (#70): three role slots — Body / Headings / Code —
  each {face, size}, UserDefaults six values, member-based font
  resolution (family+weight lookup misresolves Concourse Book→Thin),
  silent system fallback; both prose surfaces read them; editing
  presenter's headings + dimmed syntax rewired through the slots.
- PostEditorView: Read⇄Edit toolbar button (far left) + View menu
  "Toggle Reading Mode" + ⌘R; reading state transient per open; drafts
  included (draft mirror); flip-back caret hint applied once per token.
- SettingsPaneView: Typography section — three slot rows (family
  picker incl. current face not in the installed list + size field).
- kitchen-sink.md (+png): corpus piece exercising constructs absent
  from the eight posts, per #69.

Verified: 94 unit tests (renderer classification, renumbering, source
ranges, fallbacks) + UI smoke; PERF-3k renders 128 blocks in ~17 ms;
live-app probe — Read renders kitchen-sink markers-hidden, renumbered,
byte-stable file after full round-trip; click-to-edit flips at the
clicked paragraph; typography ladder pixel-verified (20/15 ink px).
2026-10-05 15:51:28 +02:00