Date: 2026-06-08
I would like the option of moving a video in one playlist to a different playlist (while maintaining the guarantee that a video will be in at most one playlist). what would you recommend to support this action in the UI?
Added a "Move to…" entry to the ⋯ more menu in the playlist detail view (single-playlist view). Clicking it expands an inline sub-list of the other five playlists; selecting one atomically removes the video from the current playlist and appends it to the target.
popup/popup.js
moveSubmenuOpenFor: null state (tracks which video's move submenu is open by menuId key)otherPlaylists: [] state (array of {name, display} objects for the other playlists)updateCurrentPlaylistVideos() to recompute otherPlaylists using formatPlaylistName() for display labelsasync moveVideoToPlaylist(fromPlaylistName, videoIndex, toPlaylistName) — splices video from source array, appends to target, single storage.set call (preserves video object including status)closeAllMenus() and toggleMenu() to reset moveSubmenuOpenFormoveToSubmenuButton (toggle), moveToSubmenu (x-show), moveToPlaylistButton (execute move)popup/popup.html
x-for="pl in otherPlaylists" with x-text="pl.display" and data-to-playlist-name="pl.name"popup/popup.css
.move-to-playlist-item, .move-to-submenu (separator border), and .move-to-playlist-option (indented, blue text with hover)copy the "move" button to the triple-dot menu on the main screen, not just the playlist view screen
Added the same "Move to…" button and submenu to the ⋯ more menu in the main playlists view. Each playlistData object in playlistsForDisplay now carries its own otherPlaylists array (computed in updatePlaylistsForDisplay()), so the x-for="pl in playlistData.otherPlaylists" loop in the main view template has the correct per-playlist options without needing any inline expressions.
Additional files changed: popup/popup.js (updatePlaylistsForDisplay), popup/popup.html (main playlists view more menu)
moveVideoToPlaylist splices from the source before appending to the target in a single atomic storage write — no window where the video exists in two playlistsotherPlaylists is pre-computed with formatted display names so x-text="pl.display" needs no method call in the template