From 2c907ea72616ff78d3d9ed9c8dd51fcff3f3202a Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 25 Jan 2026 00:41:30 -0600 Subject: [PATCH] feat(sidebar): add context menu for moving playlists to folders - Add oncontextmenu prop to NavigationItem component - Right-click on playlist shows context menu with folder options - "Move to folder" shows available folders - "Move to root" appears if playlist is already in a folder - Context menu closes on outside click - Immediate UI update after moving playlist --- src/lib/components/NavigationItem.svelte | 4 +- src/lib/components/Sidebar.svelte | 166 +++++++++++++++++++++++ 2 files changed, 169 insertions(+), 1 deletion(-) diff --git a/src/lib/components/NavigationItem.svelte b/src/lib/components/NavigationItem.svelte index fd8d1b2d3..50c397b4c 100644 --- a/src/lib/components/NavigationItem.svelte +++ b/src/lib/components/NavigationItem.svelte @@ -9,12 +9,13 @@ active?: boolean; onclick?: () => void; onHover?: () => void; + oncontextmenu?: (e: MouseEvent) => void; class?: string; showLabel?: boolean; indented?: boolean; } - let { icon, label, badge, tooltip, active = false, onclick, onHover, class: className = '', showLabel = true, indented = false }: Props = $props(); + let { icon, label, badge, tooltip, active = false, onclick, onHover, oncontextmenu, class: className = '', showLabel = true, indented = false }: Props = $props(); // When label is hidden, always show tooltip on hover const effectiveTooltip = $derived(showLabel ? tooltip : (tooltip || label)); @@ -53,6 +54,7 @@ + {/if} + {/each} + + {/if} + {#if contextMenu.currentFolderId} + + {/if} + {#if folders.length === 0 && !contextMenu.currentFolderId} +
+ No folders yet +
+ {/if} + +{/if} + {#if showCreateFolderModal}