refactor(workspace): finish-audit fixes — off-main scan, parser edges, dead code out
Reviewers' findings on 804b588: scan moved off MainActor (Task.detached),
PostLibrary struct folded into Post.scan, hidden dirs and symlinked dirs
now actually skipped (test de-vacuated), unterminated frontmatter no longer
leaks as the Title, quoted YAML values unquoted, leading blank line before
--- tolerated, #-only body reads untitled, persisted Home validated
isFileURL. Dead code deleted: radiusLarge, editorMinWidth, homeKey,
PaneHeader trailing slot, Settings ScrollView, PostRow fill dance.
Tests 56/56, lint 0.
[Generated by AI]
This commit is contained in:
1 parent
804b5889f6
commit
765d32d4d4
10 files changed
+158
-101
No files matched your search
@@ -24,7 +24,8 @@ final class AppGateState {
|
||||
let mentor = MentorSessionModel()
|
||||
/// #17: the Museion Home — repoint-only (ADR-0004). Defaults to
|
||||
/// `~/Documents/Museion`; UserDefaults is the persistence floor: a Home is
|
||||
/// a plain folder, nothing app-owned to put in a database.
|
||||
/// a plain folder, nothing app-owned to put in a database. Non-file URLs
|
||||
/// read back as nil (the default wins) — the Home is always a folder.
|
||||
var museionHome: URL {
|
||||
didSet { UserDefaults.standard.set(museionHome.absoluteString, forKey: "museionHome") }
|
||||
}
|
||||
@@ -32,7 +33,9 @@ final class AppGateState {
|
||||
init() {
|
||||
// Explicit init: `Self` in a stored-property initializer trips
|
||||
// @ObservationTracked's macro expansion (covariant Self).
|
||||
museionHome = UserDefaults.standard.string(forKey: "museionHome").flatMap(URL.init(string:))
|
||||
museionHome = UserDefaults.standard.string(forKey: "museionHome")
|
||||
.flatMap(URL.init(string:))
|
||||
.flatMap { $0.isFileURL ? $0 : nil }
|
||||
?? Self.defaultMuseionHome
|
||||
}
|
||||
|
||||
@@ -40,8 +43,6 @@ final class AppGateState {
|
||||
/// (b3daac9: Documents, not the account root; TCC note in ADR-0004).
|
||||
nonisolated static let defaultMuseionHome = FileManager.default.homeDirectoryForCurrentUser
|
||||
.appendingPathComponent("Documents/Museion", isDirectory: true)
|
||||
|
||||
private static let homeKey = "museionHome"
|
||||
}
|
||||
|
||||
@main
|
||||
|
||||
Reference in new issue
Block a user