Fix split divider drag tracking during multi-split resize#89
Fix split divider drag tracking during multi-split resize#89austinywang merged 1 commit intomainfrom
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified hit-testing and state update logic in the split container divider handler. Added an inclusive boundary check helper function, adjusted divider hit rect inset from -4 to -5 pixels, and replaced asynchronous state updates with synchronous direct assignments in the drag delegate callback. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ 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 1 file
You’re at about 94% of the monthly review 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.
Greptile SummaryThis PR fixes multi-split divider drag tracking with three coordinated changes: expanding the hit rect from Confidence Score: 5/5Safe to merge — all three fixes are narrowly targeted and consistent with the surrounding delegate pattern. No P0/P1 issues found. The -4→-5 alignment closes a hit-area mismatch between checkDividerDrag and the two AppKit delegate methods (effectiveRect/additionalEffectiveRect) that already used -5. The inclusive boundary check (>=/<=) directly fixes the known AppKit edge case where a point reported exactly on maxX/maxY would fail NSRect.contains. Removing the Task { @mainactor in } wrapper is safe because NSSplitViewDelegate callbacks always execute on the main thread; the isSyncingProgrammatically guard already prevents re-entrant feedback loops, and synchronous writes are consistent with the non-drag path that already calls syncPosition and onGeometryChange? synchronously. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User (Mouse)
participant AppKit as NSSplitView (AppKit)
participant Delegate as SplitCoordinator
participant State as splitState
User->>AppKit: leftMouseDown / leftMouseDragged
AppKit->>Delegate: splitViewWillResizeSubviews
Delegate->>Delegate: checkDividerDrag(event)<br/>hitRect = dividerRect.insetBy(-5,-5)<br/>dividerHitRectContains → inclusive boundary
Delegate-->>Delegate: isDragging = true
AppKit->>Delegate: splitViewDidResizeSubviews
Delegate->>Delegate: wasDragging = isDragging && leftDown
Delegate->>State: splitState.dividerPosition = normalizedPosition (synchronous, main thread)
Delegate->>Delegate: onGeometryChange?(wasDragging)
User->>AppKit: leftMouseUp
AppKit->>Delegate: splitViewDidResizeSubviews
Delegate->>Delegate: leftDown=false → wasDragging=false, isDragging=false
Delegate->>Delegate: syncPosition(statePosition) — re-assert model
Reviews (1): Last reviewed commit: "Fix split divider drag tracking during m..." | Re-trigger Greptile |
Summary
Verification
Notes
Summary by cubic
Fixes unreliable divider drag tracking during multi-split resizes. Expands the hit area and writes divider updates synchronously to prevent missed drags and snap-backs.
Written for commit 0e7b0b8. Summary will update on new commits.
Summary by CodeRabbit