Fix action keywords for disabled web search sources

DO
2d ago
+74-9

Fixes #4744.

Web Searches already excludes disabled sources when producing results, but their action keywords can still intercept a query and appear in Plugin Indicator.

Reconcile the registered keywords with the enabled sources at startup and after a source is added, edited, or deleted. Keep a shared keyword registered while any enabled source uses it.

Both new startup cases failed before the change and passed afterward. The Web Searches, query builder, and URL plugin tests passed on Windows (101 tests).


Summary by cubic

Summary of changes

Fixes #4744. Web search results already excluded disabled sources, but their action keywords could still intercept queries and appear in the Plugin Indicator.

  • Replaces the direct AddActionKeyword/RemoveActionKeyword calls on add, edit, and delete with a single reconciliation step so disabled sources no longer keep registered keywords.
  • Adds UpdateActionKeywords, which runs at startup and after source changes; it removes stale keywords, adds missing ones for enabled sources, and keeps a shared keyword registered while any enabled source uses it.
  • Removes the direct API keyword calls from SearchSourceSetting.xaml.cs (add/edit) and SettingsControl.xaml.cs (delete); all paths now route through UpdateActionKeywords.
  • No memory usage impact; only plugin API keyword registration changes, with no new persistent data.
  • No security risks; the change affects only action keyword registration, not query handling or permissions.
  • Adds WebSearchPluginTest.cs with startup cases for enabled and disabled global search; the Web Searches, query builder, and URL plugin test suites pass on Windows (101 tests).

Release Note

Disabled web search sources no longer intercept query keywords or show up in the plugin indicator.