[Flyout System] Scoped history#9413
Conversation
53b42ca to
f4ab067
Compare
00e3b70 to
e40a4ee
Compare
e40a4ee to
3405ec6
Compare
|
This PR contains breaking changes. The opener of this pull request is asked to perform the following due diligence steps below, to assist EUI in our next Kibana upgrade:
|
None. |
There was a problem hiding this comment.
Pull request overview
Scopes flyout session history/back-navigation so that only flyouts belonging to the same historyKey group participate in the Back button + history popover, preventing unrelated product areas from mixing histories.
Changes:
- Added optional
historyKey?: symboltoEuiFlyoutand threaded it through the managed flyout stack (addFlyoutaction/store/API + session state). - Updated flyout manager history computation and navigation/close behavior to operate within a history group (including
ACTION_CLOSE_ALLand group-localgoBack/goToFlyoutbehavior). - Updated tests, stories, docs, and changelog to reflect the new history scoping behavior.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/website/docs/components/containers/flyout/_session_management.mdx | Documents historyKey behavior and provides examples for scoped history groups. |
| packages/eui/src/components/flyout/manager/types.ts | Extends FlyoutSession with historyKey and updates addFlyout API signature. |
| packages/eui/src/components/flyout/manager/store.ts | Filters history items to only include sessions in the same historyKey group; updates store addFlyout signature. |
| packages/eui/src/components/flyout/manager/store.test.ts | Updates/adds tests validating scoped history behavior across multiple groups. |
| packages/eui/src/components/flyout/manager/reducer.ts | Implements historyKey assignment and group-scoped behavior for close/back/navigate actions. |
| packages/eui/src/components/flyout/manager/reducer.test.ts | Updates/adds reducer tests for multi-group close/back/navigation behavior. |
| packages/eui/src/components/flyout/manager/layout_mode.test.tsx | Updates mock session construction to include historyKey. |
| packages/eui/src/components/flyout/manager/flyout_sessions.stories.tsx | Updates Storybook demos to illustrate independent history groups and shared keys. |
| packages/eui/src/components/flyout/manager/flyout_managed.tsx | Threads historyKey into addFlyout registration for main flyouts only. |
| packages/eui/src/components/flyout/manager/activity_stage.test.tsx | Updates mock state sessions to include historyKey. |
| packages/eui/src/components/flyout/manager/actions.ts | Adds historyKey to addFlyout action payload/signature and docs. |
| packages/eui/src/components/flyout/manager/actions.test.ts | Updates action tests and adds coverage for historyKey in payload. |
| packages/eui/src/components/flyout/manager/mocks/index.ts | Updates test session factory to always provide a historyKey. |
| packages/eui/src/components/flyout/manager/README.md | Adds developer-facing explanation of historyKey scoping semantics. |
| packages/eui/src/components/flyout/flyout.tsx | Adds public historyKey?: symbol prop and passes it into managed flyout variants. |
| packages/eui/src/components/flyout/flyout.test.tsx | Adds test ensuring historyKey is accepted on session="start" flyouts. |
| packages/eui/changelogs/upcoming/9413.md | Changelog entry describing the new historyKey feature and close behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/website/docs/components/containers/flyout/_session_management.mdx
Outdated
Show resolved
Hide resolved
tkajtoch
left a comment
There was a problem hiding this comment.
Code changes look great and work as expected. Thank you for updating the sessions story to nicely demo this new functionality! It made validating the changes very easy 💯
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
Summary
Closes elastic/kibana#250889
Makes flyout histories scoped by
historyKey.This branch introduces a new optional
historyKey?: symbolprop toEuiFlyoutand threads it through the entire flyout manager stack. The purpose is to scope Back-button navigation and history to a specific group of flyouts, preventing different product domains from mixing their flyout histories.API Changes
EuiFlyouthistoryKeysymbolto scope flyout history. Flyouts sharing the same Symbol reference share Back-button navigation and history entries.FlyoutManagerStoreaddFlyouthistoryKey?: symbolparameter (position 5, betweensizeandiconType). Callers passingiconType/minWidthpositionally must update their call sites.FlyoutSessionhistoryKeysymbol) on theFlyoutSessiontype; assigned automatically — no consumer action needed unless constructing sessions manually.Screenshots
This PR doesn't add visual changes. It's a user-interaction change for an EUI flyout's "Back" button to show up only in expected scenarios.
Impact Assessment
FlyoutManagerApi.addFlyoutis a method signature change, not a new prophistoryKeyis optional and inserted beforeiconType, it is technically a breaking positional change for any callers passingiconTypeorminWidth. No known usages / use cases for this.addFlyoutsignature to accept an options object rather than positional arguments.[ ] 💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.[ ] 🧪 Test impact — May break functional or snapshot tests (e.g., HTML structure, class names, default values).[ ] 🔧 Hard to integrate — If integration is complex, stage commits in Kibana/Cloud UI branches for cherry-picking and link to them below.Impact level: 🟢 None. There are no zknown external consumers of FlyoutManagerApi. The updated methods are meant to be called from internal hooks.
Release Readiness
[ ] Figma: {link to Figma or issue}[ ] Migration guide: {steps or link, for breaking/visual changes or deprecations}[ ] Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}QA instructions for reviewer
Checklist before marking Ready for Review
[ ] QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen readerbreaking changelabel (if applicable)Reviewer checklist