Bug 480750 - Direct users of Milou (e.g. Plasma's Search widget and KWin's Overview) do not respect search order settings
Summary: Direct users of Milou (e.g. Plasma's Search widget and KWin's Overview) do no...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Milou (show other bugs)
Version: 6.0.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Alexander Lohnau
URL:
Keywords: qt6, usability
: 481295 482373 482848 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-02-02 20:28 UTC by Adam Fontenot
Modified: 2024-03-16 18:18 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.2


Attachments
screenshot of the problem (111.59 KB, image/png)
2024-02-02 20:28 UTC, Adam Fontenot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Fontenot 2024-02-02 20:28:06 UTC
Created attachment 165488 [details]
screenshot of the problem

SUMMARY
In my Plasma Search settings (in System Settings), I have set Applications to appear above Windows, but windows matching my searches always appear above applications.

The same issue happens for other search sources, e.g. "recent files" appear above applications even though I've favorited Applications and not Recent Files.

STEPS TO REPRODUCE
1. Add both "Applications" and "Windows" to your favorite plugins in your Plasma Search settings.
2. Drag Applications so that it appears above Windows.
3. Search for the name of an application that you already have open.

OBSERVED RESULT
The window for the already open application will be found by the search and appear above the application name itself.

EXPECTED RESULT
The application appears first, because you prioritized it in your settings.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.3-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL NOTES

I don't want to disable the problematic search sources, I do use them. My understanding is that Plasma 6 is supposed to respect the search order preferences in KRunner and Plasma Search widgets.
Comment 1 fanzhuyifan 2024-02-02 23:30:39 UTC
Can't reproduce... With the same setting my results for applications appear above those for windows..

Does this also happen when you run krunner from the command line? Or when you trigger it via shortcuts?
Comment 2 Adam Fontenot 2024-02-03 04:55:41 UTC
Interesting, I'm currently seeing that KRunner respects the order I set, and the Plasma Search widget does not. From what I remember, the search order was unified between the two in the past year, so this possibly represents a regression?

I originally saw the wrong order in KRunner as well, but it seems to have started working after I rebooted. Probably just restarting the KRunner daemon would have been enough. I also updated to the latest RC. Possible I missed something with KRunner, but at any rate, I'm seeing the wrong order in the Plasma Search widget.
Comment 3 fanzhuyifan 2024-02-03 16:35:59 UTC
Can reproduce with plasma search widget.
Comment 4 fanzhuyifan 2024-02-03 16:38:44 UTC
Also seems to be the case in overview.
Comment 5 Adam Fontenot 2024-02-04 18:11:06 UTC
I may have been incorrect in believing that search result order had been unified among all Plasma Search consumers. It looks like this was implemented for the Application Launcher, but perhaps not for anything else: bug 431204.

Maybe a bug should be reported against the relevant components (e.g. the Plasma Search widget)?

Incidentally, it looks like RC2 contained changes to the search order logic for KRunner, which is probably why it started working immediately after I filed this issue (because I installed the update): bug 478087.
Comment 6 Nate Graham 2024-02-05 21:41:16 UTC
Can reproduce. Looks like Kickoff does now share result ordering with KRunner, but other apps/implementations using Milou directly do not.
Comment 7 fanzhuyifan 2024-02-14 02:59:44 UTC
*** Bug 481295 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2024-03-05 22:09:06 UTC
*** Bug 482373 has been marked as a duplicate of this bug. ***
Comment 9 Alexander Lohnau 2024-03-06 06:32:30 UTC
Okay, so we might need a little bit of code in milou to take care of that. I will look into this :)
Comment 10 Bug Janitor Service 2024-03-07 20:20:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/milou/-/merge_requests/79
Comment 11 Bug Janitor Service 2024-03-07 21:02:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4018
Comment 12 fanzhuyifan 2024-03-09 03:06:24 UTC
*** Bug 482848 has been marked as a duplicate of this bug. ***
Comment 13 Alexander Lohnau 2024-03-11 11:02:23 UTC
Git commit 181013c8838418ce1fd0baa68adf38e7bbd500e8 by Alexander Lohnau.
Committed on 11/03/2024 at 11:02.
Pushed by alex into branch 'master'.

resultsmodel: Read plasma settings for KRunner favorites

This ensures all users of milout have the settings respected.
In case of an explicit assignment, we do not use the automatically read value.
Using the RESET property, one can revert to the automatic behavior.

M  +1    -0    .kde-ci.yml
M  +1    -1    CMakeLists.txt
M  +1    -0    lib/CMakeLists.txt
M  +19   -1    lib/resultsmodel.cpp
M  +18   -1    lib/resultsmodel.h

https://invent.kde.org/plasma/milou/-/commit/181013c8838418ce1fd0baa68adf38e7bbd500e8
Comment 14 Alexander Lohnau 2024-03-11 11:03:04 UTC
Git commit 8e3252e338d4eb6a2f4848d74a434a0c70b76878 by Alexander Lohnau.
Committed on 11/03/2024 at 11:03.
Pushed by alex into branch 'Plasma/6.0'.

resultsmodel: Read plasma settings for KRunner favorites

This ensures all users of milout have the settings respected.
In case of an explicit assignment, we do not use the automatically read value.
Using the RESET property, one can revert to the automatic behavior.


(cherry picked from commit 181013c8838418ce1fd0baa68adf38e7bbd500e8)

0e3f7831 resultsmodel: Read plasma settings for KRunner favorites
0e9e38a6 ResultsModel: Override favoriteIds property to only read/assign config value...
5e25d099 ResultsModel: Add RESET to change favoriteIds property back to automanaged

M  +1    -0    .kde-ci.yml
M  +1    -1    CMakeLists.txt
M  +1    -0    lib/CMakeLists.txt
M  +19   -1    lib/resultsmodel.cpp
M  +18   -1    lib/resultsmodel.h

https://invent.kde.org/plasma/milou/-/commit/8e3252e338d4eb6a2f4848d74a434a0c70b76878
Comment 15 Alexander Lohnau 2024-03-16 18:15:13 UTC
Git commit 1516e63dc8e8479ba17b3573d9226d725d0bd947 by Alexander Lohnau.
Committed on 16/03/2024 at 17:51.
Pushed by alex into branch 'master'.

krunner: Remove code for assigning favorites to model

M  +0    -4    krunner/qml/RunCommand.qml
M  +0    -3    krunner/view.cpp
M  +0    -10   krunner/view.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/1516e63dc8e8479ba17b3573d9226d725d0bd947
Comment 16 Alexander Lohnau 2024-03-16 18:18:50 UTC
Git commit 2cb1a4bd536fe0fc0e14bc6936ddb69828d79e47 by Alexander Lohnau.
Committed on 16/03/2024 at 18:18.
Pushed by alex into branch 'Plasma/6.0'.

krunner: Remove code for assigning favorites to model


(cherry picked from commit 1516e63dc8e8479ba17b3573d9226d725d0bd947)

M  +0    -4    krunner/qml/RunCommand.qml
M  +0    -3    krunner/view.cpp
M  +0    -10   krunner/view.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/2cb1a4bd536fe0fc0e14bc6936ddb69828d79e47