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

Show warning when search text is too short #671

Merged
merged 2 commits into from
Jul 6, 2023
Merged

Conversation

csillag
Copy link
Contributor

@csillag csillag commented Jul 5, 2023

image
image
image

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Deployed to Cloudflare Pages

Latest commit: 3902a194ac33ab6638bffdf0b77f244e1599f6ee
Status:✅ Deploy successful!
Preview URL: https://25d397eb.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/search-too-short branch from f009f44 to f5cd6c1 Compare July 5, 2023 17:11
@csillag csillag marked this pull request as ready for review July 5, 2023 17:11
@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

I would suggest this for the 'too little characters' notification: https://www.figma.com/file/ifCrok8cP5ymEYjMa2PIi9/Block-Explorer?type=design&node-id=6624%3A246974&mode=design&t=Gk19GONKNbhNZF6X-1

OOps, I didn't see that.

@donouwens
Copy link
Collaborator

I really like the concept you've got now. If we can add the colours and icon we should be there.

@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

I have updated the screenshort after making it more similar to the visuals.

@csillag csillag requested review from lukaw3d and buberdds July 5, 2023 17:40
@donouwens
Copy link
Collaborator

Could we outline the input field with a red stroke as well, please?

@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

Could we outline the input field with a red stroke as well, please?

Like this?
image

@csillag csillag force-pushed the csillag/search-too-short branch from fe09cdd to 5ca1016 Compare July 5, 2023 17:56
@donouwens
Copy link
Collaborator

Could we outline the input field with a red stroke as well, please?

Like this? image

Yeah exactly, although the stroke feels thicker than in the visuals. I assume it's the 3px active stroke, but maybe we could try the inactive 1px if it's not too much work?

@csillag csillag force-pushed the csillag/search-too-short branch 2 times, most recently from bc6297a to d7d4045 Compare July 5, 2023 18:03
@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

the stroke feels thicker than in the visuals. I assume it's the 3px active stroke, but maybe we could try the inactive 1px if it's not too much work?

I just triggered the built-in "error" flag on the input field, anything beyond that was automatic. Will have to dig deeper... 🧤

@donouwens
Copy link
Collaborator

the stroke feels thicker than in the visuals. I assume it's the 3px active stroke, but maybe we could try the inactive 1px if it's not too much work?

I just triggered the built-in "error" flag on the input field, anything beyond that was automatic. Will have to dig deeper... 🧤

Ideally I'd say the error would be less thick, but I understand if that's not within the scope of this task.

@lukaw3d
Copy link
Member

lukaw3d commented Jul 5, 2023

I don't like that it is so hard to get to search suggestions

@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

I don't like that it is so hard to get to search suggestions

Please elaborate

@lukaw3d
Copy link
Member

lukaw3d commented Jul 5, 2023

If user doesn't know what to search for, they shouldn't need to make up 3 chars

@lukaw3d
Copy link
Member

lukaw3d commented Jul 5, 2023

also, hold on, why are we not allowing searching for block "10" :/

@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

also, hold on, why are we not allowing searching for block "10" :/

That we can fix easily.

image
image

@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

I don't like that it is so hard to get to search suggestions. If user doesn't know what to search for, they shouldn't need to make up 3 chars

Fair point. Here is some potential solutions, and the drawbacks I see

Option Problem
0. (Current behavior) for short search string, the default suggestions are obscured. image If user doesn't know what to search for, they shouldn't need to make up 3 chars just to get the search suggestion.
1. Leave the default suggestions in place, don't show the "too short" message, just disable the search It won't be obvious why the search button is disabled.
2. Leave the default suggestions in place, don't show the "too short" message, enable the search and execute it normally. (Since the search term is too short, we won't search for tokens.) The users might never figure out why they can't find their "XYZ" token when they search for "XY".
3. Leave the default suggestions in place, don't show the "too short" message, enable the search, but instead of executing it, show a separate error message (at a different location, not obscuring the search suggestion) upon searching. Something like this: image (This was my previous implementation) Visually might not be that pleasant (?)
4. Introduce a second line of search suggestions. One line would always be the default suggestions, and the other line would be the "too short" message, when applicable. Something like this: image ???
X Something else I didn't think of

@donouwens @lukaw3d please state your preferences.

@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

