Skip to content

Reorder queue via drag-and-drop and move up/down buttons - #16

Open
prateeekbuilds wants to merge 1 commit into
7akob:mainfrom
prateeekbuilds:reorder-queue
Open

Reorder queue via drag-and-drop and move up/down buttons#16
prateeekbuilds wants to merge 1 commit into
7akob:mainfrom
prateeekbuilds:reorder-queue

Conversation

@prateeekbuilds

Copy link
Copy Markdown

Summary

This PR implements queue reordering as requested in #8, allowing users to reorder videos in the shared playback queue via both native drag-and-drop and accessible Move Up / Move Down buttons on each queue item.

Key Changes

  • Multiplayer Synchronization: Added a reorder_queue socket event in server.js that looks up queue items by their stable qid, handles target index clamping, and re-emits queue_update to keep all connected clients in sync.
  • Drag-and-Drop: Made queue items draggable with HTML5 drag-and-drop (dragstart, dragover, dragleave, drop, dragend). Dynamic drop indicators (.drag-over-top / .drag-over-bottom) accurately position items above or below target items based on midline cursor position.
  • Move Up () & Move Down () Buttons: Added reorder buttons on every queue item with boundary disabling (Move Up disabled for the top item, Move Down disabled for the last item).
  • Styling & Themes: Added grab cursor styling, drag preview dimming (.is-dragging), and drop indicators styled with var(--star) to blend with all themes (yt2008, neon90s, midnight).
  • PWA / Cache: Bumped service worker cache name to skood-v4 in public/sw.js.

Closes #8

Allow anyone in a room to reorder videos in the shared playback queue
using either HTML5 drag-and-drop or Move Up (▲) / Move Down (▼) buttons
on each queue item.

Reordering is keyed by the item's stable qid and target destination
index, broadcasting queue_update across all connected clients to keep
the queue in sync. Added drag preview, drop position indicators, and
disabled state styling for boundary move buttons across all themes.

Closes 7akob#8
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.

Reorder the queue

2 participants