Add equal-grid snapping for split panes - #2488
Conversation
0d39493 to
074e03f
Compare
074e03f to
956030f
Compare
|
Reopened after correcting the interaction model: this now uses one shared midpoint grid per split surface with fast-crossing capture and magnetic release hysteresis. |
eb95481 to
a128a99
Compare
|
🚨 SLOP COP 🚨 · I am SlopCop. I will review this pull request against the configured guidelines. I will check security, code quality, performance, architecture, duplication, tests, and user behavior. I will post one final report after the parallel checks finish. |
a128a99 to
4796c42
Compare
4796c42 to
2aeab61
Compare
| moveEvent.stopPropagation(); | ||
| const nextPointer = | ||
| axis === "x" ? moveEvent.clientX : moveEvent.clientY; | ||
| const result = snapSession.resolve({ |
There was a problem hiding this comment.
🚨 slopcop/review — The panel adapter applies the wrong size limits.
The shared resolver limits the leading panel to 15%–85%. These panels require 30%–76%, plus a collapsed state.
The adapter blocks the panel library's move events. Thus, the panels cannot reach their collapse thresholds.
A browser check showed a 15% preview. The panel then jumped to 24% after release.
Pass the panel limits and collapse rules into this path. Add tests for both limits and both collapse directions.
| }; | ||
| const commitDrag = () => complete(true); | ||
| const cancelDrag = () => complete(false); | ||
| const finishForPointer = (finishEvent: PointerEvent) => { |
There was a problem hiding this comment.
🚨 slopcop/review — A pointer cancellation saves a temporary size.
pointercancel calls the commit path. The custom split dividers restore the original size after a cancellation.
Route this event to cancelDrag. Add a test that restores both flex values and preserves the panel state.
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Plain English summary
This change makes a divider pause at equal pane sizes. It adds the same guide and resistance to inner splits and right panels.
Findings
-
High — The right-panel adapter uses the generic 15%–85% split limits.
The panels require 30%–76%, plus a collapsed state. The adapter also blocks the panel library's move events.
Thus, a user cannot collapse either panel with a drag. Extreme previews also jump to a valid size after release.
-
Medium — A
pointercancelevent commits the temporary preview.A browser or device can cancel a pointer action. This event must restore the original size, as the custom dividers do.
Other review results
I found no security problem. I also found no new performance problem in the pointer-move path.
Three resize paths repeat pair state and release logic. A shared drag-session helper could keep their behavior consistent.
Verification
- The Turbo type check for
@bb/apppassed. - The five focused test files passed all 99 tests.
- The full app suite passed 3,477 tests. Nine failures occurred in unchanged test files.
- A Chrome check reproduced both findings on the real right-panel handle.
- The final GPT-5.6 review gate confirmed both findings and returned
REQUEST CHANGES. - The author rebased the branch during this review. The two affected feature files remained identical.
Please fix both regressions before merge. I posted this as a comment-only review, as required.
Why
Users usually want a newly created split to return to equal-sized panes, but free resizing makes that canonical grid hard to recover precisely. This layer adds one shared equal-grid interaction to tab, page/thread, and thread/right-panel dividers without removing arbitrary sizing.
User-visible behavior
Reliability and performance
Screenshot evidence
All captures use Chrome for Testing 151.0.7922.71 at the same 1440×900 CSS viewport (DPR 2), the same one-file
Split tab UX verificationfixture, and one coarse pointer jump that crosses the equal boundary by 80 px. The before revision is exact parent head1dbfc83bd587b98968d6b0a839da9f81751ce3b9; the after revision is exact PR heada128a9917ffe49588cb2c84d573f01113834e5a6.Thread / right-panel divider
Before, the fast crossing follows the sampled pointer past center and leaves an arbitrary-width right panel with no guide.
After, the same crossing holds at 50/50 and renders a full-height guide through the owning split.
Vertical tab split
Before, the stacked Diff/Info divider lands 80 px beyond the equal-height boundary with no guide.
After, the same crossing holds both panes at equal heights and renders the full-width horizontal guide.
Validation
BB-Thread-ID: thr_q8degf2y66