Added + button next to playlists in sidebar

This commit is contained in:
patben8 committed 2026-10-22 10:03:35 +02:00
1 parent 068e4da08b
commit 75cb0c8138
2 files changed
+20 -3

No files matched your search

+3 -2
View File
@@ -1107,8 +1107,9 @@ Two independent apps that talk over HTTP:
picker used to be a one-way door with `forcePicker` never set, so changing picker used to be a one-way door with `forcePicker` never set, so changing
library meant restarting; switching confirms first when there are unsaved library meant restarting; switching confirms first when there are unsaved
edits, since the adapter holds them in a native model that opening another edits, since the adapter holds them in a native model that opening another
library replaces — plus the playlist tree. **Creating is right-click library replaces — plus the playlist tree. **Creating is right-click,
only**: a folder's menu offers New Playlist / New Folder inside it, empty or the Playlists header's +** (the top-level menu under the button; with
no folders, straight to a new playlist): a folder's menu offers New Playlist / New Folder inside it, empty
space below the rows creates at the top level, and the new node is named space below the rows creates at the top level, and the new node is named
in place (Esc or an empty name creates nothing). Rename/Delete are on the in place (Esc or an empty name creates nothing). Rename/Delete are on the
same menu and the row's hover buttons, which share one set of actions. same menu and the row's hover buttons, which share one set of actions.
+17 -1
View File
@@ -774,10 +774,26 @@ export function Sidebar({
</button> </button>
</div> </div>
<div className="mt-3 shrink-0 px-4"> <div className="mt-3 flex shrink-0 items-center justify-between px-4">
<span className="text-[11px] font-semibold uppercase tracking-wider text-faint"> <span className="text-[11px] font-semibold uppercase tracking-wider text-faint">
Playlists Playlists
</span> </span>
{/* The same choices as right-clicking below the rows: straight to a
new playlist where there is nothing else to create, else the
menu, opened under the button. */}
{canCreate && (
<button
title={foldersSupported ? 'New playlist or folder' : 'New playlist'}
onClick={(e) => {
if (!foldersSupported) return startDraft('playlist', null)
const r = e.currentTarget.getBoundingClientRect()
setMenu({ x: r.left, y: r.bottom + 4, items: createItems(null) })
}}
className="rounded px-1 text-sm text-faint hover:text-text"
>
+
</button>
)}
</div> </div>
{/* Right-click here (below the rows) creates at the top level; rows {/* Right-click here (below the rows) creates at the top level; rows