feat(posts): import & external markdown — S1.1 (#22)
CI / ci (push) Canceled after 0s

External .md/.markdown opens and edits as-is in a single guest slot
(File > Open... Cmd+O, drag-onto-window): SessionTarget extends
EditorSession to write in place verbatim, no cursor sidecar, the #67
conflict alert reused for foreign files. Import... (Shift+Cmd+O)
copies multi-select files in as Posts behind ONE Origin ask
(writer default, immutable); external frontmatter keys ride verbatim
with pass_state/origin set; slug/collision machinery shared with
writeNew.

Audit fixes folded in: BOM stripped + CRLF normalized at the trust
boundary (a CRLF pair is one Swift grapheme — \n splits saw one
line); unreadable files refuse to open (loadFailed — a failed read
never becomes a write); dropped web links and severed symlinks
guarded; ~24 lines of reviewer-flagged dead weight removed.

7 new tests; full unit + UI suite green; swiftlint clean.

Map #22 stays open pending the live calibration pass (#88 posture).
This commit is contained in:
AlexKucera committed 2026-10-12 17:00:03 +02:00
1 parent 683d697367
commit 0f1c4ef4fe
14 files changed
+691 -49

No files matched your search

+11 -4
View File
@@ -126,7 +126,8 @@ struct PostEditorView: View {
Button("Reload") { session?.reloadFromDisk() }
Button("Keep Local") { session?.keepLocal() }
} message: {
Text("post.md changed outside Museion. Reload discards your unsaved edits; Keep Local overwrites the file on the next save.")
Text("\(session?.fileURL?.lastPathComponent ?? "post.md") changed outside Museion. "
+ "Reload discards your unsaved edits; Keep Local overwrites the file on the next save.")
}
}
@@ -241,10 +242,16 @@ struct PostEditorView: View {
private var crumb: String {
if let session {
"posts / \(session.postID) / post.md"
} else {
"unsaved draft — no folder until first save"
if let fileURL = session.fileURL {
// #92: the external guest — the crumb shows the file name in
// the same muted mono style.
return fileURL.lastPathComponent
}
if let id = session.postID {
return "posts / \(id) / post.md"
}
}
return "unsaved draft — no folder until first save"
}
}