Repository navigation
refactor(config): nest grid-style options into group records (#118) - #177
Merged
Merged
Conversation
The flat 78-arity GridStyleOptions record forced a wide flatten/unflatten surface: two mappers, a color-enumerating validator, and a x3 view-model mirror (property declarations, Seed, BuildRecord) all had to name every field. Slice 3 of the #118 grid-style debloat replaces it with a one-level nested root composing 10 group records, so each reader touches only the group it needs. - GridStyleOptions is now a nested root: Fonts, Layout, Selection, ChangedCells, ReadOnlyCells/DisabledCells (one shared DepthPalette), Execution, StatusBar, ValidationPanel, Chrome, plus root Orientation. - Both mappers rebuilt as per-group construction, preserving the exact fallback regimes: whole-DTO-null returns Default; ?? defaults per field for the loose groups; a no-fallback ! chain for the three validator-guaranteed cell palettes; Orientation via Parse. grid_line folds into Chrome.GridLine and the changed/changed_selected pair into ChangedCellColors, matching the DTO cross-sections. - All grid and style-editor consumers read the nested paths; the view model's Seed/BuildRecord rebuild each group positionally. - The slice-1 silent-drop guards are adapted to the nested record (a hand-maintained property-to-path map plus a typed recursive leaf walk) and their non-vacuity re-proven. The on-disk YAML, the DTOs, and GridStyleValidator are byte-identical; only the record shape and its readers change. Default is byte-equal to the old flat Default, so the record round-trips losslessly through the unchanged file format. Colors stay string (StyleColor is slice 4) and the view model's public property surface is unchanged (the split is slice 5); #118 stays open. 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 flat 78-arity
GridStyleOptionsrecord forced a wide flatten/unflatten surface across the grid-style stack: two mappers, a color-enumerating validator, and a ×3 view-model mirror (property declarations,Seed,BuildRecord) each had to name every one of the 78 fields. A field surfaced in one block but dropped from another compiled fine and silently misbehaved. Slice 3 of the #118 grid-style debloat replaces the flat record with a nested shape so each reader touches only the group it needs.What changed
GridStyleOptionsis now a one-level nested root composing 10 group records + rootOrientation:GridStyleFonts,GridStyleLayout,SelectionColors,ChangedCellColors,DepthPalette(one type reused forReadOnlyCellsandDisabledCells),ExecutionPalette,StatusBarStyle,ValidationPanelStyle,ChromeColors.return Default;?? defaults.<group>.<field>for the loose groups (fonts/layout/selection/changed/grid_line/status_bar/validation_panel/chrome); a no-fallback!chain for the three validator-guaranteed cell palettes (readonly/disabled/execution);OrientationviaParse.colors.grid_linefolds intoChrome.GridLine;colors.cells.changed/changed_selectedintoChangedCellColors— the two DTO cross-sections the one-level nesting absorbs into the mapper.Seed/BuildRecordrebuild each group positionally (a dropped field is now a compile error, CS7036).Orientationa first-class leaf — and their non-vacuity re-proven by scratch checks.Deliberately out of scope (later slices): colors stay
string(StyleColoris slice 4); the view model's public property surface is unchanged (the split is slice 5). The on-disk YAML, the DTOs, andGridStyleValidatorare byte-identical.Verification
dotnet build SemiStep.slnx— 0 warnings, 0 errors;dotnet test— 1687 passed, 0 failed;dotnet formatclean.Defaultis byte-equal to the old flatDefault, so the nested record round-trips losslessly through the unchanged file format (SaveThenLoad_DistinctFixture, record→dto→yaml→dto→record, green).BuildRecordcross-wire →BuildRecord_PerturbingEachProperty…RED; a droppedSeedline →Seed_PopulatesEverySurfacedProperty…RED; a droppedGridStyleDtoMapperline →SaveThenLoad_DistinctFixtureRED.with-mechanism comments corrected, 10 restatement banners removed.grid_style.yamlduring testing was discarded (config file unchanged on the branch).Slice 3 of #118 (stays open). Next: slice 4 introduces
StyleColorand folds the validator's per-key checks into the mapper.Per-task commits before collapse
🤖 Generated with Claude Code