-
Notifications
You must be signed in to change notification settings - Fork 841
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
EuiSelectableTemplateSitewide for Elastic's global search #3800
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
I've started to take a look at this (in Kibana) alongside John's mockups and I'm wondering how we should approach feedback/tweaks. For example, let's suppose we wanted to change the background color of the unfocused search input, or maybe we want to change the width of the form layout. Would we do that on the EUI side? perhaps within the header component and force dark input styles? or, should we address such design overrides with custom CSS on the Kibana side? |
I know what you're referencing is specifically changing the styles of the search input to look better on the black header. That will be coming later and will most likely need to happen on the EUI side as it will require quite a bit of style overrides that we'll want consistent in Kibana, Cloud, etc. As for the width of the form element, that is completely controllable by the location by the consuming application and any I originally posted this PR up just to give a heads up that this is the direction that I'm taking from the EUI side, so if you need more than what it provides, please explain in detail. Of course this is completely lacking any documentation as it is sill a draft which would have probably helped you out figuring what you might need. But consider that the component basically takes all the same props as the basic EuiSelectable component, so you can use those docs as examples. |
Good to know, I wasn't aware there would be another PR. We'll do what we can with the props and then sync up after the final EUI PR.
I'll keep this initial feedback mostly geared toward content and UX within the context of Kibana. That should help us scare up any missing pieces (nothing jumped out on an initial pass). Thanks! |
I provided some feedback on @myasonik 's PR that seem to only occur when I was using this branch (+ the related Kibana implementation PR). It's not clear if anything needs to be done, but things to consider:
|
Yeah, this is totally an implementation detail, and is not baked into the template component. The docs example will have something wired up primarily as an example. But because this could be really specialized in how applications (outside Elastic) want to handle such a keyboard shortcut, it costs too much to handle all the specificities than just giving consumers an example.
When you say this, what do you mean by works/doesn't work. The auto-showing of the popover, the actual focus of the input, something else? I'd be interested in investigating why there is such a difference, but my guess is that it has to do with the placement of the search input in the header.
I'm pretty sure this happens because of the way the Kibana side does the search. In the EUI docs, the component is given all possible options to do a text-based search on. While on the Kibana side, each time a user enters a letter to search, Kibana has to ping a separate API which takes time, then it passes back the results to the EUI component, essentially by-passing EuiSelectable's built-in search functionality. During this API ping, @myasonik is putting the EuiSelectable component into the Overall I do think your concerns mainly lie with Kibana's implementation. Some of the other pieces to review would be:
|
While purely on Michail's PR, I can tab across the header from Elastic Logo > search input > clear input > support button. Update: this and the keyboard shortcut both work on the Gatsby prototype so 🤷♂️ - https://cchaos.github.io/kibana-8-nav/ Is that using the |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
2 similar comments
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
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'm still working out some of the CI failures (a11y), but @thompsongl can you help me with a TS issue? I'll comment below.
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
Ok that last commit should fix CI (Axe) tests. This is now ready for review :) |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
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.
Worth the wait!
@myasonik The input will only turn back to white in light mode. In dark mode, we keep the original styling dark. |
src/components/selectable/selectable_templates/selectable_template_sitewide.tsx
Outdated
Show resolved
Hide resolved
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.
Wow! It looks great. 🎉
Tested in Safari, Firefox, and Edge. I also looked at the code and everything looks good.
I just found one misspelling when running the text in Grammarly (I'm not completely sure it is really a misspelling but I added it as a suggestion).
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
1 similar comment
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
Also fixes the implementation of the on focus badge for EuiComboBox and EuiSelectable
Now through SASS only
…lectableTemplateSitewideOption
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
Thanks for keeping this moving along! Once this is merged, and Kibana has been updated to include it, we'll then move the header/search PR out of draft mode. @thompsongl if you could take a look soon, it would be very much appreciated as opening Michail's PR is our next major milestone. |
src/components/selectable/selectable_list/__snapshots__/selectable_list_item.test.tsx.snap
Outdated
Show resolved
Hide resolved
src/components/selectable/selectable_templates/selectable_template_sitewide.tsx
Outdated
Show resolved
Hide resolved
src/components/selectable/selectable_templates/selectable_template_sitewide.tsx
Outdated
Show resolved
Hide resolved
src/components/selectable/selectable_templates/selectable_template_sitewide.tsx
Outdated
Show resolved
Hide resolved
src/components/selectable/selectable_templates/selectable_template_sitewide.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
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.
src/
code changes LGTM
Preview documentation changes for this PR: https://eui.elastic.co/pr_3800/ |
This PR sets up a template wrapper on top of EuiSelectable that creates an opinionated pattern for create Elastic's global/sitewide search.
The documentation example describes it best, so I refer those reviewing to read that portion of the docs.
I also added an example of how this fits into the global header, including a quick (ie hacky) style override to change the non-focus input into a dark version while sitting within a dark header.
Other component updates
EuiBadge
Prior to this PR, if a consumer provided only an icon and no text (which was allowed), the layout would still include margins as if there were an icon and text next to each other. This PR updates the render of the EuiBadge contents so that the text wrapper only appears if there is
children
and updates the styles to match. Also, since then the icon was so tiny that it made the badge size too small, I increased the size of the icon back tom
but only if there is nochildren
.This also then updated the usage of the enter badge for EuiComboBox.
EuiMark and EuiHighlight
Syntactically, EuiHighlight should have used EuiMark as the renderer of the highlighted portion of text, but EuiMark came in late. This PR updates EuiHighlight from rendering a
<strong>
tag to rendering a<EuiMark>
(<mark>
) tag.Also, when EuiMark was created, it wasn't actually styled and was only using the browser's default render of the
<mark>
tag. I updated the style of EuiMark to match that of the original<strong>
tag, essentially just bolding it. I also updated the Amsterdam background color of EuiMark to our light blue.Before vs After
EuiSelectable
I've added a few more options to this component that I've also documented in the various sections of the docs.
Options props
I added a couple extra capabilities to the
option
object itself.searchableLabel
: This provided the sitewide template to be able to include the meta data in the searchable context, but not use a separate display for thelabel
.[key: string]: any
: We've seen consumers ask that our data objects be more extendable. The addition of this generic key/value prop should allow consumers to pass their full data object instead of a modified version of.Custom messages
The component used to explain that consumers would have to replace the render of
list
with their custom message, but this was too manual because the consumer would have to do a check for each state. Now the component providesloadingMessage
,noMatchesMessage
, andemptyMessage
that just accept nodes to replace those messages with.EuiSelectableMessage also now accepts a
bordered
prop in order to match the render of the list.listProps.onFocusBadge
Similar to the new EuiComboBox enter badge, EuiSelectable's list items will also show an enter badge on focus. This prop allows consumers (like the sitewide template) to override the appearance of this badge.
Checklist
[ ] Checked in mobileI will do a follow up PR that addresses the mobile header version[ ] Checked Code Sandbox works for the any docs examples[ ] Checked for breaking changes and labeled appropriately