-
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
fix unified search for long field inputs #166024
Conversation
@andreadelrio looking for your thoughts here for expanding the input fields for long field names. |
@timductive Thanks for putting this together! We actually explored this route back in December but I didn’t make a formal proposal because I wasn’t convinced the layout shifts worked well. I understand this is still a UX debt. I'm sharing some of those explorations here to give you context which might be useful as we try to solve this. [Background] Exploration done in code by one of our contractorsCon: It completely hid the values in the two fields not in focus[Background] Exploration in Figma
Going back to your proposal, is it possible to automatically remove focus on an input after a user has made their selection (whenever the input only allows for single selection)? This would make the transition between the two states smoother like so: |
Thanks @andreadelrio I didn't realize we had so much prior research. I also played with how much to hide and show and landed on the same outcome as you, to try and minimize how much the layout shifts and leave the other values as visible as possible. I also considered if we could auto-blur the input after selection and I agree that would minimize the stutter and shift for the user. I'm sure it is possible, although I'm less sure if that would require a new prop on the EUI side. I can experiment with that a bit tomorrow and see if we can add in that behavior. |
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.
So since you forced me to look at this code I had to fix some things that were bothering me.
First was just come cleanup of naming, types and react code - 3963550.
Secondly, this input is a single selection, yet once you select the input remains focused. I think this is an issue/feature enhancement for the EuiComboBox
on their side. Should be simple for an explicit prop or even automatic for single selection mode. But I forced this in d20ef3e but it only applies to the first field selection and not the third filter input box to select the value. This could and should be added like the first one, I can do that tomorrow if you want but there are a few components to apply that behavior to.
Just saw I was not the first to see this as an issue/improvement.
The last part is the animation of the width change, I think doing so extraFast
is quick enough to occur before the options list appears, any slower and the list will flicker to the full width. See 6155757.
All in all the final result looks something like...
You welcome to revert any changes and sorry for pushing to your branch 🙂
src/plugins/unified_search/public/filter_bar/filter_editor/truncated_label.tsx
Show resolved
Hide resolved
src/plugins/unified_search/public/filters_builder/filter_item/field_input.tsx
Show resolved
Hide resolved
src/plugins/unified_search/public/filters_builder/filter_item/field_input.tsx
Show resolved
Hide resolved
src/plugins/unified_search/public/filter_bar/filter_editor/phrases_values_input.tsx
Show resolved
Hide resolved
src/plugins/unified_search/public/filters_builder/filter_item/field_input.tsx
Outdated
Show resolved
Hide resolved
src/plugins/unified_search/public/filters_builder/filter_item/filter_item.styles.ts
Outdated
Show resolved
Hide resolved
src/plugins/unified_search/public/filter_bar/filter_editor/phrase_value_input.tsx
Outdated
Show resolved
Hide resolved
Added blur on single select for |
Thanks @nickofthyme I am grateful for all contributions 🙇 I will test it out later this afternoon. I noticed when I tried applying animations that the truncatedlabel seemed to calculate the width of the label inconsistently while the animation was occurring but I didn't try it at extra fast. All of the other typescript cleanups are great and I appreciate the example for passing the ref, I was trying to figure that out yesterday. |
I find it very cool tbh and def an improvement in comparison with the current state. @andreadelrio do you want to take a look? I feel that it works pretty well. |
…-ref HEAD~1..HEAD --fix'
This is harder than it seems as the preview is doing a lot of logic to build a full filter semantically. I think we can do this but maybe move it to a separate PR, maybe take it on with the updated design for the Preview together. |
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.
Design changes LGTM. Thanks for the improvements!
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.
Changes LGTM, as I said above is a significant improvement from the current experience
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #166019
Checklist
Delete any items that are not applicable to this PR.
For maintainers