From dd512ee5aca9960fb5469d2dee9f2e1d74741d13 Mon Sep 17 00:00:00 2001
From: vicrodh <103399283+vicrodh@users.noreply.github.com>
Date: Tue, 28 Apr 2026 16:34:42 -0600
Subject: [PATCH] feat(sidebar): edit folder from context menu
Adds an "Edit folder" entry at the top of the playlist-folder context
menu in the sidebar, opening the existing FolderEditModal. The modal is
mounted globally in +page.svelte (separate instance from the one in
PlaylistManagerView) so it works from any view, and uses Tauri's ask()
for delete confirmation per the destructive-dialog convention.
Closes part 1 of #364.
cc
---
src/lib/components/Sidebar.svelte | 14 ++++++
src/routes/+page.svelte | 75 +++++++++++++++++++++++++++++++
2 files changed, 89 insertions(+)
diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte
index 060f79020..5fca84694 100644
--- a/src/lib/components/Sidebar.svelte
+++ b/src/lib/components/Sidebar.svelte
@@ -95,6 +95,7 @@
isHidden: boolean;
currentFolderId: string | null;
}) => void;
+ onEditFolder?: (folder: PlaylistFolder) => void;
onSettingsClick?: () => void;
onKeybindingsClick?: () => void;
onAboutClick?: () => void;
@@ -122,6 +123,7 @@
onImportPlaylist,
onPlaylistManagerClick,
onEditPlaylist,
+ onEditFolder,
onSettingsClick,
onKeybindingsClick,
onAboutClick,
@@ -1500,6 +1502,12 @@
closeContextMenu();
}
+ function editFolderFromContextMenu() {
+ if (!contextMenu.folder || !onEditFolder) return;
+ onEditFolder(contextMenu.folder);
+ closeContextMenu();
+ }
+
function handlePlaylistDragStart(e: DragEvent, playlistId: number) {
const fromFolderId = getPlaylistFolderId(playlistId);
draggedPlaylistId = playlistId;
@@ -2223,6 +2231,12 @@
>
{#if contextMenu.folder}
{@const contextFolderHidden = contextMenu.folder.is_hidden ?? false}
+ {#if onEditFolder}
+
+ {/if}