-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Serverless nav] Accordion auto-expand state + polish work #169651
[Serverless nav] Accordion auto-expand state + polish work #169651
Conversation
9c07de9
to
08c3daf
Compare
890612c
to
a7607f9
Compare
Pinging @elastic/appex-sharedux (Team:SharedUX) |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @sebelga |
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.
search changes LGTM!
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.
Security changes LGTM!
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.
Great work.
Since the nav is collapsed now instead of hidden, I think we can close this, correct? #169355
|
||
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; | ||
import classNames from 'classnames'; | ||
import { css } from '@emotion/css'; |
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.
nit: any reason to use /css instead of /react? https://emotion.sh/docs/best-practices#if-using-react-prefer-emotionreact-or-emotionstyled-over-emotioncss
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.
No, I didn't even realized 😄 I guess both work
packages/shared-ux/chrome/navigation/src/ui/components/navigation_section_ui.tsx
Show resolved
Hide resolved
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.
APM Changes LGTM
No it is still relevant. I am not sure I would bother much with that issue to be honest, I don't think many users try going mobile on their desktop and then back to desktop view. |
In this PR I fixed the auto-expand behaviour for the nav accordions if one of their item is "active" (matches the URL location). I've updated the Observability nav to correctly render the accordion with the chevron.
How to test
Launch the serverless Observability
Other fixes
Show the collapsed nav with icon
Correctly set the active state of root nav items
Set the active state on the accordion title if it is collapsed (and any of its children is active)
Known issue
There is a UI "glitch" when the last accordion is expanded/collapsed. I looked into it and it seems related to the
block-size
inline style that gets added by EUI. cc @cee-chenIt is being fixed in elastic/eui#7317
Fixes #167328
Fixes #167330