I have now implemented option 4. It can be tested here.

@csillag csillag force-pushed the csillag/search-too-short branch from 174ba75 to 40074fd Compare July 5, 2023 22:12
@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

the stroke feels thicker than in the visuals. I assume it's the 3px active stroke, but maybe we could try the inactive 1px. [...] Ideally I'd say the error would be less thick, but I understand if that's not within the scope of this task.

OK @donouwens , but what do you mean exactly?

A) Shall I reduce the 3px active stroke at the outline of input fields to 1px everywhere?
B) Shall I reduce the 3px active stroke at the outline of input fields in case of errors to 1px everywhere?
C) Shall I reduce the 3px active stroke at the outline, in case of errors, just this once, at this field?

@csillag
Copy link
Contributor Author

csillag commented Jul 5, 2023

the stroke feels thicker than in the visuals. I assume it's the 3px active stroke, but maybe we could try the inactive 1px. [...] Ideally I'd say the error would be less thick, but I understand if that's not within the scope of this task.

OK @donouwens , but what do you mean exactly?

A) Shall I reduce the 3px active stroke at the outline of input fields to 1px everywhere?
B) Shall I reduce the 3px active stroke at the outline of input fields in case of errors to 1px everywhere?
C) Shall I reduce the 3px active stroke at the outline, in case of errors, just this once, at this field?

Until further notice, I have done option B)

@lukaw3d
Copy link
Member

lukaw3d commented Jul 6, 2023

Option 5: show suggestions on focus, show "min 3 chars" when anything is entered
(that would require quite some refactoring of search using ClickAwayListener, so separate PR?)

@csillag csillag force-pushed the csillag/search-too-short branch from 5a18611 to c24292e Compare July 6, 2023 11:27
@csillag
Copy link
Contributor Author

csillag commented Jul 6, 2023

Sorry @donouwens we want to move on, so we will just merge this now. We can always update the styling if required.

@csillag csillag force-pushed the csillag/search-too-short branch from c24292e to 3902a19 Compare July 6, 2023 14:20
@csillag csillag enabled auto-merge July 6, 2023 14:21
@csillag csillag merged commit 262b932 into master Jul 6, 2023
@csillag csillag deleted the csillag/search-too-short branch July 6, 2023 14:22
@donouwens
Copy link
Collaborator

@csillag I think in essence this works okay, but visually it needs updating - could we show it like this: https://www.figma.com/file/ifCrok8cP5ymEYjMa2PIi9/Block-Explorer?type=design&node-id=6624%3A246974&mode=design&t=NgiFzpta47LLPkRx-1

Moreover, would it be possible to only start showing the 'too short...' notification after the user doesn't enter an additional character after the first one within 500ms? I'm hoping that gives the user time to enter a second and third character without having to see the error.

Finally, would it be possible to smooth out the status between showing the 'too short..' and regular state? I would like animations like this - you can access the flow from the video here.

I want this to be smooth as it will be part of the very first impression users will have of the product.

@donouwens
Copy link
Collaborator

OK @donouwens , but what do you mean exactly?

A) Shall I reduce the 3px active stroke at the outline of input fields to 1px everywhere? B) Shall I reduce the 3px active stroke at the outline of input fields in case of errors to 1px everywhere? C) Shall I reduce the 3px active stroke at the outline, in case of errors, just this once, at this field?

Could we make it behave like this and this - so an inline stroke everywhere of 3px and not have a stroke on the search button itself, please.

@csillag
Copy link
Contributor Author

csillag commented Jul 7, 2023

visually it needs updating - could we show it like this:

Sorry could you please help me by detecting and enumerating the points of difference?

Design Implementation
image image

@donouwens
Copy link
Collaborator

visually it needs updating - could we show it like this:

Sorry could you please help me by detecting and enumerating the points of difference?

Design Implementation
image image

Of course;

  1. Stroke is inside and 3px thick - no stroke on CTA button (not sure if there is one though)
  2. Additional spacing (5px) between input field, error ("Please enter..") and helper text )"Not sure what..")
  3. No background color for error text ("Please enter...")
  4. Added clear search icon (different task though, right)?
  5. Missing period after "Token" in helper text ("Not sure what...")

@csillag
Copy link
Contributor Author

csillag commented Jul 7, 2023

See follow up in #689

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants