Skip to content

[Flyout System] Child Flyout History - #9409

Merged
tsullivan merged 15 commits into
elastic:mainfrom
tsullivan:flyout/child-history
Mar 15, 2026
Merged

tsullivan merged 15 commits into
elastic:mainfrom
tsullivan:flyout/child-history

Conversation

@tsullivan

@tsullivan tsullivan commented Feb 24, 2026 •

Copy link
Copy Markdown
Member

Depends on #9377
Depends on #9412

Summary

Tracks history of child flyouts.

Why are we making this change?

Closes #9410
Per the design in the issue, the internal structure of the managed flyout system has changed to allow multiple child flyout entries per main flyout. When the state has historical sessions with child flyouts, they are shown in the history popover in the flyout menu.

Unblocks https://github.com/elastic/kibana-team/issues/2725
Addresses a bug where child flyouts rendered as siblings to the main flyout (rather than nested in React) are not automatically closed when the main flyout closes. The fix criteria also applies to historical child flyouts.
Also needed: elastic/kibana#256339

Screenshots #

Child History Demo 2

Impact to users

Supports advanced use cases where user flows can branch off into separate sub-flows with history-managed child flyouts.

Note to reviewers

When is a a child flyout entry added to the history list
When creating this PR, I found I need to control against child flyouts entering the history needlessly. I came up with what I call a "zero-depth" scenario and the principle that a history state with "zero depth" should not be surfaced in the history popover. This especially makes sense when history contains only 1 or 2 items, but when "zero-depth" scenarios are handled with more complex states can be a little confusing.

What is "zero-depth"
If you open a main, and open a child, a choice is made to not show a history entry for the standalone main. Why: clicking that history item does the same thing as closing the child.

How it may get confusing
Imagine there are 2 mains, and each main can open 1 child. The user flow goes:

Main1 -> Child1 -> Main2 -> Child2

When we subtract the "zero-depth" states from the history, the result popover contains just Child1.

  1. It doesn't show Child2 because that's currently the latest flyout that has been opened.
  2. It doesn't show Main2 in the popover, because clicking that would do the same thing simply closing Child2.
  3. It does show Child1.
  4. It doesn't show Main1 in the popover, because clicking that would do the same thing as clicking Child1 and then closing the child.

The choice is made in the code to give users fewer distracting options and to avoid the history popover from being seen as a surprising and complex way to simply close child flyouts.

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)
    • [ ] If the changes unblock an issue in a different repo, smoke tested carefully (see Testing EUI features in Kibana ahead of time)
  • 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 flyout/child-history branch from af14590 to c99b023 Compare March 12, 2026 17:28
@tsullivan
tsullivan force-pushed the flyout/child-history branch from 76f1e24 to 22e9cfb Compare March 12, 2026 19:45
@tsullivan
tsullivan marked this pull request as ready for review March 12, 2026 20:16
@tsullivan
tsullivan requested a review from a team as a code owner March 12, 2026 20:16
@tsullivan
tsullivan requested a review from Copilot March 12, 2026 20:17
</EuiFlexGroup>
</EuiText>
</EuiFlyoutBody>
</EuiFlyout>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: this changes the structure of the child flyout in relation to the main: it is rendered as a sibling now, rather than nested, to reflect the structure that is used most often in Kibana.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates EUI’s managed Flyout System to support history-managed child flyouts, enabling multiple sequential child flyouts per main flyout session and allowing users to navigate back through prior child flyouts (including via the history popover). This also addresses cascade-close behavior for child flyouts rendered outside the main flyout’s React subtree.

Changes:

  • Extend FlyoutSession to track childTitle, childIconType, and a childHistory stack, and update reducer logic to push/pop child history on navigation.
  • Enhance history popover items to include child flyout history (current session first, then prior sessions’ child breadcrumbs).
  • Update goToFlyout to accept an optional level argument to support jumping to a child in the current session’s history.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/eui/src/components/flyout/manager/types.ts Adds child history session types and extends goToFlyout API typing.
packages/eui/src/components/flyout/manager/store.ts Computes history popover items with child history + prior session breadcrumbs; updates goToFlyout signature.
packages/eui/src/components/flyout/manager/store.test.ts Adds unit tests covering child history ordering and “zero-depth” history behavior.
packages/eui/src/components/flyout/manager/selectors.test.tsx Updates selector test fixture to include the new childHistory field.
packages/eui/src/components/flyout/manager/reducer.ts Implements child history stack behavior and navigation/close semantics.
packages/eui/src/components/flyout/manager/reducer.test.ts Adds tests for child history push/pop, idempotent re-registration, and child-history navigation.
packages/eui/src/components/flyout/manager/flyout_sessions.stories.tsx Updates storybook demo to exercise child→child navigation and history.
packages/eui/src/components/flyout/manager/flyout_managed.tsx Improves cascade-close detection for sibling-rendered managed flyouts via store-state checks.
packages/eui/src/components/flyout/manager/flyout_managed.test.tsx Adds test coverage for cascade-close cleanup behavior.
packages/eui/src/components/flyout/manager/actions.ts Extends goToFlyout action to include an optional level for child-history navigation.
packages/eui/changelogs/upcoming/9409.md Adds changelog entry documenting child history + cascade-close fix + goToFlyout enhancement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

@tkajtoch
tkajtoch self-requested a review March 13, 2026 10:44

@tkajtoch tkajtoch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code looks great and works exactly as expected when tested locally. Thank you so much for implementing it and writing tests to cover the updated functionality!

@tsullivan
tsullivan merged commit 00f8d90 into elastic:main Mar 15, 2026
1 check passed
@tsullivan
tsullivan deleted the flyout/child-history branch March 15, 2026 17:37
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.

1️⃣ Child Flyout History

4 participants