Bug 397092

Summary: Retain prior search when KRunner is re-opened
Product: [Plasma] krunner Reporter: Nate Graham <nate>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: wishlist CC: alexander.lohnau, rwbarat
Priority: NOR Keywords: usability
Version: 5.13.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.20

Description Nate Graham 2018-08-02 15:37:13 UTC
It would be nice if KRunner remembered the previous search text when it's closed and re-opened. The previous search text shuold be selected so you can immediately start typing to replace it with a new search.

Reasons why this would be handy behavior:
- Lets you return to the results of a previous search if they would still be relevant (e.g. you searched for an item, opened one of the search results, then discovered that it wasn't the item you were looking for)
- Makes it easier to use KRunner as a calculator for complex expressions where you're updating the expression in response to data in another app (currently, interacting with the app closes KRunner and clears the mathematical expression you were working on)
- Allows you to use KRunner as a handy systemwide text field for the purpose of building up strings (sounds weird, but I use Spotlight for this all the time in macOS)
Comment 1 Nate Graham 2020-07-12 13:52:26 UTC
*** Bug 424121 has been marked as a duplicate of this bug. ***
Comment 2 Alexander Lohnau 2020-07-13 08:08:06 UTC
Super interesting idea!

Although I am against setting this behavior by default, because this would lead to the case where we run a query with the last term. This is contrary to the the current workflow of KRunner which only shows results when explicitly asked for. Also this would feel like a big visual change for the users. Maybe we can make this an option in the KCM.

PS: Also there have been quite a few feature request to add more options for the
KRunner UI. Because of that I had the idea of adding an "Advanced" expandable section to the KCM, but that might be a VDG discussion for another time :-).
Comment 3 Nate Graham 2020-07-13 21:20:29 UTC
(In reply to Alexander Lohnau from comment #2)
> Super interesting idea!
> 
> Although I am against setting this behavior by default, because this would
> lead to the case where we run a query with the last term. This is contrary
> to the the current workflow of KRunner which only shows results when
> explicitly asked for. Also this would feel like a big visual change for the
> users. Maybe we can make this an option in the KCM.
We could probably change it to not run a new query when it's shown but there's already search text in the text field, FWIW.

> PS: Also there have been quite a few feature request to add more options for
> the
> KRunner UI. Because of that I had the idea of adding an "Advanced"
> expandable section to the KCM, but that might be a VDG discussion for
> another time :-).
Not sure we explicitly need an "Advanced" section, but I wouldn't be averse to judiciously adding some more options if needed.
Comment 4 Bug Janitor Service 2020-08-24 10:48:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/226
Comment 5 Alexander Lohnau 2020-08-30 16:19:30 UTC
Git commit ddd005b1f5bd802193d9393f68cf2bd1e01dee6d by Alexander Lohnau.
Committed on 30/08/2020 at 16:19.
Pushed by alex into branch 'master'.

Add option to retain prior search
FIXED-IN: 5.20

M  +11   -1    krunner/view.cpp
M  +5    -0    krunner/view.h
M  +14   -2    lookandfeel/contents/runcommand/RunCommand.qml

https://invent.kde.org/plasma/plasma-workspace/commit/ddd005b1f5bd802193d9393f68cf2bd1e01dee6d