Wire new animation engine into scanning managers with per-session renderer and DI integration#274
Wire new animation engine into scanning managers with per-session renderer and DI integration#274
Conversation
…ger/UserControlAnimationManager, integration tests, and performance benchmarks Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
…n, update INDEX.md Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
…anelName}.animation.json from panel XML configs Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
|
@copilot Review this PR and determine if there is any more work that needs to be completed. |
…n renderer in CreateSession, BuildRenderer in AnimationPlayerAdapter, wiring in DialogCommon/UserControlCommon, tests T21-T25 Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Reviewed the PR. The previous 4 commits had the adapter infrastructure in place ( The following gaps were filled in commit
|
Completes the switch-over to the new animation engine by closing the wiring gap between the adapter infrastructure and the actual call sites. The previous commits added
AnimationPlayerAdapterand property injection on both managers, but the engine was never activated becauseAnimationServicewas never set at call sites andTryCreate()lacked a renderer.Changes Made
Context.AppAnimationServiceAdded a static
IAnimationService AppAnimationServiceproperty toContext.csthat resolvesIAnimationServicefrom the DI container. Returnsnullwhen DI is not configured, preserving full backward compatibility.IAnimationService.CreateSession()— per-session rendererAdded an optional
IHighlightRenderer rendererparameter. When supplied it overrides the DI singleton renderer, allowing each panel to supply its own renderer with panel-specific widget-lookup callbacks. Falls back to the singleton; throwsInvalidOperationExceptionif neither is available.AnimationService.CreateSession()— renderer fallbackImplements the per-session override / singleton fallback chain to match the updated interface.
AnimationPlayerAdapter.BuildRenderer()New factory method that builds a
WinFormsHighlightRendererfrom theWidgettree usingFinder.FindChild()+HighlightOn()/HighlightOff(), with UI-thread marshalling viaControl.BeginInvoke. A sharedInvokeOnUIThread()helper eliminates the duplicated marshalling pattern. The built renderer is passed toCreateSession(), removing the dependency on a pre-registered singleton.DialogCommon.initAnimationManager()Sets
_animationManager.AnimationService = Context.AppAnimationServiceso the new engine is automatically used when DI is configured and falls back to the legacyAnimationPlayerotherwise.UserControlCommon.initAnimationManager()Same wiring pattern as
DialogCommon.Testing
CreateSession()succeeds when a per-session renderer is supplied and the singleton isnullCreateSession()throwsInvalidOperationExceptionwhen no renderer is available at allCreateSession()falls back to the singleton renderer when the per-session parameter isnullAnimationPlayerAdapter.TryCreate()returnsnullwhenIAnimationServiceisnullAnimationPlayerAdapter.TryCreate()succeeds with a singleton renderer and anullroot widgetOriginal prompt
This section details on the original issue you should resolve
<issue_title>Animation System: Integration, Testing & Documentation</issue_title>
<issue_description># Animation System: Integration, Testing & Documentation
Labels
phase-3,workstream-b,animation,integration,testingMilestone
Phase 3: Animation System Modernization
Summary
Wire the new animation engine (from Issue #4) into the existing ACAT application, creating adapter layers so the new engine handles scanning while maintaining 100% backward compatibility. Includes comprehensive testing (unit, integration, performance), BCI extension validation, and developer documentation.
This is the higher-risk part of the animation work — it touches production scanning behavior that users with motor disabilities depend on.
Context
After Issue #4, the new engine exists as standalone components. This issue connects them to the real application:
PanelAnimationManagerdelegates internally toIAnimationService.CreateSession()UserControlAnimationManagersimilarly adaptedAnimationPlayerremains functional for any callers not yet migratedAnimationSharpManagerV2.cs, 2,885 lines) must continue to functionPerformance Requirements (from Design Spec §14)
XML Configuration Landscape
<Animation>elementssrc/ACATResources/panelconfigs/(common/,en/,es/)NumericUserControlBCI.xml(25 animations),KeyboardABCUserControlBCI2.xml(25 animations)Implementation Steps
Part 1: Adapter Layer (~3 days)
Create
AnimationPlayerAdapter— bridgesPanelAnimationManagerto newIAnimationService:PanelAnimationManagercalls remain unchanged from callers' perspectiveIAnimationSessionviaIAnimationService.CreateSession()IAnimationSession.HandleInput()AnimationPlayerif new engine session failsUpdate
PanelAnimationManager.cs:IAnimationService(property injection to avoid constructor breakage)IAnimationServiceis availableUpdate
UserControlAnimationManager.cs:PanelAnimationManagerUpdate
AnimationManager.cs:Part 2: XML-to-JSON Configuration Bridge (~2 days)
Implement
XmlAnimationConfigAdapter(started in Issue Restarting the Presage engine #4, complete here):<Animation>elementsAnimationConfigJSON model at runtimeIterationsas@VarNameruntime referenceScanTime/FirstPauseTimeas variable namesBox1/*,@SelectedWidget)OnSelectedPCodeOnEnter/OnEndPCodeValidate against high-complexity configs:
NumericUserControlBCI.xml(25 animations)KeyboardABCUserControlBCI2.xml(25 animations)KeyboardEditUserControlBCI.xml(17 animations)Part 3: BCI Extension Validation (~2 days)
Validate BCI extension compatibility:
src/Extensions/BCI/AnimationSharpManagerV2.cs(2,885 lines) has its own animation loop and SharpDX overlay renderingDocument BCI migration path for future work:
AnimationSharpManagerV2.cscould be replaced by the new enginePart 4: Testing (~3 days)
Integration tests — test real panel lifecycle with new engine:
Performance benchmarks:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.