Browse Source

add move-to-playlist to main playlists view more menu

Extends the "Move to…" feature to the ⋯ menu in the main playlists view.
Each playlistData entry now carries its own otherPlaylists array so the
submenu shows the correct target options without inline template expressions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Brandon Wong 2 weeks ago
parent
commit
eb0c9fb19a
3 changed files with 36 additions and 0 deletions
  1. 8 0
      2026-06-08-claude-move-video-between-playlists.md
  2. 25 0
      popup/popup.html
  3. 3 0
      popup/popup.js

+ 8 - 0
2026-06-08-claude-move-video-between-playlists.md

@@ -27,6 +27,14 @@ Added a "Move to…" entry to the ⋯ more menu in the playlist detail view (sin
 **`popup/popup.css`**
 - Added styles for `.move-to-playlist-item`, `.move-to-submenu` (separator border), and `.move-to-playlist-option` (indented, blue text with hover)
 
+## Follow-up Request (2026-06-10)
+
+> 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)
+
 ### Design Notes
 
 - The one-playlist-per-video invariant is maintained because `moveVideoToPlaylist` splices from the source before appending to the target in a single atomic storage write — no window where the video exists in two playlists

+ 25 - 0
popup/popup.html

@@ -161,6 +161,31 @@
                         >
                           Remove
                         </button>
+                        <button
+                          :data-playlist-name="playlistData.name"
+                          :data-playlist-index="video.originalIndex"
+                          x-bind="moveToSubmenuButton"
+                          class="menu-item move-to-playlist-item"
+                        >
+                          Move to…
+                        </button>
+                        <div
+                          class="move-to-submenu"
+                          :data-playlist-name="playlistData.name"
+                          :data-playlist-index="video.originalIndex"
+                          x-bind="moveToSubmenu"
+                        >
+                          <template x-for="pl in playlistData.otherPlaylists" :key="pl.name">
+                            <button
+                              class="menu-item move-to-playlist-option"
+                              :data-from-playlist-name="playlistData.name"
+                              :data-playlist-index="video.originalIndex"
+                              :data-to-playlist-name="pl.name"
+                              x-bind="moveToPlaylistButton"
+                              x-text="pl.display"
+                            ></button>
+                          </template>
+                        </div>
                       </div>
                     </div>
                   </div>

+ 3 - 0
popup/popup.js

@@ -137,6 +137,9 @@ document.addEventListener("alpine:init", () => {
             visibleVideos: visibleVideos,
             shouldShowTruncation: shouldShowTruncation,
             truncationText: truncationText,
+            otherPlaylists: Object.keys(this.playlists)
+              .filter((n) => n !== playlistName)
+              .map((n) => ({ name: n, display: this.formatPlaylistName(n) })),
           };
         },
       );