Skip to content

fix: make menu conditions dynamic and optimize accessibility check - #83

Open
SarthakDudhe wants to merge 1 commit into
WaftTech:masterfrom
SarthakDudhe:optimize-navigation-menu-logic
Open

fix: make menu conditions dynamic and optimize accessibility check#83
SarthakDudhe wants to merge 1 commit into
WaftTech:masterfrom
SarthakDudhe:optimize-navigation-menu-logic

Conversation

@SarthakDudhe

Copy link
Copy Markdown

Dynamic Navigation Menu Path Opening: We replaced the static length checks (depth of 2 or 3) with a helper function togglePathKeys that recursively/iteratively toggles the menu expansion state (openSet) for all dot-separated keys in splitPath. This dynamically supports menus of any arbitrary nesting depth.
Short-Circuit Accessibility Check: We optimized menuFunction's child permission check. Instead of using .map(), which checks all children regardless of match, we now use .some() to return early (true) as soon as any child menu with valid access is found.

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.

1 participant