Skip to content

Drag-and-drop for playlists in custom sort on Watch page - #10133

Open
kommunarr wants to merge 4 commits into
FreeTubeApp:developmentfrom
kommunarr:feat/watch-playlist-drag-sort
Open

kommunarr wants to merge 4 commits into
FreeTubeApp:developmentfrom
kommunarr:feat/watch-playlist-drag-sort

Conversation

@kommunarr

Copy link
Copy Markdown
Collaborator

Pull Request Type

  • Feature Implementation

Related issue

#9469 - faster scroll logic added in this PR could be applied to the User Playlist page as well
#547 - soft prerequisite

Description

Implements drag and drop UI/UX for user playlists with Custom sort enabled. It's built to match most/all of the conveniences the YT drag and drop offers, including faster scrolling speed when dragging sufficiently high/low enough above the Watch Video Playlists box, visibly "extracting" the grabbed video list element, and visibly swapping the positions during the drag.

The behaviors all feel pretty nice and have a high degree of fidelity to the YT implementation, so please cross-reference with that on any of your behavioral nitpicks before posting (although I wouldn't expect very many).

Screenshots

Scenario Screenshot
New view with custom sort Screenshot_20261115_172614
Using the drag and drop Screenshot_20261115_172717

Testing

For testing, you need to set your playlist Sort By to Custom first.

  • test dragging from inside context menu doesn't work
  • test drag and drop works regardless of where you grab it from
  • test order changes persist permanently
  • test slow/fast scrolling while dragging works, regardless of how far to the left/right the cursor is
  • test that releasing outside of the playlist box or cancelling the drag with Esc cancels the attempted drag
  • test edge case behaviors at top/bottom of playlist

Desktop

  • OS: CachyOS
  • OS Version: rolling release

Additional context

  • I initially looked at drag and drop libraries to do this and tested with @vue-dnd-kit/core, but it was a larger increase in the bundle size, didn't sizably reduce maintainability concerns, and still lacked some fundamental behaviors in the UX that makes YT's (and our current PR's) so much crisper & more satisfying to use. The drag and drop composable with geometry helpers at least help keep this more maintainable & ideally reusable to other places in the code in the future we may want to apply it in part or whole (e.g., for tweaks to the User Playlist page drag and drop).
  • I forayed into using v-memo because it produced a small but meaningful reduction in latency for drag-and-drop swapping in larger playlists from my testing.
  • I didn't touch the light mode hover styling for the number/icon section being different from the watch hover styling since it's not in scope, but maybe worth a small follow-up in the future by someone since it looks quite ugly IMO:
Screenshot_20261117_182251

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) November 18, 2026 00:28
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 18, 2026
@Shadorc

Shadorc commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

The dynamic scrolling speed seems a bit inconsistent, it is slow, then very fast, then fast

2026-11-20.16-44-40.mp4

@Shadorc

Shadorc commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

If I drag'n'drop the video over the task bar, the scroll goes backward

2026-11-20.16-47-58.mp4

@Shadorc Shadorc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Nov 20, 2026
@Shadorc

Shadorc commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

On small window's width, dragging a video to the bottom scroll the whole page

2026-11-20.16-55-02.mp4

@kommunarr kommunarr added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Nov 21, 2026

@absidue absidue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this seems to be a new drag and drop implementation, separate from the one that the playlist page uses, could you please either explain why we need two separate ones or deduplicate the code and use either of the implementations for both places.

Another thing to note is that link dragging, specifically for the title link and channel name link were intentionally kept in the playlist page implementation to avoid regressing an existing feature, could you please do the same here?

@absidue absidue added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Nov 22, 2026
@kommunarr

Copy link
Copy Markdown
Collaborator Author

As this seems to be a new drag and drop implementation, separate from the one that the playlist page uses, could you please either explain why we need two separate ones or deduplicate the code and use either of the implementations for both places.

The long-term plan would be to consolidate much of their behaviors under this implementation. I kept it out of this PR to avoid increasing its size, but I can do that if you would prefer.

The rationale for the new one is that it has many subtle behavioral differences through testing to match YT's implementation for both increased fidelity and improved UX, like accelerated scrolling past a certain threshold, adjusted horizontal drag handling, surviving playback changes, not saving temporary drags that are aborted.

The only issue is that they might need some different handling by necessity since the user playlist page in grid view has different behaviors and testing needs for identifying and dragging, e.g., horizontally into rows and columns. It also, on YT and FT, has larger video entries on the user playlist page, so it makes more sense to only allow drag-and-drop on the handle portion there.

Another thing to note is that link dragging, specifically for the title link and channel name link were intentionally kept in the playlist page implementation to avoid regressing an existing feature, could you please do the same here?

This does has merit, but I do want to hear broader input from the team before confirming, as this behavior puts it in conflict with fidelity to YT's implementation, which doesn't have this behavior for playlists. From a UX perspective, I worry it could be frustrating if users click on the title section and end up only dragging the title. To provide a bit more edification for that, that feature exists on the User Playlist summary page for YT as well, but not on their watch page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants