feat(outline): outline type + outliner — S3 (#109)
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
Dedicated block surface (ADR-0013, #105 variant B): OutlineTree parses/serializes plain nested-bullet markdown leniently and normalizes on save; the outliner promotes one NSTextView over the focused row with LogSeq-style keys (Tab/⇧Tab, ⌥↑/⌥↓ subtree move, ↑/↓ hop, ⇧↑/⇧↓ block selection, ⌘↑/⌥↓ fold, Enter split), folds session-scoped by runtime node UUID. New Outline ⇧⌘N stages a type: outline draft through the existing autosave/conflict machinery; reading renders the serialized markdown unchanged. Outline rows use the body face at its natural line box — the prose CSS-1.8 lineHeightMultiple grew the focused row and detached the bullet (test-pinned). Finish-audit fixes included: paste-multiline sanitizing at setText, dead Enter disjunct, dead Row.path. Closes #109
This commit is contained in:
1 parent
e55747e7fe
commit
c23ee0f62f
21 files changed
+1809
-21
No files matched your search
@@ -115,6 +115,31 @@ private func readPost(_ home: URL, _ id: String) throws -> String {
|
||||
#expect(scanned.first?.project == "essays")
|
||||
}
|
||||
|
||||
@Test func `writeNew with type outline stamps scans back and lands in the project`() throws {
|
||||
let home = try storeHome()
|
||||
let post = try PostStore.writeNew(body: "- Root\n\t- Child", project: "essays", type: .outline, home: home)
|
||||
|
||||
#expect(post.type == .outline)
|
||||
#expect(post.id == "root")
|
||||
#expect(post.project == "essays")
|
||||
#expect(FileManager.default.fileExists(atPath: home.appendingPathComponent("projects/essays/root/post.md").path))
|
||||
// #59 stamp with type first, outline rawValue.
|
||||
#expect(try readPiece(home, root: "projects", project: "essays", post.id)
|
||||
== "---\ntype: outline\npass_state: First Draft\norigin: writer\n---\n- Root\n\t- Child")
|
||||
|
||||
// The #17 reader round-trips the outline type and the project.
|
||||
let scanned = try #require(Post.scan(home: home).first)
|
||||
#expect(scanned.type == .outline)
|
||||
#expect(scanned.project == "essays")
|
||||
}
|
||||
|
||||
@Test func `writeNew default still stamps type post`() throws {
|
||||
let home = try storeHome()
|
||||
let post = try PostStore.writeNew(body: "# Plain\n", home: home)
|
||||
#expect(post.type == .post)
|
||||
#expect(try readPost(home, post.id).hasPrefix("---\ntype: post\n"))
|
||||
}
|
||||
|
||||
@Test func `rename retitles moves folder and keeps frontmatter`() throws {
|
||||
let home = try storeHome()
|
||||
let original = try PostStore.writeNew(body: "# Old Name\n\nBody.", home: home)
|
||||
|
||||
Reference in new issue
Block a user