Bug 465865 - Enabling the "sort applications alphabetically" setting results in nonsensical positioning of separator items
Summary: Enabling the "sort applications alphabetically" setting results in nonsensica...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) (show other bugs)
Version: 5.27.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-16 19:08 UTC by AF
Modified: 2023-03-18 15:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.4
Sentry Crash Report:


Attachments
Screenshot (90.26 KB, image/png)
2023-02-17 07:56 UTC, Justin Zobel
Details
Screenshot showing how the application menu is sorted with "Sort applications alphabetically" off (73.01 KB, image/png)
2023-02-17 08:24 UTC, AF
Details
Screenshot showing how the application menu is sorted with "Sort applications alphabetically" enabled (78.44 KB, image/png)
2023-02-17 08:25 UTC, AF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description AF 2023-02-16 19:08:05 UTC
SUMMARY

I spent awhile trying to figure out why my applications in the application menu widget were sorted so oddly on a fresh installation on new hardware until I found the culprit: the "sort applications alphabetically" option on the application menu settings page. If you enable that setting, the sort order that is applied to all categories in the application menu is as follows:

1- All separators (no matter how many)
2 - All submenus in alphabetical order)
3 - All application launchers that are not in a submenu, sorted alphabetically

This is very confusing because the sort order being applied is very unnatural. This could confuse a new user greatly. I have been using KDE for years and this had me confused for 2 days. The only way this setting would produce a natural feeling sort order is if your application menu had no separators or submenus at all.

There are many ways in which this bug could be dealt with, however I think the best way would be that the "sort applications alphabetically" setting should leave separators in the same position as they appear in the KDE Menu Editor and then sort all applications or submenus within that space between separators/ends of that category alphabetically. This would be a more natural feeling sort order.


STEPS TO REPRODUCE
1. Add the applications menu widget to the taskbar.
2. Right click on the widget, select "configure application menu"
3. On the general tab in the behavior section, check the "Sort applications alphabetically" box and click OK
4. Check the sort order applied to the applications.

OBSERVED RESULT

The sort order is all separators, all submenus alphabetically, and finally all applications not in submenus alphabetically.

EXPECTED RESULT

I would expect separators to be left where they were placed, and all applications/submenus between separators or the beginning/end of the category of applications to be sorted alphabetically.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.27.0-1
KDE Frameworks Version: 5.103.0-1
Qt Version: 5.15.8+kde+r181-1
Comment 1 Justin Zobel 2023-02-17 07:56:00 UTC
Created attachment 156345 [details]
Screenshot

