[Flyout System] Add managed history controls#9003
[Flyout System] Add managed history controls#9003tsullivan merged 67 commits intoelastic:feat/flyout-systemfrom
Conversation
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> Co-authored-by: Timothy Sullivan <tsullivan@elastic.co> Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
1dac84e to
3331dce
Compare
clintandrewhall
left a comment
There was a problem hiding this comment.
A few nits, but looks good to me. Approving to unblock.
Great work!
acstll
left a comment
There was a problem hiding this comment.
Only a suggestion for the changelog, and translations in EuiFlyoutMenu. I tested the feature locally and it's working as expected.
| <EuiButtonEmpty size="xs" color="text" {...props}> | ||
| <EuiIcon type="editorUndo" /> Back | ||
| </EuiButtonEmpty> |
There was a problem hiding this comment.
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 ✨
| <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" /> |
There was a problem hiding this comment.
| <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. | |||
There was a problem hiding this comment.
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:
| [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. |
7101792 to
6cb11fb
Compare
|
@acstll This is ready for another look! |
💚 Build SucceededHistory
|
acstll
left a comment
There was a problem hiding this comment.
🟢 Looks good to merge! Thanks for the updates @tsullivan
💚 Build Succeeded
History
|
## 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>
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:
onActivecallback (optional prop) is fired.When the user navigates to a previous flyout:
onClosecallbacks are firedonActivecallback for the flyout that becomes active is firedNote: This PR is targeted to the
feat/flyout-systemfeature 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:
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
@defaultif default values are missing) and playground toggles