discourse/app
Grayden 7ba35e0d71
UX: Improvements for reordering categories (#13013)
* UX: Improvements to reorder categories UX

Before, moving a category from, for example, position 25 to position 0 would result in switching the positions of the two categories at those positions.

Category A at position 0 would move to position 25, and Category B at position 25 would move to position 0.

Instead of switching positions, the reorder categories function should retain the order of categories except for the one being moved.

So, Category B at position 25 would still move to position 0, but Category A is merely bumped down to position 1.

This improves the UX because if a user *really* wants to switch the two categories, it results in one extra step. However in the other (what I think is normal) case, it saves the 24 other switches the user has to make to get Category A back to position 1 (you can imagine the user having to click the up arrow button repeatedly to return Category A to the top of the page). Now, imagine trying to do this with a site with 100s of categories. Yikes!

The UX improvement described above is what this commit accomplishes by redesigning the `move()` method of the reorder-categories controller. It adds some overhead to adjust the positions of all categories in between the origin and target positions, but in testing this is not noticible to the user. It's better for the computer to do extra work than the user.

* UX: Allow decimal input in reorder-categories for more precise positioning.

A common UX pattern when reordering a list of items is to allow a user to specify a target position as a decimal between two valid integer positions. The user is indicating they want the target list item to move in between the list items at the positions on either side of the target position.

For example, say there are three categories Category A at position 0, Category B at position 1, and Category C at position 3.

To move Category C in between Categories A and B, a user can now simply update Category C's position to 0.5.
2021-06-09 13:01:06 +03:00
..
assets UX: Improvements for reordering categories (#13013) 2021-06-09 13:01:06 +03:00
controllers FEATURE: Add user custom fields to user directory (#13238) 2021-06-07 12:34:01 -05:00
helpers FEATURE: Normalize the service worker route (#12343) 2021-05-25 19:39:31 -03:00
jobs DEV: ensure user export ordering is predictable (#13340) 2021-06-09 15:55:52 +10:00
mailers FEATURE: Use group SMTP settings for sending user notification emails (initial) (#13220) 2021-06-03 14:47:32 +10:00
models DEV: Refactor user_badge select_for_grouping scope (#13334) 2021-06-08 13:37:42 -05:00
serializers FEATURE: Add user custom fields to user directory (#13238) 2021-06-07 12:34:01 -05:00
services FIX: Handle timeout errors when sending push notifications (#13312) 2021-06-07 20:46:07 +02:00
views FIX: Theme tests should work in production (#13333) 2021-06-08 22:03:59 +03:00