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
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