Make drag-and-drop usable in the outliner#431
Conversation
TheExGenesis
left a comment
There was a problem hiding this comment.
I pulled but the drag and drop wasn't updating block position.
Could you elaborate more? Do you mean when dropping the block it doesn't get reordered/moved? (a screencast would be very helpful) |
|
Hey I recorded a video, see if you can reproduce some of the problems I faced. Sometimes blocks won't move, sometimes they'll disappear, one time a block got cloned: https://www.loom.com/share/a226dfe5d3db43519e296be377a712c1 I'm really excited about this feature btw, glad you're working on it :) |
|
Thank you for the video! Looks like the detection of drop target jumps a lot. What browser/OS are you using? And where is the server running (on the same machine / in the same local network / on a cloud service / etc)? |
|
Using Brave (which is Chromium), server running locally. |
|
I downloaded Brave (on Linux) and drag-and-drop worked normally. But I did see some of the bugs (block not moving on drop, block duplicates) when I was in a tab that was idle for a long time. At this moment drag-and-drop calls API to update data, and the UI reflects changes through data subscriptions, so if the network/server/subscription doesn't work correctly, drag-and-drop would fail. |
|
Just tried the latest commit - it is still very hard to click on the note blocks (bottom 25% is completely unclickable, for example) - I've tried to make the Otherwise everything looks fine, and feel free to merge this once the unclickable issue is done :) |
|
@thesophiaxu Discovered the "Sortable" examples today. In fact we can infer the drop action without the need of explicit drop target elements. So no more drop targets now, clicking into the note blocks should work like before. |
* And hide bugs that produce wrong result when dropping after itself or before its next sibling.
|
Thanks @thesophiaxu for your input on switching the executable approach to direct There's a little annoying effect, which is that the dropped block may flicker its text to show its uid for a bit, though I think we can address it later. Video in 0.5x speed: kazam_screencast_00000.out.mp4 |
I've found that as well - the issue is with how subscriptions are handled and it will probably be fixed later |
Functionality Changes
Code Changes / Refactoring / Fixes
packages/unigraph-dev-explorer/src/examples/notes/useOutlineCollapsed.ts):packages/default-packages/unigraph.core/executables/addItemToList.js).<Outline>component frompackages/unigraph-dev-explorer/src/examples/notes/NoteBlock.tsxsince the file is too big and hard to navigate.