Conversation
Comment hygiene (advisory)No comment-style violations in the lines this branch adds since |
mark-sil
marked this pull request as ready for review
August 20, 2026 20:47
mark-sil
marked this pull request as draft
August 20, 2026 20:50
mark-sil
marked this pull request as ready for review
August 20, 2026 20:58
Store a per-field writing-system restriction in the project view override. Note: Nothing writes this operation at runtime yet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1097 +/- ##
==========================================
+ Coverage 38.33% 38.35% +0.01%
==========================================
Files 1507 1507
Lines 350580 350621 +41
Branches 40293 40300 +7
==========================================
+ Hits 134410 134473 +63
+ Misses 186941 186921 -20
+ Partials 29229 29227 -2
🚀 New features to boost your workflow:
|
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.
A project view override can now store a per-field writing-system restriction. The differ captures a changed
VisibleWritingSystemsset as a newSetVisibleWritingSystemsoperation, the JSON wire format round-trips it, and the applier writes it onto the rebuilt node.Nothing writes this operation at runtime yet. The RecordEditView mirror that records the user's Writing Systems menu choice ships separately: the mirror is the piece a native command layer would delete, while this storage layer survives either answer to the open adapter-direction question — which is why it lands alone. The review question here is narrower than the diff suggests: does the new operation round-trip losslessly, and does a bad patch file fail safely?
Where to look:
Diff→Applyreproduces a restriction and clears one —RoundTrip_DiffThenApply_ReproducesCustomized_WritingSystemRestriction/_ClearedRestrictionComesBackNull.DetailComposer.ApplyVisibleWritingSystemsresolves them —Diff_CaseOnlyWritingSystemDifference_EmitsNoOp.ReadStringListguard now covers both string-list lanes (writingSystemsand the previously unguardedchildOrder) —Deserialize_NullChildOrderEntry_Throws.override-added-ws-restriction-droppedinstead of losing it silently.Deliberately not here:
formatVersionstays 1 (see the deferred accordion).Based directly on
main(originally stacked on #1096, since merged; the branch was rebased and the diff is unchanged). Verified:build.ps1 -CommentHygieneclean; 76/76 targeted FwAvaloniaTests green. Manual testing deferred to the mirror PR, when a UI write path exists.Reading this a year from now — start here
This PR is the storage half of LT-22691's "commit 4", split so the part that survives the adapter-direction decision (this) is not held hostage by the part that decision could delete (the RecordEditView mirror). The working review record was produced in-session and lives in this description; the
.review/folder is gitignored by design, so this is the only durable copy.Decisions, and why
ViewNode.VisibleWritingSystemsnever holds an empty list on any path. Today's composer treats both alike; the normalization exists so no future consumer ever sees the ambiguous state.OrdinalIgnoreCasefor tag comparison.DetailComposer.ApplyVisibleWritingSystemsresolves tags case-insensitively, so anOrdinaldiffer would emit operations for layouts that render identically — a render-identical project would carry a persistent non-empty override file, defeating empty-patch cleanup. StableId comparisons elsewhere in the differ deliberately stayOrdinal; the two comparers are correct for different domains, which is why the two list-compare sites were not unified.childOrderlane read the same JSON shape as the newwritingSystemslane but let a null entry through to crash at compose time — where a broad catch degrades the layout to the first-slice fallback persistently. Both lanes now read through one validating helper that fails the load withInvalidDataException, which the store quarantines cleanly (logged, shipped definition used).override-added-ws-restriction-droppedkeeps the differ's "unrepresentable edits become diagnostics" contract truthful without growing the AddNode wire shape while nothing exercises it.Deferred, and what would unblock it
visibleWritingSystemson AddNode ops (so an added node's restriction survives Diff→Apply): unblocked whenViewDefinitionOverrideMigratorgets a production caller — today the drop is reported as a diagnostic and no product path produces the input..viewoverride.jsondoes not travel through Send/Receive), and bumpingformatVersionwould be strictly worse (old readers would reject every new file). Skipping unknown ops with a diagnostic is the remedy; it changes forward-compat semantics for the whole format and deserves a deliberate design call.setVisibility/setLabelsince the applier existed; only hand-authored patches can produce the input. Unblocked if the field menus ever operate on added/duplicated nodes.Preflight review details
This branch went through an adversarial review in-session: 8 independent finder angles (line-by-line, removed-behavior, cross-file tracing, reuse, simplification, efficiency, altitude, repo conventions), 23 raw candidates deduplicated to 12, each verified by its own agent. Results: 9 CONFIRMED, 1 PLAUSIBLE, 1 REFUTED (write-path asymmetry — no producer can construct the bad input today), 1 resolved by a later fix in the same review cycle.
Fixed before this PR (each with a locking test where behavior changed):
Ordinalwhile the composer matchesOrdinalIgnoreCase— fixed,Diff_CaseOnlyWritingSystemDifference_EmitsNoOp.childOrderJSON lane accepted null entries that crashed at compose time — fixed via sharedReadStringList,Deserialize_NullChildOrderEntry_Throws.Diff_AddedNodeWithWsRestriction_ReportsDiagnostic.ViewNodeconstructions unified behindWsFieldNode; a provably-dead assertion disjunct replaced withIs.Null.Deferred with reasons (see the accordion above): AddNode restriction carriage, per-op unknown-kind skip, patch-created-id set-ops. Dropped: missing-
idexception type (pre-existing for every op kind; the store catches broadly).Validation:
.\build.ps1 -CommentHygieneclean;.\test.ps1 -CommentHygiene -TestProject "Src/Common/FwAvalonia/FwAvaloniaTests" -TestFilter "FullyQualifiedName~ViewDefinitionOverride"— 76/76 passed. UTF-8 BOM state verified unchanged on all five files. Manual testing deferred to the mirror PR: nothing populatesVisibleWritingSystemsat runtime yet, so the read path is only reachable via hand-authored patch files; a six-scenario manual recipe (restriction, order, casing, clear, coexistence with the Field Visibility write path, corruption quarantine) is recorded for that PR.🤖 Generated with Claude Code
This change is