Skip to content

centralize sidebar layout state#224

Open
ash1shkumar wants to merge 1 commit into
Shriii19:masterfrom
ash1shkumar:improve-sidebar-state-management
Open

centralize sidebar layout state#224
ash1shkumar wants to merge 1 commit into
Shriii19:masterfrom
ash1shkumar:improve-sidebar-state-management

Conversation

@ash1shkumar
Copy link
Copy Markdown
Contributor

📝 Description

This PR improves sidebar and layout state coordination by centralizing route-derived UI state into a reusable layout state helper. Previously, multiple sidebar visibility and layout conditions were derived directly within the component, making future navigation-related enhancements more difficult to maintain.

The updated implementation introduces a dedicated layout state computation flow and memoizes derived values to reduce unnecessary recalculations during navigation changes.

Key Improvements

  • Centralized sidebar and layout state derivation
  • Consolidated route-based visibility logic into a reusable helper
  • Reduced scattered state computation within the component
  • Added memoized layout state generation using useMemo
  • Improved maintainability for future navigation and workspace features
  • Established a more scalable foundation for sidebar-related enhancements

Impact

This refactor improves consistency across sidebar interactions while reducing maintenance complexity. The centralized layout state approach makes future navigation, workspace, and sidebar integrations easier to implement and maintain.

🎯 Type of Change

  • ♻️ Refactoring
  • ⚡ Performance Improvement

✅ Testing

  • Verified sidebar visibility behavior on public routes
  • Verified sidebar visibility behavior on insights routes
  • Verified standard application routes continue rendering correctly
  • Verified top navigation behavior remains unchanged
  • Confirmed layout spacing and rendering are preserved
  • Confirmed route transitions update layout state correctly

Fixes #219

Expected Labels

level3 NSoC'26

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

@ash1shkumar is attempting to deploy a commit to the shreemp194-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

👋 Thank you for opening this pull request! I will review your changes and assist you soon.

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.

Improve Sidebar State Management Consistency

1 participant