Repository navigation
chore: simplify mouse input simulation support - #1646
Conversation
Move interrupted and timed-out response projection behind a focused factory so action executors no longer own wire response assembly. Add characterization coverage for timeout fields and multiple pause hits.
Move device release, delta reset, and timeout recovery behind one stateless owner so action execution no longer carries cleanup policy. Keep the async cancellation-token guard tracking the moved methods.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughResponse construction and cleanup logic previously embedded in ChangesMouse Input Response/Cleanup Extraction
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant UseCase as SimulateMouseInputUseCase
participant Factory as MouseInputSimulationResponseFactory
participant Cleanup as MouseInputMainThreadCleanup
participant Registry as PausePointRegistry
participant Mouse
UseCase->>UseCase: detect timeout or pause interruption
alt interrupted by pause point
UseCase->>Factory: InterruptedButtonResult/InterruptedActionResult(...)
Factory->>Registry: query latest pause-point snapshot
Registry-->>Factory: snapshot/hits
Factory-->>UseCase: response with PausePointId, hits
else timed out
UseCase->>Cleanup: ScheduleTimedOutButtonCleanup/OverlayCleanup/DeltaCleanup
Cleanup->>Mouse: release button / reset delta / clear overlay
UseCase->>Factory: TimedOutButtonResult/TimedOutActionResult(...)
Factory-->>UseCase: failure response
end
UseCase-->>UseCase: return SimulateMouseInputResponse
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
User Impact
Changes
MouseInputSimulationResponseFactory.MouseInputMainThreadCleanup.SimulateMouseInputUseCasefrom 770 to 580 lines; action execution remains in the use case for the next R2-42 stages.Refactor Safety
ConfigureAwait(false),CancellationToken.Nonecleanup semantics, fire-and-forget scheduling, response strings and fields, overlay mutations, and Pause Point projection are preserved.SimulateMouseInputUseCase.Verification
SimulateMouseInputTests: 12/12 passed.git diff --check: passed.Follow-up