Repository navigation
refactor(config): split grid-style editor VM into drafts (#118) - #179
Merged
Merged
Conversation
The grid-style editor view model declared its ~77 style fields three times over: property declarations, a Seed method, and a with-based BuildRecord. A field dropped from BuildRecord compiled fine and silently reverted on save. Slice 5 (the last of #118) replaces the monolith with a thin parent plus one small ReactiveObject draft per group, where field omission stops being representable. - Nine draft classes, one per group record (DepthPaletteDraft serves both ReadOnlyCells and DisabledCells). A draft's property initializers are the seed, read from the group record; its Build() constructs the record positionally, so an omitted field is a compile error (CS7036), not a silent revert. - The parent VM shrinks to draft wiring: ten reactive draft properties, ReplaceDrafts (seed + swap the CanSave subscriptions on load), a BuildRecord of ten Build() calls plus Orientation, and CanSave as the numeric-range checks only. SaveCommand, the load failure path, and error routing are behavior-identical. - All 77 AXAML binding paths become grouped Group.Leaf form, compile-checked against the window x:DataType (a bad path fails the build, AVLN2000). - Validate is removed from IGridStyleEditorFacade: with typed StyleColor a loaded record is valid by construction, so the seam is Load/Save only. - The architecture doc is rewritten as current-state (the interim slice notes and the obsolete "Known gap" section are gone). The guard net moves with the structure: per-draft round-trips catch a wrong-source seed or a wrong Build slot, and the perturbation guard pins the walked leaf count at 77. A dropped field is now CS7036 or AVLN2000 and a miswired one is a red test, proven by the non-vacuity scratch checks. The editor is behavior-preserving and the on-disk YAML is unchanged. This is the final slice: the last hand-maintained full-field list in the grid-style stack is gone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The grid-style editor view model declared its ~77 style fields three times — property declarations, a
Seedmethod, and awith-basedBuildRecord. A field dropped fromBuildRecordcompiled fine and silently reverted on save. This is the fifth and final slice of the #118 debloat; it removes the last hand-maintained full-field list in the stack, so field omission stops being representable.What changed
DepthPaletteDraftserves bothReadOnlyCellsandDisabledCells). A draft's property initializers are the seed (read from the group record); itsBuild()constructs the record positionally, so an omitted field is a compile error (CS7036), not a silent revert.ReplaceDrafts(seed + swap theCanSavesubscriptions on load), aBuildRecordof tenBuild()calls +Orientation, andCanSave= the numeric-range checks only.SaveCommand, the load-failure path, and error routing are behavior-identical.Group.Leafform, compile-checked against the windowx:DataType(a bad path fails the build, AVLN2000).Validateremoved fromIGridStyleEditorFacade— with typedStyleColora loaded record is valid by construction, so the seam isLoad/Saveonly.Verification
dotnet build SemiStep.slnx— 0 warnings;dotnet test— 1727 passed, 0 failed;dotnet formatclean.Build()argument → CS7036; mistype an AXAML path → AVLN2000; miswire a draft initializer → the per-draft round-trip test red; miswire aBuild()slot → the perturbation guard red.new <Draft>(fixture.Group).Build() == fixture.Group,DepthPaletteDraftagainst both palettes) replace the deleted seed guard; the perturbation guard pins the walked leaf count at 77 (asserted, not derived); the re-seed rewiring test proves the subscription swap.SaveThenLoad_DistinctFixture, andGridStyleEditorWindowTestsbyte-identity. The on-disk YAML is unchanged.DraftNumbersguard-dedup, the roadmap Slice-2 status corrected, two null-throw invariant tests, three draft-accessor style alignments, two comment trims.Closes #118
Per-task commits before collapse
🤖 Generated with Claude Code