-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Controls] Migrate range slider to EuiDualRange
and make styling consistent across all controls
#162651
[Controls] Migrate range slider to EuiDualRange
and make styling consistent across all controls
#162651
Conversation
211577a
to
4f9abae
Compare
c6e587e
to
9583ae6
Compare
…r/kibana into switch-to-dual-range_2023-05-15
WRT the Whereas, when running it locally (where it passes reliably), there is one "Open" alert and one "Acknowledged" alert, like so: Ideally, when the test first loads, both alerts should be So, this doesn't seem like this is actually a problem with the options list, and is instead something funky going on with the test itself... 🤔 Also, the second attempt doesn't seem to get reset properly, so you just end up in a no data state - i.e. it always fails on the retry, which isn't ideal. |
@Heenawter seems like the fix on the EUI side came much sooner than we expected. Should we hold this off til that is released into Kibana? It shouldn't take too long. |
since it is holiday is germany, for now, I have disabled the problematic tests and raised a bug for it : #163920 Now, all suites are passing and security tests should not block you. |
@andreadelrio While that PR does improve the options list ever so slightly (it will basically function the same as it does now in this PR, but (a) the code will be a bit cleaner, because we'll no longer need the resize observer and (b) we could have a default I personally think it is still best to merge this PR as-is and wait until we can fix both the options list and the range slider in the follow up :) |
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 a lot!
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.
LGTM!!
A heads up regarding failing |
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.
Looks good! Thanks!
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @Heenawter |
Closes #164375 ## Summary This PR wraps up #162651 by fully migrating to the `EuiInputPopover` for all controls - specifically, this is made possible by the new `panelMinWidth` prop, which makes it so that the popover can now extend past the size of the input **while maintaining** the expected positioning. | Before | After | |--------|--------| | The popover was centered underneath the control on the smallest size:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/e2814ee2-6df6-47d6-925e-9f97cb8be2a5) | The popover is left-aligned with the start of the input and expands to the right:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/7c698ef0-1534-43b6-ac95-9ae95f1c7613) | | The range slider popover could not extend past the control width, regardless of how small that was:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/12e33967-b616-4f0a-9ded-4374d65a51b2) | The range slider popover now also has a minimum width, which makes it more useable on the smallest size:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/2fb844db-8f5d-44d8-a6dc-c9cb95d5a4ea) | ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes elastic#164375 ## Summary This PR wraps up elastic#162651 by fully migrating to the `EuiInputPopover` for all controls - specifically, this is made possible by the new `panelMinWidth` prop, which makes it so that the popover can now extend past the size of the input **while maintaining** the expected positioning. | Before | After | |--------|--------| | The popover was centered underneath the control on the smallest size:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/e2814ee2-6df6-47d6-925e-9f97cb8be2a5) | The popover is left-aligned with the start of the input and expands to the right:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/7c698ef0-1534-43b6-ac95-9ae95f1c7613) | | The range slider popover could not extend past the control width, regardless of how small that was:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/12e33967-b616-4f0a-9ded-4374d65a51b2) | The range slider popover now also has a minimum width, which makes it more useable on the smallest size:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/2fb844db-8f5d-44d8-a6dc-c9cb95d5a4ea) | ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes #140135
Closes #159724
Summary
Changes to range slider
This PR migrates the range slider control to use the
EuiDualRange
component, which both (a) removes a bunch of range slider code , thus improving DX, and (b) improves the usability of the control by simplifying the different states and making the slide animation much smoother:Note that, due to the fact that migrating to the
EuiDualRange
component means we no longer control the opening/closing of the popover, this makes the "selections that extend beyond the current min/max of the data" scenario slightly more difficult to handle. Specifically, we need to decide the best time to recalculate the min/max of the slider as the user's selections change.The benefit of having control over the popover opening and closing was that we could calculate the range slider's min/max values when the popover opened and lock them in place so that they stayed static as the user dragged:
However, because the
EuiDualRange
handles the behaviour of the popover and we therefore do not know when it opens/closes, it is not currently possible to fully replicate this old behaviour. We have two main options:Recalculate the min/max of the range slider the user drags, which gives a "sliding" effect:
Debounce this min/max calculation - with this, we avoid the "sliding" effect shown above, and the min/max values only get adjusted when the pin has been static for a long enough period of time (specifically,
750ms
) or when the pin is dropped (i.e. the user lets go of the mouse):Ultimately, I went with option 2 in this PR. As a future enhancement, we could replicate the old behaviour by adding some sort of
onPopoverClosed
oronPopoverOpened
logic to theEuiDualRange
component - however, this would need discussion with the EUI team to ensure that this is the best way to handle it and not too specific to our use case. Since EUI changes take awhile to propagate to KIbana, it's not worth holding up this PR even further.Consistency with other control types
To keep things consistent, this PR also switches both the options list and time slider controls to use the
EuiInputPopover
component and removes the redundant control titles from the popover header:Checklist
aria-label
to the thumbdiv
s ([EuiDualRangeSliders] Slider handles need accessible labels in popovers and two-handle sliders eui#7035). This is purely for the sake of axe and/or automateda11y
testing - it does not actually impacta11y
of the range slider, because the components missing anaria-label
are never accessible via the keyboard.For maintainers