Repository navigation
Deliver the Filters menu choice to its clerk through Pub/Sub - #1267
Merged
Merged
Conversation
A choice in the View > Filters menu now reaches its record clerk as a Pub/Sub message, published in the main window where it was made, and the clerk filters its list before the menu click returns. Until now the clerk heard it from the Mediator's queued OnPropertyChanged broadcast of currentFilterForRecordClerk_<clerk id>, which the menu no longer sends. This sets the pattern for the other property-table names that still broadcast. The message is the property name behind the prefix "PropertyChanged:", with the new value as its data, published only when the value changed; PropertyTable.SetProperty now returns whether it did. The menu code that stores a list choice publishes the properties named in its own check and broadcasts the rest as before, so each later property moves by joining that check. In an unrelated fix, the Filters menu now names a word set by its best analysis name. A set named only in a second analysis writing system was listed as "Error generating label!". Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1267 +/- ##
=======================================
Coverage 40.92% 40.93%
=======================================
Files 1602 1603 +1
Lines 360800 360816 +16
Branches 42245 42246 +1
=======================================
+ Hits 147648 147682 +34
+ Misses 183655 183639 -16
+ Partials 29497 29495 -2
🚀 New features to boost your workflow:
|
thejambi
approved these changes
Nov 25, 2026
thejambi
left a comment
Contributor
There was a problem hiding this comment.
@thejambi reviewed 10 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.
A choice in the View > Filters menu now reaches its record clerk as a Pub/Sub message, published in the main window where it was made, and the clerk filters its list before the menu click returns. Until now the clerk heard it from the Mediator's queued OnPropertyChanged broadcast of
currentFilterForRecordClerk_<clerk id>, which the menu no longer sends.This sets the pattern for the other property-table names that still broadcast. The message is the property name behind the prefix
PropertyChanged:, with the new value as its data, published only when the value changed;PropertyTable.SetPropertynow returns whether it did. The menu code that stores a list choice publishes the properties named in its own check and broadcasts the rest as before, so each later property moves by joining that check.In an unrelated fix, the Filters menu now names a word set by its best analysis name. A set named only in a second analysis writing system was listed as "Error generating label!".
Reviewer notes
Start here:
ChoiceGroup.ChooseSinglePropertyAtomicValueinSrc/XCore/xCoreInterfaces/ChoiceGroup.cs. It is the sender: one check decides, per property name, between a Pub/Sub publish and the Mediator broadcast. Then readRecordClerk.ActivateUIandRemoveNotificationfor the listener.Does anything still need the Mediator to hear this property? No. The clerk was its only
OnPropertyChangedlistener, and every other property the menu code serves is set and broadcast exactly as before.Where to look
MenuChoice_OfTheCheckedItem_DoesNotFilterAgain.MenuChoice_InAnotherWindow_LeavesThisWindowsClerkAlone.ActivateUIandBecomeInactive, as it does for its three other subscriptions.SetPropertyreturnsboolinstead ofvoid: source compatible, not binary compatible for an assembly built outside this repository.Deliberately not here
<name>Parametersset in the same method still broadcasts for every property.LinkListener.FollowActiveLinkstill sets link-carried properties with the broadcast flag.Verification
RecordClerkFilterSelectionTests, three in the newChoiceGroupPropertyChoiceTests, and one each inPropertyTableTests,PubSubSystemTestsandWordformFiltersTests. Each new clerk test was confirmed to fail with its rule removed.Next: approve, or tell me what to change.
What stopped happening
OnPropertyChangedforcurrentFilterForRecordClerk_<clerk id>. The clerk was the only listener, and it now subscribes.RecordList.ReloadListputs the reload off whileClerk.IsActiveInGuiis false).currentFilterForRecordClerk_<clerk id>sets the menu's check mark without filtering the list. No code builds such a link; the link producers add onlyInterlinearTab,ConcordOn,SuspendLoadListUntilOnChangeFilter,LinkSetupInfoandHvoOfAnthroItem.Decisions, and why
The sender publishes; the property table does not. A flag on
SetProperty(no notice, publish now, publish later) was the alternative. It lost for three reasons. Some later names need one notice after two sets, which a flag on a single set cannot express. Publishing at the end of an action needs a fixed order entry per message, which a property name taken from configuration cannot have. And the intended end state is a property table that stores values and notifies nobody.Not every broadcasting set publishes. Having the table publish on every set that broadcasts would have needed no sender changes. It was rejected because
LinkListener.FollowActiveLinksets property names taken from a link URL, so a link could publish a message named like a real event, and because sets that still depend on queued delivery would be published at once.The message name carries a prefix. Property names come from configuration files, so a bare name could equal the name of an existing event.
PropertyChangedMessages_ShareNoNameWithAnotherMessagefails if anEventConstantsname ever starts with the prefix.The shared setter publishes listed names only. Publishing every property it serves would also tell subscribers about names whose other senders are not ready for immediate delivery. The same check turns the Mediator broadcast off for a listed name, so no dead job is queued for it.
The clerk reads the property table, not the message data. The table is what the menu's check mark reads, so the two cannot disagree.
Only the new unsubscribe is guarded by
!m_isDisposed. Its message name is built from the clerk's id, which throws after disposal, andBecomeInactivecan reach a disposed clerk. The other three use fixed names.Found in passing
WordSetFilter.SameFiltercompares the display name as well as the id, and the name is saved with the filter. Renaming a set after a filter on it was saved leaves its Filters menu item unchecked after a restart, although the list opens filtered. The id is the set's hvo, which has the same effect when the hvo changes between sessions.xWindow.LoadDefaultPropertiesruns before the window stores itself in its property table. A default property with alistattribute would be chosen with no window to scope a publish. No configuration has such a default.Preflight review details
Code Review Summary
Branch: claude/pubsub-current-filter-a7bef8
Base: main (merge base 183be7c)
Date: 2026-11-25
Review model: Claude Fable 5.2
Files changed: 10 (1 commit)
Overview
The branch moves
currentFilterForRecordClerk_<clerk id>off the Mediator'squeued
OnPropertyChangedbroadcast. A choice in View > Filters is now publishedthrough Pub/Sub, scoped to the main window, and the record clerk subscribes to its
own property's message while it is active in the GUI. It is the first of the
property-table names to move this way and sets the pattern for the rest: the
message is the property name behind the prefix
PropertyChanged:, the value isthe data, and the sender publishes only when the value changed.
One unrelated one-line fix rides along at the author's request: a word set named
only in a non-default analysis writing system was listed in the Filters menu as
"Error generating label!".
Contract/API Changes
PropertyTable.SetProperty(both public overloads) returnsbool(true when theproperty is new or its value changed) instead of
void. Source compatible;binary incompatible for an assembly built outside the repository.
PropertyConstantsgainsChangedMessagePrefix,CurrentFilterForRecordClerkPrefixand
PropertyChanged(string propertyName).ChoiceGroup.ChooseSinglePropertyAtomicValuepublishes the properties named inits own check (today the
currentFilterForRecordClerk_prefix) and no longerbroadcasts those through the Mediator; every other property is unchanged.
RecordClerk.OnPropertyChangedno longer answers its filter property.Findings
Critical - Must address before merge
None.
Important - Should address before merge
(Kept: this is the lifetime of the clerk's threeSrc/xWorks/RecordClerk.cs: the clerk hears the menu only betweenActivateUIandBecomeInactive, where the Mediator reached it whenever itsview was a message target.
other subscriptions; no tool path was found that leaves a live view's clerk
inactive; InfoPane and PopupToolWindow re-activate it.)
(Accepted: no code builds such a link; inventory item 10.30 stopsSrc/xWorks/RecordClerk.cs: a link whose URL carriescurrentFilterForRecordClerk_<id>now changes the menu's check mark withoutfiltering.
LinkListener broadcasting those sets.)
Minor - Consider
review:
ChoiceGroupPropertyChoiceTests.cschecks the message, value, scope,the unchanged-value case and that an unlisted property goes to the Mediator
only)
(Kept: the table is what the menu's check mark reads.)RecordClerk.CurrentFilterChosenignores the published value and re-readsthe property table.
(All threeChoiceGroup.PublishesChoicethrows on a null property name.callers pass a non-null name.)
The publish is process-wide when no window is registered(
xWindow.LoadDefaultPropertiesruns before the window property is set).(No configuration has a list default property.)
The filter change now runs inside the menu click, under
(Manual runs on a 7,059-wordform listListPropertyChoice's click guard.behaved normally.)
WordSetFilter.SameFiltercompares the display name, so renaming a setafter saving a filter leaves its menu item unchecked on restart.
(Pre-existing; belongs with the known hvo-as-id problem.)
Required Validation / Evidence
.\build.ps1 -CommentHygiene -TokenHygiene: clean, 0 warnings.xCoreTests 30; xCoreInterfacesTests 28; FiltersTests 25; FwUtilsTests 494.
(no subscription, unscoped subscription, unconditional publish, no
unsubscribe).
Bulk Edit Wordforms (choose, re-choose, clear, No Filter), two windows, and
Lexicon Edit column filter cleared by No Filter, in both UI modes.
Positive Observations
and the scope; the handler needs no "is this mine?" test.
job is queued for it.
EventConstantsname.
Interview Notes
the author before any code.
SetPropertyreturnsboolso the sender can keep change-only delivery.names, and for the prefix and builder to live in
PropertyConstants.broadcast; the author asked for this in place of publishing every member.
!m_isDisposedguard around the new unsubscribe stays on that one call.Suggested Review Focus
ChoiceGroup.ChooseSinglePropertyAtomicValue: the per-name check and theorder of set, persistence and publish.
RecordClerk.ActivateUI/RemoveNotification: the subscription lifetime.PropertyTable.SetProperty: the return value.🤖 Generated with Claude Code
This change is