Skip to content

Feature: Drag and Drop#8681

Open
PikachuEXE wants to merge 74 commits intoFreeTubeApp:developmentfrom
PikachuEXE:feature/drag-n-drop
Open

Feature: Drag and Drop#8681
PikachuEXE wants to merge 74 commits intoFreeTubeApp:developmentfrom
PikachuEXE:feature/drag-n-drop

Conversation

@PikachuEXE
Copy link
Copy Markdown
Member

@PikachuEXE PikachuEXE commented Feb 17, 2026

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Continue of #8621
Closes #4872

Description

Adds drag and drop ordering when custom sort is enabled for playlist videos both in list and grid view.

Grab bar on hover (list view only)

ListHover

List drag and drop

ListDnD

Grid drag and drop

GridDnD

Testing

Testing instructions

  • Prepare a playlist with multiple videos
  • Test drag and drop feature in user playlists, ensure only draggable on custom sort (can be dragged back to original position
  • Test drag and drop NOT working on online playlists
  • Test drag and drop in BOTH list or grid view, ensure videos can only be moved by dragging the grab bar
  • Test dragging video title (link) and channel link to text box like top nav still makes it filled with an URL
  • Ensure dragging on user playlist with 1 video is disabled

To ensure list view is not broken, ensure to test the list view in search results (video playlist channel hashtag) to ensure nothing broken

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

https://github.com/maranran/eslint-plugin-vue-a11y/blob/master/docs/rules/mouse-events-have-key-events.md ignored for mouseenter/mouseleave let me know if it's not desired

Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Fix inability to drag grid videos to different rows.

Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
Signed-off-by: Android789515 <derflug@mailfence.com>
@PikachuEXE
Copy link
Copy Markdown
Member Author

Well if you want I can show grab bar always with index number (which this PR already looks like it for device without hover
I am fine with grab bar shown on hover/always, up to you guys...
image

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

Well if you want I can show grab bar always with index number

Sure lets do that.

@PikachuEXE
Copy link
Copy Markdown
Member Author

@efb4f5ff-1298-471a-8973-3d47447115dc Updated
Added testing entry Ensure dragging on user playlist with 1 video is disabled

@PikachuEXE PikachuEXE added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Mar 2, 2026
@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

It behaves a bit weird with duplicates

VirtualBoxVM_h99WvRXdSz.mp4

Sometimes there is like a trailing ghost effect as seen in the first seconds of the video. My expectation would be for it to be not there and behave like in the rest of the video (dont watch the full clip you will get it after the first 10sec)

VirtualBoxVM_1Xyiz6V46x.mp4

Moving around here also looks a bit weird here

VirtualBoxVM_ubYHAJzEdZ.mp4

@PikachuEXE
Copy link
Copy Markdown
Member Author

It behaves a bit weird with duplicates

Yup but still no idea why, trying to fix this week

trailing ghost effect

Cannot reproduce, you using VM? Might have graphic acceleration issue if yes

Moving around here also looks a bit weird here

Probably the transition plus rapid firing of events
Added a throttle to prevent it

@PikachuEXE
Copy link
Copy Markdown
Member Author

It behaves a bit weird with duplicates

I dunno why I did not realize the playlist item ID not being used last time, probably due to lack of sleep
Fixed now

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.

Sometimes when i want to drag a video from down to up it doesnt let me

VirtualBoxVM_YLqIRHUIRV.mp4
VirtualBoxVM_VqC5gyrojr.mp4

@PikachuEXE
Copy link
Copy Markdown
Member Author

I think you might be looking at the side effect of:

Probably the transition plus rapid firing of events
Added a throttle to prevent it

try drag over another item for > 100ms first

Or you can try to apply a fix for the previous issue with no throttle and no transition to see if that's the cause
I can't reproduce your case here

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

efb4f5ff-1298-471a-8973-3d47447115dc commented Mar 13, 2026

Uhhh not sure how this happened

VirtualBoxVM_nlnmAlllWY.mp4

I think im unable to drag when thumbnail isnt fully in view.
Edit: yup seems like this is it because im seeing it now in both directions

VirtualBoxVM_9AXIw6MgtW.mp4

@PikachuEXE
Copy link
Copy Markdown
Member Author

I can only see dragend fired right after start dragging an item partially out of screen, dunno why it happens

* development: (106 commits)
  Translated using Weblate (Portuguese)
  Bump electron from 40.8.0 to 41.0.2 (FreeTubeApp#8801)
  Translated using Weblate (German)
  Translated using Weblate (Lithuanian)
  Bump lefthook from 2.1.3 to 2.1.4 (FreeTubeApp#8799)
  Bump babel-loader from 10.1.0 to 10.1.1 in the babel group (FreeTubeApp#8794)
  Bump the webpack group with 2 updates (FreeTubeApp#8797)
  Bump the fortawesome group with 5 updates (FreeTubeApp#8796)
  Bump the eslint group with 3 updates (FreeTubeApp#8795)
  Bump vue from 3.5.29 to 3.5.30 (FreeTubeApp#8800)
  Translated using Weblate (Japanese)
  Serialize the error as a string to pass it back to the main view (FreeTubeApp#8789)
  Bump tar from 7.5.10 to 7.5.11 (FreeTubeApp#8788)
  Workaround for electron/electron#49253 (FreeTubeApp#8714)
  Translated using Weblate (Icelandic)
  Translated using Weblate (Japanese)
  Trim video titles with the local API to avoid breaking the databases (FreeTubeApp#8354)
  Translated using Weblate (Tamil)
  enhance issue templates (FreeTubeApp#8770)
  Bump vue-i18n from 11.2.8 to 11.3.0 (FreeTubeApp#8769)
  ...
@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

@absidue any idea?

@PikachuEXE
Copy link
Copy Markdown
Member Author

PikachuEXE commented Mar 23, 2026

It's the AutoScrollWrapper invisible hot zone
Wondering if that's needed...

Update 1
image

Update 2
Add .hotZone to CSS for .hotZone to see its area

Update 3
If no idea how to fix just set the zone to 50px first...

@PikachuEXE
Copy link
Copy Markdown
Member Author

Found a way to fix it, but that also means when user starts to drag from near the window bottom the scrolling will start
I think we might want to reduce the height for the auto scroll zone (hot zone)

Preview: (green background is for easier viewing, we can keep or remove it

image image
Screen.Recording.2026-03-23.at.15.39.40.mp4

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

efb4f5ff-1298-471a-8973-3d47447115dc commented Mar 24, 2026

Noticed that Grid also is affected by this

VirtualBoxVM_pS1vlv9kas.mp4

Also sometimes in List it does drag and sometimes it doesnt even when its in view

VirtualBoxVM_xIfavJdPJd.mp4

* development: (42 commits)
  Translated using Weblate (Swedish)
  Translated using Weblate (Arabic)
  Translated using Weblate (Turkish)
  Translated using Weblate (Slovak)
  Translated using Weblate (French)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Polish)
  Translated using Weblate (Japanese)
  Translated using Weblate (Russian)
  Translated using Weblate (Danish)
  Translated using Weblate (Italian)
  Bump shaka-player from 5.0.6 to 5.0.7 (FreeTubeApp#8848)
  Bump @babel/preset-env from 7.29.0 to 7.29.2 in the babel group (FreeTubeApp#8842)
  Bump calibreapp/image-actions (FreeTubeApp#8843)
  Bump actions/cache from 5.0.3 to 5.0.4 (FreeTubeApp#8844)
  Bump flatted from 3.3.3 to 3.4.2 (FreeTubeApp#8851)
  Translated using Weblate (German)
  Translated using Weblate (Czech)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Norwegian Bokmål)
  ...
@PikachuEXE
Copy link
Copy Markdown
Member Author

They both use the auto scroll component so I fixed both now
No idea about the list one, can't reproduce need steps

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Copy Markdown
Member

In Grid mode video on the left lights up as if im hovering on it after i dragged the video besides it
This doesnt happen in List mode

VirtualBoxVM_YYjLi9jKJF.mp4
VirtualBoxVM_DKm9XWB2W0.mp4

@PikachuEXE
Copy link
Copy Markdown
Member Author

PikachuEXE commented Mar 28, 2026

This issue not happening on list view is due to list view's grab bar is not part of the ft-item box (which is lighten up on hover when watched
The mouse hover state seems to remain on as if the cursor never left the position before the mouse button is pressed during dragging (it's the previous/next item moved to the position of the cursor when mouse button when pressed which is considered hovered
You can observe the same thing if you drag the title/thumbnail to anywhere (like topnav text input) and it would remain like it's hovered (let me upload a video from mac soon

Update 1: the video

Screen.Recording.2026-03-28.at.12.08.25.mp4

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.

LGTM, thanks for taking this one over!

@PikachuEXE PikachuEXE requested a review from absidue March 30, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Drag and drop videos in edit mode

4 participants