Repository navigation
refactor: extract mouse UI press action execution - #1636
Conversation
Expose the final coordinate conversion seam and pin the top-left Y flip and round-trip behavior against the current Game view height before moving the shared implementation.
Move top-left and Unity screen-space conversion into a focused helper so press and drag executors can share the same Game view coordinate contract without depending on the use case.
Move click and long-press event orchestration into a stateless executor, passing the shared cleanup scheduler explicitly so the helper remains independent of the use case. Retarget the timeout-state source guard to the new owner.
|
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)
📝 WalkthroughWalkthroughAdds ChangesMouse UI coordinate conversion and press execution refactor
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant UseCase as SimulateMouseUiUseCase
participant Executor as MouseUiPressActionExecutor
participant Converter as MouseUiCoordinateConverter
participant MainThread as Unity Main Thread
UseCase->>Executor: ExecuteClick / ExecuteLongPress(input)
Executor->>Converter: InputToScreen(inputPos)
Executor->>Executor: resolve pointer targets
Executor->>Executor: update overlay, run expand animation
Executor->>MainThread: switch context
MainThread->>MainThread: fire pointerDown/pointerUp/pointerClick
Executor->>Executor: run dissipate animation
Executor->>UseCase: return SimulateMouseUiResponse
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 |
There was a problem hiding this comment.
No issues found across 8 files
You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
MouseUiCoordinateConverterMouseUiPressActionExecutorSimulateMouseUiUseCasefrom 891 lines to 690 lines while leaving all drag execution for the next stagesBehavioral Preservation
ConfigureAwait(false)callMouseUiPressActionExecutorso it continues to reject Unity object re-evaluation after asynchronous timeoutsPlanned Adaptation
ExecuteClickandExecuteLongPressare now static executor entries and receiveMouseUiMainThreadCleanupSchedulerexplicitlyValidation
SimulateMouseUiTestsPlayMode: 32 passed before and after extractionStaticFacadeStateGuardTests: 20 passed after moving the guarded source ownerCompatibility