feat(workspace): add M1 Home & Posts list — nav rail, posts mirror, Home repoint (fixes #17)
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]
This commit is contained in:
1 parent
b3daac9486
commit
804b5889f6
15 files changed
+762
-5
No files matched your search
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// SettingsPaneView.swift
|
||||
// Museion
|
||||
//
|
||||
// #17 (S1.1): Settings — the Museion Home path, repoint-only (ADR-0004).
|
||||
//
|
||||
|
||||
import AppKit
|
||||
import SwiftUI
|
||||
|
||||
/// Settings pane. #17 scope: the Home control only — further settings arrive
|
||||
/// with their tickets. Choosing a folder repoints Museion at that root;
|
||||
/// content is never moved.
|
||||
struct SettingsPaneView: View {
|
||||
@Binding var home: URL
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
Text("Content")
|
||||
.font(.system(size: 13, weight: .semibold))
|
||||
HStack(spacing: 8) {
|
||||
Text(home.path(percentEncoded: false))
|
||||
.font(.system(size: 12, design: DesignTokens.mono))
|
||||
.lineLimit(1)
|
||||
.truncationMode(.middle)
|
||||
.textSelection(.enabled)
|
||||
Spacer(minLength: 12)
|
||||
Button("Choose…") { chooseHome() }
|
||||
}
|
||||
Text(
|
||||
"Repoint-only: Museion never moves content. The Posts list reads this folder's posts/ directory.",
|
||||
)
|
||||
.font(.callout)
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
}
|
||||
.padding(24)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
.background(DesignTokens.background)
|
||||
}
|
||||
|
||||
private func chooseHome() {
|
||||
let panel = NSOpenPanel()
|
||||
panel.canChooseDirectories = true
|
||||
panel.canChooseFiles = false
|
||||
panel.canCreateDirectories = true
|
||||
panel.message = "Choose the folder holding your posts. Museion never moves content."
|
||||
if panel.runModal() == .OK, let url = panel.url {
|
||||
home = url
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user