Q42 / sanity-plugin-page-tree

MIT License
25 stars 5 forks source link

Feature request: Drag/Drop/Sortable items #9

Open magicspon opened 9 months ago

magicspon commented 9 months ago

Something like this would be absolutely belting! PixelSnap 2023-12-20 at 15 28 37

I wouldn't mind having a go at this myself. Any thoughts?

https://master--5fc05e08a4a65d0021ae0bf2.chromatic.com/?path=/story/examples-tree-sortable--collapsible

Jamiewarb commented 9 months ago

Love it

djohalo2 commented 4 months ago

Hi @magicspon. Sorry for the late reply. Thanks for the feature request! On the one hand I doubt if this should be part of the scope of this package because the plugin reflects a page tree structure where order might not be so relevant, but on the other hand I can imagine this would help content editors to organize it further.

I'm not sure how we would implement this without creating drafts all the time, because I would think we need to persist the order on the document in the data store. Did you have any ideas how to achieve this?

magicspon commented 2 months ago

How about a button to apply the new order/hierarchy

So you drag and drop the elements, then hit a button to apply the changes in one go rather that creating drafts