Repository navigation
Conversation
Every entry-search dialog (Go to Entry, Merge Entry, Add Allomorph, Link Allomorph, Link MSA, Link Entry or Sense) now shows a "Writing System:" picker under the search box, as the WinForms BaseGoDlg does. It lists each current analysis and vernacular writing system once, sorted by name, with the default vernacular one selected. Picking a writing system re-runs the search in it: an analysis writing system matches sense glosses, a vernacular one matches citation, lexeme and alternate forms. The search box takes the chosen writing system's font and direction, resetting them when the choice changes, and its keyboard switches when the box gains focus. The dialog stays free of LCModel: the search-box spec carries the options and a selection callback, and each launcher shares one SearchWritingSystem between that callback and its search, which reads it on every query. Closes GAP-WS-SELECTOR in the control exemplar map and documents the design in dialog-conversion.md 2d. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add Allomorph now opens with the writing system of the form being added selected, as the WinForms dialog does, so a form typed in a second vernacular writing system is found straight away. A writing system that is not current falls back to the default vernacular one. Result rows no longer show "???" for an entry with no form in the default vernacular writing system: the headword falls back to the first current vernacular writing system with a form, then the analysis ones. The new selector made such entries reachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 2d note said the default vernacular writing system is always selected. It now describes the starting writing system the launcher supplies, Add Allomorph starting on the form's writing system, and the headword fallback across writing systems. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NUnit Tests 1 files ± 0 1 suites ±0 15m 6s ⏱️ -1s Results for commit ad464aa. ± Comparison against base commit 936ae91. This pull request removes 1 and adds 24 tests. Note that renamed tests count towards both. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1217 +/- ##
==========================================
+ Coverage 40.00% 40.38% +0.37%
==========================================
Files 1544 1551 +7
Lines 355308 355742 +434
Branches 41357 41508 +151
==========================================
+ Hits 142142 143650 +1508
+ Misses 183833 182770 -1063
+ Partials 29333 29322 -11
🚀 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.
Start here:
Src/LexText/LexTextControls/Avalonia/EntryGoLauncherShared.cs--SearchWritingSystem,GetSearchFieldsandBuildSearchFieldSpecare the mechanism; the rest plumbs into them.Every Avalonia Go-family dialog (Go to Entry, Merge Entry, Add Allomorph, Link Allomorph, Link MSA, Link Entry or Sense) gets the
BaseGoDlg"Writing System:" selector. An analysis writing system searches sense glosses; a vernacular one searches citation, lexeme and alternate forms. The search box follows the choice's font, direction and keyboard.Headless captures (Avalonia.Headless, test data): Spanish selected; Arabic selected, the search box flips right-to-left.
Is this only a dropdown? No: the legacy selector changes which fields are searched. The dialog stays LCModel-free (options and a
WritingSystemChangedcallback onEntryGoSearchFieldSpec); each launcher shares oneSearchWritingSystembetween that callback and its search delegate, which reads it on every query. The question worth your time is whether that hand-off is ordered correctly.Where to look
EntryGoDialogViewModel.OnSelectedWritingSystemChanged: the callback must run beforeRunSearch. Pinned bySharedSearch_SelectionChangedAfterBuild_NextSearchUsesNewWsandGoFamilyBuildInputs_SelectorDrivesTheirSearch(all six dialogs).GetSearchFields: analysis to glosses, vernacular to forms, both to both.EntryGoDialogView.ApplySearchTypography: clears what the new writing system leaves unset, so right-to-left reverts.HeadwordTextfalls back across writing systems instead of showing "???"; Insert Entry and Merge use it too.Not here
main:***for an empty gloss (LT-22883) and the headword font per value (LT-22884).Verification:
test.ps1FwAvaloniaDialogsTests 297/297; LexTextControlsTests 379 passed, 3 pre-existing skips; comment and token hygiene clean. Author ran Go to Entry, Merge, Link Entry or Sense and Add Allomorph under the new UI, and re-checked Add Allomorph after the review fixes. Not run: a fullbuild.ps1. Branched from 380cc90;mainhas moved on, no overlapping files.Next: check the hand-off ordering and approve, or name a deliberate difference to change.
Reading this a year from now -- start here
This PR closes GAP-WS-SELECTOR from the control exemplar map. The durable design note is
dialog-conversion.mdsection 2d (in the tree); the exemplar map row and a lessons-ledger entry were added alongside it. Nothing was deleted from the branch: its only markdown changes are those three skill references. The reasoning below is what the code and docs do not say.The layer cake -- from a pick to a search
EntryGoDialogViewbuilds a dropdownFwOptionChooserintoPART_WritingSystemHostfromEntryGoDialogViewModel.WritingSystems. Committing an option setsSelectedWritingSystem.EntryGoDialogViewModel.OnSelectedWritingSystemChangedinvokesEntryGoSearchFieldSpec.WritingSystemChanged(id), raisesSearchTypography, then re-runs the search.EntryGoLauncherShared.BuildSearchFieldSpec) points the sharedSearchWritingSystem.Handleat the chosen writing system.BuildEntrySearch/BuildEntryOrSenseSearch) reads the handle and asksGetSearchFieldsfor fields: vernacular gives citation, lexeme and alternate forms; analysis gives sense glosses.EntryGoSearchEngineruns those fields; rows take their headword fromHeadwordText.SearchTypography, clearing whatever the new writing system leaves unset.Decisions, and why
Func<string, ...>to carry the writing system would have touchedEntryGoDialogInput, the ViewModel and every launcher's search contract. The holder confines the change to the launcher layer. Cost: the ViewModel must report the change before it searches.FwOptionChooser, not aComboBox. The exemplar map's dialog rule forbids ad-hoc ComboBoxes.EntryGoDlg.GetFieldsalso searches definitions when the Definitions column is visible; it is hidden by default and the Avalonia list has no column chooser, so the default is what ships.BaseGoDlg.SetDlgInfo(..., tssform)). Go to Entry, Merge and Link Entry or Sense start on the default vernacular one in WinForms too. A starting writing system that is not current falls back to the default vernacular one, so the selection and the search cannot disagree.Sorted = true) is, not grouped by kind.Paths not taken
fwFieldHost, to avoid the doubled frame: the view harness fails anyPART_*Hostwith a zero border, and all 45 view tests failed. The framed host is the convention.BaseGoDlgdoes: arrow keys on a collapsed picker change the selection, so stealing focus breaks browsing. The keyboard switch happens when the user returns to the box.Surprising findings
HeadWordreads the default vernacular writing system only; the WinForms browser column usesbest vernoranal. The bug predates this branch but was unreachable until the selector let a search find such entries.Deferred, and what would unblock it
EntryGoResultColumnrather than per-column.GlossesText,SenseGlossandLexemeFormTextuse LCM's best-alternative properties, which return***when nothing is stored, andHeadwordText's last fallback returns???for an entry with no form at all. Already onmain; found while manually testing this PR.WordformGoDlg(vernacular only) andReversalEntryGoDlg(the index's writing system only) narrow the list. Neither is in the Avalonia family yet; porting one needs a way for the launcher to pass a subset toBuildSearchFieldSpec.Evidence
New tests:
EntryGoDialogLauncherTests(real cache):SharedSearch_AnalysisWsSelected_FindsEntryByGloss,SharedSearch_VernacularWsSelected_DoesNotMatchGlosses,SharedSearch_SecondVernacularWsSelected_FindsEntryByFormInThatWs,SharedSearch_SelectionChangedAfterBuild_NextSearchUsesNewWs,SharedEntryOrSenseSearch_AnalysisWsSelected_SenseModeFindsSenseByGloss,BuildSearchFieldSpec_*(options, typography, callback, null argument),GoFamilyBuildInputs_SelectorDrivesTheirSearch,AddAllomorph_BuildInput_OpensOnTheFormsWritingSystem,AddAllomorph_BuildInput_FormInANonCurrentWs_OpensOnTheDefaultVernacular,HeadwordText_*.EntryGoDialogTests(ViewModel and realized headless view):WritingSystemSelector_*-- initial selection, unknown-id fallback, change reports and re-searches, typography change, cleared selection, labelled picker, right-to-left and back, reset to defaults, hidden row.Manual check, new UI:
$env:FW_AVALONIA = '1'and startOutput\Debug\FieldWorks.exe; choose the new UI in Tools > Options > General.Preflight review details
Code Review Summary
Branch: LT-22671-go-dialog-ws-selector
Base: main (merge base 380cc90; origin/main is 8 commits ahead, none touching these files)
Date: 2026-10-29
Review model: Claude Opus 5.5
Files changed: 19 (3 commits: feature, in-review fixes, doc alignment)
Overview
LT-22671 adds the WinForms
BaseGoDlgwriting-system selector to every Avaloniaentry-search ("Go") dialog: Go to Entry, Merge Entry, Add Allomorph, Link
Allomorph, Link MSA, and Link Entry or Sense. A "Writing System:" row under the
search box offers every current analysis and vernacular writing system. Picking
one re-runs the search in it: analysis searches sense glosses, vernacular searches
citation, lexeme and alternate forms. The search box takes the chosen writing
system's font and direction and switches keyboard on focus.
The dialog layer stays LCModel-free:
EntryGoSearchFieldSpeccarries the optionsand a
WritingSystemChangedcallback; each launcher shares oneEntryGoLauncherShared.SearchWritingSystembetween that callback and its searchdelegate, which reads it on every query. Analysis found one parity gap in Add
Allomorph, and manual testing found a "???" headword exposed by the new selector;
both were fixed during review.
Contract/API Changes
FwAvaloniaDialogs(public, additive): newEntryGoWritingSystemOption;EntryGoSearchFieldSpec.WritingSystems,SelectedWritingSystemId,WritingSystemChanged;EntryGoDialogViewModel.WritingSystems,HasWritingSystemSelector,WritingSystemLabel,SelectedWritingSystem,SearchTypography.FwAvaloniaDialogs.EntryGoWritingSystemLabel("Writing System:",same seed text as
LexTextControls.ks_WritingSystem_).BuildVernacularSearchFieldSpec(cache)replaced byBuildSearchFieldSpec(cache, searchWs);GetSearchFieldstakes the cache;BuildEntrySearch/BuildEntryOrSenseSearchand the six launchers'BuildSearchgain an optionalSearchWritingSystem. All callers updated.EntryGoLauncherShared.HeadwordTextnow falls back across currentwriting systems; it also feeds Insert Entry's matching list and Merge's
confirmation text.
Findings
Critical - Must address before merge
None.
Important - Should address before merge
the form's (fixed during review:
LcmAddAllomorphDialogLauncher.BuildInputseeds the shared writing system from
tssForm;BuildSearchFieldSpecreplaces anon-current one with the default vernacular. Tests
AddAllomorph_BuildInput_OpensOnTheFormsWritingSystem,AddAllomorph_BuildInput_FormInANonCurrentWs_OpensOnTheDefaultVernacular.)(found in manual testing; fixed during review:
HeadwordTexttries each currentvernacular writing system, default first, then analysis, matching the WinForms
column's
best vernoranal. TestsHeadwordText_NoDefaultVernacularForm_UsesAnotherVernacularForm,HeadwordText_DefaultVernacularForm_IsPreferred.)Minor - Consider
headword comes from another writing system (author: leave for a follow-up; filed as LT-22884)
Required Validation / Evidence
Run:
./test.ps1 -TestProject Src/LexText/LexTextControls/LexTextControlsTests -CommentHygiene -TokenHygieneafter the in-review fixes: 379 passed, 3 skipped(pre-existing: two LIFT import tests,
GlossesBeforeWords; plus the explicitscreenshot harness), 0 failed.
./test.ps1 -TestProject Src/Common/FwAvaloniaDialogs/FwAvaloniaDialogsTests -CommentHygiene -TokenHygiene: 297/297 (the in-review fixes do not touch thisproject).
Build/Agent/comment-hygiene.ps1andtoken-hygiene.ps1: clean.Manual (author-confirmed): Go to Entry, Merge Entry, and Link Entry or Sense (via
Reversal Indexes > Senses) under the new UI with
FW_AVALONIA=1; the AddAllomorph repro in the Interlinear sandbox, and its re-check after the in-review
fixes (Spanish preselected, "chucho" listed, no "???").
Still needed:
./build.ps1full build was not run by the reviewer;test.ps1built the touchedprojects.
Positive Observations
existing EntryGo tests pass untouched.
selection after build, all six dialogs), ViewModel (selection, fallback, cleared
selection, typography change), and realized headless view (picker, RTL and back,
reset to defaults, hidden row).
FwOptionChooserrather than an ad-hoc ComboBox, per the controlexemplar map.
(
EveryAccessorProperty_ResolvesFromTheNeutralResx).dialog-conversion.md2d, and records the scope lesson inlessons-learned.md.Interview Notes
(the harness requires a framed
PART_*Host, and the dropdown draws its own);focus stays on the picker after a switch (the WinForms dialog refocused the
search box, which would break arrow-key browsing of the collapsed picker);
alternate forms are always searched for a vernacular writing system (the
WinForms dialog searched them only when the Allomorphs column was visible).
SearchWritingSystemconnects thepicker's selection callback to the search delegate, and why the ViewModel must
invoke
WritingSystemChangedbefore it re-runs the search. Author answered"not sure".
In-Review Quality Check
The two Important fixes are the second commit. After them the full
LexTextControlsTests run passed with clean comment and token hygiene, and no
comment lines were re-wrapped. A third commit aligns
dialog-conversion.md2dwith the fixes (doc only).
Suggested Review Focus
EntryGoDialogViewModel.OnSelectedWritingSystemChanged: thecallback updates the shared
SearchWritingSystembeforeRunSearchreads it(the area the author is unsure of).
EntryGoLauncherShared.GetSearchFields: analysis to glosses, vernacular toforms, both to both, neither to forms.
EntryGoDialogView.ApplySearchTypography: clears values the new writingsystem leaves unset.
HeadwordTextfallback and its effect on Insert Entry and Merge text.🤖 Generated with Claude Code
This change is