chore: simplify mouse UI drag orchestration
Merged
HA
3mo ago+586+586+012345678901234567890123456789-336-336-012345678901234567890123456789
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
IDragHandlerlookup. - Reuse the resolver from one-shot drag and
DragStartwhile preserving the observable failure order: start-target failure, drop-target failure, then no-handler fallback. - Move
DragStart,DragMove,DragEnd, and active-drag validation intoMouseUiIncrementalDragExecutor. - Keep
MouseDragStateownership unchanged and pass the main-thread cleanup scheduler explicitly. - Reduce
SimulateMouseUiUseCasefrom 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
0errors and0warnings. - 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
FinalizeDragbeforeMouseDragState.Clearwith 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.