CI / ci (push) Canceled after 0s
Pieces re-root from posts/<id>/ to projects/<name>/<id>/ with an archive/ twin root (ADR-0012): scan walks both levels, New Piece and Import land in the selected project else the default posts, the slug namespace is global across projects and archive (an archived slug is never reused), and every piece carries type: post frontmatter — stamped by New/Import, read leniently (absent or unknown reads as post), the file stays post.md for every content type. Write paths resolve the folder from the id alone (folder(of:)); sessions and sidecars never thread (project, id). Finish-audit hardening: duplicate ids on disk (Finder copy) dedupe in scan to the same first-match folder(of:) writes to; folder(of:) skips hidden/symlinked projects like scan does. Dev posts moved by hand to projects/posts/ — no migration machinery, the app never reads the old posts/ root (#103). Full suite green (128 unit + UI), swiftlint clean on changed files. Closes #107
63 lines
1.7 KiB
Swift
63 lines
1.7 KiB
Swift
//
|
|
// SettingsPaneView.swift
|
|
// Museion
|
|
//
|
|
// #17 (S1.1): Settings — the Museion Home path, repoint-only (ADR-0004).
|
|
// #72 rework: the Typography + Text Flow sections are gone — single-user
|
|
// app, prose typography is hardcoded (editing: ProseTypography constants;
|
|
// reading: Museion/Resources/reading.css, editable while the app runs).
|
|
//
|
|
|
|
import AppKit
|
|
import SwiftUI
|
|
|
|
/// Settings pane. Home control per #17.
|
|
struct SettingsPaneView: View {
|
|
@Binding var home: URL
|
|
|
|
var body: some View {
|
|
ScrollView {
|
|
VStack(alignment: .leading, spacing: 24) {
|
|
contentSection
|
|
}
|
|
.padding(24)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
|
}
|
|
.background(DesignTokens.background)
|
|
}
|
|
|
|
// MARK: Home (#17)
|
|
|
|
private var contentSection: some View {
|
|
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 projects/ and archive/ directories.",
|
|
)
|
|
.font(.callout)
|
|
.foregroundStyle(DesignTokens.muted)
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|