Repository navigation
LT-22691: Answer the Category Edit menus natively - #1244
Merged
Merged
Conversation
The Avalonia detail view answers every Grammar > Category Edit menu
itself, and the Insert menu's category commands. Until now Duplicate and
Move on an affix slot or template, and Insert Subcategory, needed the
hidden DataTree, where Move could not show its category list; the Insert
menu's commands showed only once a right-click had built that tree.
Move asks for the category with the Avalonia chooser dialog, and
Duplicate is one undoable step in the New UI. In both views a move's undo
text is the command's own ("Undo Move Affix Slot") in place of fixed
English, and moving an item to the category it is in does nothing. The
move, duplicate and subcategory rules are shared with WinForms in
DetailRules.
Inserting a list item's sub-item is answered natively too, which covers
the Subitems menu of Exception "Features" and the Lists area's sub-item
menus.
Menus and commands now answered natively:
* mnuDataTree-POS-AffixSlot, mnuDataTree-POS-AffixTemplate,
mnuDataTree-POS-SubPossibilities
* mnuDataTree-SubPossibilities, mnuDataTree-SubSemanticDomain,
mnuDataTree-SubComplexEntryType, mnuDataTree-SubVariantEntryType,
mnuDataTree-SubAnthroCategory, mnuDataTree-SubLocation
* CmdDataTree-Insert-POS-SubPossibilities,
CmdDataTree-Insert-POS-AffixTemplate, CmdDataTree-Insert-POS-AffixSlot,
CmdDataTree-Insert-POS-InflectionClass (Category Edit)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
NUnit Tests 1 files ± 0 1 suites ±0 14m 31s ⏱️ -34s Results for commit fe5b5ff. ± Comparison against base commit a1f69e7. This pull request removes 1 and adds 29 tests. Note that renamed tests count towards both. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1244 +/- ##
==========================================
+ Coverage 40.69% 40.83% +0.13%
==========================================
Files 1567 1573 +6
Lines 356898 357159 +261
Branches 41755 41812 +57
==========================================
+ Hits 145241 145832 +591
+ Misses 182321 182022 -299
+ Partials 29336 29305 -31
🚀 New features to boost your workflow:
|
thejambi
approved these changes
Nov 11, 2026
thejambi
left a comment
Contributor
There was a problem hiding this comment.
@thejambi reviewed 18 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on mark-sil).
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 Avalonia detail view answers every Grammar > Category Edit menu
itself, and the Insert menu's category commands. Until now Duplicate and
Move on an affix slot or template, and Insert Subcategory, needed the
hidden DataTree, where Move could not show its category list; the Insert
menu's commands showed only once a right-click had built that tree.
Move asks for the category with the Avalonia chooser dialog, and
Duplicate is one undoable step in the New UI. In both views a move's undo
text is the command's own ("Undo Move Affix Slot") in place of fixed
English, and moving an item to the category it is in does nothing. The
move, duplicate and subcategory rules are shared with WinForms in
DetailRules.
Inserting a list item's sub-item is answered natively too, which covers
the Subitems menu of Exception "Features" and the Lists area's sub-item
menus.
Duplicating an affix slot whose name is still being typed keeps the name
on the original and copies it, which fixes LT-22843.
Reviewer notes
Start here:
Src/xWorks/Avalonia/Hosting/RecordEditView.CategoryMenus.cs, the Duplicate and Move answers. Then the rules both views call, inSrc/FdoUi/DetailRules:CategoryItemMove.cs,DetailObjectDuplication.cs, andOffersSubItemwith the newResolveTargetoverload inDetailObjectInsertion.cs.The question to bring: what changed in Legacy? Two things, both intended. A move's undo text now comes from the command ("Undo Move Affix Slot", "Undo Move Affix Template") in place of the hardcoded "Undo Move Slot" and "Undo Move Template". Moving a slot to the category it is already in no longer makes an undo step. Legacy keeps its in-row category drop-down with
<Any>andMore..., its two-step Duplicate, and its MasterRefresh after a slot move.Where to look
CategoryEditMenuTests.EveryRowMenu_OfACategoryWithSlotsTemplatesAndSubcategories_IsAnsweredNatively; the owned-id pin inLexiconMenuAuthorityTestsshows the nine new menus.TheSlotTemplateAndSubcategoriesMenus_RenderWhatTheAdapterPathRendered_WithoutTheMediator.CategoryItemMove.Moveagainst the removedDTMenuHandler.MoveSlotandMoveTemplate: a template moved to the category above takes its slots unless a slot of that name exists there. Pinned byCategoryItemMoveTests.InsertSubcategory_GoesUnderTheShownCategory_AndBesideASubcategoryFromItsRow.InsertLeafInScope), so six sub-item menus of the Lists area are owned too.ALeafItsAnswersScopeRefuses_LeavesItsIdUnowned_AndIsNotBuiltkeeps the scope-refusal path tested.Deliberately not here
<Any>and noMore..., preselects nothing, and lists categories in list order, not by name.mnuInflAffixTemplate-TemplateTable: the template table is an Unsupported row in the New UI, so nothing raises that menu.MasterCategoryListDlg).Verification: build, comment and token hygiene clean. Targeted tests passed: 39 rule tests in FdoUiTests, 53 in LexTextControlsTests, 172 over the xWorks menu fixtures, then 54 over the three fixtures that share the new test helper. 13 manual steps on Sena 3 in both UIs passed. Tests only (Sena 3 has no data): a template moved up taking its slots, and Insert subitem under Exception "Features". The Move dialog's modal loop is not run by tests. Full suite not run. Main's two newer commits merge cleanly; the merged tree was not built.
Next: approve, or name a Category Edit menu that still behaves differently from Legacy.
Decisions, and why
ChooserDialogin tree single-select mode already exists (LcmCreatePartOfSpeechLauncheruses it);LcmCategoryChooserLauncheradds only the input and the result. Legacy'sTreeCombowithPOSPopupTreeManageris left as it is. Rejected: an in-form drop-down tree on the row, which would need a transient editor in a row that is not editing.DetailObjectDuplication.CopyProperties) and keeps two. The native path creates the copy with the plain model call and copies in the same step, so it is offered only for an object that can copy itself and sits in an owning sequence or collection. The copy's name is the model's: the original's plus "2".slice="owner"means the owner of the row's object, but Legacy switches to the owner only when a slice shows it, so on the shown record it inserts under that record.ResolveTargetnow takes the shown record and does the same.OffersSubItem: the command's class must be the shown record's class). Rejected: a scope limited to Category Edit, which would leave the same command answered two ways.DTMenuHandler.CanInsert; the native menu is built from the row that binds it.CreateCommandAuthority), now also registered in Category Edit. A command that does not apply to the shown category is disabled, and since those items aredefaultVisible="false"it is hidden, as in Legacy.Found in passing
Also happens on main; kept out of this PR.
NullReferenceExceptioninDataTree.SetCurrentSlicePropertyNames) when the UI mode is switched from New to Legacy on a tool whose list is empty, such as Exception "Features" in Sena 3, and the user then leaves the tool. The switch shows the WinForms tree without initializing it.Preflight review details
Code Review Summary
Branch: claude/lt-22691-posedit-b4e759
Base: main (merge base c6cd25f; main has 2 newer commits, #1241 and #1198; #1241 touches
Slice.csin other hunks and merges cleanly; the merged tree was not built)Date: 2026-11-11
Review model: Claude Fable 5.2
Files changed: 18 (1 commit, fe5b5ff)
Overview
LT-22691 stage 4, Category Edit (with main-menu item 3c). In the New UI, every Grammar >
Category Edit row menu is answered by the detail view, and so are the Insert menu's four
category commands. Until now Duplicate and Move on an affix slot or template, and Insert
Subcategory, needed the hidden DataTree. Move asks for the category with an Avalonia chooser
dialog; Duplicate is one undoable step. The move, duplicate and sub-item rules live in
Src/FdoUi/DetailRulesand the WinForms handlers call them. Sub-item inserts are in scopefor every list, which also covers Exception "Features" and the Lists area's sub-item menus.
The native Duplicate fixes LT-22843.
The review was
/code-review highon the working tree before the commit, then the author'sown code review. Nothing Critical or Important is open. The branch has no native, build,
installer or resource change.
Contract/API Changes
FdoUi): newCategoryItemMoveandDetailObjectDuplication;DetailObjectInsertiongainsSubItemsField,OffersSubItemand aResolveTargetoverload that takes the shown record.
DTMenuHandler.GetPOSSlot(public static),MoveSlotandMoveTemplateremoved;the rule is
CategoryItemMove.DTMenuHandler.CanInsertandSlice.HandleCopyCommandcall the shared rules.
RecordEditView.CategoryMenus.cs(Duplicate, Move, theMoveDestinationChosentest seam); the Lexicon cluster authority answers
DataTreeCopyandDataTreeMove;InsertLeafInScopeno longer excludes SubPossibilities; the command authority answersDataTreeInsertin Category Edit.LcmCategoryChooserLauncherover the AvaloniaChooserDialog.Affix Template") in place of the hardcoded "Undo Move Slot" / "Undo Move Template"; moving
a slot to the category it is in no longer makes an undo step.
Findings
Critical - Must address before merge
None.
Important - Should address before merge
chooser cannot show a selection, so nothing was highlighted and OK was enabled (fixed:
the dialog opens with nothing selected and OK waits for a choice)
Minor - Consider
ALeafItsAnswersScopeRefuses_LeavesItsIdUnowned_AndIsNotBuilt)DataTreeMoveReachabilityTestsstill said Move cannot work in the Avalonia view(fixed: summary and assertion messages reworded; both tests unchanged)
DetailObjectDuplication.Duplicatedid not say it creates the copy with the plainmodel call, skipping any step a class adds to its Insert (fixed: stated in the doc
comment)
CategoryEditMenuTestsrepeated the menu-test plumbing of two other fixtures(fixed:
DetailMenuTestSupport.cs, used by all three)Each Insert item resolves the shown record twice(author: leave it as is)After a move the focus goes to the nearest row left, assuming the moved object's(judged in the review to need no change: the focus then lands on arows leave the view
neighbouring row, nothing is lost)
Required Validation / Evidence
.\build.ps1 -CommentHygiene -TokenHygiene: clean..\test.ps1 -CommentHygiene -TokenHygiene -TestFilter ...: FdoUiTests rule fixtures39/39; LexTextControlsTests launcher fixtures 53/53; xWorksTests 172/172 over
CategoryEditMenuTests and the neighbouring menu fixtures, then 54/54 over
CategoryEditMenuTests, LexiconMenuAuthorityTests and NotebookMenuTests after the shared
helper.
passed.
Insert subitem under Exception "Features".
not built.
Positive Observations
LexiconMenuAuthorityTestsshows the nine newly owned menus.Interview Notes
Decisions settled with the author during the session (not re-asked here):
<Any>andMore....(LT-22240), which the New UI does not have.
catalog dialog.
showing is not replicated.
separate change, not this PR.
is switched from New to Legacy on a tool whose list is empty and the user then leaves the
tool.
Suggested Review Focus
CategoryItemMove.Moveagainst the removedDTMenuHandler.MoveSlot/MoveTemplate:same moves, same slot rule.
DetailObjectInsertion.ResolveTargetwith the shown record:slice="owner"no longerstarts at the owner when the row's object is the shown record.
RecordEditView.CategoryMenus.cs: when Duplicate and Move are absent, disabled orenabled.
🤖 Generated with Claude Code
This change is