Build Edit mode with debounced, byte-honest saves
The editing surface: the same hosted TextKit-1 text view gains an editable branch with a per-keystroke line-scanner highlighter — chosen over a parser re-parse because a mid-typing buffer is usually invalid Markdown and 05 wants the delimiters themselves dimmed; apply only sets attributes, so presentation-never-transforms is structural. Saves ride a ~700ms injectable debounce through BoardWriter.writeBody — toggleTaskMarker's idiom widened to the body span, frontmatter bytes untouched, refusing to write when disk already holds that body, which enforces all three gates (untouched, reverted, echo) at the layer that owns the bytes with one isDirty predicate above it. Mode grammar lands whole: ⌘E toggles with a checkmark, Return in Preview enters, Escape returns, and every flip flushes first; window close flushes through the existing retry/save-copy/discard modal, and the dismissal flush deliberately reaches a tombstoned card. Dirty-buffer-wins: disk always follows the snapshot, the buffer only when clean, both surfaces render the buffer. Undo is the editor's own session-scoped NSUndoManager; endEditSession names the pro-m1 one-commit-per-session boundary. Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
@@ -646,6 +646,12 @@ public final class BannerCenter {
|
||||
// the read that preceded the flip learned its title, so a body write that refused says
|
||||
// *which* card refused it — a card window is not always the frontmost thing on screen.
|
||||
if let title { "Couldn't tick the checkbox in '\(title)'" } else { "Couldn't tick the checkbox" }
|
||||
case let .editBody(title):
|
||||
// **Save**, because that is the word for what just failed: the Edit→Preview flip is the
|
||||
// effective Save button (05-card-window.md ▸ Edit), and the debounced tick is the same
|
||||
// act happening on its own. The keystrokes are still in the buffer — the banner says the
|
||||
// app could not put them on disk, not that they are gone.
|
||||
if let title { "Couldn't save '\(title)'" } else { "Couldn't save the card" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user