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

LinkControl - initial search suggestions, first result is prematurely selected. #19630

Closed
getdave opened this issue Jan 14, 2020 · 6 comments
Closed
Labels
[Block] Navigation Affects the Navigation Block [Feature] UI Components Impacts or related to the UI component system [Status] Needs More Info Follow-up required in order to be actionable.

Comments

@getdave
Copy link
Contributor

getdave commented Jan 14, 2020

When search results are non-empty, the first item should be highlighted by default indicating that it will be selected when Enter is pressed.

Originally posted by @WunderBart in #19458 (comment)

Description

When initial suggestions are present (see referenced PR) then the input has no value. However when you hit enter the first search suggestion is populated as the link. This shouldn't happen. The suggestion should only become "selected" if the user clicks it or uses the keyboard arrows to select it.

The behaviour should be that hitting enter should show some kind of error indicating no value has been selected/entered and therefore no link can be created.

@aduth
Copy link
Member

aduth commented Jan 20, 2020

Related discussions:

Technically, this issue appears to be fixed by the changes included in #19651, whereby: pressing Enter when entering a value in the LinkControl search field will not select any of the suggestions unless the user first navigates to one of those suggestions using the arrow key.

It may be worth reformulating this issue to consider what we might want to be the ideal user interaction here. For example, it might be worth considering whether one of those suggestions should be shown to be selected by default. And if so, whether we should optimize that to select a search result vs. a raw URL, and whether we should be "smart" about considering raw URLs vs. search results.

  • If I input "example" and it yields no search results, what should happen when I immediately press Enter?
  • If I input "example" and it yields a search result, what should happen when I immediately press Enter?
  • If I input "example.com" and it yields no search results, what should happen when I immediately press Enter?
  • If I input "example.com" and it yields a search result, what should happen when I immediately press Enter?

@aduth aduth added the [Feature] UI Components Impacts or related to the UI component system label Jan 20, 2020
@tellthemachines tellthemachines added Needs Decision Needs a decision to be actionable or relevant Needs Design Feedback Needs general design feedback. labels Mar 23, 2020
@tellthemachines
Copy link
Contributor

The initial issue here has been fixed, but given the questions raised by @aduth above, I'm changing the labels and moving this back to Needs Design. FWIW, I'm quite happy with the current interaction 😄

@karmatosed
Copy link
Member

For example, it might be worth considering whether one of those suggestions should be shown to be selected by default.

I am not sure if I am understanding this right, this wouldn't be unexpected. Just to be super clear what I see is this:

image

@aduth can you confirm this is me looking in right spot?

@karmatosed karmatosed added [Status] Needs More Info Follow-up required in order to be actionable. and removed Needs Decision Needs a decision to be actionable or relevant Needs Design Feedback Needs general design feedback. labels Mar 24, 2020
@aduth
Copy link
Member

aduth commented Mar 24, 2020

@karmatosed Yes, if I recall correctly, one of the "open questions" here is whether any of those "Recently" or search-associated suggestions should be highlighted by default. I think this can have a pretty dramatic difference on what happens in a typical workflow of type, then press Enter.

Consider:

  1. I search "example.com"
  2. There may be a search result associated with this query (contents or title of some other post, or URL of the post, or in the future some advanced search functionality to search outside the site itself
  3. If, at this point, I press enter, should it either:
    a. Insert the first of the suggestions
    b. Or, infer based on the input "example.com" that the user wants to apply a link for "example.com"

In terms of how this is displayed to the user, and based on the text you quoted, we could show a suggestion as highlighted by default (presumably the first, which would have the behavior of 3a above).

Seeing how this behaves in other link editing experiences (e.g. Google Docs), I'm inclined to think that we should require some user interaction (ArrowDown or mouse over) and never select/highlight a suggestion by default. If a user types a query and immediately presses enter, I think that value should be used verbatim. I expect this would be more aligned with their own expectations (especially in circumstances where they're pasting a complete URL in the input).

@aduth
Copy link
Member

aduth commented Mar 24, 2020

Seeing how this behaves in other link editing experiences (e.g. Google Docs), I'm inclined to think that we should require some user interaction (ArrowDown or mouse over) and never select/highlight a suggestion by default. If a user types a query and immediately presses enter, I think that value should be used verbatim. I expect this would be more aligned with their own expectations (especially in circumstances where they're pasting a complete URL in the input).

To clarify, I believe this is the current behavior, and as such, if it's considered fine as-is (which would be my position), then we could consider this issue closed.

@karmatosed
Copy link
Member

I think also closing this, for now, makes sense, let's do that and we can always iterate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Feature] UI Components Impacts or related to the UI component system [Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

No branches or pull requests

4 participants