Skip to content

Conversation

@tkajtoch
Copy link
Member

@tkajtoch tkajtoch commented Sep 8, 2025

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 internal useEuiFlyoutResizable hook and integrated directly into EuiFlyoutComponent (EuiFlyout on main). 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 sets resizable=true on EuiFlyout.

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

  • Ensure CI is passing on this PR
  • Confirm EuiFlyoutResizable works the same as on prod
  • Confirm the mainFlyoutResizable and childFlyoutResizable toggles work in the managed flyout story

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Props have proper autodocs (using @default if default values are missing) and playground toggles
  • Release checklist
    • A changelog entry exists and is marked appropriately.

@tkajtoch tkajtoch self-assigned this Sep 8, 2025
@tkajtoch tkajtoch changed the base branch from main to feat/flyout-system September 8, 2025 13:07
`;

exports[`EuiFlyout props size fill is rendered 1`] = `
[
Copy link
Member Author

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 @@
/*
Copy link
Member Author

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

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

@tkajtoch tkajtoch marked this pull request as ready for review September 8, 2025 14:29
@tkajtoch tkajtoch requested a review from a team as a code owner September 8, 2025 14:29
size?: EuiFlyoutSize | CSSProperties['width'];
/**
* Sets the minimum width of the panel.
* Especially useful when set with `resizable = true`.
Copy link
Member

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.

@tsullivan
Copy link
Member

This is great!

I spot a few issues, which you probably are aware of

  1. A "jump" happens when we increase a flyout size to where the combined size of both flyouts is above the layout switch breakpoint

    Resizable Jump

  2. The content of the flyout can become cut off if we resize to a certain size, and then lower the viewport width.

    Flyout Cutout

IMO, we should use a calculation for the width to make sure the flyout never becomes wider than 90% of the viewport:

  • stacked layout: min(90vw, size)
  • side-by-side: min(90vw, size + siblingWidth)

@tsullivan
Copy link
Member

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

Copy link
Member

@tsullivan tsullivan left a 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!

@acstll acstll self-requested a review September 16, 2025 07:32
Copy link
Contributor

@acstll acstll left a 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 and childFlyoutResizable 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 👍

@tkajtoch
Copy link
Member Author

@acstll

child flyout animates over or above ("z-index") the main flyout when opening
This is actually expected and is in line with the behavior in feat/flyout-system. Animations work is included in this PR.

type push is not working as expected in the docs

I can see it's working but crashes when toggling between push and overlay in the docs. That applies to both this PR and main. It might be related to docusaurus 🤔 Considering it's also broken there and this targets a feature branch, I'd vote to fix it separately.

Do you see any other issues?

@acstll
Copy link
Contributor

acstll commented Sep 16, 2025

child flyout animates over or above ("z-index") the main flyout when opening

This is actually expected and is in line with the behavior in feat/flyout-system. Animations work is included in this PR.

perfect, thanks for the clarification!

type push is not working as expected in the docs

I can see it's working but crashes when toggling between push and overlay in the docs. That applies to both this PR and main. It might be related to docusaurus 🤔 Considering it's also broken there and this targets a feature branch, I'd vote to fix it separately.

I agree

Do you see any other issues?

nope

:shipit:

Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 LGTM

@tkajtoch
Copy link
Member Author

the story's prop table is not picking up the comments (it does in prod)

@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 Omit, Pick as well as the underlying ForwardRefExoticComponent that does quite a lot internally and can easily confuse react-docgen used in storybook.

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.

@tkajtoch tkajtoch merged commit 228aef4 into elastic:feat/flyout-system Sep 16, 2025
4 checks passed
acstll pushed a commit to acstll/eui that referenced this pull request Sep 17, 2025
tkajtoch added a commit to elastic/kibana that referenced this pull request Dec 16, 2025
## Summary

This EUI upgrade brings the new Flyout System. While all of the changes
we made are opt-in, we did have to update the DOM nesting in `EuiFlyout`
and `EuiFlyoutResizable`. This change includes making overlay masks a
sibling of flyouts, rather than wrapping the flyouts as children, which
required internal changes to the mask's z-index value. Following
@tsullivan request, please run through your UIs and make sure the
flyouts render as expected, especially in the areas where you override
EuiFlyout styles.

## Dependency updates

- `@elastic/eui`: `v110.0.0` ⏩ `v111.0.0`
- `@elastic/eui-theme-borealis`: `v5.1.0` ⏩ `v5.2.0`

---

## Changes

- Removed `z-index` overrides from various places across Kibana. The
updated EuiFlyout logic calculates `z-index` values dynamically based on
the order of opening flyouts, making the manual overrides unnecessary.
- Updated types of refs passed to `EuiFlyout` and `EuiFlyoutResizable`

## Package updates

### `@elastic/eui` v111.0.0

- Added an opt-in EuiFlyout session management for creating flyout
compositions and journeys effortlessly. Session management handles
side-by-side flyout rendering based on parent-child grouping, simple
flyout transitions with history, state sharing, and more.
([#9202](elastic/eui#9202))
- EuiFlyout session management is an optional feature that can be
enabled by adding `session="start"` to EuiFlyout. Check out the
[documentation](https://eui.elastic.co/docs/components/containers/flyout/session-management)
to learn more.
- Added a new `hasChildBackground` boolean prop (defaults to false) to
`EuiFlyout` ([#9056](elastic/eui#9056))
- Updated `EuiFlyout` with new `onActive` callback and enable stack
managed history controls.
([#9003](elastic/eui#9003))
- Updated `EuiFlyoutMenu` with new prop `historyItems` and refactored
props for back button.
([#9003](elastic/eui#9003))
- Added a new optional `resizable` (boolean) prop to `EuiFlyout`.
Resizability can now be controlled dynamically without the need to use
`EuiFlyoutResizable`.
([#8999](elastic/eui#8999))
- Flyout system menu bar: require tile, support custom actions
([#8897](elastic/eui#8897))
- Added a new `EuiFlyoutMenu` component that provides a standardized top
menu bar for flyouts.
([#8851](elastic/eui#8851))

**Breaking changes**

- Changed the way EuiFlyout renders overlay masks to decouple the
overlay mask from the flyout itself. Now, the overlay mask is a separate
portalled element. ([#9202](elastic/eui#9202))
- This change does not modify the functionality or behavior of flyout
overlays but might affect some custom usages when your application
relies on the specific element nesting within EuiFlyout.

### `@elastic/eui-theme-borealis` v5.2.0

- Updated parameters used for `euiAnimSlightResistance` for a smoother
animation ([#9202](elastic/eui#9202))

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flyout System] Add support for resizing a grouped flyout

4 participants