Repository navigation
LT-22691: Answer Jump to field and new-record focus in the New UI - #1261
Merged
Merged
Conversation
The dictionary preview's Jump to field now lands on the field's row in the New UI detail view, and on a field of another entry in both detail views. Until now nothing in the New UI answered it, and in the WinForms view a field of another entry showed that entry but focused no field. JumpToField is now published immediately instead of at the end of the action, and it carries the record to show. The record edit view is its one subscriber in both views: it has its clerk show the record, then focuses the row, at once when the record is already shown and otherwise once it has been. The preview no longer publishes JumpToRecord for this. The end-of-action publish could run before the record was shown, which is why a field of another entry was never found. Both views pick the row by one shared rule. In the New UI a record its clerk inserts or duplicates, and an entry a pop-up Lexicon Edit window is asked to show, now open with the keyboard in their first field, as in the WinForms view. Among the New UI tools this reaches Insert > Exception Feature in Grammar and Create & Edit from Notebook's Add to Dictionary. The clerk raises an event beside its FocusFirstPossibleSlice message, which stays on the Mediator for the WinForms view. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1261 +/- ##
==========================================
+ Coverage 40.16% 40.60% +0.44%
==========================================
Files 1597 1601 +4
Lines 360084 360728 +644
Branches 42148 42239 +91
==========================================
+ Hits 144633 146481 +1848
+ Misses 185724 184608 -1116
+ Partials 29727 29639 -88
🚀 New features to boost your workflow:
|
thejambi
approved these changes
Nov 24, 2026
thejambi
left a comment
Contributor
There was a problem hiding this comment.
@thejambi reviewed 14 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on mark-sil).
4 of 11 tasks
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 dictionary preview's Jump to field now lands on the field's row in
the New UI detail view, and on a field of another entry in both detail
views. Until now nothing in the New UI answered it, and in the WinForms
view a field of another entry showed that entry but focused no field.
JumpToField is now published immediately instead of at the end of the
action, and it carries the record to show. The record edit view is its
one subscriber in both views: it has its clerk show the record, then
focuses the row, at once when the record is already shown and otherwise
once it has been. The preview no longer publishes JumpToRecord for this.
The end-of-action publish could run before the record was shown, which
is why a field of another entry was never found. Both views pick the
row by one shared rule.
In the New UI a record its clerk inserts or duplicates, and an entry a
pop-up Lexicon Edit window is asked to show, now open with the keyboard
in their first field, as in the WinForms view. Among the New UI tools
this reaches Insert > Exception Feature in Grammar and Create & Edit
from Notebook's Add to Dictionary. The clerk raises an event beside its
FocusFirstPossibleSlice message, which stays on the Mediator for the
WinForms view.
Reviewer notes
Start here:
Src/xWorks/RecordEditView.RowFocus.cs: the Jump to field subscriber, the wait for a record still to be shown, and the rows a new record asks to focus. ThenSrc/FdoUi/DetailRules/DetailFieldJump.cs, the row-picking rule both views call.The unknown you start with: "what changed for the WinForms view?" Its row-picking cases moved out of
DataTreeintoDetailFieldJump, with the one difference listed below. And a field of another entry now gets focus. New-record focus in the WinForms view is untouched.Where to look
DetailFieldJump.FindRowholds the cases that were inDataTree.JumpToField. One difference: the grammatical-category case no longer checks the slice's class, because the shared rule may not name a control type. The combo box is the only shipped slice for that field. Pinned byDetailFieldJumpTests.DataTree.JumpToFieldon a record just shown keeps the request until the end ofOnReadyToSetCurrentSlice; another record or a reset drops it. Pinned by two tests inRecordEditViewRowFocusTests.RecordClerk.RecordWantsKeyboardis raised beside eachFocusFirstPossibleSlicebroadcast the clerk sends, and fromOnJumpToPopupRecordonly when the jump landed.DetailHostControl.ShowDetail(focusRows)moves the window's keyboard into the Avalonia host only after a row has taken focus. Only the manual runs show that.Deliberately not here
FocusFirstPossibleSlicestays a Mediator message.Verification
build.ps1 -CommentHygiene -TokenHygieneis clean. Targeted runs: xWorksTests 229/229; DetailControlsTestsDataTreefixtures 58 passed, 1 skipped (pre-existingNestedCollapsedPart). FdoUiTests 231, FwAvaloniaTests detail 497 and FwUtilsTests Pub/Sub 18 ran before the lastDataTree-side change, which touched none of their code. The full suite was not run.Next: approve, or name a Jump to field target that lands on the wrong row.
Decisions, and why
JumpToFieldis an immediate publish that carries the record. The end-of-action publish ran from one idle queue and the record show from another, with no order between them. The view now does the sequencing: its clerk shows the record, then the row is focused. No production code callsPublishAtEndOfActionafter this.RecordEditViewis the one subscriber, for both views. TheDataTreeno longer subscribes on its own. Each view answers through the same code up to the point of focusing a row.Src/FdoUi/DetailRules. The New UI cannot drift from WinForms, andDetailRulesBoundaryTestskeeps control types out of it.OnInsertItemInVector(Insert > Exception Feature; the other inserts are answered by dialog listeners first),OnDuplicateSelectedItem(phonological rules, not a New UI tool) and the pop-up jump. Insert > Entry never sent the message: focus stays in the Entries list in both UIs.DataTree. Slices just built cannot take focus until they are displayed, andDataTreealready defers its own focus toOnReadyToSetCurrentSlice. The request waits on that step, so there is no new idle-queue task and no ordering rule between two classes.Paths not taken
JumpToRecord. The clerk is that message's only subscriber and knows nothing of rows; the detail view would still need its own hand-off.DataTree's own. It worked, but only while both tasks sat on the same idle queue at different priorities.FocusFirstPossibleSliceto Pub/Sub here. It belongs with the other focus deferrals of the Mediator retirement.RecordEditView.RowsAskedToFocusis a test seam that records what the view asked for instead;DetailFocusMemoryTestscovers the focusing itself.Preflight review details
Code Review Summary
Branch: claude/lt-22691-focus-3e-3f-38da99
Base: main (merge base e29350b; main has since gained #1257, #1255, #1251, #1196 and #1258, which merge cleanly)
Date: 2026-11-24
Review model: Claude Fable 5.2
Files changed: 14 (1 commit)
Overview
Makes the New UI (Avalonia) detail view answer two things only the WinForms DataTree answered
(LT-22691): the dictionary preview's Jump to field, and putting the keyboard in the first field
of a record its clerk inserts or duplicates or a pop-up Lexicon Edit window is asked to show.
Jump to field also now works for a field of another entry in the WinForms view, where it
showed the entry and focused nothing.
JumpToFieldbecomes an immediate publish that carriesthe record to show;
RecordEditViewis its one subscriber in both views, and both views pickthe row by one shared rule.
Contract/API Changes
EventConstants.JumpToFieldis published withPublisher.Publishand carries aJumpToFieldRequest(record to show, field object, field name, text). It is removed fromEndOfActionOrder; no production code callsPublishAtEndOfActionany more.XhtmlDocViewno longer publishesJumpToRecordfor Jump to field.DataTreeno longer subscribes toJumpToField; it gains publicJumpToField(int fieldHvo, string fieldName, string fieldValue), called byRecordEditView.DetailFieldJumpandDetailFieldJumpRowinSrc/FdoUi/DetailRules.RecordClerk.RecordWantsKeyboard.DetailHostControl.ShowDetailgains optionalfocusRows; newDetailHostControl.FocusRowand
DetailFocusMemory.ForRows.Findings
Critical - Must address before merge
None.
Important - Should address before merge
keyboard moves into the Avalonia host only once a row has taken focus)
and no row is focused)
keeps a waiting request with its root and drops it when another root is shown)
the clerk is on the requested record)
Minor - Consider
answers a waiting request at the end of its own ready step; the view queues nothing)
Pop-up window's preview jump no longer answered there(the item is offered only whilethe main tool is Lexicon Edit, where no pop-up opens; with a pop-up left open from another
tool both windows show the same entry and the main window's row takes focus)
MSA slice type check dropped from the rule(the shared rule may not name a sliceclass; the combo box is the only shipped slice for that field)
RowsAskedToFocus exists only for tests(the headless host does not lay out itsAvalonia content, so the view tests cannot assert real focus)
Sender and window-focus hand-off untested(needs a live preview and a real window;covered by the manual runs)
Required Validation / Evidence
build.ps1 -CommentHygiene -TokenHygienesucceeded; comment and token hygiene clean.test.ps1 -CommentHygiene -TokenHygienetargeted runs on the committed code: xWorksTests229/229 (the record edit view, clerk, menu and command-coverage fixtures); DetailControlsTests
DataTree fixtures 58 passed, 1 skipped (pre-existing NestedCollapsedPart).
FwAvaloniaTests detail fixtures 497, FwUtilsTests Pub/Sub 18.
WinForms UI (headword, gloss, grammatical category, a field of another entry, and the filter
prompt answered No and Yes); Insert > Exception Feature into an empty and a non-empty list;
Notebook's Add to Dictionary, Create and Edit pop-up; Insert > Entry leaves focus in the
Entries list in both UIs.
Positive Observations
DataTreefor a control-free rule with 21 unit test cases, so thetwo views cannot drift.
not by a longer delay.
Interview Notes
JumpToFieldstop usingPublishAtEndOfAction, and chose the shapewhere it is an ordinary publish and the view has its clerk show the record first, including
the WinForms DataTree change in this PR.
site and no ordering rule between two classes, which also eases the Mediator retirement.
FocusFirstPossibleSliceMediator messageis deliberately untouched.
RowsAskedToFocusseam were raised and kept by the author.Suggested Review Focus
RecordEditView.RowFocus.cs: the subscriber and the wait for a record still to be shownDetailFieldJump.FindRowagainst the cases removed fromDataTreeDataTree.JumpToFieldandOnReadyToSetCurrentSlice: the waiting requestDetailHostControl.ShowDetail(focusRows): when the window keyboard moves🤖 Generated with Claude Code
This change is