Repository navigation
Run the record list's menu commands without the Mediator - #1262
Merged
Merged
Conversation
The main menu, toolbars, pane bar and keyboard shortcuts now ask the window's active record clerk directly to show and run the commands that send InsertItemInVector, DuplicateItemInVector, FirstRecord, PreviousRecord, NextRecord or LastRecord. Until now the Mediator delivered those six messages to every record clerk the window could reach. Only the active clerk answers, and that changes two things. In Collect Words, First, Previous, Next and Last Record now move through the semantic domains; they moved the selected row of the word list. With the pop-up Lexicon Edit window open, Insert > Entry in a main window tool of another area is no longer offered; the pop-up's clerk offered it. DuplicateItemInVector has no Mediator receiver any more. The other five messages keep theirs: two right-click menus of the WinForms Notebook detail view still send InsertItemInVector through the Mediator, and all five still arrive that way when the window has no active clerk to answer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1262 +/- ##
==========================================
+ Coverage 40.34% 40.92% +0.57%
==========================================
Files 1597 1602 +5
Lines 360082 360800 +718
Branches 42148 42245 +97
==========================================
+ Hits 145282 147650 +2368
+ Misses 185121 183653 -1468
+ Partials 29679 29497 -182
🚀 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 5 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 main menu, toolbars, pane bar and keyboard shortcuts now ask the
window's active record clerk directly to show and run the commands
that send InsertItemInVector, DuplicateItemInVector, FirstRecord,
PreviousRecord, NextRecord or LastRecord. Until now the Mediator
delivered those six messages to every record clerk the window could
reach.
Only the active clerk answers, and that changes two things. In Collect
Words, First, Previous, Next and Last Record now move through the
semantic domains; they moved the selected row of the word list. With
the pop-up Lexicon Edit window open, Insert > Entry in a main window
tool of another area is no longer offered; the pop-up's clerk offered
it.
DuplicateItemInVector has no Mediator receiver any more. The other
five messages keep theirs: two right-click menus of the WinForms
Notebook detail view still send InsertItemInVector through the
Mediator, and all five still arrive that way when the window has no
active clerk to answer.
Reviewer notes
Start here:
Src/xWorks/RecordClerkCommandAuthority.cs, the whole change in one small class.RecordClerkonly registers it inActivateUIand removes it inRemoveNotification.The rules.
JumpToRecord.IsActiveClerk). A dependent clerk registers and declines.DetailCommandAuthorityand a clerk never answer the same message, because their order changes whenever a clerk is activated again.Where to look
InCollectWords_TheRecordCommands_MoveTheSemanticDomains_NotTheWordspins the new behaviour.TheActiveClerk_ShowsItsCommands_AsTheMediatorShowsThemcompares both routes for the 39 commands the Mediator still reaches, in five tools. A Collect Words variant covers the 35 inserts.NoNewUiTool_AnswersAMessageItsRecordClerkAnswerspins the disjoint-messages rule.Converted
InsertItemInVector: 35 commands, on the Insert menu and toolbar, Ctrl+I, Ctrl+E, the Notebook pane bar and the WinForms Notebook hotlinks.DuplicateItemInVector: 10 Lists toolbar commands. Its two receivers are now plain methods.FirstRecord,PreviousRecord,NextRecord,LastRecord: Data menu, Standard toolbar, Alt+P and Alt+N.Not here:
DuplicateSelectedItem, raised only from browse-view object menus, which skip authorities. The record arrows still follow a sorted list's stored order, not its on-screen order (Category Edit, the Lists tools).Verification. Build and both hygiene gates clean. 333 targeted xWorks tests pass. By hand on Sena 3, in the WinForms UI and in the New UI where the tool has one: Collect Words, Record Edit (Insert menu, toolbar, Ctrl+I, pane bar, hotlink, right-click menu), Category Edit, Phonemes, Academic Domains and Locations, Lexicon Edit (Ctrl+E), two windows, and the pop-up Lexicon Edit window. Full suites not run. Not re-tested on a merge with main after #1261, which merges cleanly.
Next: approve, or say which rule to change.
Preflight review details
Code Review Summary
Branch: claude/clerk-menu-authority-9a9652
Base: main
Date: 2026-11-24
Review model: Claude Fable 5.2
Files changed: 5 (1 commit)
Overview
A record clerk now registers a command authority (
RecordClerkCommandAuthority) while it isin use in its window. The main menu, toolbars, pane bar and keyboard shortcuts ask it, ahead
of the Mediator, to show and run the commands that send
InsertItemInVector,DuplicateItemInVector,FirstRecord,PreviousRecord,NextRecordandLastRecord.Only the window's active clerk answers.
The Mediator used to offer those messages to every clerk the window could reach, so two
states behave differently: Collect Words, where the record commands now move the semantic
domains and not the word list, and a main-window tool beside the pop-up Lexicon Edit window,
where Insert > Entry is no longer offered.
Contract/API Changes
RecordClerkCommandAuthority : ICommandAuthority, registered inRecordClerk.ActivateUIand removed inRecordClerk.RemoveNotification.RecordClerk.OnDisplayDuplicateItemInVector(object, ref UIItemDisplayProperties)andRecordClerk.OnDuplicateItemInVector(object), public Mediator receivers, are replaced bythe internal
DisplayDuplicateItemInVector(Command, UIItemDisplayProperties)andDuplicateItemInVector(Command).DuplicateItemInVectorhas no Mediator receiver.RecordEditView.InsertItemInVectorMessageis defined asRecordClerkCommandAuthority.InsertItemMessage.Findings
Critical - Must address before merge
None.
Important - Should address before merge
In Collect Words the record commands move the semantic domains, not the word(intended: the author chose the active-clerk rule for navigation; confirmed bylist
hand and pinned by a test)
With the pop-up Lexicon Edit window open, Insert > Entry is no longer offered in a(accepted by the author; confirmed by hand)main-window tool of another area
The duplicate commands have no Mediator fallback(kept by the author's choice:it only matters if a Lists clerk is deactivated while its tool shows, a state in which
Delete Record and published jumps already fail)
Minor - Consider
The authority runs while the Mediator is not processing messages(only while awindow closes;
DetailCommandAuthoritybehaves the same, and the clerk unregisters whenit is disposed)
CheckDisposedinActivateUI(fixed during review:registration moved after it)
IsActiveClerkwas read before the message lookup (fixed during review: thedictionary lookup comes first)
InsertItemInVectormessage (fixed during review:RecordEditView.InsertItemInVectorMessagerefers to the clerk authority's constant)InCollectWords_TheInsertCommands_ShowAsTheMediatorShowsThem)Required Validation / Evidence
./build.ps1 -CommentHygiene -TokenHygiene: 0 warnings, 0 errors, both gates clean../test.ps1 -CommentHygiene -TokenHygiene -TestProject Src\xWorks\xWorksTests -TestFilterover the clerk, menu, record-view, navigation, bulk-edit and authority fixtures: 333
passed. Full suites not run.
RDEwordsclerk inCollect Words and the
concordanceWordsclerk in Word List Concordance; the authoritymoves
SemanticDomainListandconcordanceWords.the tools that have one: Collect Words, Record Edit (Insert menu, toolbar, Ctrl+I, pane
bar, hotlink, right-click menu, record commands), Category Edit, Grammar Sketch, Phonemes,
Academic Domains, Locations, Lexicon Edit (Ctrl+E), two windows, and the pop-up Lexicon
Edit window.
RecordClerk.OnInsertItemInVectorandOnDuplicateSelectedItem. The branch mergescleanly and was not re-tested on that merge.
Positive Observations
WinForms right-click menus and the no-active-clerk fallback.
Interview Notes
no ticket.
the four record commands under the active-clerk rule, and chose to drop the duplicate
pair's Mediator receivers.
Edit. That is
PossibilityRecordListfollowing the stored order of a sorted list; it isthe same on main and is outside this PR.
Suggested Review Focus
RecordClerkCommandAuthorityand its registration inRecordClerk🤖 Generated with Claude Code
This change is