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

+58 -24
View File
@@ -24,30 +24,34 @@ struct WorkspaceView: View {
}
var body: some View {
@Bindable var gate = gate
return GeometryReader { geo in
HStack(spacing: 0) {
navRail
paneBorder
switch selection {
case .posts:
// #14: mentor column hands in the app-scoped model + gate's winner.
// Column collapse mirrors the export's media queries (library ≤1100,
// mentor ≤920) as macOS pane collapse per the PRD.
PostsPaneView(
home: gate.museionHome,
mentor: gate.mentor,
mentorBinaryPath: gate.gateModel.currentBinaryPath,
model: gate.posts,
availableWidth: geo.size.width - DesignTokens.railWidth,
)
case .sessions:
PlaceholderPane(title: "Sessions", detail: "Session lifecycle arrives with S2.3 (#28).")
case .learnings:
PlaceholderPane(title: "Learnings", detail: "Promote, consult, and decay arrive with S4 (#26, #27).")
case .settings:
SettingsPaneView(home: $gate.museionHome)
GeometryReader { geo in
Group {
if gate.isFocused {
// #21: the rail recedes; the pane takes the full width. The
// measure stays centered — revealed panes float, never push.
paneContent(geo)
} else {
HStack(spacing: 0) {
navRail
paneBorder
paneContent(geo)
}
}
}
// #21: left-edge hover slides rail+library back in as an overlay.
// Library only while the window width allows it (#17 verdict stands:
// a collapsed pane is not summoned by focus).
.overlay {
if gate.isFocused {
FocusOverlayPanel(edge: .leading, panelWidth: leftRevealWidth(geo)) {
HStack(spacing: 0) {
navRail
paneBorder
if geo.size.width >= 1100 {
PostsLibraryColumn(home: gate.museionHome, model: gate.posts)
}
}
}
}
}
.background(DesignTokens.background)
@@ -56,6 +60,36 @@ struct WorkspaceView: View {
.frame(minWidth: 480, minHeight: 320)
}
@ViewBuilder
private func paneContent(_ geo: GeometryProxy) -> some View {
@Bindable var gate = gate
switch selection {
case .posts:
// #14: mentor column hands in the app-scoped model + gate's winner.
// Column collapse mirrors the export's media queries (library ≤1100,
// mentor ≤920) as macOS pane collapse per the PRD.
PostsPaneView(
home: gate.museionHome,
mentor: gate.mentor,
mentorBinaryPath: gate.gateModel.currentBinaryPath,
model: gate.posts,
availableWidth: geo.size.width - DesignTokens.railWidth,
)
case .sessions:
PlaceholderPane(title: "Sessions", detail: "Session lifecycle arrives with S2.3 (#28).")
case .learnings:
PlaceholderPane(title: "Learnings", detail: "Promote, consult, and decay arrive with S4 (#26, #27).")
case .settings:
SettingsPaneView(home: $gate.museionHome)
}
}
/// The left reveal panel's width: rail + border (+ library when the window
/// width still grants it — the unfocused verdict, not the focused budget).
private func leftRevealWidth(_ geo: GeometryProxy) -> CGFloat {
DesignTokens.railWidth + 1 + (geo.size.width >= 1100 ? DesignTokens.libraryWidth : 0)
}
/// 1px contract border between rail and pane (`.rail { border-right }`).
private var paneBorder: some View {
Rectangle()