Repository navigation
Conversation
In the New UI detail view, a context menu now opens on the field the user is in. A keyboard-opened menu (Shift+F10 or the Menu key) opens just below the caret, and a right-click in a value moves focus and the caret there before the menu opens. Until now, clicking another field while a menu was open only closed the menu, so the next keyboard menu opened on the old field again; the value box's own menu opened centred under the whole field; and a right-click left focus behind, so closing the menu scrolled the view back to the field the user had left. The click that closes a detail-view menu now also lands where it was aimed. A keyboard-opened menu drops from the caret of a text field, as the WinForms view opens it at the insertion point; a field without a caret drops it from its bottom-left corner. A right press in a text value focuses it and moves the caret to the pointer unless it lands inside the selection, as SimpleRootSite does. A right-click still opens the menu at the pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NUnit Tests 1 files ± 0 1 suites ±0 15m 25s ⏱️ + 3m 55s Results for commit 909e7d4. ± Comparison against base commit c5da1ae. This pull request removes 2 and adds 16 tests. Note that renamed tests count towards both. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1272 +/- ##
=======================================
Coverage 40.93% 40.93%
=======================================
Files 1603 1603
Lines 360816 360847 +31
Branches 42246 42251 +5
=======================================
+ Hits 147687 147715 +28
- Misses 183637 183638 +1
- Partials 29492 29494 +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.
In the New UI detail view, a context menu now opens on the field the
user is in. A keyboard-opened menu (Shift+F10 or the Menu key) opens
just below the caret, and a right-click in a value moves focus and the
caret there before the menu opens. Until now, clicking another field
while a menu was open only closed the menu, so the next keyboard menu
opened on the old field again; the value box's own menu opened centred
under the whole field; and a right-click left focus behind, so closing
the menu scrolled the view back to the field the user had left.
The click that closes a detail-view menu now also lands where it was
aimed. A keyboard-opened menu drops from the caret of a text field, as
the WinForms view opens it at the insertion point; a field without a
caret drops it from its bottom-left corner. A right press in a text
value focuses it and moves the caret to the pointer unless it lands
inside the selection, as SimpleRootSite does. A right-click still opens
the menu at the pointer.
Reviewer notes
Start here:
Src/Common/FwAvalonia/Detail/DetailMenuFlyout.cs.ConfigureandFocusOnRightPresshold the whole behaviour; the other files only call them.Every detail-view context menu goes through
DetailMenuFlyout.Configure: the host-built row menus, the value box's own menu, the reversal-entry jump menu and the reference-vector item menu. Multi-string value boxes and reversal entries now take focus on a right press, through the helper the structured-text rows already used.The question to start with: does letting the dismissing click through break anything? Before, Avalonia swallowed the click that closed a menu; now it reaches the control under it, as a WinForms context menu lets it through. Clicking another field moves focus there. Right-clicking another field opens that field's menu. A second left-click on the "..." button still only closes its menu, as before.
Where to look
PlaceUnderCaret/CaretBounds: Avalonia hands the callback the target's bounds in top-level coordinates, so the caret rectangle must be in the same space. Pinned by the caret, wrapped-line, empty-field and right-to-left cases inKeyboardMenuPlacementTests.FwMultiWsTextField: the right-press surface is the row panel for a bridged row, whose abbreviation raises the menu too, and the value content otherwise. Pinned byValueBoxRightClickTests.DataTreeholds the re-show while the press or the menu is in flight, as it does for a left click.Not here:
FwChooserFieldis untouched; its right-click lands separately, and a chooser menu built as a local flyout should wrap it inDetailMenuFlyout.Configure. LT-22915 still removes the value box's local menu; the placement and dismissal stay with the host menus.Verification: FwAvaloniaTests 1076 passed, 1 skipped (the existing non-headless drag test). The new tests fail with the fix switched off. Manual runs in Sena 3 passed: keyboard placement, the dismissing click, an empty field, right-click focus without scroll-back, and a reversal entry.
Next: approve.
Reading this a year from now
LT-22691 QA found that Shift+F10 in Definition, then a click in Gloss, then Shift+F10 again, opened the menu under the middle of Definition. Two causes: the dismissing click never reached Gloss, and the value box's own menu used Avalonia's default placement, centred below the field. Testing the fix exposed a third: a right-click in a value left focus in the previous field. No working documents were written for this change; the reasoning below is the record.
Decisions, and why
SimpleRootSite.ProcessCmdKeyopens the Shift+F10 menu at the centre of the selection rectangle. In a wrapped Definition the caret's line is where the user is looking. Targets without a caret (label cell, list item, button) keep the bottom-left drop.PlacementMode.Customwith a placement callback. A right-click makes the flyout usePlacementMode.Pointer, which ignores the callback, so one setting serves both kinds of opening without knowing which one happened.OverlayDismissEventPassThrough. The dismissing click is what the user meant to do next. Swallowing it left focus in the old field. WinForms lets it through: clicking the slice menu icon twice closes and reopens the menu with either button.SimpleRootSite.OnMouseDownswitches focus to the clicked view and keeps a range selection the click lands in. Without it, closing the menu returned focus to the field the user had left and scrolled the view back to it.Paths not taken
BottomEdgeAlignedLeftplus offsets to the caret. Avalonia appliesHorizontalOffset/VerticalOffsetto pointer placement too, so the offsets would shift right-click menus away from the pointer.Evidence
New tests:
KeyboardMenuPlacementTests: the reported case on unbound and bridged rows; menu under the caret; under a wrapped value's first line; below an empty field's line; leftward from the caret in a right-to-left value; bottom-left of a non-text target; at the pointer for a right-click.ValueBoxRightClickTests: right-click in another field focuses it with the caret at the pointer; a second right-click in the same field keeps focus there; a bridged row's abbreviation focuses its value; a press inside the selection keeps it.FwReversalEntriesFieldTests.ARightClickOnAnEntry_FocusesIt_WithTheCaretAtThePointer.With the dismiss pass-through and caret placement switched off, 6 of the 7 original placement tests fail (the right-click case passes either way). With right-press focus switched off, 6 of the 7 right-click tests fail (the keep-selection guard passes either way).
Manual, Sena 3, Lexicon Edit, New UI: entry
sana(keyboard menus on Definition, Gloss and Lexeme Form; the dismissing click; the empty Portuguese Definition; right-click focus with no scroll-back; a selection kept across a right-click; the Lexeme Form abbreviation), entryzinji(reversal entry "many"), and the WinForms comparison of the slice menu icon.Preflight review details
Code Review Summary
Branch: claude/lt-22691-shiftf10-placement-8dccd6
Base: main (c5da1ae)
Date: 2026-12-01
Review model: Claude Opus 5.5
Files changed: 8 (1 commit)
Overview
QA (LT-22691) found that Shift+F10 in the New UI detail view opened the menu on the wrong
field: after a menu opened in Definition, clicking Gloss and pressing Shift+F10 reopened the
menu under Definition, centred under the field. The cause was the dismissing click: Avalonia
swallows the click that light-dismisses a flyout, so focus stayed in Definition. The value
box's own menu also used Avalonia's default placement (centred below the target).
Every detail-view menu now goes through
DetailMenuFlyout.Configure: the dismissing clickpasses through, and a pointer-less menu drops from the caret of a text box (WinForms opens
it at the insertion point) or from a non-text target's bottom-left corner. During manual
testing the author found that a right-click in a value box left focus in the previous field,
so closing the menu scrolled back there; a right press now focuses the box and moves the
caret to the pointer unless it lands inside the selection, as SimpleRootSite does.
Contract/API Changes
DetailMenuFlyout.Configure(MenuFlyout); new internalDetailMenuFlyout.FocusOnRightPress(Control, TextBox).DetailMenuFlyout.Showno longer setsPlacementMode.BottomEdgeAlignedLeft; every flyoutfrom
BuildusesPlacementMode.Customwith a placement callback.Findings
Critical - Must address before merge
None.
Important - Should address before merge
zero-height caret falls back to the target's bounds; headless test added)
(fixed during review: the right-press handler sits on the row panel for bridged rows;
headless test added)
A second left-click on the "..." button no longer reopens its menu, unlike WinForms(author: keep it closing -- the usual toggle; behaviour unchanged by this branch)
Minor - Consider
Caret anchor is not clipped to the visible viewport(skipped: the positioner keepsthe menu on screen; WinForms also opens at a hidden insertion point)
Reversal and vector-item menus'(skipped:Configurecall has no placement testsame one-line call as the tested sites)
Reversal right-press focus is wired only when the field has a navigation callback(skipped: the app always supplies it; previews only)
Retypable vector editor keeps its own right-press logic(skipped: it also sets thecurrent editor)
asserts the menu grows leftward from the caret)
Required Validation / Evidence
.\test.ps1 -CommentHygiene -TokenHygiene -TestProject "Src/Common/FwAvalonia/FwAvaloniaTests":1076 passed, 1 skipped (the existing non-headless drag test).
original placement tests fail; with right-press focus disabled, 6 of 7 right-click tests
fail (the keep-selection guard passes either way by design).
focus, empty Definition (Por), right-click focus and no scroll-back on sana, reversal entry
right-click on zinji, WinForms comparison of the "..." button -- all passed.
Positive Observations
removing the value box's local menu.
Interview Notes
Suggested Review Focus
DetailMenuFlyout.Configure-- dismiss pass-through applies to every detail menuDetailMenuFlyout.PlaceUnderCaret/CaretBounds-- top-level coordinates, RTL relies onAvalonia's mirroring
FwMultiWsTextFieldright-press surface choice (row panel when bridged)🤖 Generated with Claude Code
This change is