CQRS Call-Site Migration: Phase 2 Extension Handlers & Phase 3 Base Classes#269
Merged
michaelbeale-IL merged 2 commits intomasterfrom Feb 24, 2026
Merged
Conversation
… classes Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate call sites to injected CQRS handlers
CQRS Call-Site Migration: Phase 2 Extension Handlers & Phase 3 Base Classes
Feb 24, 2026
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.
Migrates
PanelManager.Instance.CreatePanel/Context.AppPanelManager.CreatePaneldirect singleton call sites to useICommandHandler<CreatePanelCommand>via CQRS, with safe DI-or-fallback pattern throughout.Phase 2 – Extension Command Handlers
Inline safe-fallback pattern (no constructor change possible — framework instantiates these):
TalkWindowHandler.cs–CmdTalkApppanel creationShowScreenLockHandler.cs– screen lock scanner creationDashboardAppScanner.cs–ShowTalkPanelscanner creationPhase 3 – Base Classes (property injection)
Single-field + lazy-resolve property added to each base class; propagates automatically to all derived types:
ActuatorBase.cs–ShowDefaultScanTimingsConfigureDialog+ShowDefaultTryoutDialogScannerCommon.cs–Interpreter_EvtShowPopuppopup scannerDialogCommon.cs–createAndShowScannerForWidgetscannerTests
New
CQRSHandlerTests.cscovers both resolution paths forCreatePanelCommandHandlerandHandleActuatorSwitchCommandHandler: DI-available (verifies manager delegation) and null-handler fallback (verifies no exception, no state mutation).Original prompt
This section details on the original issue you should resolve
<issue_title>CQRS Call-Site Migration: Entry Points, Handlers & Base Classes</issue_title>
<issue_description># CQRS Call-Site Migration: Entry Points, Handlers & Base Classes
Labels
phase-3,workstream-a,architecture,cqrsMilestone
Phase 3: Architecture Completion
Summary
Migrate 76 call sites from direct singleton access (
Context.AppPanelManager,Context.AppActuatorManager) to injected CQRS command/query handlers. This covers Phases 1–3 of the CQRS Implementation Guide, targeting the highest-leverage structural changes — application entry points, command handlers, and base classes.Phase 4 (122 agent query sites) is handled in a separate issue.
Context
CQRS infrastructure was built in Phase 2:
ICommandHandler<T>andIQueryHandler<TQuery, TResult>interfaces exist insrc/Libraries/ACATCore/Patterns/CQRS/AddCQRSHandlers():CreatePanelCommandHandler→CreatePanelCommandHandleActuatorSwitchCommandHandler→HandleActuatorSwitchCommandGetActiveAgentNameQueryHandler→GetActiveAgentNameQuery→stringGetConfigurationValueQueryHandler→GetConfigurationValueQuery→stringServiceConfiguration.cs→ServiceCollectionExtensions.csContext.ServiceProviderbridges DI into legacy singleton codeThe established safe-fallback pattern is:
Implementation Steps
Phase 1: Application Entry Points (4 sites, 2 files)
These already have access to
_serviceProvider. Lowest risk.src/Applications/ACATApp/Program.cs(2 panel creation sites)ICommandHandler<CreatePanelCommand>from_serviceProviderPanelManager.Instance.CreatePanel()callssrc/Applications/ACATTalk/Program.cs(2 panel creation sites)Phase 2: Extension Handlers (5 sites, ~5 files)
Command handlers that respond to user actions. Use constructor injection.
src/Extensions/Default/UI/Scanners/DashboardAppScanner.cs(1 site)ICommandHandler<CreatePanelCommand>as constructor parametersrc/Extensions/Default/UI/CommandHandlers/(4 sites across ~4 files)TalkWindowHandler.csShowScreenLockHandler.csPhase 3: Base Classes (67 sites, ~3 files — highest leverage)
Changes to base classes automatically fix all derived classes. Use property injection with safe fallback to avoid breaking constructor signatures in 30+ derived classes.
src/Libraries/ACATCore/ActuatorManagement/ActuatorBase.cs(2 panel creation sites)ICommandHandler<HandleActuatorSwitchCommand>as injectable propertyContext.ServiceProviderinInit()or property setterContext.AppActuatorManager.Pause()/Resume()callssrc/Libraries/ACATCore/PanelManagement/ScannerCommon.cs(~30 actuator pause/resume sites)ICommandHandler<HandleActuatorSwitchCommand>_handler ?? Context.AppActuatorManagersrc/Libraries/ACATCore/PanelManagement/DialogCommon.cs(~20 actuator sites)Remaining base class sites (~15 across other base classes)
Acceptance Criteria
PanelManager.InstanceorContext.AppActuatorManager.Pause()/Resume()access in migrated filesKey Files
src/docs/SECTION_3_3_IMPLEMENTATION_GUIDE.mdsrc/Libraries/ACATCore/Patterns/CQRS/✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.