Add FlyoutSystemMenu component#8851
Conversation
1538889 to
2ec3f5f
Compare
|
|
||
| if (state.activeFlyoutGroup) { | ||
| newHistory.push(state.activeFlyoutGroup); | ||
| newHistory.unshift(state.activeFlyoutGroup); |
There was a problem hiding this comment.
Changed the ordering of history items to be reversed (newest in the front) to simplify the rendering of the history popover.
a19f9d3 to
9891366
Compare
|
@tsullivan I think the answer is 'yes' but will |
9891366 to
b5a3212
Compare
@ryankeairns, yes there aren't any limitations against putting an If you are rendering the components declaratively, you can compose them this way: The This PR currently updates the API for state management: if you want to open a "basic" flyout and have a flyout that looks exactly the way flyouts look in the current version, then you would call Note that this PR is still in draft mode because the API decisions may need to change. |
|
Thanks @tsullivan . Added the 'Closes [issue]' text to the PR description. Feel free to remove that if you feel it is not needed here. |
|
Updated the description, added screenshots. |
|
@ryankeairns from that issue, I see:
👍🏻 This PR does support custom actions that implementors want to show in the menu bar, if the developers render the flyout structure declaratively. But for developers that use state management system API:
I think this is good for now, as I need to avoid making the state management system too polished in this phase. Some API design changes are forthcoming to meet a set of refined Kibana developer requirements. Some terminology changes will come in through that as well. |
|
Understood. For those following along, we understand that the current Security flyout does have custom actions that we'll ultimately need to support in the managed setup. |
b65ce43 to
37fc2f6
Compare
| /** | ||
| * Title to display in top menu bar and in the options of the history popover | ||
| */ | ||
| title: string; |
There was a problem hiding this comment.
@clintandrewhall just want to point this field out specifically, because we will have to think about how titles will be displayed in the top menu bar and in the history popover with the replacement API.
| historyFilter?: ( | ||
| history: EuiFlyoutSessionHistoryState<FlyoutMeta>['history'], | ||
| activeFlyoutGroup?: EuiFlyoutSessionGroup<FlyoutMeta> | null | ||
| ) => EuiFlyoutSessionHistoryState<FlyoutMeta>['history']; |
There was a problem hiding this comment.
I asked @ryankeairns about this today for clarification. When the design idea for this came up, it was to limit the number of items in the history popover visually. Old items in the history should still be accessible by scrolling down or paging back. The idea actually wasn't to give developers a way to pull items out of the history or replace a given set of history items with another, or empty the history completely. So the historyFilter mechanism as it is in this PR isn't actually needed at this point. (But maybe it doesn't hurt to leave it here).
| }) => { | ||
| const { onClose } = useContext(EuiFlyoutMenuContext); | ||
|
|
||
| const styles = useEuiFlyoutMenuStyles(); |
There was a problem hiding this comment.
nit: Could you please use useEuiMemoizedStyles instead? It passes euiTheme as an argument to the given styles function, so useEuiFlyoutMenuStyles could be pure.
packages/eui/src/components/flyout/sessions/managed_flyout_menu.tsx
Outdated
Show resolved
Hide resolved
Cherry-picked from PR elastic#8851 by tsullivan. This adds the EuiFlyoutMenu component and managed flyout menu functionality, including bug fixes, terminology updates, documentation, and stories.
|
I see the flyout menu bar does not appear on the In its most minimal state, it would show the close button. |
💚 Build SucceededHistory
cc @tsullivan |
💚 Build Succeeded
History
cc @tsullivan |
|
@tsullivan I updated the base to |
## 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>

Closes #8873Summary
Adds a new
EuiFlyoutMenucomponent that provides a standardized top menu bar for flyouts. Key features:EuiFlyoutandEuiFlyoutChildcomponentsEnhances the flyout session API with:
openSystemFlyoutmethod for creating flyouts designed for flyout-to-flyout navigation (flyout sessions).historyFilterprop inEuiFlyoutSessionProviderGO_TO_HISTORY_ITEMaction for direct history accessOther changes:
flyoutReducerwhere themetadata from incoming actions needed to be merged with the past state. Caused by#8857Why are we making this change?
Part of https://github.com/elastic/kibana-team/issues/1606 - SharedUX Flyout System
Screenshots
Demonstrating navigating deeply through history
Demonstrating the
historyFilterImpact to users
QA
Remove or strikethrough items that do not apply to your PR.
General checklist
@defaultif default values are missing) and playground toggles