Skip to content

Conversation

@tsullivan
Copy link
Member

@tsullivan tsullivan commented Sep 9, 2025

Summary

Depends on #8997
Resolves #8873

This exposes tracked history to flyout sessions in contexts and exposes controls in the UI to allow users to navigate to previous flyouts.

When a user opens a flyout for the first time:

  1. The onActive callback (optional prop) is fired.

When the user navigates to a previous flyout:

  1. The "newer" flyout sessions are discarded from the tracked history state and their onClose callbacks are fired
  2. The onActive callback for the flyout that becomes active is fired

Note: This PR is targeted to the feat/flyout-system feature branch.

Why are we making this change?

A requirement for the Flyout System is to allow users to navigate to previous flyout sessions. This PR achieves that, and allows consumer apps to have a local state that is synchronized with the internal state of the Flyout System.

Screenshots

A new "Multi-session example" storybook has been added to show the effects of the lifecycle callbacks being called:

Flyout History Tracking Demo

Impact to users

Ability to view a list of previous flyout sessions in state, and navigate to those flyout sessions.

QA

Remove or strikethrough items that do not apply to your PR.

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
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@tsullivan tsullivan force-pushed the session-flyouts/track-history branch 2 times, most recently from 1dac84e to 3331dce Compare September 11, 2025 16:10
@tsullivan tsullivan changed the base branch from main to feat/flyout-system September 11, 2025 16:24
Copy link
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

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

A few nits, but looks good to me. Approving to unblock.

Great work!

@acstll acstll self-requested a review September 26, 2025 07:57
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.

Only a suggestion for the changelog, and translations in EuiFlyoutMenu. I tested the feature locally and it's working as expected.

Comment on lines 57 to 59
<EuiButtonEmpty size="xs" color="text" {...props}>
<EuiIcon type="editorUndo" /> Back
</EuiButtonEmpty>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if you'd like to add translations now, but here's a suggestion (you'd need to adjust imports) — also, the icon can be part of EuiButtonEmpty

Suggested change
<EuiButtonEmpty size="xs" color="text" {...props}>
<EuiIcon type="editorUndo" /> Back
</EuiButtonEmpty>
<EuiButtonEmpty size="xs" color="text" iconType="editorUndo" {...props}>
<EuiI18n token="euiFlyoutMenu.back" default="Back" />
</EuiButtonEmpty>

return (
<EuiPopover
button={
<EuiButtonIcon iconType="arrowDown" color="text" aria-label="History" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<EuiButtonIcon iconType="arrowDown" color="text" aria-label="History" />
<EuiButtonIcon iconType="arrowDown" color="text" aria-label={useEuiI18n('euiFlyoutMenu.history', 'History')} />

@@ -0,0 +1 @@
[Flyout System] Added back button, history stack managed history controls. Added history navigation events.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would more alined with how changelogs are written in EUI, but feel free to take it or not. I think the important bit is having at least 1 bullet point and start with either "Added" or "Updated", while also mentioning the public-facing component affected:

Suggested change
[Flyout System] Added back button, history stack managed history controls. Added history navigation events.
- Updated `EuiFlyout` with new `onActive` callback and enable stack managed history controls.
- Updated `EuiFlyoutMenu` with new prop `historyItems` and refactored props for back button.

@tsullivan tsullivan force-pushed the session-flyouts/track-history branch from 7101792 to 6cb11fb Compare September 26, 2025 21:30
@tsullivan tsullivan requested a review from acstll September 29, 2025 17:43
@tsullivan
Copy link
Member Author

@acstll This is ready for another look!

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

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.

🟢 Looks good to merge! Thanks for the updates @tsullivan

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@tsullivan tsullivan merged commit faf365c into elastic:feat/flyout-system Sep 29, 2025
4 checks passed
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.

EuiFlyout Add menu bar support history, custom actions and links

5 participants