Skip to content

Fix sidebar active state after navigation#6547

Open
vicksiyi wants to merge 2 commits into
FlowiseAI:mainfrom
vicksiyi:codex/fix-logo-sidebar-active
Open

Fix sidebar active state after navigation#6547
vicksiyi wants to merge 2 commits into
FlowiseAI:mainfrom
vicksiyi:codex/fix-logo-sidebar-active

Conversation

@vicksiyi

Copy link
Copy Markdown

Summary

  • Sync sidebar active menu state whenever the route pathname changes.
  • Keep Chatflows selected when navigating back through the Flowise logo/default route.

Fixes #6510

Tests

  • git diff --check
  • pnpm --dir packages/ui build

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the NavItem component to use the useLocation hook from react-router-dom instead of accessing document.location.pathname directly, and adds location.pathname to the useEffect dependency array to ensure the active menu item updates correctly on route changes. The reviewer suggested optimizing this hook by checking if the menu item is already open before dispatching MENU_OPEN to prevent redundant Redux dispatches and unnecessary re-renders, as well as caching the split pathname.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

Sidebar active menu item remains highlighted after navigating via Flowise logo

1 participant