Repository navigation
Conversation
The Avalonia detail view showed every "Publish ... In" row on every record. Those parts are visibility="ifdata", and their slices name a visField (DoNotPublishIn) whose data decides visibility: Publish In displays the publications not excluded, so it always holds Main Dictionary. The view never read visField and judged the displayed field instead. The layout importer now carries visField onto the ViewNode, the JSON serializer and override rebuilds keep it, and the composer judges an ifdata reference-vector row on that field's count. A row with an exclusion shows even though it lists no publications. The Publish Sense In Help test now composes with hidden fields shown, since a sense excluded from nothing no longer shows that row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1234 +/- ##
=======================================
Coverage 40.51% 40.52%
=======================================
Files 1559 1559
Lines 356080 356107 +27
Branches 41586 41588 +2
=======================================
+ Hits 144280 144306 +26
- Misses 182489 182490 +1
Partials 29311 29311
🚀 New features to boost your workflow:
|
VisibilityCount counted the visField property with get_VecSize whatever its type, so a part whose visField named an atomic or string field would read the wrong kind of property. The count now comes from visField only when it is an owning or reference sequence or collection; otherwise the row is judged on the field it displays, as if the part named no visField. No shipped part is affected. DetailComposer.Compose now hands its compiled layout to an internal ComposeModel, so a test can compose a hand-built layout node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thejambi
marked this pull request as ready for review
November 6, 2026 02:44
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.
In the New UI detail view, the "Publish Sense In" and "Publish Example In" rows now appear only when the sense or example is excluded from a publication, or when View > Show Hidden Fields is on, as in the WinForms view. Until now they showed on every record, listing "Main Dictionary", because the new view checked the publications a row lists rather than the exclusions that decide whether it has data.
Reviewer notes
Root cause. These parts are
visibility="ifdata", and their slices inLexSenseParts.xmlandLexEntryParts.xmlnamevisField="DoNotPublishIn". A "Publish ... In" row lists every publication not inDoNotPublishIn, so the virtualPublishInit displays always holds Main Dictionary. The WinFormsDataTree.AddSimpleNodejudges an ifdata reference collection on thevisFieldproperty when one is named.XmlLayoutImporterdropped the attribute, soDetailComposerjudged the displayed field and the row always showed.Deliberate rules.
ViewNode.VisibilityFieldcarries the slice'svisField. The JSON serializer and bothViewDefinitionOverrideApplierrebuilds (CloneWith,CloneWithId) keep it, so a user override or a duplicated row still hides correctly.visFieldjoinsHandledSliceAttributes, so it is no longer reported as unhandled.WalkReferenceVectorFieldmakes the ifdata decision once, before choosing an editor, on thevisFieldcount when one is named, otherwise on the displayed count. That replaces four identical per-branch checks. For every row without avisFieldthe outcome is unchanged; the lookups now skipped for hidden rows are reads with no side effects. A row with an exclusion but nothing left to list (every publication excluded) shows, empty, as in WinForms.VisibilityCountuses thevisFieldcount only when that field is an owning or reference sequence or collection. When the name does not resolve, or names an atomic or string field, it falls back to the displayed count, as if the part named novisField. WinForms would throw fromGetFieldId2on an unknown name and read the wrong kind of property on a non-list field; no shipped part does either.DetailComposer.Composehands its compiled layout to a new internalComposeModel, which does the walk. It changes nothing for callers and lets a test compose a hand-built layout node.visFieldis honoured on reference sequences as well as reference collections; WinForms applies it to collections only, and no shipped sequence part names one. Grouping nodes do not carry it, since no shipped part needs it.Not changed: rows that are always shown. Only the
LexSenseandLexExampleSentencelayouts inLexSense.fwlayoutmarkPublishInasifdata. The ticket's acceptance step 2 expects no entry-level "Publish Entry In" row, butLexEntry.fwlayoutmarks it and "Show As Headword In"visibility="always", and theCmPictureandLexPronunciationlayouts referencePublishInwith no visibility, which defaults to always. Both UIs always show those four rows; this keeps parity with the WinForms view, and QA should look for the change on senses and examples. For the same reason the ticket's Show As Headword In composer check cannot be written against the shipped layouts.Tests.
ViewDefinitionTests.Import_VisField_RidesTheNode_AndIsNotReportedUnhandledcovers the import. The JSON round-trip test inCanonicalJsonTestsand both override-rebuild tests inViewDefinitionOverrideApplierTestsnow assert the property survives. Two new composer tests inDetailComposerReferenceChooserTestsuse the shipped layouts: a sense excluded from nothing has no Publish Sense In row (and has one, listing Main Dictionary, with hidden fields shown), and a sense excluded from Main Dictionary shows the row with no items. Both fail against the old code.ComposeModel_VisFieldNotAVector_FallsBackToTheDisplayedFieldcomposes a Publish Sense In node whosevisFieldnames Gloss, a multistring, and expects the row judged on what it lists.Help_OnPublishSenseIn_OpensTheRowsOwnTopicnow composes with hidden fields shown, because its row was visible only because of this bug. FwAvaloniaTests: 952 passed, 1 skipped (first commit). xWorksTests on the first commit: 1910 passed, 2 skipped. xWorksTests on the second commit: 1909 passed, 2 skipped, run while the Windows session was locked, which crashed theBulkEditBarUiaSmokeTestshost and failedTextDrag_FromAvaloniaPayload_LegacyClipboardBridgeReadsBothRichAndNeutralLanesfor want of a clipboard; rerun on the unlocked desktop, both pass. Build, comment hygiene and token hygiene are clean.Manual tests (done). In FLEx with the New UI, Lexicon Edit, Show Hidden Fields off: a sense excluded from nothing has no Publish Sense In row and an example has no Publish Example In row, while Publish Entry In and Show As Headword In still show. With hidden fields on, removing Main Dictionary from Publish Sense In and then turning hidden fields off leaves the row showing, empty; adding Main Dictionary back hides it again, so the view re-composes after the edit.
Out of scope. Changing the entry, picture or pronunciation rows to
ifdatawould change the WinForms view as well and is a layout decision, not part of this parity fix.🤖 Generated with Claude Code
This change is