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.
This commit is contained in:
AlexKucera committed 2026-10-09 11:11:36 +02:00
1 parent 99aa3d2faf
commit b0ab800d3d
12 files changed
+550 -98

No files matched your search

@@ -0,0 +1,47 @@
# 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).
[Generated by AI]
+1
View File
@@ -5,6 +5,7 @@ Complete history of session logs in this directory, newest first. One-line summa
<!-- write-log: full-index -->
| Date | Type | File | Summary |
|------|------|------|---------|
| 2026-10-09 | issue | [20261009-issue87-focus-mode_log.md](20261009-issue87-focus-mode_log.md) | #87 focus mode: pane/toolbar recession, hover overlay reveal, soft caret centering — full suite green, calibration gate #88 next |
| 2026-10-08 | issue | [20261008-issue84-view-menu-doubled_log.md](20261008-issue84-view-menu-doubled_log.md) | #84 single View menu: CommandMenu → CommandGroup(after: .toolbar), menu-count pin test — 105 tests green |
| 2026-10-08 | issue | [20261008-issue83-save-indicator-honesty_log.md](20261008-issue83-save-indicator-honesty_log.md) | #83 honest save dot: Changed while dirty, Saving… deleted, sticky failed, vanished-disk keepLocal fix — 106 tests green |
| 2026-10-08 | issue | [20261008-issue77-editing-parity_log.md](20261008-issue77-editing-parity_log.md) | #77 editing parity: reading-mirrored presenter (30/22/19 ladder, inline traits, 66ch measure), fence-staleness audit fix — 104 tests green |