Skip to content

Publish JumpToRecord at once from two Find dialog handlers - #1243

Merged
mark-sil merged 1 commit into
mainfrom
claude/pubsub-jump-after-dialog-senders-25d97c
Nov 12, 2026
Merged

mark-sil merged 1 commit into
mainfrom
claude/pubsub-jump-after-dialog-senders-25d97c

Conversation

@mark-sil

@mark-sil mark-sil commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Find Record in the Notebook and Find Wordform in Texts & Words now publish JumpToRecord to their own window, so the window's active clerk selects the chosen record before the handler returns. Until now each queued it with the Mediator's BroadcastMessageUntilHandled, which ran after the handler had returned and offered the jump to every colleague of the window.

The two senders are GoLinkRecordDlgListener.OnGotoRecord and MorphologyListener.OnGotoWfiWordform.

The jump can run at once because each handler publishes as its last step, after its dialog has closed. When a filter hides the chosen record, the clerk's prompt to turn the filter off now opens inside the handler.

Reviewer notes

Start here: Src/LexText/LexTextControls/RecordDlgListener.cs, GoLinkRecordDlgListener.OnGotoRecord -- the whole change is this swap, made twice.

The unknown: what does an immediate jump change? The only Pub/Sub subscriber is RecordClerk.JumpToRecordViaPublisher, which acts only in the window's active clerk, and both ends are scoped to the main window.

  • The Notebook tools have no other JumpToRecord handler, so the clerk was already the only receiver that acted.
  • Find Wordform is enabled only while the wordform-list clerk (concordanceWords) is active: Word Analyses, Word List Concordance and Bulk Edit Wordforms. It is hidden in the Concordance tool, so ConcordanceControl is never involved.
  • In Word List Concordance the occurrences pane has a second, dependent clerk, which the Mediator could also offer the jump. The publish reaches only the active wordform clerk.
  • The filter prompt is the one visible difference: it now opens while the handler is on the stack, with the Find dialog already closed.

Where to look.

  • Both hunks: the publish is the last statement before the dialog is disposed and the handler returns.
  • MorphologyListener.cs: the added using static is the only other change.

Deliberately not here. Four other senders that jump after a dialog stay on the Mediator.

  • GoLinkEntryDlgListener.OnGotoLexEntry (WinForms and Avalonia Go-to-Entry) and ReversalListener.OnGotoReversalEntry: in Dictionary and Reversal Indexes the preview XhtmlDocView is a High-priority Mediator colleague and hears the jump before the clerk. A clerk-only publish would drop its "Entry not published" warning and its preview regeneration. They convert once the doc view hears JumpToRecord over Pub/Sub.
  • FwXWindow.JumpToPopupLexEntry: it runs inside Insert Entry's closing handler, and in Lexicon Edit the dialogs that link an entry run their linking code after it.

Verification.

  • build.ps1 -CommentHygiene -TokenHygiene: 0 warnings, 0 errors.
  • No automated test: each handler opens a modal dialog before the publish.
  • Manual, project Ibwe, all passed:
    • Notebook > Record Edit: Find Record; a filter-hidden record with the prompt answered No and Yes; Find Record > Create; a jump in one of two windows leaves the other alone.
    • Texts & Words: Find Wordform in Word Analyses, Word List Concordance and Bulk Edit Wordforms; a filter-hidden wordform with No and Yes; no Find Wordform in the Concordance tool; two windows.

No Jira ticket: Pub/Sub work gets none.

Next: approve, or tell me what to change.

Found in passing

The JumpToRecord senders converted in #1054 have the same gap with the doc view. In Lexicon > Dictionary with a publication selected, Insert > Entry and choosing an existing entry that is excluded from that publication no longer shows the "Entry not published" warning; Edit > Find lexical entry on the same entry still does. Reproduced on main, and the warning appears in a build from before #1054. Not changed here; it will be fixed with the doc view's Pub/Sub path.

Preflight review details

Code Review Summary

Branch: claude/pubsub-jump-after-dialog-senders-25d97c
Base: origin/main (merge base 21935d3; one unrelated commit on main since)
Date: 2026-11-11
Review model: Claude Fable 5.2
Files changed: 2 (1 commit)

Overview

Part of retiring the xCore Mediator: two deferred BroadcastMessageUntilHandled("JumpToRecord")
senders become an immediate, window-scoped Publisher.Publish. They are
GoLinkRecordDlgListener.OnGotoRecord (Notebook, Edit > Find Record) and
MorphologyListener.OnGotoWfiWordform (Texts & Words, Edit > Find Wordform). The only subscriber
is RecordClerk.JumpToRecordViaPublisher, which acts only in the window's active clerk.

