Bug 478472 - When searching, result is cluttered by empty categories
Summary: When searching, result is cluttered by empty categories
Status: RESOLVED FIXED
Alias: None
Product: kdeplasma-addons
Classification: Plasma
Component: Application Dashboard (show other bugs)
Version: 5.90.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6, regression, usability
: 486105 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-13 13:11 UTC by Jan Rathmann
Modified: 2024-08-30 04:20 UTC (History)
3 users (show)

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


Attachments
Screen recording of the steps to reproduce (672.44 KB, video/webm)
2023-12-13 13:11 UTC, Jan Rathmann
Details
Patch to fix the empty categories by enabling runnerModel.mergedResults (341 bytes, patch)
2024-07-30 11:03 UTC, Jan Rathmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Rathmann 2023-12-13 13:11:13 UTC
Created attachment 164135 [details]
Screen recording of the steps to reproduce

SUMMARY
When searching in the Application Dashboard, the search result shows all possible categories even though they don't contain any search result. What makes this especially problematic is that actual search results can get "hidden" by the empty categories and can only be seen by scrolling down.
(see attached screen recording)

STEPS TO REPRODUCE
1. Open Application Dashboard
2. Type something like Kate or Konsole to search

OBSERVED RESULT
Beside search results, lots of empty categories are shown. One maybe needs to scroll to down to see all actual ssearch results.

EXPECTED RESULT
Only search results are shown (that's the case in the P5 version of the Dashboard).

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.90
KDE Frameworks Version: 5.247 
Qt Version: 6.6.1

ADDITIONAL INFORMATION
Reproduced on up-to-date Neon Unstable installation and a VM with openSuse Krypton live image.
Comment 1 Nate Graham 2023-12-13 16:22:57 UTC
Can reproduce.
Comment 2 cwo 2024-06-13 19:49:55 UTC
*** Bug 486105 has been marked as a duplicate of this bug. ***
Comment 3 Jan Rathmann 2024-07-30 11:03:44 UTC
Created attachment 172120 [details]
Patch to fix the empty categories by enabling runnerModel.mergedResults

Preliminarily results of investigating the cause of this bug:

* To get "merged search results" like in kicker menu, add
    runnerModel.mergeResults = true;
  at bottom of onVisibleChanged() of Kicker.DashboardWindow.root in DashboardRepresentation.qml (see attached diff file).
  While this will not restore the exact same layout for search results as in Plasma 5, it _does_ effectively solve the problem of displaying empty categories that clutter the actual search results. (Shall I start a merge request?)
  
* Couldn't find a way to restore the exact same behaviour as in Plasma 5 (grouping search results by categories, but don't show empty categories) after spending several hours on different days.
 If I got it right, the path forward should be to filter out all RunnerMatchesModels that contain no search results, but I couldn't figure out on which place I could inject code that would do this (possible candidates: DashboardRepresentation.qml? runnermodel.cpp? runnermatchesmodel.cpp?). It seems I would need to have better knowledge/undestanding of QML/Qt/C++ to tackle this.

Why this worked fine in Plasma 5 I'm not sure. My two hypothesises are that either:
* there was code that somehow was responsible for not showing empty categories, but it was (accidentally?) changed/deleted during conversion to Plasma 6; or
* there was no actual code filtering out empty categories; this was just working implicitly "right" for Qt5, while something changed in Qt6 that makes it not working anymore (and adds the necessity to explicitly handle the filtering somewhere).
Comment 4 Bug Janitor Service 2024-08-13 19:58:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2439
Comment 5 Bug Janitor Service 2024-08-29 12:09:07 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2483
Comment 6 Nate Graham 2024-08-30 03:49:43 UTC
Git commit 7ca2c3a7ddee9f909634214e082921c3a065496d by Nate Graham, on behalf of Marco Martin.
Committed on 30/08/2024 at 03:22.
Pushed by ngraham into branch 'master'.

Hide empty categories

in ItemMultiGridView, hide empty categories so
krunner search results don't get cluttered by them

M  +1    -0    applets/kicker/package/contents/ui/ItemMultiGridView.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/7ca2c3a7ddee9f909634214e082921c3a065496d
Comment 7 Nate Graham 2024-08-30 04:20:53 UTC
Git commit 33b4cecfa94d4a4b0c5c10de8940026b18092fd5 by Nate Graham.
Committed on 30/08/2024 at 04:20.
Pushed by ngraham into branch 'Plasma/6.1'.

Hide empty categories

in ItemMultiGridView, hide empty categories so
krunner search results don't get cluttered by them


(cherry picked from commit 7ca2c3a7ddee9f909634214e082921c3a065496d)

7ca2c3a7 Hide empty categories

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +1    -0    applets/kicker/package/contents/ui/ItemMultiGridView.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/33b4cecfa94d4a4b0c5c10de8940026b18092fd5