Skip to content

fix(playlists): sidebar playlists no longer jump when you drop or refresh - #1867

Merged
lklynet merged 1 commit into
mainfrom
lklynet/playlist-sidebar-sort-jump
Nov 13, 2026
Merged

lklynet merged 1 commit into
mainfrom
lklynet/playlist-sidebar-sort-jump

Conversation

@lklynet

@lklynet lklynet commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Reordering a playlist in the sidebar made the rows jump when you let go, even though they had already moved into place while dragging. And after a refresh, the sidebar showed the default order for a moment before snapping to yours.

The jump on drop had three causes:

  • Sidebar rows inherit .sidebar-link's CSS transform transition, which fights dnd-kit for transform. On drop, the dropped row animated in from its old drag offset, about 170px away. Sidebar playlist rows now leave transform to dnd-kit.
  • The "Playlist order" menu only appears once you have a custom order, and it's 2.5px taller than the heading. Your first reorder pushed the whole list down. The heading row now has a fixed minimum height.
  • The new order reached the sidebar a tick after dnd-kit reset its transforms, because React Query delivers cache updates to components later. The sidebar now holds the dropped order in local state, which renders together with the drop. Saves run one at a time, and a failed save still reverts and shows the error.

The flash on refresh was a waterfall: the sidebar mounted only after playlist status loaded, and only then fetched your order. It now mounts right away, so both requests run in parallel, and it renders once the order is known.

Before After
Sidebar rows jumping on drop Sidebar rows staying put on drop
🎥 screen recording 🎥 screen recording

Proof: in a browser against Eden, a frame-by-frame probe of row positions showed the dropped row starting about 170px off and the list shifting 3px on main. With this change, every row stays at its mid-drag position through the drop. With a 4s delay added locally to the order endpoint, main painted the default order and then snapped; this branch paints the saved order first. pnpm run check and pnpm test pass.

Reviewed with sol-loop: 1 round with gpt-6.1-sol on high. Sol verdict: approved

Created with Opus 5.5 in Claude Code (T3 Code).

Rows jumped on drop: the inherited .sidebar-link transform transition
animated the dropped row from its stale drag offset, the heading row grew
when the order menu appeared, and the new order rendered a tick after
dnd-kit reset its transforms. On refresh the order request only started
after playlist status loaded, so the default order flashed first.
@github-actions github-actions Bot added bug Something is broken or behaving incorrectly. size:S 10-29 changed lines. labels Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Preview image: ghcr.io/lklynet/aurral:pr-1867

Built from pr.1867+1916eae. Each push replaces it.

docker pull ghcr.io/lklynet/aurral:pr-1867

Back up your Aurral config, point your compose service at this image, then docker compose pull aurral && docker compose up -d aurral. Switch back to your usual tag when you're done.

@github-actions

Copy link
Copy Markdown
Performance: Nothing is slower than main.

50,336 tracks, 2 alternating rounds per side, lower quartiles.

main this PR change queries
app shell 3.5 ms 3.3 ms -4% 13
library home 101 ms 102 ms 0% 121
library albums 16.1 ms 16.1 ms 0% 20
library albums, last page 23.0 ms 22.9 ms 0% 20
library albums, recently added 39.8 ms 39.7 ms 0% 20
library artists 15.6 ms 15.7 ms +1% 12
library tracks 7.7 ms 7.8 ms +1% 21
library genres 2.0 ms 2.0 ms -1% 4
library genre filter 18.2 ms 18.2 ms 0% 20
library status filter 37.0 ms 36.3 ms -2% 32
library filter 19.9 ms 20.0 ms 0% 20
artist page 14.1 ms 14.0 ms 0% 57
album page 3.1 ms 3.1 ms +2% 24
favorites 35.8 ms 35.5 ms -1% 22
search 18.4 ms 18.3 ms 0% 21
discover recently added 7.4 ms 7.6 ms +2% 28
discover releases 3.1 ms 3.2 ms +4% 8
releases page 8.9 ms 8.9 ms +1% 24
discover artist 15.4 ms 15.3 ms -1% 58
discover album 1.3 ms 1.3 ms +2% 3
discover album tracks 4.1 ms 4.0 ms -2% 8
discover album editions 1.9 ms 1.9 ms +2% 4
discover search 1.2 ms 1.3 ms +1% 3
similar artists 1.7 ms 1.6 ms -3% 6
playlists 17.5 ms 17.9 ms +2% 19
activity queue 44.8 ms 39.2 ms -12% 12
listening history 1.3 ms 1.3 ms -5% 4
subsonic getArtists 18.1 ms 18.1 ms 0% 9
subsonic getAlbumList2 84.0 ms 83.9 ms 0% 43
subsonic getArtist 4.3 ms 4.4 ms +3% 15
subsonic getAlbum 3.1 ms 3.1 ms 0% 14
subsonic search3 19.9 ms 20.1 ms +1% 22
subsonic getStarred2 30.5 ms 29.6 ms -3% 15
subsonic getRandomSongs 4.6 ms 4.6 ms +1% 15
subsonic getGenres 1.5 ms 1.5 ms +2% 3
subsonic getSongsByGenre 35.7 ms 35.5 ms -1% 14
subsonic playlists 38.7 ms 37.5 ms -3% 49
album match 1.7 ms 1.7 ms -1% 4
track match 1.5 ms 1.6 ms +3% 5
artist match 1.3 ms 1.4 ms +6% 4
subsonic edit playlist 159 ms 158 ms 0% 964
server startup 987 ms 1006 ms +2%
server memory at startup 174.4 MiB 175.0 MiB 0%
initial JS and CSS, gzip 284.6 KiB 284.6 KiB 0%

@lklynet
lklynet merged commit 5479088 into main Nov 13, 2026
15 checks passed
@lklynet
lklynet deleted the lklynet/playlist-sidebar-sort-jump branch November 13, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken or behaving incorrectly. size:S 10-29 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant