-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Serverless] New UX for Global Search bar #158978
[Serverless] New UX for Global Search bar #158978
Conversation
afcebfd
to
2e8bd57
Compare
ffb2c0f
to
5ccf620
Compare
4f2eca6
to
d9f70ad
Compare
f625eb6
to
9e40881
Compare
2724026
to
1c5ea66
Compare
11a3972
to
8418f07
Compare
Pinging @elastic/appex-sharedux (Team:SharedUX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (chromeStyle === 'project' && input) { | ||
// while the input ref is in flight, we set focus on it | ||
// to autofocus the input when it appears | ||
input.focus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the autoFocus
prop work here?
searchProps={{
autoFocus: chromeStyle === 'project',
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this will be much better than my hack 🤦🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const chromeStyle = useObservable(chromeStyle$); | ||
|
||
// These hooks are used when on chromeStyle set to 'project' | ||
const [isVisible, setIsVisible] = useLocalStorage(GLOBAL_SEARCH_BAR_VISIBLE_KEY, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this a bit weird that we keep this state inside the storage. It seems that usually, this kind of state is just in memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is benefit to preserving the selection, since the search bar used to be always visible and now it takes a click to show it. If it's ok, I'll go ahead with it this way for now, and bring it up for discussion in the project document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be right that it's better to not store this. I would prefer to make this a simple PR and not add anything that isn't really necessary. If there is friction, we can store the state with a tiny change.
Pushed 82c5e60
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @tsullivan |
Global Search
Project document: https://docs.google.com/document/d/1Z-AkRoagS6JMVN5YHZpjgQr0sYGFXBTNS9SHsbLPfGQ/edit#
Summary
Closes #159763
Currently there is a known issue with the search bar when there is not enough screen real estate: #154415
Checklist
Delete any items that are not applicable to this PR.