-
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
[Stateful sidenav] Fix collapsed menu for panels with no landing pages #195904
[Stateful sidenav] Fix collapsed menu for panels with no landing pages #195904
Conversation
@@ -44,7 +44,6 @@ export const NavigationKibanaProvider: FC<PropsWithChildren<NavigationKibanaDepe | |||
basePath, | |||
recentlyAccessed$: chrome.recentlyAccessed.get$(), | |||
navigateToUrl, | |||
navIsOpen: true, |
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.
Did some cleaning, this navIsOpen
is not used anywhere.
Pinging @elastic/appex-sharedux (Team:SharedUX) |
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.
I tested it and works fine! When sidenav is collapsed, o11y renders panel opener groups as accordions for groups that don't have landing pages.
Screen.Recording.2024-10-11.at.15.42.52.mov
I verify that this change does not change security.
I was curious to see the implementation. I have thought about somehow getting directly in the o11y navigation_tree the information isSideNavCollapsed
and conditionally rendering items as accordion
vs panelOpener
. But I see you did the changes directly to the navigation package, which is fine!
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
Thanks for the review @mgiota !
We want the same behaviour for any panel opener that does not have a landing page, so yes I fixed it globally 😊 |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
History
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.
Verified locally, it works as advertised. I however noticed that on clicking a nav menu item within the popover, the popover remains visible even after the route has transitioned, wdyt?
Thanks for the review @eokoneyo ! 👍
That's the behaviour coming from the underlying EUI component. It has its pros and cons. Let's leave it like that for now and we can revisit if users complain. |
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11325829039 |
elastic#195904) (cherry picked from commit a3289e4)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…g pages (#195904) (#196098) # Backport This will backport the following commits from `main` to `8.x`: - [[Stateful sidenav] Fix collapsed menu for panels with no landing pages (#195904)](#195904) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sébastien Loix","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T10:37:15Z","message":"[Stateful sidenav] Fix collapsed menu for panels with no landing pages (#195904)","sha":"a3289e440ad88825b1ae17495caf13ef5720ae7c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor","Feature:Chrome","ci:project-deploy-observability","Team:obs-ux-management"],"title":"[Stateful sidenav] Fix collapsed menu for panels with no landing pages","number":195904,"url":"https://github.com/elastic/kibana/pull/195904","mergeCommit":{"message":"[Stateful sidenav] Fix collapsed menu for panels with no landing pages (#195904)","sha":"a3289e440ad88825b1ae17495caf13ef5720ae7c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195904","number":195904,"mergeCommit":{"message":"[Stateful sidenav] Fix collapsed menu for panels with no landing pages (#195904)","sha":"a3289e440ad88825b1ae17495caf13ef5720ae7c"}}]}] BACKPORT--> Co-authored-by: Sébastien Loix <[email protected]>
In this PR I've updated the logic of the side navigation to render the "panel opener groups" as "accordions" whenever the side nav is collapsed, **only for groups that don't have a link (landing page)". This change does not impact the security navigation which has a landing page for each of the panels.
When the side nav is collapsed, a popover is used to render the navigation. We can't open the panel in that mode as the panel renders beneath the popover.
How to test
kibana.dev.yml
Screenshot
Collapsed
Extended