Add multidimensional Reorder support - #3785
Open
mattgperry wants to merge 3 commits into
Open
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThe PR extends Reorder to support explicit and automatically detected two-dimensional layouts.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code defect identified. The new axis detection, two-dimensional drag wiring, grid target selection, and preservation of unmeasured values form a consistent flow covered by focused unit and browser tests. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["Reorder.Item layout measurement"] --> B["Reorder.Group layout map"]
B --> C["Detect x, y, or xy axis"]
D["Drag offset and velocity"] --> E["checkReorder"]
C --> E
E --> F{"Single-axis or grid?"}
F -->|x / y| G["Cross adjacent item midpoint"]
F -->|xy| H["Find cell containing dragged center"]
G --> I["Remap measured values into full values array"]
H --> I
I --> J["onReorder(newValues)"]
Reviews (1): Last reviewed commit: "Fix #1400: Add multidimensional Reorder ..." | Re-trigger Greptile |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
axis=\"xy\"support toReorder.Groupand automatically detect one- or two-dimensional layouts whenaxisis omittedRoot cause
Reorder only stored one scalar layout axis and only compared adjacent items on that axis, so wrapped layouts had no cross-axis measurements or target selection.
Test plan
yarn buildreorder-grid.tswith React 18reorder-grid.tswith React 19Fixes #1400
Made with Cursor