feat(cold-turkey): the writing lock (#162)
CI / ci (push) Canceled after 0s

Wires #161's goal engine and #160's contract into the app: armed
from a corner dot or View ▸ Start Cold Turkey…, enforced by the
macOS app-kiosk (7-option presentation combo + fullscreen, restored
on completion), readout with hairline + near-goal terracotta, and
a completion note fading back into focus. While held: focus exit,
reading, new buffers, ⌘W/⌃⌘F/⌘N refused (key-code-matched monitor
— character matching is layout/Caps-blind; no .closeItem placement
exists), ⌘Q asks once per #163's ruling. Typing continuity holds by
construction — lock ⇒ focus freezes the branch under the editor and
chrome mounts as overlays only. Arm values type directly (1…1000
words / 1…60 min, defaults 250/5). Nothing persists.

Wayfinder map #158 Build S2; suite 620, flip-verified pins.
This commit is contained in:
AlexKucera committed 2026-11-04 15:58:47 +01:00
1 parent 7b6abb5d65
commit a9e199fce4
16 files changed
+1167 -19

No files matched your search

+36
View File
@@ -341,6 +341,42 @@ final class PostsModel {
draft?.text = text
}
// MARK: - Cold Turkey (#162, map #158)
/// #162: can the writing lock arm on what's open? Mirrors the editor
/// column's branch precedence and outline routing (PostsPaneView) —
/// prose drafts, the external guest, and prose posts qualify; an
/// outline piece never does (#158 settle 11: Posts + drafts, not
/// Outline). Keep the expression in step with the editor branch.
var canArmWritingLock: Bool {
if let draft {
return draft.type != .outline
}
if externalSession != nil {
return true
}
guard let session, session.postID == selectedPostID else { return false }
let outline = session.postID != proseOverridePostID
&& (lastDraftWasOutline || posts.first(where: { $0.id == session.postID })?.type == .outline)
return !outline
}
/// #162: the live whole-document text of the surface the editor is
/// showing — the lock's baseline at Start. The per-keystroke feed
/// rides ProseTextView.onTextChange; this is the arm-time snapshot.
var editorBodyText: String? {
if let draft {
return draft.text
}
if let externalSession {
return externalSession.text
}
if let session, session.postID == selectedPostID {
return session.text
}
return nil
}
/// Explicit Rename = retitle + move (#60). Renaming the open post flushes
/// first (rename reads the file from disk — unflushed edits must land
/// before the move), then reopens a session at the new id. Sets lastError