Loris icon indicating copy to clipboard operation
Loris copied to clipboard

[Core] Add the ability to sort menu categories

Open driusan opened this issue 8 months ago • 2 comments

This adds the ability to sort the top-level menus via a new "menu_categories" table. GetMenuCategory returns a new MenuCategory class rather than a string, which permits us to store the metadata that the UserPageDecoration needs for sorting.

A new (fairly trivial) middleware is added to populate the MenuCategory::singleton's cache and if a module uses a menu category that is not in the menu_categories table an exception is thrown. This is intended to prevent typos and ensure that all modules use a valid / existing menu category. It also takes the sorting out of the individual module's hands so that there are no inconsistencies between where any given module thinks the category should be sorted.

Within each dropdown, the sorting is still alphabetical and there is no frontend for customizing it. The default should be the same as our current almost-alphabetical sorting.

Resolves #9748

driusan avatar Apr 17 '25 18:04 driusan

@driusan 500 errors in tests

ridz1208 avatar May 09 '25 02:05 ridz1208

@ridz1208 it is fixed

driusan avatar May 09 '25 15:05 driusan