New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make queue items moveable via drag & drop #185
base: oembed
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for ytify failed.
|
Thanks for the wonderful work. I was trying this myself as you can tell by the commented code but was failed by the sticky behaviour of the elements. Then I thought something must be wrong with the queuelist container they are in so i postponed it to a refactor. First things I noticed about this PR
About the drag handle, my point on implementing one is that it increases the width of the list items which means we have to reduce the width of the original list item to maybe a 85% for drag handle to take 15% space. The icon for which could be https://remixicon.com/icon/draggable. Since we were going to wrap it into a div anyway, we could fit the drag handle into that. <div>
<stream-item></stream-item>
<i class="ri-draggable"></i>
</div> |
Thanks for the feedback, I really appreciat it!
I hope I'll be able to make some changes in a few days, I am currently occupied with other things. |
Hey take your time! I'm currently experimenting with replacing lit components with solid-js tsx components, if all things go well it might help reduce the complications with this PR. Thank you for your work on improving this project. |
Quick update from me, I still dont have much time
|
Please rebase from the oembed branch. I'll try to attempt the rest. ytify/src/components/StreamItem.tsx Lines 62 to 90 in 50d7243
we are going to insert the handle just beside the metadata div, it should be hidden by default so that when the class is toggled it's visible, this would be the case for queue (and user imported playlists), a lot of things are broken right now but with continued hard work and persistence a polished and refactor could be made in time |
Rebase to Thanks for your help! |
I have integrated the draggable icon with the stream item to be active dynamically on queue using the draggable property passed to it. |
I tried my hand at making queue items movable via drag & drop provided by SortableJS. Keep in mind JS is not my forte and I pretty much only do simple stuff in projects that i find useful myself.
Some parts, like the drag handle content / icont are still WIP, but I need some input.
It works fine with my testing on desktop browsers (FF, Chrome, other Chromium-based: Brave, Edge), but as soon as I switch to Responsive Design Mode it stops working. I'm stuck here and need some input (tag this PR Help Needed?)
Over the last few days I have tried the following things to no avail:
I did however find, that removing the ease-out transition in line 222 in src/stylesheets/style.css at least prevents the dragged item from snapping / glitching back to its original position all the time. Dropping the item on a different location does not fire the appropriate events (OnMove, OnUpdate, OnEnd). The element is not actually being moved in the DOM.
If there no solutions or obvious things I have missed come up here, I should probably open an issue about this in SortableJS.
EDIT: i just tested the deployed preview on my actual phone running Bromite on LineageOS and it seems to work just fine. Maybe it is just an issue with the Responsive Design Mode in the Desktop browser. Can somebody else please confirm if it works on their mobile device too?