Files
museion/docs/devlog/20261009-issue87-focus-mode_log.md
T
AlexKucera 695ad5e5f9 docs(devlog): #87 follow-up — shortcut saga, audit synthesis
⌥⌘F settled after ⇧⌘F (system-wide collision) and ⌃F (shadows
caret-forward). Audit fan-out fixes recorded; remount trade-off
flagged for the calibration gate. GitNexus counts refreshed.
2026-10-09 11:46:26 +02:00

56 lines
6.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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](https://git.babylondreams.de/AlexKucera/museion/issues/87) — build child of map [#21](https://git.babylondreams.de/AlexKucera/museion/issues/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).
## Follow-up (same day, same session)
**Shortcut settled at ⌥⌘F after three attempts** — the charting probe's "⌘⇧F is free" pin was wrong twice over: ⇧⌘F is taken by a system-wide shortcut on this machine (probe checked NSUserKeyEquivalents + in-app only, not global hotkeys; live report from Alexander), and the first rebind ⌃F shadowed NSTextView's Emacs caret-forward binding (menu key equivalents beat the responder chain — caught by the audit's general reviewer). ⌥⌘F (9c2926f → 1bb3b45). Lesson recorded: a macOS shortcut probe must check global hotkeys AND the Emacs bindings.
**Finish-audit reviewer fan-out (ponytail / security / general) synthesized and applied** (d07d418, tests green): one failure surface in focus (floating chip carries `SaveStateDot(state: .failed)`; the toolbar no longer unhides on failure — both firing stacked two widgets), dirty-draft "⌘S saves" cue in focus (drafts have no autosave; the hint otherwise vanished with the toolbar), mentor reveal honors #17's width verdict (`showsMentor` guard), hidden overlay panels `accessibilityHidden`, `NSColor(DesignTokens.background)` bridge replaces the NSColor twin (the "can't derive NSColor from Color" justification was wrong — macOS 11+), HoverZone width plumbing deleted + `zoneWidth` hoisted as the named calibration knob, manual `updateTrackingAreas()` churn removed, single `>=1100` threshold read in WorkspaceView.
Accepted trade-off (flagged, not fixed): toggling focus remounts MentorPaneView/PostsLibraryColumn — a half-typed mentor prompt or open rename sheet dies on toggle. Recorded on #87 for the calibration pass to feel for.
[Generated by AI]