-
Notifications
You must be signed in to change notification settings - Fork 862
Feature: Flyout System [Beta] #9068
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
Conversation
Co-authored-by: Tim Sullivan <[email protected]> Co-authored-by: Timothy Sullivan <[email protected]> Co-authored-by: Weronika Olejniczak <[email protected]>
…ions in top menu (#8997) Co-authored-by: Tomasz Kajtoch <[email protected]>
…ransition animations of managed flyouts (#9015) Co-authored-by: Arturo Castillo Delgado <[email protected]> Co-authored-by: Tim Sullivan <[email protected]>
Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Weronika Olejniczak <[email protected]> Co-authored-by: Tomasz Kajtoch <[email protected]>
💚 Build SucceededHistory
cc @tsullivan |
… use for child flyouts only (#9056) Co-authored-by: Tim Sullivan <[email protected]>
Co-authored-by: Timothy Sullivan <[email protected]> Co-authored-by: Tim Sullivan <[email protected]>
|
I've added a PR mergeability / release readiness checklist to the PR description. Please make sure everything listed there is accounted for before merging this PR to main. |
| })); | ||
|
|
||
| describe('EuiFlyout', () => { | ||
| // TODO: Add `maskProps` to `childProps` again when EuiOverlayMask |
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.
@tkajtoch fix this
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.
Addressed in #9155
|
|
||
| export type EuiFlyoutOpenState = 'opening' | 'open'; | ||
|
|
||
| export const useEuiFlyoutOpenState = () => { |
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.
@tkajtoch remove unused hook
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.
Addressed in #9155
Co-authored-by: Timothy Sullivan <[email protected]> Co-authored-by: Tim Sullivan <[email protected]>
…rom interacting with the Flyout System (#9124) Co-authored-by: Timothy Sullivan <[email protected]>
3934a1f to
d199818
Compare
d199818 to
32edff0
Compare
|
Thanks for updating this issue with the "Summary of API changes" table and handling the other release readiness items. It looks good to me on that front 👍 |
|
/ci |
@JasonStoltz I have updated the docs on |
|
@tsullivan Thank you Tim! From the review point of view, I'm good with this in terms of release. I didn't actually approve the PR because I haven't looked at the code -- someone else from the EUI team can provide that. |
29d5609 to
3bd96e3
Compare
💚 Build SucceededHistory
cc @tsullivan |
💚 Build Succeeded
History
cc @tsullivan |
This is addressed in #9150 |
|
We can disregard the changelog CI step reporting I'm wrapping up my final QA against Kibana and should approve the PR within the next few hours. |
Thanks @ryankeairns I have filed this to work on as a separate change. Hope that is OK. |
|
I have finished testing the changes against Kibana and found no regressions. There are a few places where Kibana overrides EuiFlyout LGTM 🚢 |
This reverts commit e500915.
Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Weronika Olejniczak <[email protected]> Co-authored-by: Tomasz Kajtoch <[email protected]> Co-authored-by: Arturo Castillo Delgado <[email protected]> Co-authored-by: Paulina Shakirova <[email protected]>


New Managed Flyout System
This represents a significant evolution in the flyout system: a hook-based manager system with automatic context detection and support for complex flyout workflows.
Summary of API changes
session?('start' | 'never' | 'inherit', optional - defaults toinherit)Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#EuiFlyout-prop-session
onActive?(() => void, optional)Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#EuiFlyout-prop-onActive
resizable?(boolean, optional - defaults tofalse)resizableprop is dynamic which allows toggling between resizable state without whole-component rerendersThis makes the old EuiFlyoutResizable component obsolete (but it still works exactly like before). We may officially deprecate it in near future, but that's not the goal of this project. Read more
Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#resizable-flyout
onResize?minWidth?(number, optional)resizabe={true}to set a minimum width of the flyout.Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#resizable-flyout
flyoutMenuProps?(EuiFlyoutMenuProps, optional)Documentation: https://eui.elastic.co/pr_9068/docs/components/containers/flyout/#flyout-menu
hasChildBackground?refprop updateref?(React.Ref, optional)Legacy string refs are no longer supported with EuiFlyout. Use modern React refs like
useRefinstead. Read moreuseEuiFlyoutSession
EuiFlyoutSessionApi
EuiFlyoutSessionConfig
EuiFlyoutSessionRenderContext
ADDED - New Public-Facing Features
1. New Manager System
A comprehensive new "manager" system for centralized management of flyout sessions (
src/components/flyout/manager/):Core Component:
EuiFlyout: Same flyout component that developers are accustomed toSession Management Props:
sessionprop onEuiFlyoutwith three modes:'start'- Creates a new flyout session (for main flyouts)'inherit'- (default) Inherits existing session if active'never'- Opts out of session managementRequired EuiFlyoutMenu:
Managed flyouts require an
EuiFlyoutMenuat the top, which is automatically rendered when you provide the necessary props.flyoutMenuProps.title- (Required, or providearia-label) Prop that provides the title for the automatically renderedEuiFlyoutMenu. Additional properties inflyoutMenuPropsallow further customization of the menu (back button, history items, custom actions, etc.).Synchronizing local state with the visible flyout session:
Since flyout sessions can be programmatically activated, i.e the history navigation system can reactivate them, you may want to have a local state that is kept in sync with the active session. These callbacks can be used to update your local state variables:
onActivecallback - Fires when flyout becomes active/visible (new prop)onClosecallback - Fires when flyout is closed (not a new prop)The new manager system uses
use-sync-external-storeand a singleton store pattern for cross-React-root state sharing.2. New Flyout Menu Component
EuiFlyoutMenuandEuiFlyoutMenuProps: A new component for rendering a top menu bar in EuiFlyout.3.
resizableprop.EuiFlyoutResizablewas a complex wrapper that managed all resizing and state logic internally. The logic has been moved to an internal hook, which is now integrated directly into the main flyout component.EuiFlyoutnow supports aresizableboolean propEuiFlyoutResizableis still supported, but is just a wrapper forEuiFlyoutwithresizableset totrue.REMOVED - Earlier iteration of the Flyout System Feature
An earlier pre-release iteration of the Flyout System was in main but is now being removed.
1. Old Session System
The entire API of the earlier version is being removed:
EuiFlyoutSessionProvideruseEuiFlyoutSession()EuiFlyoutSessionApiEuiFlyoutSessionConfigEuiFlyoutSessionOpenChildOptionsEuiFlyoutSessionOpenMainOptionsEuiFlyoutSessionOpenGroupOptionsEuiFlyoutSessionProviderComponentPropsEuiFlyoutSessionRenderContext2. Old Child Flyout Implementation
Standalone(replaced with managed version)EuiFlyoutChildcomponentThe key difference from the old session system is that it used render props; the new manager system uses a centralized state store with hooks. The old system required explicit provider wrapping; the new system automatically detects when to use managed behavior.
Number of component usages in Kibana that will need to be updated: 0
Screenshots #
Impact to users #
BREAKING CHANGE - String Refs No Longer Supported
EuiFlyoutis aforwardRefcomponent that previously had loose typing allowing string refs. It now enforces strict typing that only accepts modern ref patterns. Specifically, this could impact you in two scenarios:EuiFlyout, you will need to pass an HTML element ref instead:styled-componentsto wrapEuiFlyout, your component implicitly becomes a string ref component. You will need to addref={null}to your component:Number of component usages in Kibana that will need to be updated: 1
fleet/sections/agent_policy/list_page/components/create_agent_policy.tsxFlyout overlay mask
z-indexvalue updateOverlay masks are now siblings of flyouts, which required a change to the mask's
z-indexvalue. Now, flyout overlay masks usez-indexvalue oflevels.flyout - 1making it more predictable.QA
Remove or strikethrough items that do not apply to your PR.
PR Mergeability / Release readiness checklist
We must ensure this feature has everything it needs to be a publicly available feature in EUI before this branch is merged into
main. Please ensure the following are completed before merging this PR:General checklist
@defaultif default values are missing) and playground toggles[ ] Updated visual regression tests