You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The computed collapsed state is derived from persistentCollapsed !== hoverToggled. This XOR-like logic can be hard to reason about and may lead to unexpected toggling when state updates race (e.g., resize + hover). Validate that the sidebar never ends up in a stuck state and that keyboard/screen-reader users can still toggle reliably.
The .menu-toggle-icon div is clickable with role="button" but lacks keyboard handlers and ARIA state. Add tabIndex, aria-pressed/aria-expanded, and handle Enter/Space to ensure accessibility.
The rotation of the toggle icon uses a class .open based on the collapsed state. Double-check the mapping so the rotation direction matches the visual expand/collapse action to avoid confusing cues.
Latest suggestions up to 0d3a717
Explore these optional code suggestions:
Category
Suggestion
Impact
Possible issue
Avoid SSR window access
Guard against server-side rendering by avoiding direct access to window during initialization. Use a safe default and compute on mount instead. This prevents runtime errors in non-browser environments and improves hydration stability.
Why: Correctly guards against window being undefined during SSR by adding a typeof check, preventing runtime errors without altering behavior in-browser.
Medium
General
Move CSS var out of inline style
Avoid setting CSS custom properties inline as they can be harder to override and may cause unnecessary re-renders. Update the root variable via effect when collapsed changes to keep behavior consistent with prior implementation.
Why: Restores prior pattern of updating --navbar-width via effect, aiding overrideability and avoiding inline CSS variables; moderate improvement with accurate code.
Low
Clarify collapsed computation
The derived collapsed state flips based on hover, which can be confusing and brittle. Replace with an explicit computed value for readability and to avoid logic errors when states change rapidly.
Clear any existing timeout before setting a new one to avoid multiple queued timers causing flicker or stale updates. Also clear the timeout on unmount to prevent leaks.
Why: Clearing existing timeouts before setting a new one and on unmount prevents flicker and leaks; this is accurate and improves robustness with the newly added hover-delay logic.
Medium
Fix state initialization and cleanup
Initialize useState with getInitialCollapsedState() to avoid passing the function reference as the initial state. Also, clear any pending hover timeout on unmount to prevent memory leaks and state updates after unmount.
Why: Initializing useState with getInitialCollapsedState() avoids unintended lazy init semantics and the cleanup for hoverTimeout is a reasonable enhancement, though the added TS type is not applicable in JSX and cleanup isn’t shown in the PR context.
Low
General
Keep toggle always accessible
Ensure the toggle control remains visible and clickable when the sidebar is collapsed by positioning it consistently. Add a higher z-index and explicit width to prevent it being overlapped or clipped during transitions.
Why: Making the toggle sticky with z-index can improve usability during collapse/expand, but it's a stylistic/layout change with potential side effects and is not strictly required for correctness.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
📝 Pull Request Summary
Description:
Navbar updated with hover toggle and toggle button
Related Jira Ticket:
https://aottech.atlassian.net/browse/FWF-5586
Type of Change:
🧩 Microfrontends Affected
Please select all microfrontends or modules that are part of this change:
Details (if Others selected):
🧠 Summary of Changes
🧪 Testing Details
Testing Performed:
Screenshots (if applicable):


✅ Checklist
👥 Reviewer Notes
PR Type
Enhancement
Description
Add persistent hover-toggle sidebar behavior
Introduce clickable menu toggle icon
Responsive collapse on viewport resize
Update styles for toggle and layout
Diagram Walkthrough
File Walkthrough
index.tsx
Add MenuToggleIcon SVG componentforms-flow-components/src/components/SvgIcons/index.tsx
MenuToggleIconSVG component.Sidebar.scss
Style menu toggle icon and layout tweaksforms-flow-nav/src/sidenav/Sidebar.scss
.menu-toggle-iconstyles and rotation on open.Sidebar.jsx
Add persistent hover-toggle and responsive sidebarforms-flow-nav/src/sidenav/Sidebar.jsx
.menu-toggle-iconusingMenuToggleIcon.--navbar-widthstyle based on collapsed state.