Repository navigation
fix(sortable): line indicator draws one slot early on downward drags - #266
Open
KevinVandy wants to merge 1 commit into
Conversation
In indicator: 'line' mode, #project drew the drop-line using every item's rect (the dragged item's ghost included) at to_index, which is in insert-after-removal space. Past the origin slot those spaces differ by one, so a downward drag drew the line one row above where the item committed. Upward drags were unaffected because the spaces coincide. Skip the dragged item when building the rect list, matching how the foreign-list path already measures. Adds a unit test that checks the line index against reorderKeys for every from/to pair. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9b6ec18 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@KevinVandy is attempting to deploy a commit to the Purus Projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
In
indicator: 'line'mode the drop-line is positioned atrects[to_index], butrectsincludes the dragged item's ghost whileto_indexis in insert-after-removal space. Past the origin slot the two differ by one, so dragging down shows the line one row above where the item lands. Dragging up is unaffected.#projectnow measures against the non-dragged items only, via a small exportedlineIndicatorRectshelper. This matches what the foreign-list path already does.reorderKeysfor every from/to pair.@neodrag/corepatch.Repro: three rows a/b/c, drag
apastb's midpoint. The line draws onb's top edge while the item commits afterb.Notes
Based on
cursor/cloud-agent-1779803543133-o25azbecause it is the only pushed branch that contains the line-indicator code (the published3.0.0-next.12has it too). Happy to retarget.🤖 Generated with Claude Code