-
Notifications
You must be signed in to change notification settings - Fork 860
[Flyout System] Support resizing flyouts #8999
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
[Flyout System] Support resizing flyouts #8999
Conversation
…lyout resizable when `resizable=true`
…ble` to prevent extra styles being added
`; | ||
|
||
exports[`EuiFlyout props size fill is rendered 1`] = ` | ||
[ |
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.
This is an updated snapshot that was failing on feat/flyout-system
due to last-minute changes on the last PR merged to the feature branch. The changes match other "is rendered" variants
@@ -0,0 +1,180 @@ | |||
/* |
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.
This is primarily a restructure of the event handlers previously defined in flyout_resizable.tsx
. I did not change the logic here
💚 Build SucceededHistory
cc @tkajtoch |
💚 Build Succeeded
History
cc @tkajtoch |
size?: EuiFlyoutSize | CSSProperties['width']; | ||
/** | ||
* Sets the minimum width of the panel. | ||
* Especially useful when set with `resizable = true`. |
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.
It will be good to have this for fill
mode calculations as well. In the side-by-side
layout when a flyout has fill
mode, we need to refer to this in our calculation for the breakpoint when the layout is switched to stacked
. Right now the code is using non-dynamic s
value as the minimum width.
This is great! I spot a few issues, which you probably are aware of
IMO, we should use a calculation for the width to make sure the flyout never becomes wider than 90% of the viewport:
|
I think this looks good as this is targeted to a feature branch and it achieves 90% of what is needed. The pending feedback I gave can be addressed in a later PR |
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
Thanks for fixing the broken snapshot and consolidating the code!
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.
Small things I found in a QA round:
Confirm
EuiFlyoutResizable
works the same as on prod
- type
push
is not working as expected in the docs - the story's prop table is not picking up the comments (it does in prod)
Confirm the
mainFlyoutResizable
andchildFlyoutResizable
toggles work in the managed flyout story
- child flyout animates over or above ("z-index") the main flyout when opening
Everything else working as expected. No comments on the code side 👍
I can see it's working but crashes when toggling between push and overlay in the docs. That applies to both this PR and Do you see any other issues? |
perfect, thanks for the clarification!
I agree
nope |
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
@acstll It seems that the EuiFlyoutResizable story already has some props type overrides in place to possibly fix an underlying issue related to how deeply nested the type is - there's multiple Props are rendered correctly in the docs; I think it's okay to find a way to fix this issue in this specific story later on. |
Summary
Resolves #8875.
This PR is targeting the
feat/flyout-system
feature branch.This PR adds support for making flyouts resizable by setting
resizable=true
, allowing managed flyouts to be resized when resizing is explicitly enabled.The solution builds upon the original
EuiFlyoutResizable
implementation. The resizing logic is moved to an internaluseEuiFlyoutResizable
hook and integrated directly intoEuiFlyoutComponent
(EuiFlyout
onmain
). This allows for dynamic control of whether a flyout is resizable while keeping the API backwards compatible. With this change,EuiFlyoutResizable
becomes a small wrapper that setsresizable=true
onEuiFlyout
.Tests remain unchanged since the functionality is generally the same. We may consider restructuring them before merging the feature branch into main and releasing it.
Why are we making this change?
Because the Flyout System project needs to support resizable main and child flyouts as per requirements. See #8875 and the Flyout System meta issue for more information.
Impact to users
No negative impact to users expected.
QA
EuiFlyoutResizable
works the same as on prodmainFlyoutResizable
andchildFlyoutResizable
toggles work in the managed flyout storyGeneral checklist
@default
if default values are missing) and playground toggles