Skip to content

[Flyout System] Scoped history#9413

Merged
tsullivan merged 12 commits intoelastic:mainfrom
tsullivan:flyout/optin-to-history
Mar 19, 2026
Merged

[Flyout System] Scoped history#9413
tsullivan merged 12 commits intoelastic:mainfrom
tsullivan:flyout/optin-to-history

Conversation

@tsullivan
Copy link
Member

@tsullivan tsullivan commented Feb 26, 2026

Summary

Closes elastic/kibana#250889

Makes flyout histories scoped by historyKey.

This branch introduces a new optional historyKey?: symbol prop to EuiFlyout and 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

component / parent prop / child change description
EuiFlyout historyKey Added Optional symbol to scope flyout history. Flyouts sharing the same Symbol reference share Back-button navigation and history entries.
FlyoutManagerStore addFlyout Updated Added optional historyKey?: symbol parameter (position 5, between size and iconType). Callers passing iconType/minWidth positionally must update their call sites.
FlyoutSession historyKey Added New required field (symbol) on the FlyoutSession type; 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

  • 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?
  • FlyoutManagerApi.addFlyout is a method signature change, not a new prop
    • historyKey is optional and inserted before iconType, it is technically a breaking positional change for any callers passing iconType or minWidth. No known usages / use cases for this.
    • One alternative that wasn't pursued was to change the addFlyout signature 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

  • Documentation: {link to docs page}
  • [ ] 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

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@tsullivan tsullivan force-pushed the flyout/optin-to-history branch from 53b42ca to f4ab067 Compare February 26, 2026 22:48
@tsullivan tsullivan force-pushed the flyout/optin-to-history branch from 00e3b70 to e40a4ee Compare March 15, 2026 18:04
@tsullivan tsullivan force-pushed the flyout/optin-to-history branch from e40a4ee to 3405ec6 Compare March 16, 2026 21:55
@tsullivan tsullivan added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Mar 16, 2026
@tsullivan tsullivan marked this pull request as ready for review March 16, 2026 22:30
@tsullivan tsullivan requested a review from a team as a code owner March 16, 2026 22:30
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

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:

  • If this PR contains prop/API changes:
    • Search through Kibana for <EuiComponent usages (example search)
    • In the PR description or in a PR comment, include a count or list with the number of component usages in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • If this PR contains CSS changes:
    • [ ] Search through Kibana for the changed EUI selectors, e.g. .euiComponent (example search)
    • [ ] In the PR description or in a PR comment, include a count or list with the number of custom CSS overrides in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • 🔍 Tip: When searching through Kibana, consider excluding **/target, **/*.snap, **/*.storyshot files to reduce noise and only look at source code usages
  • ⚠️ For extremely risky changes, the EUI team should potentially consider the following precautions:
    • Using a pre-release release candidate to test Kibana CI ahead of time
    • Using kibana-a-la-carte for manual QA, and to give other Kibana teams a staging server to quickly test against

@tsullivan
Copy link
Member Author

If this PR contains prop/API changes:

  • In the PR description or in a PR comment, include a count or list with the number of component usages in Kibana that will need to be updated (if that amount is "none", include that information as well)

None.

Copilot AI review requested due to automatic review settings March 17, 2026 18:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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?: symbol to EuiFlyout and threaded it through the managed flyout stack (addFlyout action/store/API + session state).
  • Updated flyout manager history computation and navigation/close behavior to operate within a history group (including ACTION_CLOSE_ALL and group-local goBack/goToFlyout behavior).
  • 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.

@tkajtoch tkajtoch self-requested a review March 18, 2026 15:42
Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

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

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 💯

@tsullivan tsullivan enabled auto-merge (squash) March 19, 2026 19:57
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@tsullivan tsullivan merged commit 429fbed into elastic:main Mar 19, 2026
5 checks passed
acstll added a commit to acstll/kibana that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1️⃣ [Flyout System] Make history opt-in

4 participants