Add drag-and-drop section reordering with overlay#117
Merged
Conversation
A drag handle now appears next to every section heading (admin-only, hidden in print and absent on the public site). Pressing it opens a floating overlay showing each section's title over a dimmed, blurred CV. The grabbed pill is latched to the cursor; drop it anywhere in the list and other pills FLIP-animate into place. The overlay stays open for further adjustments; OK saves via the existing PUT /api/sections/order, Cancel/Esc/backdrop click reverts. Hidden sections appear dimmed with a visibility_off badge so their order can still be adjusted for when they get re-enabled. The existing Settings → Sections & Headlines panel is unchanged. https://claude.ai/code/session_019TcEZbfYgmysPB4avbS6Bi
The drop-position indicator was computed from the pointer's Y coordinate, but the floating pill is offset from the cursor (the pointer latches on wherever the user grabbed the handle). That made the placeholder appear in a different slot than where the pill was visually, which was disorienting — especially when grabbing a pill near its top or bottom edge. Now we use the floating pill's own midpoint (its getBoundingClientRect top + height / 2), so the "ghost slot" always sits where the pill looks like it belongs. https://claude.ai/code/session_019TcEZbfYgmysPB4avbS6Bi
confirmReorder PUT /api/sections/order but forgot to call autoSaveActiveDataset(). When a dataset is loaded (which it is by default via loadDefaultDatasetOnStartup), the live section_visibility table got the new order, but the dataset's saved snapshot kept the old one. On reload, the dataset's snapshot was restored and the reorder appeared to vanish. Mirrors what saveSettingsSectionOrder does at admin.js:2992. https://claude.ai/code/session_019TcEZbfYgmysPB4avbS6Bi
When the drag starts from a section-heading handle (outside the overlay), the cursor is typically on the left edge of the section while the pill is in the overlay's centered list. Preserving the pointer→pill offset meant the pill floated far from the cursor and the user had to traverse the viewport before the pill caught up — annoying on a small trackpad. Now, if the pointerdown falls outside the pill's bounding rect (or the caller passes snapPillToCursor: true), we center the pill on the cursor. Drags started on a pill already inside the overlay keep the original offset, so grabbing near the edge still feels natural. https://claude.ai/code/session_019TcEZbfYgmysPB4avbS6Bi
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.
https://claude.ai/code/session_019TcEZbfYgmysPB4avbS6Bi