Repository navigation
[Flyout System] Child Flyout History - #9409
Conversation
6b10192 to
7155be4
Compare
bca1ca1 to
af14590
Compare
af14590 to
c99b023
Compare
76f1e24 to
22e9cfb
Compare
| </EuiFlexGroup> | ||
| </EuiText> | ||
| </EuiFlyoutBody> | ||
| </EuiFlyout> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
FlyoutSessionto trackchildTitle,childIconType, and achildHistorystack, 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
goToFlyoutto accept an optionallevelargument 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.
…ing a child in a non-current session
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
tkajtoch
left a comment
There was a problem hiding this comment.
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!
Depends on #9377Depends on #9412Summary
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 #
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:
When we subtract the "zero-depth" states from the history, the result popover contains just
Child1.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
[ ] Checked in both light and dark modes[ ] Checked in both MacOS and Windows high contrast modes(emulate forced colors if you do not have access to a Windows machine.)[ ] Checked in mobile[ ] Checked for accessibility including keyboard-only and screenreader modes[ ] Added documentation[ ] Props have proper autodocs (using@defaultif default values are missing) and playground toggles[ ] Checked Code Sandbox works for any docs examples[ ] Updated visual regression tests[ ] 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)[ ] 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)