Skip to content

LT-21515: Implement GetToolForList in Pub/Sub system#930

Merged
mark-sil merged 2 commits into
mainfrom
LT-21515
Jun 9, 2026
Merged

LT-21515: Implement GetToolForList in Pub/Sub system#930
mark-sil merged 2 commits into
mainfrom
LT-21515

Conversation

@mark-sil

@mark-sil mark-sil commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This change is Reviewable

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ± 0      1 suites  ±0   11m 43s ⏱️ -5s
4 251 tests +41  4 178 ✅ +38  73 💤 +3  0 ❌ ±0 
4 260 runs  +41  4 187 ✅ +38  73 💤 +3  0 ❌ ±0 

Results for commit 5fe81b2. ± Comparison against base commit 53d5dbb.

This pull request removes 2 and adds 43 tests. Note that renamed tests count towards both.
SIL.FieldWorks.Common.RootSites.SimpleRootSiteTests.RenderEngineFactoryTests ‑ get_Renderer_Graphite
SIL.FieldWorks.Common.RootSites.SimpleRootSiteTests.RenderEngineFactoryTests ‑ get_Renderer_Uniscribe
LexTextDllTests.AreaListenerTests ‑ GetToolForList_KnownList_ReturnsConfiguredToolName
LexTextDllTests.AreaListenerTests ‑ GetToolForList_UnknownList_ReturnsCustomToolName
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ NormalizePreservingLegacy_NormalizesOpenTypeFeatures
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ NormalizePreservingLegacy_NormalizesOpenTypeFeaturesThatStartWithPunctuation
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ NormalizePreservingLegacy_PreservesNumericGraphiteFeatureIds
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ Normalize_ReturnsDeterministicRendererNeutralString
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ Parse_AcceptsCustomPrintableAsciiTags
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ Parse_IgnoresInvalidEntries
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ Parse_LastValueWinsForDuplicateTags
SIL.FieldWorks.Common.FwUtils.FontFeatureSettingsTests ‑ Parse_LogsIgnoredInvalidEntries
…

♻️ This comment has been updated with latest results.

Copilot AI 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.

Pull request overview

This PR migrates the “GetToolForList” lookup used during link-following (when a link’s tool is "default" and the target is a CmPossibilityList) from the obsolete XCore Mediator.SendMessage reflection pathway to the FieldWorks FwUtils Publisher/Subscriber pub-sub system, reducing reliance on obsolete APIs and cross-assembly mediator messaging.

Changes:

  • Replace m_mediator.SendMessage("GetToolForList", ...) with Publisher.Publish(EventConstants.GetToolForList, ...) in LinkListener.
  • Add EventConstants.GetToolForList subscription/unsubscription in AreaListener.
  • Convert the handler from OnGetToolForList (mediator/reflection shape) to a pub-sub handler that returns the tool name via parameters[1].

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Src/xWorks/LinkListener.cs Publishes GetToolForList via pub-sub instead of calling obsolete mediator reflection.
Src/LexText/LexTextDll/AreaListener.cs Subscribes to GetToolForList and provides the handler to map a list to its editing tool name via the pub-sub payload.

Comment thread Src/xWorks/LinkListener.cs Outdated
@@ -512,9 +512,7 @@ private bool FollowActiveLink(bool suspendLoadingRecord)
// Thus we've created this method (on AreaListener) which we call awkwardly throught the mediator.
Subscriber.Subscribe(EventConstants.SetToolFromName, SetToolFromName);
Subscriber.Subscribe(EventConstants.ReloadAreaTools, ReloadAreaTools);
Subscriber.Subscribe(EventConstants.GetContentControlParameters, GetContentControlParameters);
Subscriber.Subscribe(EventConstants.GetToolForList, GetToolForList);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I disagree with this type of request in this type of PR. This PR is a tool replacement.  If I understand this correctly, then I think this is a pre-existing coverage gap, not a gap introduced by this PR.  The mediator.SendMessage() call did not have this type of test coverage.

We probably should discuss as a group if tests for pre-existing coverage gaps that would be “nice to have”, should block a PR.

I’m adding the Claude generated tests to continue moving this PR forward.

@mark-sil mark-sil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mark-sil made 1 comment and resolved 1 discussion.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion.

Subscriber.Subscribe(EventConstants.SetToolFromName, SetToolFromName);
Subscriber.Subscribe(EventConstants.ReloadAreaTools, ReloadAreaTools);
Subscriber.Subscribe(EventConstants.GetContentControlParameters, GetContentControlParameters);
Subscriber.Subscribe(EventConstants.GetToolForList, GetToolForList);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I disagree with this type of request in this type of PR. This PR is a tool replacement.  If I understand this correctly, then I think this is a pre-existing coverage gap, not a gap introduced by this PR.  The mediator.SendMessage() call did not have this type of test coverage.

We probably should discuss as a group if tests for pre-existing coverage gaps that would be “nice to have”, should block a PR.

I’m adding the Claude generated tests to continue moving this PR forward.

@johnml1135 johnml1135 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:

@johnml1135 johnml1135 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.

@johnml1135 reviewed 3 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on mark-sil).

@mark-sil mark-sil merged commit 026ca3d into main Jun 9, 2026
6 of 7 checks passed
@mark-sil mark-sil deleted the LT-21515 branch June 9, 2026 18:25
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