Skip to content

Add drag-and-drop section reordering with overlay#117

Merged
vincentmakes merged 4 commits into
mainfrom
claude/section-reorder-overlay-Gg1TH
Apr 17, 2026
Merged

Add drag-and-drop section reordering with overlay#117
vincentmakes merged 4 commits into
mainfrom
claude/section-reorder-overlay-Gg1TH

Conversation

@vincentmakes

Copy link
Copy Markdown
Owner

claude added 4 commits April 17, 2026 18:59
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
@vincentmakes vincentmakes merged commit ef3606a into main Apr 17, 2026
3 checks passed
@vincentmakes vincentmakes deleted the claude/section-reorder-overlay-Gg1TH branch April 17, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants