bullet-train-co / bullet_train-core

The Open Source Ruby on Rails SaaS Framework
40 stars 46 forks source link

Sortable lists should be more obviously sortable #826

Open jagthedrummer opened 6 months ago

jagthedrummer commented 6 months ago

Currently if you super scaffold a sortable model you'll end up with an index page that is technically sortable, but there's no indication given to the user that the items can be reordered.

rails g super_scaffold Blog Team name:text_field --sortable

CleanShot 2024-05-07 at 11 10 14

I think we should probably add a defined "drag handle" (something like ↕️) to help indicate that the items are draggable.

It would also be nice to change the cursor when someone is hovered over the draggable item. Probably cursor: grab when hovered over the item, and then cursor: grabbing when the drag has been started.

The lack of dragging indicators might be at play in this comment: https://github.com/bullet-train-co/bullet_train-core/pull/825#issuecomment-2098188135

swombat commented 6 months ago

Agreed. I ended up disabling on most lists this since it made clicking less reliable, and gave rise to users saying "the list isn't working" because they moved the mouse a tiny bit while clicking.

I'd advise:

Between those two things it should be more obvious that this is draggable.

swombat commented 6 months ago

This from the Refactoring UI book suggests an even better solution, visually:

image