The board wears a picture — background becomes a mapping, and the window chrome follows it under a thin frost
background is {color:, image:} and only a mapping at every level; the board's image paints the full window under a transparent title bar, with a thin-material frost strip keeping the chrome legible and the standard accommodations intact.
Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
@@ -345,17 +345,21 @@ extension BoardStore {
|
||||
/// the write — or removes the key, which is what "before" means for a field that was not there.
|
||||
///
|
||||
/// A **malformed** prior reads as a removal, and that is the one place an inverse is not
|
||||
/// byte-exact: the app cannot re-emit `background: [a, b]` through a document edit that only
|
||||
/// knows how to set scalars. It is also the case the forward write was designed to clear
|
||||
/// ("choosing any well replaces it" — 03-board-ui.md § Styling ▸ Controls), so the undo lands the
|
||||
/// item on the app's own reading of that field rather than resurrecting a value nothing could
|
||||
/// read.
|
||||
/// byte-exact: the app cannot re-emit `background: [a, b]` — or a hand-written scalar
|
||||
/// `background: green`, which the schema stopped reading when the key became a mapping — through
|
||||
/// a document edit that only writes the shapes the schema names. It is also exactly the case the
|
||||
/// forward write was designed to clear ("choosing any well replaces it" — 03-board-ui.md §
|
||||
/// Styling ▸ Controls), so the undo lands the item on the app's own reading of that field rather
|
||||
/// than resurrecting a value nothing could read.
|
||||
///
|
||||
/// The **mapping** case needs no branch of its own here and gets none: `setStyleValue` edits the
|
||||
/// `color` subkey and leaves the rest (BackgroundField.swift), so an undo on a board with an
|
||||
/// image restores the colour the board had — including restoring it to *absent* — without
|
||||
/// disturbing the image the forward write already preserved. What the inverse does not promise
|
||||
/// is the author's subkey order when the colour was absent before: a restored colour that had no
|
||||
/// pair to go back to is appended, like any newly written subkey.
|
||||
static func restore(_ prior: FieldValue<String>, to key: String, in document: inout FrontmatterDocument) {
|
||||
if let value = prior.value {
|
||||
document.set(key, to: .string(value))
|
||||
} else {
|
||||
document.remove(key)
|
||||
}
|
||||
document.setStyleValue(prior.value, for: key)
|
||||
}
|
||||
|
||||
/// The style fields a gesture actually set — **one entry per dimension it did not `.keep`**, so a
|
||||
|
||||
Reference in New Issue
Block a user