Draft: Add dedicated application menu search widget
This MR is currently usable for testing and feedback.
This MR needs technical/usability opinions to continue with development. Please take a look at the "Maybe List" for potential changes to make, and add input for whether any of them should be implemented!
Reason for the change
Currently, the Global Menu widget provides a search feature to find actions within the menu, but as of Plasma 6.4.0, it no longer works. When it did work, it only worked on Wayland due to limitations of its QMenu presentation. Additionally, there is currently no way to assign a custom shortcut to quickly access the search action.
MR !5416 (closed) plans to remove the search functionality from the Global Menu widget entirely. Another MR plans to add LIM functionality for Breeze.
To me, it makes sense to split the search functionality out into a new widget for reusability and flexibility:
- Users can bind any shortcut they like to open the widget
- Users can place the widget anywhere they like
- More rich information about the actions can be displayed, much like the old Unity menu HUD
- Search functionality doesn't need to be duplicated across each implementation for accessing the global menu (i.e. menu bar, menu button, window decoration menu button, LIM)
While not a reason for making the change, not relying on QMenu for presentation brings compatibility to X11, which is a nice bonus.
TODO List
-
Handle action visibility -
Handle disabled actions -
Implement action icons -
Implement checkbox/radiobutton for checkable actions -
Find a proper way to detect when a panel is in focus (and not desktop) -
Implement better keyboard handling for list items -
Implement better tab focusing -
Implement placeholder for when there are no searchable actions -
Add handler for QAction::changed -
Make sure I18N is configured correctly for new widget -
Get code quality up to standards -
Improve aesthetics
Maybe List
-
Add component category on bug tracker for new search widget -
Hide widget when menu is not visible -
Add configuration options to show icon + label, icon only, label only -
Add buttons for pinning the widget open, and opening configuration -
Refactor AppMenuModelandActionsProxyModelto share a common abstract base class, instead ofActionsProxyModelusingAppMenuModel(or alternatively, have bothAppMenuModelandActionsProxyModelbe proxies for a shared appmenu model) -
Include the name of the application being searched in the search placeholder (e.g. "Search Konsole...") -
Preload all submenu actions to make them searchable -
Sort search results by some relevance score -
Include menu titles in search (e.g. "export" matching File -> Export -> Some Action) -
Fuzzy search -
Indicate which part of the result was matched in search (bold/highlight)
Test plan
-
Implement autotests for SearchProxyModelandActionsProxyModel -
Make sure Global Menu widget has no regressions -
Make sure that the new search is at parity with the previous search in Plasma 6.3 -
Use the widget with as many applications as possible to find bugs -
Use a screen reader to test accessibility
Screenshots or screen recordings
Known issues
When triggering an action that creates a new window, such as "About Konsole" or similar, the global menu and search widget will often lose track of the currently active window until the focus changes again. This issue does not appear on X11, but does on Wayland. I spent days trying to figure out what was happening, but from everything I can find, this is an issue in TasksManager::TasksModel or perhaps even deeper down (KWin, Wayland, etc). When this issue happens, the tasks manager widget also shows that it lost track of the currently active window, meaning that this issue is not exclusive to or caused by the application menu widgets:

Bugs fixed
BUG: 505876
BUG: 439273
BUG: 481686 (Solving this is a requirement for this to work)
BUG: 479519 (No need for search there when it's a separate widget)
BUG: 495124