Skip to content
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

List View: Make drag chip resemble list item, and displace blocks when dragging #56539

Open
2 of 4 tasks
andrewserong opened this issue Nov 27, 2023 · 2 comments · May be fixed by #58103
Open
2 of 4 tasks

List View: Make drag chip resemble list item, and displace blocks when dragging #56539

andrewserong opened this issue Nov 27, 2023 · 2 comments · May be fixed by #58103
Assignees
Labels
[Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@andrewserong
Copy link
Contributor

andrewserong commented Nov 27, 2023

What problem does this address?

Part of #49563

Dragging list view items does not feel like picking up a list view item and moving it to a new position.

When dragging blocks within the list view, the drag chip (the icon that follows the mouse cursor around) obscures the drop indicator line, while also not being a WYSIWYG representation of dragging blocks around. Also, there has been feedback on issues and PRs that the drop indicator line can make it feel difficult to drag blocks around in an intuitive way.

What is your proposed solution?

A suggestion that's come up many times is to try displacing list items while dragging, that is to say, when a user drags a block, move all the other list items out of the way. This has been tried previously in #34022. It would be good to explore this idea again, especially now that a number of improvements have landed for the list view. One potential path forward could involve:

Potential way to implement it

This is one potential path, that (hopefully) wouldn't involve a large refactor, but that could provide the visual appearance of dragging "real" list view items while moving the other list view items out of the way as a user drags blocks around:

  • When a user starts dragging a block, "hide" the blocks within the list view, and use a duplicate of the DOM elements for those blocks as the drag chip (effectively part of what was being explored in List View: Update draggable chip to resemble the list view item when dragged #49820)
  • Then, for each list view item, animate the item to move either up or down, based on whether or not the item is above or below the mouse cursor. The distance the item is to move up or down should be the height of the dragged items

With these two ideas combined, we might be able to get something that feels like a WYSIWYG experience of dragging blocks in the list view.

To-do

@andrewserong
Copy link
Contributor Author

I've started a proof of concept for displacing list view items over in #56625. Happy for any early feedback!

@andrewserong
Copy link
Contributor Author

Update in case anyone is looking at this issue in particular:

In WP 6.5, the first part of this feature landed in the form of enabling displacement list view dragging in #56625. For WP 6.6 it would be good to continue work on this feature and explore making the drag chip resemble the list view item (as explored in the WIP PR #58103). In the process it would also be good to resolve some of the wrinkles or subtle visual issues with the current animation when displacing list view items, as raised in #59937.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
1 participant