Bug 478174 - Better inbuilt search mode for all treeviews and listviews
Summary: Better inbuilt search mode for all treeviews and listviews
Status: CONFIRMED
Alias: None
Product: frameworks-kitemviews
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-06 17:32 UTC by Eric Armbruster
Modified: 2024-09-08 20:53 UTC (History)
2 users (show)

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


Attachments
jetbrains_ide_example (37.50 KB, image/png)
2023-12-06 17:32 UTC, Eric Armbruster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Armbruster 2023-12-06 17:32:06 UTC
Created attachment 163949 [details]
jetbrains_ide_example

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. In Jetbrains IDEs you can type in every tree/listview to search for matching items. You can do that aswell in Qt but there are some subtle but important differences
2. Jetbrains IDEs highlight all matches not just the one which matched best and the selection jumped to while typing
3. They stay in that search mode until you hit Esc or something and its possible to quickly switch between all matching items using respective arrow keys
4. Also you can use "space" while searching and it will match each part separately

I think this would be really nice to have, even though it is targeted at advanced users. I would be interested in implementing this myself some time in the future when I find the time for it. Maybe you could help me out and tell me where an implementation for this would need to go. KItemViews? KItemModels?

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Might be filed against the wrong product. Please assign correctly. Thanks
Comment 1 ratijas 2023-12-06 18:05:03 UTC
Hi,

I totally agree with you. Filtered navigation UX can and should be improved.

I'd imagine a complete solution would consist of three parts:

- A model would provide a filtering layer: roles such as whether a row matches at all, and ranges of sub-matches. KItemModels feels like the right place for it.
- Then a specialized view would negotiate the filtering state with said model, presenting current search text and reacting to key press events as appropriate.
- Finally, a specialized delegate would need to render sub-matches as highlighted regions. FYI there is such implementation in Zeal, the documentation browser: https://github.com/zealdocs/zeal/pull/1475

In case of QtWidgets, KItemViews seems like a good fit for view and delegate types; except it is a Tier-1 framework, meaning it can't depend on KItemModels. That sucks, but I'm sure we'll figure something out. And then we'd also need something for QML/QtQuick.