-
Notifications
You must be signed in to change notification settings - Fork 840
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
[EuiFlyoutResizable] Add resizable flyout #7439
Conversation
TODO: test refs
- significantly easier to write in Cypress/E2E than in jsdom - much less width mocking (although there's still some with mouse/touch events) - add fix for initial size going outside specified allowed min/maxes (yay TDD)
+ convert body padding inline styles to logical properties
3da2ad0
to
579065a
Compare
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 love how straightforward this solution is!
I was afraid adding 4 event listeners to window
on mouse down and removing on mouse up might cause a small performance hit, but it seems everything's just fine 💯
I think the visual indicators you currently have are adequate. To add more context, what we've been doing lately in Discover is manually hiding the icons in EuiResizableContainer (menuDown, menuLeft, menuRight, menuUp). The reasoning behind that is that we've found that those icons then to be overkill and can crowd the UI a bit. If you look at references such as Figma, Slack and Github they follow the pattern you're following here: they change the cursor and make the line a bit thicker and/or show it in blue. |
Just curious. For the API, how did you decide to go with a new component variant as opposed to a resizable prop? |
@JasonStoltz that's mentioned in the PR description! It's actually an area I was looking for feedback on:
After having some time to sit on it, I'm like a 7.5/10 sold on the API choice - I think the code cleanliness outweighs the benefits, and having it as a separate component also I think adds a small extra friction that makes it so consumers won't reach for resizable flyouts without thinking at least a little more on it first (which I think we do want). WDYT? Am I way off on that? |
@cee-chen Ugh, I am so sorry for not reading that PR description 🤦. If we set the underlying implementation aside, the "resizable" prop feels like the right interface. Is it possible to keep the logic for this cleanly separated like you have it, but maintain a prop-based API? Something like:
|
@kyrspl @boriskirov @mdefazio @cee-chen Is there any additional guidance you think we should add that goes along with this new option? Are there any considerations or recommendations we can make around when to make a flyout resizable or not? If you'll recall, we had a lengthy conversation here, I'm hoping to try to gather some of that into our docs. Here is the copy currently in this PR:
Things we discussed in that thread that I'm wondering about:
|
Personally, I don't think so. Adding another
Ha, past me was so smart, good thing I totally forgot everything I wrote there! Most of the bullet points are addressed but I totally forgot the perf/debouncer bit. One other option we can do here is to flag the component as a Beta one (probably should have done that anyway) and continue to build up the docs and perf behavior in the interim, if Kibana needs the component sooner rather than later. IMO, beta functionality is a fairly solid reason to make this a separate component as well. |
💚 Build Succeeded
History
|
Preview staging links for this PR:
|
Hey y'all! Since this is a feature requested in Kibana, I'm going to go ahead and merge this in as a beta component so it gets into today's EUI release. That being said, I would still really love some answers (especially around documentation and recommendations) - any other comments that get added to this thread I'll be sure to address in a follow-up PR. |
Thanks for working on this @cee-chen Guidelines Edge case Screen.Recording.2024-01-10.at.11.00.01.movVisual indicators On one hand I do understand the argument of UI clutter. Conversely, removing affordances increases the mental effort to (1) know this option exists in the first place, and (2) move the cursor in the right spot to make it work Here's a relevant article that describes the problem in more detail. |
`v91.3.1`⏩`v92.0.0-backport.0` --- ## [`v92.0.0-backport.0`](https://github.com/elastic/eui/releases/v92.0.0-backport.0) **This is a backport release only intended for use by Kibana.** **Bug fixes** - Fixed an `EuiTreeView` JSX Typescript error ([#7452](elastic/eui#7452)) - Fixed a color console warning being generated by disabled `EuiStep`s ([#7454](elastic/eui#7454)) ## [`v92.0.0`](https://github.com/elastic/eui/releases/v92.0.0) - Updated generic types of `EuiBasicTable`, `EuiInMemoryTable` and `EuiSearchBar.Query.execute` to add `extends object` constraint ([#7340](elastic/eui#7340)) - This change should have no impact on your applications since the updated types only affect properties that exclusively accept object values. - Added a new `EuiFlyoutResizable` component ([#7439](elastic/eui#7439)) - Updated `EuiTextArea` to accept `isClearable` and `icon` as props ([#7449](elastic/eui#7449)) **Bug fixes** - `EuiRange`/`EuiDualRange`'s track ticks & highlights now update their positions on resize ([#7442](elastic/eui#7442)) **Deprecations** - Updated `EuiFilterButton` to remove the second `.euiFilterButton__textShift` span wrapper. Target `.euiFilterButton__text` instead ([#7444](elastic/eui#7444)) **Breaking changes** - Removed deprecated `EuiNotificationEvent`. We recommend copying the component to your application if necessary ([#7434](elastic/eui#7434)) - Removed deprecated `EuiControlBar`. We recommend using `EuiBottomBar` instead ([#7435](elastic/eui#7435))
`v91.3.1`⏩`v92.0.0-backport.0` --- ## [`v92.0.0-backport.0`](https://github.com/elastic/eui/releases/v92.0.0-backport.0) **This is a backport release only intended for use by Kibana.** **Bug fixes** - Fixed an `EuiTreeView` JSX Typescript error ([elastic#7452](elastic/eui#7452)) - Fixed a color console warning being generated by disabled `EuiStep`s ([elastic#7454](elastic/eui#7454)) ## [`v92.0.0`](https://github.com/elastic/eui/releases/v92.0.0) - Updated generic types of `EuiBasicTable`, `EuiInMemoryTable` and `EuiSearchBar.Query.execute` to add `extends object` constraint ([elastic#7340](elastic/eui#7340)) - This change should have no impact on your applications since the updated types only affect properties that exclusively accept object values. - Added a new `EuiFlyoutResizable` component ([elastic#7439](elastic/eui#7439)) - Updated `EuiTextArea` to accept `isClearable` and `icon` as props ([elastic#7449](elastic/eui#7449)) **Bug fixes** - `EuiRange`/`EuiDualRange`'s track ticks & highlights now update their positions on resize ([elastic#7442](elastic/eui#7442)) **Deprecations** - Updated `EuiFilterButton` to remove the second `.euiFilterButton__textShift` span wrapper. Target `.euiFilterButton__text` instead ([elastic#7444](elastic/eui#7444)) **Breaking changes** - Removed deprecated `EuiNotificationEvent`. We recommend copying the component to your application if necessary ([elastic#7434](elastic/eui#7434)) - Removed deprecated `EuiControlBar`. We recommend using `EuiBottomBar` instead ([elastic#7435](elastic/eui#7435))
Summary
closes #287
Areas I'm looking for feedback on:
API - does adding a new
<EuiFlyoutResizable />
component (as opposed to, e.g.<EuiFlyout resizable={true} />
) make sense? I leaned this way because it felt the cleanest in terms of implementation (as opposed to adding Yet More Code to the existing logic-heavy flyout file), but definitely would like to hear feedback on this.UI/UX - do we need more visual indicators or UI hints that the edge is resizable? Or does the existing appearance feel sufficient?
Documentation - especially with our new focus on patterns, I would really like feedback on the copy I wrote. I cribbed text from the above issue on why using resizable flyouts might be a good idea, but I think we should also consider adding some copy on when not to use resizable flyouts.
QA
General checklist
@default
if default values are missing) and playground toggles- [ ] Checked Code Sandbox works for any docs examplesjest andcypress tests- [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)