I can't seem to replicate this. I've set my launcher to "Application Menu" and enabled "Sort applications alphabetically" but I get a normal-looking and sorted menu. See attached screenshot.
Comment 2 AF 2023-02-17 08:24:49 UTC
Created attachment 156350 [details]
Screenshot showing how the application menu is sorted with "Sort applications alphabetically" off
Comment 3 AF 2023-02-17 08:25:15 UTC
Created attachment 156351 [details]
Screenshot showing how the application menu is sorted with "Sort applications alphabetically" enabled
Comment 4 AF 2023-02-17 08:37:08 UTC
(In reply to Justin Zobel from comment #1)
> Created attachment 156345 [details]
> Screenshot
> 
> I can't seem to replicate this. I've set my launcher to "Application Menu"
> and enabled "Sort applications alphabetically" but I get a normal-looking
> and sorted menu. See attached screenshot.

I believe that you are reproducing the bug in your screenshot, it is showing the exact sort order that I described with all submenus in alpha order on top and all applications that are not in submenus beneath. You don't have any separators in that category, so they are not present. Your manual sort order might be similar to this arrangement already so it is not noticeable.

I have attached two screenshot attachments, one showing the sort order with "sort applications alphabetically" disabled and another with it enabled. In mine, I have my applications not in a submenu first, then a separator, then a submenu. The issue becomes more noticeable when my manual sort order is different from what winds up happening.

Like I said, I am not sure what the correct way to deal with this issue is because it partially comes down to personal preference, but I don't think all separators going to the top is correct.

I have also since reproduced this issue on two other machines, both running the exact same software load out as described in my OP.
Comment 5 Nate Graham 2023-02-17 21:14:53 UTC
> I would expect separators to be left where they were placed
This isn't possible when sorting alphabetically. A separator's position is manually decided, so it only makes sense when using a manual app arrangement. When the arrangement is automatic (because you turned alphabetical sorting on), the separators lose the ability to know where they should live.

Really the separators should just disappear when using alphabetical sorting. Let's make the bug report about that, since it's an actionable and self-contained thing.

Otherwise, the sort ordering looks perfectly logical to me. First sub-menus, arranged alphabetically, then apps, arranged alphabetically. The only alternative I could imagine that would make more sense is to sort everything alphabetically, so as to allow sub-menus to be interspersed between apps. That might look messy though, so I can see why it's done the way it is.
Comment 6 AF 2023-02-17 23:55:50 UTC
(In reply to Nate Graham from comment #5)
> > I would expect separators to be left where they were placed
> This isn't possible when sorting alphabetically. A separator's position is
> manually decided, so it only makes sense when using a manual app
> arrangement. When the arrangement is automatic (because you turned
> alphabetical sorting on), the separators lose the ability to know where they
> should live.

Understood. If separators can't remain where they were placed manually, then this is definitely the best path forward. Thanks Nate!
Comment 7 Bug Janitor Service 2023-03-03 19:35:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2708
Comment 8 Bug Janitor Service 2023-03-07 18:55:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1426
Comment 9 Bug Janitor Service 2023-03-15 22:39:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1433
Comment 10 Joshua Goins 2023-03-18 15:44:44 UTC
Git commit 90ad64ba638649b68cf2ffb7f68e227e86a8b8f1 by Joshua Goins.
Committed on 18/03/2023 at 15:44.
Pushed by redstrate into branch 'master'.

applets/kicker: Hide separators when sorted alphabetically

Users are able to manually add separator items at custom positions in
their menu structures. When they do so, the location of these
separators are inherently custom, and only make sense when the menu
structure is being displayed in its custom order. When using the option
to display everything alphabetically, the separators' custom position
no longer exists and any automatic placement becomes nonsensical.

Currently, the separators get sorted to the beginning of the list,
which looks quite weird. This commit instead hides the separators when
sorting alphabetically. Only Kicker is affected by this change; the
underlying model providing the items is unchanged.
FIXED-IN: 5.27.4

M  +3    -1    applets/kicker/package/contents/ui/ItemListDelegate.qml
M  +2    -0    applets/kicker/package/contents/ui/ItemListDialog.qml
M  +1    -1    applets/kicker/package/contents/ui/ItemListView.qml

https://invent.kde.org/plasma/plasma-desktop/commit/90ad64ba638649b68cf2ffb7f68e227e86a8b8f1
Comment 11 Joshua Goins 2023-03-18 15:45:28 UTC
Git commit d492a691d44a2878eb3c189219dc04260294bb77 by Joshua Goins.
Committed on 18/03/2023 at 15:45.
Pushed by redstrate into branch 'Plasma/5.27'.

applets/kicker: Hide separators when sorted alphabetically

Users are able to manually add separator items at custom positions in
their menu structures. When they do so, the location of these
separators are inherently custom, and only make sense when the menu
structure is being displayed in its custom order. When using the option
to display everything alphabetically, the separators' custom position
no longer exists and any automatic placement becomes nonsensical.

Currently, the separators get sorted to the beginning of the list,
which looks quite weird. This commit instead hides the separators when
sorting alphabetically. Only Kicker is affected by this change; the
underlying model providing the items is unchanged.
FIXED-IN: 5.27.4
(cherry picked from commit 90ad64ba638649b68cf2ffb7f68e227e86a8b8f1)

M  +3    -1    applets/kicker/package/contents/ui/ItemListDelegate.qml
M  +2    -0    applets/kicker/package/contents/ui/ItemListDialog.qml
M  +1    -1    applets/kicker/package/contents/ui/ItemListView.qml

https://invent.kde.org/plasma/plasma-desktop/commit/d492a691d44a2878eb3c189219dc04260294bb77