Four other senders that jump after a dialog were examined and left on the Mediator.
GoLinkEntryDlgListener.OnGotoLexEntry (two sites) and ReversalListener.OnGotoReversalEntry fire
in tools whose XhtmlDocView hears a Mediator JumpToRecord before the clerk (it is a High-priority
target and Mediator.InvokeRecursively orders targets by priority); a clerk-only publish would
drop the Dictionary tool's "Entry not published" warning and the preview's regeneration.
FwXWindow.JumpToPopupLexEntry publishes from inside Insert Entry's closing handler, and on the
Lexicon Edit linking-dialog paths the launcher's linking code runs after it.

Contract/API Changes

None. No public member changes.

Findings

Critical - Must address before merge

None.

Important - Should address before merge

None.

Minor - Consider

  • The two converted handlers have no automated test (each opens a modal Go dialog before
    the publish; the author keeps the handlers as they are instead of extracting the post-dialog
    step only for a test, as in Publish JumpToRecord at once from three detail-pane handlers #1241; the manual runs below cover them)
  • The filter prompt now opens inside the handler (each handler publishes as its last
    step, with its dialog closed; manual steps covered both answers in both areas)

Required Validation / Evidence

  • ./build.ps1 -CommentHygiene -TokenHygiene: clean, 0 warnings, 0 errors.
  • No automated test run: no test project covers these two handlers, and none was added.
  • Manual (author, project Ibwe), all passed:
    • Notebook > Record Edit: Find Record selects the chosen record; a filter-hidden record with the
      prompt answered No and Yes; Find Record > Create; a jump in one of two windows leaves the other
      alone.
    • Texts & Words: Find Wordform in Word Analyses, Word List Concordance and Bulk Edit Wordforms; a
      filter-hidden wordform with No and Yes; the Concordance tool's Edit menu has no Find Wordform;
      two windows.

Jira: none, per the standing rule that Pub/Sub work gets no tickets.

Positive Observations

  • Each sender diff is the broadcast swapped for a scoped publish, with no restructuring.
  • Neither tool area hosts another JumpToRecord handler, so the clerk was already the only
    receiver that acted.

Interview Notes

  • The author chose to convert only the two senders whose tools have no XhtmlDocView and no code
    after the jump, and to leave the other four on the Mediator.
  • While checking the dispatch order, the same gap was found in the JumpToRecord senders converted
    by LT-21483: Part 1 - Move JumpToRecord to Pub/Sub (SendMessage) #1054: Insert Entry in the Dictionary tool, choosing an existing entry excluded from the
    selected publication, no longer shows the "Entry not published" warning. The author reproduced
    it on main and saw the warning in an older build. It is tracked separately and is not changed
    here.
  • Find Wordform is enabled only where the active clerk is concordanceWords, the wordform-list
    clerk, so it never reaches the Concordance tool's ConcordanceControl.

Suggested Review Focus

  • Both hunks: the publish is the handler's last step and is scoped with
    m_propertyTable.GetWindow().
  • MorphologyListener.cs: the added using static is the only other change.

🤖 Generated with Claude Code


This change is Reviewable

Find Record in the Notebook and Find Wordform in Texts & Words now
publish JumpToRecord to their own window, so the window's active clerk
selects the chosen record before the handler returns. Until now each
queued it with the Mediator's BroadcastMessageUntilHandled, which ran
after the handler had returned and offered the jump to every colleague
of the window.

The two senders are GoLinkRecordDlgListener.OnGotoRecord and
MorphologyListener.OnGotoWfiWordform.

The jump can run at once because each handler publishes as its last
step, after its dialog has closed. When a filter hides the chosen
record, the clerk's prompt to turn the filter off now opens inside the
handler.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   14m 32s ⏱️ -33s
7 212 tests ±0  7 127 ✅ ±0  85 💤 ±0  0 ❌ ±0 
7 221 runs  ±0  7 136 ✅ ±0  85 💤 ±0  0 ❌ ±0 

Results for commit 7d562da. ± Comparison against base commit a1f69e7.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.71%. Comparing base (21935d3) to head (7d562da).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Src/LexText/LexTextControls/RecordDlgListener.cs 0.00% 1 Missing ⚠️
Src/LexText/Morphology/MorphologyListener.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1243      +/-   ##
==========================================
+ Coverage   40.70%   40.71%   +0.01%     
==========================================
  Files        1567     1569       +2     
  Lines      356900   357048     +148     
  Branches    41754    41782      +28     
==========================================
+ Hits       145264   145375     +111     
- Misses     182305   182331      +26     
- Partials    29331    29342      +11     
Files with missing lines Coverage Δ
Src/LexText/LexTextControls/RecordDlgListener.cs 0.00% <0.00%> (ø)
Src/LexText/Morphology/MorphologyListener.cs 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thejambi thejambi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@thejambi reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on mark-sil).

@mark-sil
mark-sil merged commit ef1a81c into main Nov 12, 2026
9 checks passed
@mark-sil
mark-sil deleted the claude/pubsub-jump-after-dialog-senders-25d97c branch November 12, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants