chore: simplify mouse UI drag orchestration

Merged
HA
3mo ago
+586-336

Summary

  • Complete the final R2-33 extraction so mouse UI simulation remains easier to review and maintain.
  • Preserve all existing one-shot and incremental drag behavior while reducing the use case to a thin action dispatcher.

User Impact

  • There is no intended user-visible behavior change.
  • Drag target selection, response priority, animation timing, cancellation cleanup, and persistent drag state remain unchanged.

Changes

  • Add a shared drag target resolver for path/raycast resolution and IDragHandler lookup.
  • Reuse the resolver from one-shot drag and DragStart while preserving the observable failure order: start-target failure, drop-target failure, then no-handler fallback.
  • Move DragStart, DragMove, DragEnd, and active-drag validation into MouseUiIncrementalDragExecutor.
  • Keep MouseDragState ownership unchanged and pass the main-thread cleanup scheduler explicitly.
  • Reduce SimulateMouseUiUseCase from 434 lines to 137 lines.

Verification

  • Confirmed the resolver tests fail before implementation (0/3) and pass after implementation (3/3).
  • Passed the focused EditMode suites (141/141).
  • Passed the Simulate Mouse UI PlayMode suite before and after each extraction commit (32/32).
  • Compiled the Unity package with 0 errors and 0 warnings.
  • Compared the moved incremental drag block after normalizing static modifiers, scheduler arguments, and signatures; the only remaining difference was a trailing blank line.
  • Verified both cleanup lambdas still call FinalizeDrag before MouseDragState.Clear with the same captures and timing.

Compatibility

  • No IPC request or response shape changed, so the protocol version remains unchanged.
  • R2-40 and R2-41 remain separate follow-up tasks.