Repository navigation
fix(explorer): the drag label hangs off the cursor's bottom right (#310) - #311
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FHHaWKR4M5QtW7Wecyuk4t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FHHaWKR4M5QtW7Wecyuk4t
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.
Closes #310.
Owner, 2026-10-07: "when you pick up an item with left click drag the label is to its bottom left but also not attached to the cursor, its off by maybe like 10 to 20 px. it should be attached and it should be from the bottom right".
Cause
The drag label is not a native drag image.
lib/internalFileDrag.tscancels Chromium's drag atdragstart(its native loop swallows Ctrl+Tab) and carries an in-pageposition: fixedelement that followsmousemove. Its placement was written as "below and left of the hand":left = x - width - 4: the label's whole width sat LEFT of the pointer, so its right edge was 4 px left of the tip.top = y + 12: 12 px below the tip, which with the 4 px on the side read as a label floating 10 to 20 px away.Everything is in CSS px from the pointer's client coordinates, so display scale was never part of it (measured identical at 150% and 225%).
Fix
lib/dragBadgePlace.ts(pure, unit-tested): the label's top-left corner sits 8 px right of and 8 px below the pointer tip, File Explorer's way, so the pointer never covers the name. Only where the window edge leaves no room does it flip to the other side of the pointer, never sliding under it. The hook calls it on every move. One rule for every drag the hook carries: tree, Explorer list, one or several items, files and folders, places panel pins.Also: patch bump 0.92.1 to 0.92.2, CLAUDE.md rule quoting the owner.
Measured
New e2e
dragLabel: a real press and travel, label box read mid-drag against the pointer at two positions, under--force-device-scale-factor1, 1.5 and 2.25..e2e/shots/drag-label-*.pnglooked at.Gates
npm run typecheck: cleannpm run lint: 0 errors (7 existing warnings, none in changed files)npx vitest run: 171 files passed, 2532 tests passed (2 skipped)dragLabel,drag,sidebarPlaces,zipWrites,sidebarPeekall ok (228 checks)npm run e2e:terminal: all 18 scenarios ok (553 checks)🤖 Generated with Claude Code
https://claude.ai/code/session_01FHHaWKR4M5QtW7Wecyuk4t