Repository navigation
Conversation
The Avalonia detail view drew its data at the fixed 11-unit surface font (about 8 pt), so changing Normal in Format > Styles left it unchanged while the WinForms slices followed. The composer now reads the project's Normal style through the stylesheet and gives each text value Normal's size for its writing system, falling back to Normal's size for all writing systems and then to 10 pt, and the lexeme form's 120% scales that size. The detail model carries Normal's analysis size, and each value editor sizes its TextBlocks and TextBoxes with it in place of the surface font. Only those two types are styled, so the text a box draws inherits the box's own size, as the lexeme form's larger size needs. A styled or multi-run value, shown read-only until it is clicked, keeps its own size and bold there too. RecordEditView now answers RefreshDisplay, so closing the Styles dialog or pressing F5 recomposes the Avalonia view once any open edit is done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each compose built a new LcmStyleSheet to read the Normal style. The sizes are now kept per project and rebuilt when Normal's rules change, which saving the Styles dialog does. The Lexicon Edit error fallback built its model without a value size, so it still showed data at the 11-unit surface font. It now uses Normal's sizes too. DataTree.ApplyValueFontSize moves above CreateEditor's comment, which it had separated from its method. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1236 +/- ##
=======================================
Coverage 40.52% 40.53%
=======================================
Files 1559 1560 +1
Lines 356091 356174 +83
Branches 41589 41608 +19
=======================================
+ Hits 144298 144367 +69
- Misses 182482 182494 +12
- Partials 29311 29313 +2
🚀 New features to boost your workflow:
|
The Lexicon Edit error fallback showed the lexeme form at Normal's size but neither scaled by its part's 120% nor bold, because the first-slice nodes it builds dropped both properties. The nodes now carry them, and the fallback applies them as the composed view does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comment above the fallback lexeme form's scale named the two inputs the code beside it already reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RecordEditView.RefreshDisplay, which View > Refresh and the Styles dialog reach, had no test. One test now changes Normal's size, checks that the change alone leaves the Avalonia view as it was, then that RefreshDisplay recomposes it at the new size and returns false so the views inside still refresh. Another checks that in the WinForms UI mode it returns false and builds no Avalonia view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ghost row's value carried no size, so text typed into it showed at Normal's analysis size whatever writing system it went into. It now shows at Normal's size for the ghost's writing system. The part's fontsize percentage is applied in one place, NormalStyleFontSizes.For(ws, percent), for both the composer and the Lexicon Edit error fallback. A headless test confirms a value's Copy menu keeps its own size when the value size applies. Co-Authored-By: Claude Opus 5.5 <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.
The new (Avalonia) detail view now shows its data at the project's Normal style size, so changing Normal in Format > Styles resizes Lexeme Form, Gloss, choosers and the rest, as it does in the WinForms view. Until now every value drew at a fixed 11-unit surface font (about 8 pt) whatever Normal said, and only the lexeme form was larger, at a hardcoded 12 units times 120%.
Each writing system uses Normal's own size for it when the style sets one, otherwise Normal's size for all writing systems, otherwise 10 pt, and the lexeme form keeps its 120% of that. Closing the Styles dialog or pressing F5 now recomposes the open view in place.
Reviewer notes
Root cause.
FwSurfaceStylesgives the whole DataTree a baseline style that sizes everyTextBlockandTextBoxat the 11-unitFwSurfaceFontSizetoken, and the composer handed values no size of its own except the lexeme form's12.0 * 120%. Nothing read the Normal style. Separately, the Avalonia view was not anIRefreshableRoot, soRefreshAllWindows(Styles OK, F5) never reached it.Deliberate rules.
NormalStyleFontSizesreads Normal through anLcmStyleSheet(BaseStyleInfo.FontInfoForWs), the same per-writing-system lookup the Styles dialog's Font tab uses, and falls back to 10 pt like the native renderer (knDefaultFontSizeinVwPropertyStore.cpp). Points become Avalonia units at 96/72. One instance is kept per project (ConditionalWeakTableon theLcmCache) and rebuilt when the Normal style'sRulesinstance changes, which saving the Styles dialog does.DetailModel.ValueFontSize, Normal's size in the default analysis writing system.FwSurfaceStyles.ApplyValueFontSizeadds, inside each value editor, the same two selectors as the surface baseline (TextBlock,TextBox) at the value size. Only those two types are styled on purpose: a broaderControlselector also hits theTextPresenterinside eachTextBoxtemplate, which then draws at the view-wide size and loses a box's own size. The first version of this branch did exactly that and dropped the lexeme form's 120% on screen; a test now asserts the size each box draws. Labels, section headers, hotlinks and writing-system abbreviations set their own sizes and are unchanged.CreatePerRunFontDisplay); it now copies the text box's own size and weight, so the lexeme form stays 120% and bold there too.RecordEditView.RefreshDisplayasks the existing refresh controller for a recompose, which holds it while an edit is open, and returns false, soFwXWindowstill refreshes the views inside, as before. In the WinForms UI mode it does nothing.LexiconEditErrorFallback, shown only when composing fails) gets the same sizes through a new optionalvalueFontSizeonDetailModelProjector.FromViewDefinition. Its lexeme form keeps the part's 120% and bold too:LexiconFirstSlice.StampProductLeafdrops neither property any more.Tests.
DetailComposerFontSizeTests(new): Normal at 20 pt sizes the gloss, the model and the lexeme form at 120%; a vernacular-only size saved throughStyleInfo.SaveToDB, as the Styles dialog saves, applies to the vernacular value only; a change to Normal between composes is picked up; no Normal style gives 10 pt; the error fallback uses Normal's size, with the lexeme form at 120% and bold; ghost rows use their writing system's size.DetailViewingParityTests: the value size reaches text boxes and chooser text over the surface font, the size each box draws matches its own size, labels and abbreviations keep theirs, a styled value's display keeps the value's size and bold, and a value's Copy menu keeps its own size (menu items draw throughAccessText, which the exact-typeTextBlockstyle does not match).RecordEditViewSwitchTests: a change to Normal alone leaves the Avalonia view as it was,RefreshDisplayrecomposes it at the new size and returns false, and in the WinForms UI mode it returns false and builds no Avalonia view. FwAvaloniaTests 954 of 955 passed (1 skipped); xWorksTests 1916 of 1918 passed (2 skipped). One earlier xWorksTests run recovered from three test-host crashes atFilterBar_RealizedWindow_ExposesTargetCombosThroughUIA, a realized-window UI Automation test this branch does not touch; the other full runs were clean.Manual tests (done). On Sena 3 with the new UI, side by side with the WinForms view: labels, glosses and the plural match in size, and the lexeme form shows its 120%. Format > Styles > OK resizes the open view in place.
Out of scope. LT-22692 (refresh and re-compose parity on external changes) continues the refresh work; this branch already makes F5 and Styles OK recompose the Avalonia view. The Morph Type chooser still renders in the theme's blue sans-serif rather than the WinForms bold serif; that is chooser styling, not size. Per-writing-system sizes reach text values and ghost rows only: chooser text and reference items (Components, Cross References) draw at Normal's analysis size because
DetailChoiceOptioncarries no writing system, and a run in another writing system inside a value takes the value's size. That matters only when Normal sizes some writing systems differently, and needs a model change.🤖 Generated with Claude Code
This change is