select first option in sort dropdown by default

+ center items in dropdown
This commit is contained in:
BlackSigkill 2026-02-06 12:07:22 +01:00
parent c665be6836
commit 7a6699b329
2 changed files with 5 additions and 2 deletions

View file

@ -2161,8 +2161,10 @@ export class UIRenderer {
descEl.textContent = playlistData.description || '';
const originalTracks = [...tracks];
let currentTracks = [...tracks];
currentSort = 'custom';
// Default sort: first available option (Playlist Order if no addedAt, else Date Added Newest)
const hasAddedDate = tracks.some((t) => t.addedAt);
currentSort = hasAddedDate ? 'added-newest' : 'custom';
let currentTracks = sortTracks(originalTracks, currentSort);
const renderTracks = () => {
// Re-fetch container each time because enableTrackReordering clones it

View file

@ -2202,6 +2202,7 @@ input:checked + .slider::before {
#context-menu li,
#sort-menu li {
padding: 0.5rem 0.75rem;
margin-right: 8px;
cursor: pointer;
border-radius: 4px;
transition: