Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Discussion related to "Everything" 1.5 Alpha.
Post Reply
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Post by raccoon »

Observation:

With Search as you type disabled, when you type a search query you have to press Enter to get your results.
With Search as you type enabled, when you type a search query, results are automatically displayed as you type (after a small delay). But also, the Enter key does nothing anymore.

Try the search query below with Search as you type disabled and enabled.

video: randomize: count:10

Now hit Enter. Hit Enter again. And again, and again.
Now hit F5, F5, F5...

It is possible to add a Keyboard shortcut for "View | Refresh" -> Search Edit -> Enter, so that the Enter key behaves the same way whether Search as you type is enabled or disabled. I just feel this should be the default behavior, or this shortcut should be installed by default.

Thoughts?

My work-around for this quirk had been to type a junk character and hit backspace in order to force a requery. It just occurred to me today to add Enter as a Keyboard shortcut for View|Refresh.

Edit:

I found there's a bug if adding Enter as a shortcut to View|Refresh. When Search as you type is Enabled, and you want to clear(blank) your search query, hitting Enter will only refresh the previous search query and will not allow you to blank it out.
Last edited by raccoon on Thu Feb 16, 2023 9:25 am, edited 1 time in total.
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Post by void »

With Search as you type enabled, pressing ENTER from the search box simply focuses the result list. (the query has already been executed)
With Search as you type disabled, pressing ENTER from the search box will execute your query and focus the result list.

With Search as you type enabled, pressing ENTER from the search box shouldn't requery.
This is by design.
For example, if you have an expensive search, you would not want Everything to perform the requery.
It might also be unexpected if you see an item in the result list that interest you, you press ENTER from the search box and now your results are different.

What I find myself doing is cutting the entire search text and then pasting it back to refresh the query.



F5 is causing a requery because of the randomize: sort.



Would an option to requery on ENTER when search as you type is enabled be useful?
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Post by void »

I found there's a bug if adding Enter as a shortcut to View|Refresh. When Search as you type is Enabled, and you want to clear(blank) your search query, hitting Enter will only refresh the previous search query and will not allow you to blank it out.
This is expected.
Refresh will not perform a requery. (unless you use randomize:)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Post by raccoon »

void wrote: Thu Feb 16, 2023 9:24 am With Search as you type enabled, pressing ENTER from the search box simply focuses the result list. (the query has already been executed)
With Search as you type disabled, pressing ENTER from the search box will execute your query and focus the result list.
Whoops. I had set search_edit_enter_action=0 on purpose to eliminate this pesky behavior of focusing the result list.
With Search as you type enabled, pressing ENTER from the search box shouldn't requery.
This is by design.
For example, if you have an expensive search, you would not want Everything to perform the requery.
I'm not sure if I understand this design. This is exactly the behavior I would expect. I wouldn't press Enter on an expensive search unless I knew I wanted to commit to a requery. Right? Or is everyone really using Enter like Tab these days to navigate focus from the Search Bar to the Results List? I have never adopted or drempt of this pattern myself. (But I'm oldhat)
It might also be unexpected if you see an item in the result list that interest you, you press ENTER from the search box and now your results are different.

What I find myself doing is cutting the entire search text and then pasting it back to refresh the query.
Ah, see, so you do it too! Kind of. Shouldn't we be pressing Enter to push that baby on through the pipe? Enter is the imaginary "Search" or "Go" pushbutton that appears to the right of the Search Bar. Like on browser address bars and search engine input boxes. No?
F5 is causing a requery because of the randomize: sort.
Would an option to requery on ENTER when search as you type is enabled be useful?
Maybe attach this behavior to search_edit_enter_action?

Code: Select all

Set the action when pressing ENTER from the search box.

Can be one of the following.
0 = Do nothing
1 = Focus most run result (default)
2 = Focus last run result
3 = Focus top visible result (if no result focus)
4 = Focus top result
5 = Focus bottom result
6 = Focus search box and select all text
* 7 = Focus search box and requery text
Can you explain how a requery is different from a refresh (F5)?
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Post by void »

I'll add an option to search_edit_enter_action to requery in the next alpha update.

Thank you for the suggestion.

search_edit_enter_action
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Post by NotNull »

What I find myself doing is cutting the entire search text and then pasting it back to refresh the query.
FWIW: I just type an extra SPACE at the end of the query.
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Bug? Search As You Type changes behavior of Enter for Requery/Refresh

Post by void »

Everything 1.5.0.1339a adds a requery option to search_edit_enter_action.

To set your search edit ENTER action to requery:
  • Copy and paste the following into your Everything search box:
    /search_edit_enter_action=7
  • Press ENTER in your Everything search box.
  • If successful, search_edit_enter_action=7 is shown in the status bar for a few seconds.
Now, when you press ENTER from the search box a requery is performed.
Post Reply