Skip to content
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

fix(ui): url updates from link clicks not showing current route in sidenav #522

Conversation

TristanHoladay
Copy link
Contributor

Description

Highlights the current route in the sidenav after clicking button or card that is a link. The problem was that if the link was to a route that is a child route (e.g. /workloads/pods) and the workloads dropdown wasn't open then, even though active, the child route remained hidden.

This fix reactively looks at $page.url.pathname to open the correct dropdown if needed, and thus show the child route. The function is extracted so that the only variable svelte is looking at when deciding to trigger the update logic is $page.url.pathname. Attempts at making the entire function reactive resulted in the update logic firing when the dropdown button was toggled, meaning the submenu would be toggled off and then immediately back on.

Related Issue

resolves #487

Screencast.from.11-01-2024.01.59.22.PM.webm

@TristanHoladay TristanHoladay requested a review from a team as a code owner November 1, 2024 20:07
@TristanHoladay TristanHoladay linked an issue Nov 1, 2024 that may be closed by this pull request
Copy link
Contributor

@decleaver decleaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. pulled down and tested locally

@TristanHoladay TristanHoladay merged commit 6ae1097 into main Nov 1, 2024
14 checks passed
@TristanHoladay TristanHoladay deleted the 487-side-nav-not-showing-current-path-after-click-view-events branch November 1, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Side Nav not showing current path after click "View Events"
2 participants