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 unblocking followups #3942

Closed
KaiyuWang16 opened this issue Dec 12, 2019 · 1 comment
Closed

Search unblocking followups #3942

KaiyuWang16 opened this issue Dec 12, 2019 · 1 comment
Assignees
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@KaiyuWang16
Copy link
Contributor

KaiyuWang16 commented Dec 12, 2019

Description of the new feature/enhancement

These are the follow-up works that worthen trying but are not blocking the Search project to be checked-in:

  1. The place holder text in the TextBox ("Find...") needs to be localizable.
  2. Search event should have a delegate with more args. This is illustrated below in Issue 2.
  3. Escape should be handled in the control too, as opposed to bubbling, this is illustrated in issue 3 below.

Proposed technical implementation details (optional)

Issue 2:
In the current implementation of search, case match and search direction information are stored in SearchBoxControl as Booleans and passed to TermControl through getter methods. Besides, "Shift + Enter" reverse search are implemented by temporarily change direction state value. These are not safe approaches and should be refactored.

One solution is to use a delegate.

delegate void SearchHandler(String query, Boolean forward, Boolean caseSensitive);
...
runtimeclass xxx {
event SearchHandler Search();
}

In this way, we do not have to create an object, and we do not even need to use TypedEventHandler.

Then, the consumer can still add a search handler like this:
searchBoxControl.Search([](hstring query, bool forward, bool caseSensitive) {
})

Issue 3:
TermControl is using PreviewKeyDown as the event handler for KeyDown events, which is applying a Tunneling strategy. In tunneling, the event will first received by the Root element in the XAML tree and then pass down to the element that triggers the event. Thus, an early return check is added in TermControl::_KeyDownHandler to make sure inputs from the search dialog is handled separately. However, it is worth trying if we can handle search dialog inputs in SearchBoxControl.

(Please make sure you mention all the extra work you've moved into this bug!)

@KaiyuWang16 KaiyuWang16 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Dec 12, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 12, 2019
@KaiyuWang16 KaiyuWang16 changed the title Epic: Search, refactoring search event arguments Epic: Search, refactor search event arguments Dec 12, 2019
@DHowett-MSFT DHowett-MSFT changed the title Epic: Search, refactor search event arguments Search, refactor search event arguments Dec 12, 2019
@DHowett-MSFT DHowett-MSFT changed the title Search, refactor search event arguments Refactor search event arguments Dec 13, 2019
@DHowett-MSFT DHowett-MSFT added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Dec 13, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 13, 2019
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 13, 2019
@KaiyuWang16 KaiyuWang16 changed the title Refactor search event arguments Search unblocking followups Dec 16, 2019
@DHowett-MSFT
Copy link
Contributor

(Please make sure you mention all the extra work you've moved into this bug!)

@zadjii-msft zadjii-msft added this to the Terminal v1.0 milestone Dec 17, 2019
@ghost ghost added In-PR This issue has a related PR Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

3 participants