Files
museion/docs/devlog/20261009-issue87-focus-mode_log.md
T
AlexKucera b0ab800d3d feat(workspace): focus mode — recession, hover reveal, soft caret centering (#87)
Map #21 build child. Toggle via View menu / ⌘⇧F; panes and toolbar
recede, overlay hover reveal (left: rail+library, right: mentor),
soft caret centering while typing, loud save failure, ⌘S armed in
focus. Full suite green; calibration gate #88 judges calm.
2026-10-09 11:11:36 +02:00

4.6 KiB
Raw Blame History

Session Log — #87 Build: land focus mode (map #21)

Date: 2026-10-09 Branch: wayfinder/87-focus-mode (local, unpushed — push awaits authorization) Ticket: #87 — build child of map #21

What happened

Wayfinder work-through session on map #21 ("M1 focus mode & typographic calm"). Claimed the frontier ticket — the build child. The build IS the prototype; calibration gate #88 judges calm.

Pre-flight repairs: both ticket bodies referenced @wf21-build.md / @wf21-calib.md assets that never uploaded (asset endpoint 500s server-side at charting time — same failure reproduced this session). Recovered both specs from the charting session's scratch files and baked them into the ticket bodies via API PATCH (verified round-trip). Claimed #87 (assignee AlexKucera, verified via GET).

The build (all ACs from the ticket body):

  • AppGateState.isFocused — transient like reading mode (#68): per-launch, no persistence, fresh open lands unfocused.
  • View ▸ Toggle Focus Mode (CommandGroup after .toolbar, beside Toggle Reading Mode per #84) + ⌘⇧F. Disabled when no post open and no draft — but exit stays armed while focused (trashing the open post from the library overlay must not trap the user in focus).
  • WorkspaceView: rail recedes, pane takes full width. PostsPaneView: library + mentor columns recede. PostEditorView: toolbar row recedes; editor ground swaps surface → workspace background (NSColor twin DesignTokens.workspaceBackground — SwiftUI Color can't cross into NSTextView).
  • FocusChrome.swift (new): HoverZone (NSTrackingArea edge strip, 14pt, hitTest → nil — hover never steals clicks), FocusOverlayPanel (slide-in overlay: easeOut 0.2s in / easeIn 0.15s out, 140ms hide grace covering the zone→panel transit; floats OVER the measure, never pushes it), CaretCentering (soft caret centering).
  • Left-edge hover slides rail+library back in (library only when window ≥1100px — #17's width collapse is not overridden); right-edge hover slides the mentor back in.
  • Soft caret centering: ±60pt comfort band around the visible center, textDidChange only (scrollback and drag-selection never fought), animated clip-view scroll (0.18s), document clamp parks at the bottom — no jump when typing at the document end.
  • PostsLibraryColumn extracted from PostsPaneView — one library implementation serving both the unfocused layout and the focus overlay (rename sheet + context menu travel with it).
  • Save failure loud in focus: the full SaveStateDot-shaped widget (6px dot + "Save failed") reappears as a floating top overlay when saveState == .failed; #67 conflict alert unchanged; autosave runs underneath.
  • ⌘S moved from the toolbar into the body-level background — it stays armed with the toolbar hidden (drafts have no autosave; ⌘S is their only save path).
  • Focus × reading orthogonal: independent state axes; ⌘R works in focus, ⌘⇧F works while reading.
  • FocusModeTests.swift (5 tests): the centering band math pinned — in-band no-op, below/above-band recenter, bottom clamp (parks then no-ops), short-document floor.

Verification

  • Build green: xcodebuild build — BUILD SUCCEEDED.
  • Tests green: full suite (MuseionTests + UI tests) — TEST SUCCEEDED, FocusModeTests 5/5 passed.
  • swiftformat + swiftlint clean on all touched files (PostEditorView's file-length + tv identifier warnings pre-exist on main; my change grows the file 424→483).
  • Old AC2 verified: width-collapse logic (showsLibrary/showsMentor) untouched, focus overlay respects it.
  • AC3: no typography work (inherits ProseTypography + reading.css per #78).

Notable decisions

  • Overlay, not push: revealed panes float above the measure — the measure never moves (charting contract).
  • No Esc exit (rejected at charting) — the toggle (menu/⌘⇧F) is the only way out.
  • Calibration knobs live in FocusChrome.swift constants (band 60pt, zone width 14pt, animation curves, 140ms grace) — the fog's polish ticket can dial them without archaeology.

Deviations / follow-ups

  • Asset endpoint 500s server-side — tickets now carry their specs in-body (repaired for #87 and #88). Charting sessions should verify uploads.
  • Visual pass owed: the surface renders (build+tests green) but the calm judgment is the calibration gate #88 — Alexander writes on the pinned corpus and rules. Animation feel and hover-zone sizing are the named fog knobs.
  • PostEditorView at 483 lines vs swiftlint's 400 cap (pre-existing 424): candidate for the next drive-by split (ProseTextView representable → own file).

[Generated by AI]