Bug 477794

Summary: Commands have too low priority
Product: [Plasma] krunner Reporter: Fabian Vogt <fabian>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REOPENED ---    
Severity: normal CC: alexander.lohnau, asturm, natalie_clarius
Priority: NOR    
Version First Reported In: master   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Local results for "systemsettings"

Description Fabian Vogt 2023-11-30 19:37:37 UTC
Created attachment 163669 [details]
Local results for "systemsettings"

Entering a command like "systemsettings" should run systemsettings (either as application or command line), but it's actually far down in the result list.

Found by openQA: https://openqa.opensuse.org/tests/3762524#step/systemsettings/3

Locally (see screenshot), it shows first Applications like "YaST" and "XScreenSaver settings", then some plasma source files with systemsettings in its name, then some source folders and only then the systemsettings command. For "plasmawindowed" it first finds "plasmawindowed.mo" for multiple languages and only as last result the command.

The applications are shown first because the category is by default a favorite and preferred and the applications themselves are matches because their Categories contains X-GNOME-SystemSettings (!).

Workaround: Suffix the command with " ;", e.g. "systemsettings ;"
Comment 1 Natalie Clarius 2023-11-30 20:25:34 UTC
As you observe, this is because applications are a favorite, and I think for most users that's a sane default, as before we had that feature we've received many bug reports about applications typically being ranked too low, and missing the ability to show app  results first no matter what. It this doesn't match your usage patterns, you can set your favorites accordingly; if afterwards the command match is still ranked that low then I suppose this could be improved.
Comment 2 Natalie Clarius 2023-11-30 20:27:51 UTC
So closing as intentional; if the behavior persists after you unconfigured applications to show first, feel free to reopen.
Comment 3 Fabian Vogt 2023-12-01 07:25:14 UTC
Even with the shell command runner added as favorite, the unrelated applications appear on top.
Comment 4 Natalie Clarius 2023-12-01 17:38:21 UTC
And you added it as favorite higher or lower than applications?
Comment 5 Bug Janitor Service 2023-12-05 05:56:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/systemsettings/-/merge_requests/273
Comment 6 Alexander Lohnau 2023-12-05 14:47:50 UTC
Git commit 6c67ae0e14dc0bea64902b2003efb6c339d950a2 by Alexander Lohnau.
Committed on 05/12/2023 at 06:55.
Pushed by ngraham into branch 'master'.

Add systemsettings keyword to desktop file

This will ensure that the executable name matches a provided keyword

M  +1    -0    app/kdesystemsettings.desktop
M  +1    -0    app/systemsettings.desktop

https://invent.kde.org/plasma/systemsettings/-/commit/6c67ae0e14dc0bea64902b2003efb6c339d950a2
Comment 7 Fabian Vogt 2023-12-05 14:57:30 UTC
(In reply to Natalie Clarius from comment #4)
> And you added it as favorite higher or lower than applications?

Lower. If I set it higher then I expect it will be wrong for other searches. Otherwise it should be the default.

IMO ignoring relevance because of favorite configuration doesn't work in practice.
Comment 8 Natalie Clarius 2023-12-05 16:58:27 UTC
(In reply to Fabian Vogt from comment #7)
> (In reply to Natalie Clarius from comment #4)
> > And you added it as favorite higher or lower than applications?
> 
> Lower. If I set it higher then I expect it will be wrong for other searches.
> Otherwise it should be the default.
> 
> IMO ignoring relevance because of favorite configuration doesn't work in
> practice.

But opting out of the default relevance with your preferred ordering is exactly what this setting is for. If you order the command plugin after the application launcher then the result you describe is expected, that's what the UI tells you will happen. If you want to rely entirely on the built-in ranking, unfavorite the plugins. (But as mentioned in the Matrix room, I do tend to think now that it is better for us not to decide on applications being a favorite as a default.)
Comment 9 Fabian Vogt 2023-12-05 17:44:12 UTC
(In reply to Natalie Clarius from comment #8)
> If you want to rely entirely on the built-in
> ranking, unfavorite the plugins. (But as mentioned in the Matrix room, I do
> tend to think now that it is better for us not to decide on applications
> being a favorite as a default.)

Yes, I tried that and it didn't help because of "CategoryRelevance".
Comment 10 Natalie Clarius 2023-12-05 22:15:26 UTC
I agree that if two results have the same category relevance, it should fall back to the highest match relevance rather than to the internal (alphabetical?) ordering, like how we did previously with the match type.