-
Notifications
You must be signed in to change notification settings - Fork 862
[EuiFlyoutMenu] add hideTitle prop for “main” flyouts in a session #9150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[EuiFlyoutMenu] add hideTitle prop for “main” flyouts in a session #9150
Conversation
Co-authored-by: Tim Sullivan <[email protected]> Co-authored-by: Timothy Sullivan <[email protected]> Co-authored-by: Weronika Olejniczak <[email protected]>
…ions in top menu (elastic#8997) Co-authored-by: Tomasz Kajtoch <[email protected]>
…ransition animations of managed flyouts (elastic#9015) Co-authored-by: Arturo Castillo Delgado <[email protected]> Co-authored-by: Tim Sullivan <[email protected]>
Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Weronika Olejniczak <[email protected]> Co-authored-by: Tomasz Kajtoch <[email protected]>
… use for child flyouts only (elastic#9056) Co-authored-by: Tim Sullivan <[email protected]>
Co-authored-by: Timothy Sullivan <[email protected]> Co-authored-by: Tim Sullivan <[email protected]>
Co-authored-by: Timothy Sullivan <[email protected]> Co-authored-by: Tim Sullivan <[email protected]>
…rom interacting with the Flyout System (elastic#9124) Co-authored-by: Timothy Sullivan <[email protected]>
3934a1f to
d199818
Compare
d199818 to
32edff0
Compare
68c5edd to
1a14cd0
Compare
1a14cd0 to
867d6ba
Compare
| // TODO: allow aria-labelledby references to be used | ||
| let title = _flyoutMenuProps?.title || props['aria-label']; | ||
| if (level === LEVEL_MAIN && !title) { | ||
| console.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we want this message shown only in development environments, if that is an option.
| ); | ||
|
|
||
| // Set title from flyoutMenuProps or aria-label | ||
| // TODO: allow aria-labelledby references to be used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working this TODO is not part of this PR. There's a possibility the element with the id will not be rendered initially, which means we need to have a DOM mutation observer on the flyout content and a new action in the flyout manager reducer to update the title at arbitrary times.
| The "main" flyout in a session should use `EuiFlyoutHeader` for the actual | ||
| flyout heading. For this reason, the `title` given from `flyoutMenuProps` will | ||
| not be visible to end users. However, a title is still needed for the history | ||
| navigation feature of the flyout session management system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this mention that the menu of a child flyout does show the title given from flyoutMenuProps? Or is that already implied well enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this:
:::info Note
The `title` from `flyoutMenuProps` is hidden from the menu on main flyouts (which should use
`EuiFlyoutHeader` for the visible heading) but is displayed in the menu of child flyouts.
For main flyouts, the title is primarily used for history navigation.
💚 Build SucceededHistory
cc @tkajtoch |
💚 Build Succeeded
History
cc @tkajtoch |
|
Blocked on #9178 |
Summary
Closes #9148
EuiFlyoutMenuPropshideTitleprop.The default is
truefor "main" system flyouts,falsefor everything elseWhy are we making this change?
This fixes an issue with the initial Flyout System implementation, where "main" flyouts have a title in the menu bar, which is wrong:
EuiFlyoutHeaderis not deprecated and the "main" flyout UI should use it for a heading.On the other hand, "child" flyouts are a new concept and these types of flyouts are designed to have their title text shown in the top menu bar. This makes sense because "main" and "child" flyouts serve different purposes, and their menu bars should also serve different purposes - the main menu bar shows the history controls and not a title; the child menu bar shows the title and not the history controls.
Screenshots #
Impact to users
Before this fix, it was assumed that flyout designs would change from using an
EuiFlyoutHeaderinto a design where the title is in the menu bar - even for "main" system flyouts. Since that assumption was wrong, this fix means there will be an easier migration path from non-managed flyouts into managed flyouts.QA
Remove or strikethrough items that do not apply to your PR.
General checklist
[ ] Checked in both light and dark modes[ ] Checked in mobile@defaultif default values are missing) and playground toggles[ ] 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)