feat(core): let the catalog write app preferences outside document undo#19
Merged
Merged
Conversation
The property catalog could only write the document. An application preference has no Action, so the seam reported a successful edit and wrote nothing at all — the exact silent failure the catalog exists to remove. What now holds: - One in-memory Settings on PlotxApp is the source of truth; the file is a flush target reached only through persist_settings, which reports a failed write instead of swallowing it. Writing is crate-private, so a caller cannot leave the live value and the file disagreeing. - A commit carries a document action, application preferences, or neither — never a silently empty one. A request that would cross both storages is refused while planning, not split while executing. - Editing a preference adds no undo entry, leaves the document clean, and does not advance the automation revision. - The raster export bound (72–1200 dpi) has one home; Preferences, the export dialog and the property schema read it from there. An out-of-range value is refused naming both the value and the bound, never quietly clamped. Adding another preference means a provider module, one catalog registration and one presentation entry; it selects its storage on the transaction, and the planner still chooses nothing by scope. The Preferences draft stays an in-progress edit rather than a second source of truth, and is realigned before every flush so its debounce cannot overwrite an edit made elsewhere. Deferred: the application target is not enumerated as an automation resource, so properties.set cannot address this preference yet. The shared property-write descriptor is statically marked reversible, and advertising a non-undoing, disk-writing target through it would make that metadata untrue; the effect model has to grow first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The property catalog could only write the document. An application preference
has no
Action, so the seam reported a successful edit and wrote nothing atall — the exact silent failure the catalog exists to remove. Closing that is the
point of this change; raster export resolution is the first preference to go
through it.
What now holds
SettingsonPlotxAppis the source of truth. The file is aflush target reached only through
persist_settings, which reports a failedwrite instead of swallowing it. Writing is crate-private, so no caller can
leave the live value and the file disagreeing.
never a silently empty one. A request that would cross both storages is
refused while planning, not split while executing.
not advance the automation revision.
dialog and the property schema all read it from there. An out-of-range value
is refused naming both the value that was set and the actual bound, never
quietly clamped.
truth, and is realigned before every flush, so its debounce cannot overwrite
an edit made elsewhere.
Adding another preference
A provider module, one catalog registration, one presentation entry. The
provider selects its storage on the transaction; the planner still chooses
nothing by scope, and adding a branch there for a new setting is out of bounds.
Two traps worth knowing before you do.
persist_settingsreports a failed writethrough the status line, so it has to run after any optimistic success message
on the same path or the diagnostic is destroyed. And a preference that reaches
disk only because some later call flushes the whole struct as a side effect is
one reordering away from silently not persisting at all — flush it explicitly.
Deliberately not changed
The application target is not enumerated as an automation resource, so
properties.setcannot address this preference yet. The shared property-writedescriptor is statically marked reversible; advertising a non-undoing,
disk-writing target through it would make that metadata untrue. The effect model
has to grow first, and a half-answer here would be worse than the gap.
AGENTS.mdis unchanged. Both rules this work suggested turned out to beenforceable by machine instead — one by the planning guard and its test, the
other by narrowing write visibility — and that file is read by every session, so
a rule that restates a compiler or a test is a net loss.
Validation
cargo pr-check: all seven gates, both backend configurations.its failure observed, including the two halves that matter most: removing the
preferences arm from the commit turns four of the six export-resolution tests
red, and reordering the zoom flush ahead of its status line turns the zoom
test red.
reloading through a temporary settings file, then confirming the next export
dialog opens at the stored resolution. No test writes the real user settings.
the session and the status line says so.
npm run buildfromdocs/: 67 pages, no warnings.