Skip to content

Conversation

@clintandrewhall
Copy link
Contributor

@clintandrewhall clintandrewhall commented Aug 1, 2025

Summary

In this iteration of flyout management, a single session prop is used to control whether a flyout is rendered as a new session, or as a standard flyout.

Demo

There is a Storybook demonstration of flyout management using a contrived "shopping cart" example.

Flyouts

Shopping cart flyout

This flyout always starts a new session, session={true}.

Review order flyout

This flyout always starts a new session, session={true}.
It is rendered on it's own from the page root, but also from within the Shopping Cart flyout. This demonstrates how a new session can be started from anywhere, but how it's session interacts with others.

Item details flyout

This flyout is a regular flyout.
It is rendered on its own, but also from within the Shopping Cart flyout.
If rendered on its own, and no session is active, it is rendered as a regular flyout.
If rendered on its own, and a session is active, it is rendered as a new main flyout as a new session.
If rendered from within the Shopping Cart flyout, it will be rendered as a child flyout.

Parent + child management

parent-child-new-parent

Standard flyout becomes main if a session is active

standard flyout becomes main

Parent + child stacking behavior

stacking behavior

Details

The determination of whether a managed flyout is rendered as a main or child is based:

  1. on the presence of an active session, and
  2. if the flyout is rendered from within a managed flyout.

This approach means the relationship between the main and child flyout, as well as the history of which main flyouts have been opened, are implicitly derived from the React structure.

So from a DX perspective, no one need wonder if they should create a MainFlyout or a ChildFlyout, or check what may already be open... the way its structured and the session prop handle it all.

Notes

  • The EuiFlyout component was moved to flyout.component.tsx.
  • Logic for determining which flyout to render was thus placed in flyout.tsx.
Screenshot 2025-07-29 at 9 55 26 AM

@clintandrewhall clintandrewhall force-pushed the exploration/flyout/manager branch from 921c51d to f6ff3da Compare August 2, 2025 03:22
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@clintandrewhall clintandrewhall force-pushed the exploration/flyout/manager branch from 34fd254 to 9ffef35 Compare August 6, 2025 16:26
@clintandrewhall clintandrewhall force-pushed the exploration/flyout/manager branch from a3a5805 to 62cd4e5 Compare August 6, 2025 18:03
@weronikaolejniczak
Copy link
Contributor

@clintandrewhall I'll stop at this because my head is exploding 🤯 You've all done amazing job here! 🎉 💚 Flyouts are working smoothly, the API is simple and clear, and I love the code quality - no magic numbers, clear separation of concerns, no code smells.

There are a bunch of comments I left, I made sure to say whether they are blocking or non-blocking in my mind (the majority are non-blocking) and leave GH code suggestions to make the fixes quick and easy. Feel free to omit / postpone as many of my suggestions as you'd like. And if you want, we can discuss some of them in more depth.

@clintandrewhall
Copy link
Contributor Author

@ThomThomson @tsullivan I did, indeed, remove "automatic" virtualization for this approach. I just felt the DX ease justified the trade-off.

My mitigation would be a container component for intentional virtualization, rather than a pre-optimization:

<EuiFlyout session={true}>
  <EuiFlyoutBody virtualized={true}>
    // Expensive stuff.
  </EuiFlyoutBody>
  {renderChildFlyout ? <EuiFlyout /> : null}
</EuiFlyout>

Or perhaps <EuiFlyoutVirtualized>, or similar... but basically allow us to identify cases where the virtualization was necessary. Does that make sense? Could use a sanity check on the idea... but I'd rather solve a problem that arises, rather than plan to pre-optimize.

clintandrewhall and others added 2 commits August 14, 2025 21:39
Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
@tsullivan
Copy link
Member

My mitigation would be a container component for intentional virtualization, rather than a pre-optimization
...

Or perhaps , or similar... but basically allow us to identify cases where the virtualization was necessary.

@clintandrewhall @ThomThomson it sounds like this is an optimization that doesn't necessarily need to be made in this PR. The idea wouldn't be a major pivot from the direction we're starting here, correct?

but I'd rather solve a problem that arises, rather than plan to pre-optimize.

Totally agree

Comment on lines +520 to +524
// TODO: @tkajtoch - this is causing all kinds of issues with animations if a
// main flyout is opened with ownFocus={true}. Since the logic is to _change_
// ownFocus to false if a child is rendered, the component remounts, spinning all
// of the animations into a tailspin. One option would be to flat-out _hide_ this
// mask. :shrug:
Copy link
Member

Choose a reason for hiding this comment

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

ping @tkajtoch

Copy link
Member

Choose a reason for hiding this comment

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

I'm addressing this as part of the animations improvements work. This whole EuiOverlayMask is a bit of a mess and needs reworking.

Let's leave it as is since this goes into a feature branch, and I'll fix it in a follow-up PR for clarity if you have no objections.

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. All tasks that are open are going to be handleed in separate PRs in this feature branch. Along with other things, they're being tracked in this document: https://docs.google.com/document/d/1OXx2H997k6zfz_w4jc-CJ1qyJxesi47CW5bEDsZ7OQk/edit?tab=t.0

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

Comment on lines +35 to +36
.cursorrules
WARP.md
Copy link
Contributor

@weronikaolejniczak weronikaolejniczak Sep 1, 2025

Choose a reason for hiding this comment

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

nit:

I don't mind adding these but I'd put them in a separate "section", right now they seem under "Yarn". Maybe even move to "IDE-specific files".

Copy link
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

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

Recent changes look great! I like that it was extensively covered with tests. I skimmed them and they are alright 😄

🟢 🚀

Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

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

I'm happy merging this as is since it goes into a feature branch. I reviewed the code and functionality and have no complaints that would be blocking merging of this PR.

@tkajtoch tkajtoch merged commit 6939fed into feat/flyout-system Sep 2, 2025
4 checks passed
@tkajtoch tkajtoch deleted the exploration/flyout/manager branch September 2, 2025 12:31
tkajtoch pushed a commit that referenced this pull request Sep 4, 2025
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
acstll pushed a commit to acstll/eui that referenced this pull request Sep 17, 2025
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@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.

7 participants