Skip to content

#98942 Clear Search Pattern Fields#100024

Merged
roblourens merged 4 commits intomicrosoft:masterfrom
edjeffreys:issue/98942-search-clear-exclude
Jul 4, 2020
Merged

#98942 Clear Search Pattern Fields#100024
roblourens merged 4 commits intomicrosoft:masterfrom
edjeffreys:issue/98942-search-clear-exclude

Conversation

@edjeffreys
Copy link
Contributor

@edjeffreys edjeffreys commented Jun 12, 2020

  • Make clear button a 2-stage button
  • Clear search fields if text is present, and leave file pattern fields, otherwise clear file pattern fields
  • Introduce clear method on PatternInputWidget

Edit (Took me longer than it should have to realise what a 2-stage button means...)

This PR fixes #98942

* Register new search action button: clear search patterns
	- Visible when pattern input fields contain text
* Introduce clear method on PatternInputWidget

ToDo: Create new icon for clear search pattern button??
Finally realized what a 2-stage button is...

Clears search fields first if there are any values entered, otherwise
clears file pattern fields
@JacksonKearl
Copy link
Contributor

Thanks!
This should additionally at minimum change the hover text of the button to reflect the two stages, and ideally have two separate icons. (@misolori for input re. icons)

@miguelsolorio
Copy link
Contributor

miguelsolorio commented Jun 16, 2020

I wouldn't create a separate icon for this, we already do this in the Settings & Keyboard Shortcut search input (though it's a single input). I'd ensure you update the title properly.

I also think this should be behind a setting as people will be split on a preference. I'd personally want it to clear everything on a single click.

@edjeffreys
Copy link
Contributor Author

Happy to take a look at both the title, and the setting.

Any preference on what the default behaviour should be for clearing?

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I don't want to add a setting yet, since the default behavior is not changing, and I try to avoid adding settings for every little thing. We can wait and see if we get more feedback about that though.

@roblourens
Copy link
Member

@JacksonKearl what are you thinking that the title should be updated to say?

@edjeffreys
Copy link
Contributor Author

Thanks @roblourens! I'll hold fire for now then.

@roblourens roblourens added this to the July 2020 milestone Jul 3, 2020
@roblourens
Copy link
Member

roblourens commented Jul 3, 2020

I don't know that we need to update the title, I think that it already will say "Clear Search Results" when there are no search results and it is just clearing the input box. If we want to be totally specific, I think there would 3 states.

  • "Clear Search Results" whenever there are search results because we need to be clear that those are going away
  • "Clear Search Query"
  • "Clear Extra Query Fields" or something like that

But I don't know that it's necessary, what do you think @JacksonKearl?

Also I think we're fine without extra icons.

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jul 3, 2020

I'm convinced; people will probably discover it anyways if they need it.

@roblourens roblourens merged commit f3c89cc into microsoft:master Jul 4, 2020
@ArturoDent
Copy link

Just to be clear, this is the behaviour I see in the Insiders' Build:


The first click clears the search results and the query/replace terms and does not affect the Files to Include/Exclude fields.

The second click clears the Files to Include/Exclude fields.


I like this, it just wasn't clear from the preceding comments that this was how it would turn out.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request - Clear button of search panel should clear everything

5 participants