5.8 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick | 4 | execute | 1 |
|
true |
|
Purpose: Allow users to quickly set any playlist as the default (favorites) playlist via right-click, instead of navigating to Settings. Output: Updated playlist-view.ts with new context menu item and handler.
<execution_context> @/home/caleb/.config/Claude/get-shit-done/workflows/execute-plan.md @/home/caleb/.config/Claude/get-shit-done/templates/summary.md </execution_context>
@frontend/src/components/playlist-view/playlist-view.ts @frontend/src/store/controllers/favorites-controller.ts @frontend/src/store/favorites-store.tsFrom playlist-view.ts (already instantiated):
private favCtrl = new FavoritesController(this);
From favorites-controller.ts:
async setDefaultPlaylist(id: number): Promise<void>;
get playlistId(): number; // current default playlist ID
Playlist context menu handler pattern (line ~1707):
private async onPlaylistContextAction(action: string) {
const index = this.playlistContextMenuIndex;
const entry = this.entries[index];
if (!entry) return;
switch (action) {
case 'rename': ...
case 'delete': ...
}
// cleanup at end
this.selectedPlaylists = new Set();
this.lastSelectedPlaylistIndex = null;
this.closePlaylistContextMenu();
}
Playlist entry shape:
interface PlaylistEntry {
summary: playlist.Summary; // .ID: number, .Name: string
expanded: boolean;
tracks: playlist.Track[];
}
Single-select guard pattern (line ~2341):
${this.selectedPlaylists.size <= 1 ? html`...single-select-only items...` : nothing}
- Add handler case in
onPlaylistContextAction()(around line 1716, inside the switch statement, after the'rename'case and before'delete'):
case 'set-default':
void this.favCtrl
.setDefaultPlaylist(entry.summary.ID)
.catch((err: unknown) => {
console.error(
'Failed to set default playlist:',
err,
);
});
break;
This follows the exact same pattern used in config-page.ts (line ~812).
- Add menu item in the playlist context menu template (around line 2341). Insert a new
wa-dropdown-itemAFTER the existing Rename item but still inside thethis.selectedPlaylists.size <= 1guard block. The Rename item block currently ends at line ~2356 with: nothing}. Restructure so that both Rename AND Set as Default are inside the single-select guard:
${this.selectedPlaylists.size <= 1
? html`
<wa-dropdown-item
@click=${() =>
void this.onPlaylistContextAction('rename')}
>
<wa-icon slot="icon" name="pen"></wa-icon>
Rename
</wa-dropdown-item>
<wa-dropdown-item
@click=${() =>
void this.onPlaylistContextAction('set-default')}
>
<wa-icon slot="icon" name="star"></wa-icon>
Set as Default Playlist
</wa-dropdown-item>
`
: nothing}
Use the "star" icon name since this relates to the favorites/default playlist concept and matches the icon style option in settings.
Do NOT add any new imports — FavoritesController is already imported and instantiated as this.favCtrl.
cd frontend && npx tsc --noEmit --pretty 2>&1 | head -30
- Right-clicking a single playlist in the playlist view shows "Set as Default Playlist" option with a star icon
- Clicking it calls favCtrl.setDefaultPlaylist() with the playlist's ID
- The option does NOT appear when multiple playlists are selected (same guard as Rename)
- TypeScript compiles without errors
<success_criteria>
- Single playlist right-click menu shows "Set as Default Playlist" between Rename and Delete
- Multi-select right-click menu does NOT show the option
- Clicking the option successfully changes the default/favorites playlist
- No TypeScript compilation errors </success_criteria>