Bug 430326 - Pressing 'enter' when there are no results returned is not ignored properly.
Summary: Pressing 'enter' when there are no results returned is not ignored properly.
Status: RESOLVED DUPLICATE of bug 427672
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 5.20.4
Platform: Arch Linux Other
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-13 06:57 UTC by Kishore Gopalakrishnan
Modified: 2020-12-18 16:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2020-12-13 06:57:24 UTC
SUMMARY
Pressing 'enter' while there are no results returned, and then typing something, leads to the first result that appears getting selected without any further user interaction.

STEPS TO REPRODUCE 
1. Invoke krunner
2. Press 'Enter'
3. Type anything

OBSERVED BEHAVIOUR
Once krunner fills in results for whatever you have typed in step 3, the first result is automatically executed without any further user interaction, which is extremely confusing.

EXPECTED BEHAVIOUR
Krunner should not execute anything after step 3, but just show the results and wait for the user to give further input.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Kernel Version: 5.9.13-arch1-1
OS Type: 64-bit

ADDITIONAL INFORMATION
Comment 1 Alexander Lohnau 2020-12-13 07:38:01 UTC
This is intentional (from looking at the code), but does not remotely make sense to me.

Will write a patch :)
Comment 2 Bug Janitor Service 2020-12-13 12:21:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/milou/-/merge_requests/18
Comment 3 Alexander Lohnau 2020-12-17 14:02:59 UTC
Hey, it seems that there are users who actually utilize this behavior. The idea is that they type the query and it gets autocompleted and they just press enter.

This requires the user to know exactly in which order the results will be sorted.

I get that it can be annoying, but then it is more of a duplicate of the mentioned bug :)

*** This bug has been marked as a duplicate of bug 427672 ***
Comment 4 Kishore Gopalakrishnan 2020-12-18 05:26:47 UTC
(In reply to Alexander Lohnau from comment #3)
> Hey, it seems that there are users who actually utilize this behavior. The
> idea is that they type the query and it gets autocompleted and they just
> press enter.
> 
> This requires the user to know exactly in which order the results will be
> sorted.
> 
> I get that it can be annoying, but then it is more of a duplicate of the
> mentioned bug :)
> 
> *** This bug has been marked as a duplicate of bug 427672 ***

I see. But this sounds quite disruptive. 

I usually know that, for example, 'kinfocenter' appears on top if I type 'kinfo'. Sometimes, I make a typo which returns no results, but press enter before noticing the typo and the lack of results. Let us say I typed 'kindo' and pressed enter. Nothing happens at that moment, which is perfectly fine. Now, I Press ctrl+backspace (to clear the query), and then start trying to type the correct query ('kinfo'). But, when I type 'ki', 'Kile' appears as the first result and gets selected before I can even finish typing what I mean to type. 

In fact, this behaviour persists even if I dismiss krunner (press 'esc') and invoke it again. For example,
1. Invoke krunner
2. Press 'enter'
3. Dismiss krunner
4. Invoke krunner
5. Type anything that returns a result
leads to the IMO unexpected behaviour of running something after step 5, even if the user has not pressed 'enter'. This was actually how I noticed this behaviour in the first place, but I settled on the steps in comment #0 as an apparently simpler way to demonstrate the behaviour. Is it intentional that this 'runAutomatically' persists even after the user has dismissed krunner?
Comment 5 Alexander Lohnau 2020-12-18 16:05:54 UTC
>Is it intentional that this 'runAutomatically' persists even after the user has dismissed krunner?

That is definitely not as it should be, I will look into that.