A navigator drag keeps its drop marker until it lands, leaves the panel or is cancelled - #33
Open
LilianBarbe wants to merge 1 commit into
Open
LilianBarbe wants to merge 1 commit into
LilianBarbe wants to merge 1 commit into
Conversation
…is cancelled The panel body cleared the drop target on every dragleave, including moves between two of its own descendants, so the insertion line flickered and vanished while hovering the marker or a row. It now clears only when the pointer leaves the panel, hovers blank space, or the drag ends. The marker is absolutely positioned and ignores the pointer, so it no longer shifts the gap or becomes a drag target itself. Also, as separate UI choices: - the native drag ghost is replaced by a transparent image, so only the drop line shows where the node will land; - starting a drag selects the dragged row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Illustration of the navigator panel, not a screenshot.
The bug
While dragging a row in the navigator, the insertion line flickers and often disappears.
NavigatorBodyclears the drop target on everydragleave, anddragleavealso fires when the pointer moves between two children of the panel: from one row to the next, or onto the marker itself. The marker also takes up layout space and catches the pointer, which makes it worse.The fix
relatedTargetoutside the body), hovers blank space, or the drag ends (drop or Esc)..drop-indicatoris absolutely positioned inside its gap withpointer-events: none, so it no longer shifts the gap or becomes a drag target.Two UI choices, easy to drop if you'd rather not
Each one is a single line in
StructureTree.tsx:setDragImagegets a transparent 1×1 image, so no copy of the row sits under the pointer and hides the rows around the drop point. Only the drop line shows where the node will land. This depends on the fix above: with a flickering line, you would lose track of the drop point.Tests
test/navigator.jsgets 8 new checks: the marker survives moving onto itself and onto a row, and it clears on leaving the panel, on blank space and ondragend. Without the fix, 5 of them fail. With it, all 49 pass.test:navigatoropencodepasses andtsc --noEmitreports nothing.🤖 Generated with Claude Code