The post-gate main surface is the workspace shell from the design
contract: nav rail (Posts/Sessions/Learnings/Settings), Posts pane
mirroring <home>/posts/ on disk (Pass State groups, origin meta,
empty state; lazy folders skipped), Settings pane with repoint-only
Home picking (NSOpenPanel + UserDefaults, default ~/Documents/Museion
per b3daac9), placeholder panes until #28/#26. Column collapse
mirrors the export's media queries so narrow windows never clip.
Mentor pane becomes the fourth column (#14 surface preserved).
[Generated by AI]
5.8 KiB
5.8 KiB
M1: Home & Posts list (#17)
Date: 2026-10-01 Type: issue Reference: #17
Goal
Ship #17 (S1.1): the workspace shell from the design contract — nav rail (Posts, Sessions, Learnings, Settings), Posts pane mirroring the Home's posts/ on disk with empty state, Home editable in Settings with repoint-only semantics, placeholder panes for Sessions/Learnings.
What Was Done
DesignTokens.swift— palette + geometry extracted frommuseion-workspace.html(:rootvars, grid columns 56/232/min-420/356, radii 10/14, serif/mono designs).WorkspaceView.swift— post-gate root surface: nav rail + pane switch;RailButtonwith the export's selected-card + edge-bar treatment; honest placeholders for Sessions (#28) / Learnings (#26, #27).PostsPaneView.swift— Posts destination with Pass State group labels, post rows (title + mono meta), empty state, editor placeholder (#19–#21), mentor column (MentorPaneViewat 356).PostLibrary.swift—PostLibrary.scan(home:): mirrorsposts/(dirs withpost.mdonly — lazy folders and noise skipped), lenient frontmatter (pass_state/origin, First Draft/writer defaults), Title = first non-empty line after frontmatter with#stripped,untitledfallback.SettingsPaneView.swift— Home row + NSOpenPanel repoint; repoint-only copy in-UI.AppGateState.museionHome— UserDefaults-backed, default~/Documents/Museion(main'sb3daac9default, not the old~/Museionfrom the issue text).MentorPaneViewroot min-frame dropped (it's a column now).- Tests (+7): PostLibraryTests — bare post defaults, lenient frontmatter, empty/missing home, lazy-folder + noise exclusion, title sort, untitled edges, default Home.
Decisions & Rationale
| Decision | Rationale |
|---|---|
| Column collapse instead of a fat minWidth | First build forced rail+library+editor+mentor minWidth (1064); the restored 900pt window clipped the rail and mentor off-screen (user hit it live). The export collapses at media-query thresholds (≤1100 library, ≤920 mentor); PRD says map that to macOS pane collapse. GeometryReader budget drives showsLibrary/showsMentor. |
Lenient frontmatter read (pass_state/origin keys, defaults) |
Corpus posts ship bare; the write-side key format is #18's to pin. CONTEXT.md: Pass State explicit, never inferred — First Draft default is the honest read of a bare post. |
| UserDefaults for the Home | A Home is a plain folder the user points at — nothing app-owned worth a database. Same floor as state.json reasoning. |
| NSOpenPanel over fileImporter | fileImporter's folder mode still shows files on macOS; one proven AppKit call beats bridging workarounds. |
Explicit AppGateState.init() |
Self in a stored-property initializer trips @ObservationTracked (covariant-Self compile error). |
Scan on .task(id: home) only |
#17 is read-only; no FS events yet — #18 adds lifecycle (create/rename/delete round-trips) and re-scan triggers. |
Gotchas & Fixes
| Problem | Root Cause | Fix |
|---|---|---|
| Empty posts list despite defaults write | defaults write from the agent's shell lives in a different cfprefsd context than the open-launched app; plist on disk never got the key |
Verified scan logic standalone (swift REPL finds both posts); user-path verification (Settings → Choose…) is the honest route — CLI defaults injection is unreliable for GUI apps |
| Rail icons "invisible" in early screenshots | 900pt restored window < 1064 minWidth → HStack laid out at min size, clipping both edges | Column collapse (above) |
localizedStandardCompare order surprise |
It's Finder-like (case-insensitive, numeric-aware): "Beta 2" < "beta 10" | Test expectation corrected — the code is right |
| SwiftFormat reformatting drive-by (944-line prototype diff) | Ran swiftformat . repo-wide |
Reverted untouched files; formatted only changed files after |
AppleScript by reserved word |
set {bx, by} to position — by is an AppleScript term |
Renamed to btnPos/btnSize |
Verification
- Build:
xcodebuild … build→ BUILD SUCCEEDED - Tests: full suite → TEST SUCCEEDED, 52/52 passed (45 pre-existing + 7 new)
- Lint:
swiftlint Museion/ MuseionTests/→ 0 violations; SwiftFormat clean on changed files - Live: app launched, gate sheet passed and dismissed via AX, workspace rendered (rail/Posts/editor/mentor verified by screenshot); window-resize collapse fix built but final visual pass blocked by a fullscreen break timer — needs one manual look
Files Changed
| File | Change Summary |
|---|---|
Museion/DesignTokens.swift |
New — design-contract tokens |
Museion/WorkspaceView.swift |
New — nav rail + pane shell, collapse logic |
Museion/PostsPaneView.swift |
New — library column, groups, empty state, editor placeholder |
Museion/PostLibrary.swift |
New — disk scan + lenient frontmatter |
Museion/SettingsPaneView.swift |
New — Home repoint via NSOpenPanel |
Museion/MuseionApp.swift |
AppGateState.museionHome + default |
Museion/ContentView.swift |
Post-gate root → WorkspaceView |
Museion/MentorPaneView.swift |
Root min-frame dropped |
MuseionTests/PostLibraryTests.swift |
New — 7 tests |
Museion/AGENTS.md, MuseionTests/AGENTS.md |
Contracts updated |
Open Items & Next Steps
- Manual look at the collapse behavior at narrow widths (break timer blocked the final screenshot pass)
- #18 Post lifecycle — New Post button, lazy folder creation, slug naming, rename/delete round-trips; pins the frontmatter key format written on save
- Mentor engine crash on workspace entry — pre-existing #14 behavior (drift note also visible); not #17 scope but worth a #28 look when Sessions land
Log written by write-log skill