Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search: sometimes the search text changes at random #41156

Closed
bpasero opened this issue Jan 4, 2018 · 24 comments
Closed

Search: sometimes the search text changes at random #41156

bpasero opened this issue Jan 4, 2018 · 24 comments
Assignees
Labels
search Search widget and operation issues under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues

Comments

@bpasero
Copy link
Member

bpasero commented Jan 4, 2018

I am recently seeing an issue where my search text randomly changes to something else. Steps I did (not reproducible):

  • copy something in the editor
  • paste into search viewlet
  • toggle one search option (match case)
  • toggle another search option (match words)

=> when I clicked on "match words", my initial search word ("prepareActions") changed to "prepare"

/cc @rebornix if this could be related to the macOS search buffer clipboard support that we added in 1.19

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority search Search widget and operation issues labels Jan 4, 2018
@roblourens
Copy link
Member

You didn't use the editor find widget somewhere in there? Was just the text "prepare" selected in the editor at some point?

@bpasero
Copy link
Member Author

bpasero commented Jan 5, 2018

@roblourens wow yeah looks like that's it! When I have the find widget opened and I click into the search viewlet, the text changes to the contents of the find widget. Did we add this on purpose?

@bpasero
Copy link
Member Author

bpasero commented Jan 5, 2018

The weird thing however is that this seemed to happen while focus was in the search viewlet and not in the editor. I still think my steps from the bug description should never trigger this.

@bpasero
Copy link
Member Author

bpasero commented Jan 5, 2018

@roblourens I take it back, it just happened again. No find widget was opened, the search input field changed its value right after I checked the search options. This is crazy :-/

@chrmarti
Copy link
Contributor

chrmarti commented Jan 5, 2018

I see that too. It replaces the current text in the search viewlet with the last text that was in the find widget (also if that is now closed). It does that when I click in the search viewlet's search text field or that text field's toggle buttons.

@roblourens
Copy link
Member

@chrmarti What you're describing is by design from #39609. It should take the text from the last search done in the find widget. But not randomly like @bpasero describes.

@roblourens
Copy link
Member

Well @bpasero might still be describing the same thing though. You can see this like

  • Do a search in the search viewlet
  • Do a search with the find widget, or in chrome, or sublime, etc
  • Some time later, click in the search viewlet
  • It gets the text from the other app

One problem is that the search viewlet is not writing to the global search buffer, so it may think the global buffer text is newer even after searching in the search viewlet and restarting Code. Will fix that...

@roblourens
Copy link
Member

You can set "editor.find.globalFindClipboard": false to disable this and see if that improves it

@bpasero
Copy link
Member Author

bpasero commented Jan 6, 2018

@roblourens imho changing the text in the search viewlet when it gets focus is not correct as long as a search is running or was running. Consider this scenario:

  • run a search in VS Code and get some results
  • switch to Chrome and search something
  • jump back to VS Code

=> the search viewlet text gets replaced with what I searched in Chrome
=> the results are still from the previous search so now I might be confused what is going on?

All in all I find the automatic population of the search viewlet based on that find buffer too aggressive. Maybe the option should be disabled by default.

@roblourens
Copy link
Member

The scenario you describe is exactly how it is supposed to work. I am thinking that it should be disabled too, I've found it more annoying than useful.

@roblourens roblourens added this to the January 2018 milestone Jan 31, 2018
@roblourens
Copy link
Member

roblourens commented Feb 1, 2018

Added search.globalFindClipboard, disabled by default. The find widget globalFindClipboard is still enabled by default.

@bpasero
Copy link
Member Author

bpasero commented Feb 1, 2018

I still think this "feature" is fundamentally broken in that it would change either the global search input field or the find input field in the editor quite randomly by just moving focus into:

flicker_chrome58

Imagine I setup a very complicated search pattern and then it suddenly gets removed without me doing anything?

@bpasero bpasero reopened this Feb 1, 2018
@roblourens
Copy link
Member

roblourens commented Feb 1, 2018

That's what the feature is though. This is only when you have it enabled with the setting. And you can retrieve the previous value from the alt+up history

Have had a couple of these lately though - #42724

@bpasero
Copy link
Member Author

bpasero commented Feb 1, 2018

I would maybe accept this to happen if the search input is empty, but not when I am in the middle of a search that shows results. How as a user do you even understand that the input was changed automatically and the results below no longer match?

@roblourens
Copy link
Member

You're seeing that it's disabled by default for the search viewlet now though, right? Otherwise they'll only see that if they've opted into it.

roblourens added a commit that referenced this issue Feb 1, 2018
@bpasero
Copy link
Member Author

bpasero commented Feb 1, 2018

@roblourens yeah it is disabled by default, at least for the global search, I was testing with the option turned on explicitly.

@roblourens
Copy link
Member

It could be weird that the search viewlet shows results that don't match the query text but I wouldn't want to clear them or anything.

@sandy081 sandy081 modified the milestones: January 2018, February 2018 Feb 2, 2018
@sandy081 sandy081 removed the important Issue identified as high-priority label Feb 2, 2018
@roblourens
Copy link
Member

I'm going to consider this resolved unless you have any other suggestion.

@roblourens roblourens removed the bug Issue identified by VS Code Team member as probable bug label Feb 7, 2018
@bpasero
Copy link
Member Author

bpasero commented Feb 7, 2018

@roblourens maybe we take this to a UX meeting

@roblourens roblourens reopened this Feb 7, 2018
@bpasero bpasero added the ux User experience issues label Feb 7, 2018
@roblourens roblourens added the under-discussion Issue is under discussion for relevance, priority, approach label Feb 9, 2018
@roblourens
Copy link
Member

Will bring it up in a UX meeting after my vacation, didn't have time this month.

@roblourens roblourens modified the milestones: February 2018, March 2018 Feb 15, 2018
@roblourens roblourens modified the milestones: March 2018, April 2018 Mar 26, 2018
@roblourens
Copy link
Member

@bpasero Do you still want to discuss more? We can take it to this week's UX meeting.

I won't say this isn't a weird feature, but we do match Sublime, etc as close as we can. Implementing it a different way probably wouldn't help the people who do want it. Would like to hear any suggestions you have.

@bpasero
Copy link
Member Author

bpasero commented Apr 4, 2018

@roblourens I think its fine as long as the default is that it is disabled. I am probably not a good candidate for talking how I would expect this feature to work because I am not using it actually and I also do not find it useful for my personal workflows.

I guess what I always found unexpected was that switching between editor find widget and search viewlet was changing the search input text as soon as focus was going in. I believe Sublime (and others?) might not have this issue because they reuse the same input boxes for editor search and global search.

@roblourens
Copy link
Member

That's true. With Sublime you can do something similar when switching between apps.

  • Start typing a long and complicated search query in Sublime
  • Switch to Chrome, cmd+f 'foo'
  • Switch back to Sublime, your search query is replaced with 'foo' and can't be retrieved

@roblourens roblourens removed this from the April 2018 milestone Apr 4, 2018
@bpasero
Copy link
Member Author

bpasero commented Apr 4, 2018

@roblourens I would argue that is a different scenario though because you are leaving the application, copy something to the find clipboard elsewhere and then come back. I would never expect this behaviour from within the application. I think this feature is meant for the case where you come from another application and changed the find clipboard.

@vscodebot vscodebot bot locked and limited conversation to collaborators May 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
search Search widget and operation issues under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues
Projects
None yet
Development

No branches or pull requests

4 participants