Skip to content

New component: SubNav (Sidebar expansion) - #262

Open
zoharma wants to merge 6 commits into
mainfrom
zma/sidebar-expansion
Open

zoharma wants to merge 6 commits into
mainfrom
zma/sidebar-expansion

Conversation

@zoharma

@zoharma zoharma commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Issue: #274

This proposed changes rely on #210.

Added a SubNav (previously SecondaryNav) panel that sits alongside SidebarNav, with support for a title, grouped or expandable lists, and slots for adding different types of content within. Also added NavigationLayout component SidebarNav ability, to show both navigation panels and handles responsive behaviour automatically, showing them side by side on desktop and switching between them on mobile.

The sub navigation uses compact rows and the same rounded selection style as the primary sidebar. Shared navigation types have been moved to navigation/types.ts.

Also added history for back button.

@zoharma
zoharma force-pushed the zma/sidebar-expansion branch from bc74614 to 02a980e Compare August 3, 2026 14:59
@zoharma
zoharma requested a review from douglaswinter August 3, 2026 15:02
@zoharma
zoharma marked this pull request as ready for review August 3, 2026 15:02
@zoharma
zoharma marked this pull request as draft August 4, 2026 09:13
@zoharma
zoharma marked this pull request as ready for review August 4, 2026 14:07
@zoharma zoharma added the v0.7.0 label Aug 4, 2026
@zoharma zoharma linked an issue Aug 6, 2026 that may be closed by this pull request
1 of 2 tasks
@zoharma
zoharma force-pushed the zma/sidebar-expansion branch from 02a980e to b0bbd36 Compare August 6, 2026 11:32
@zoharma
zoharma requested a review from a team August 6, 2026 11:32
@zoharma
zoharma force-pushed the zma/sidebar-expansion branch 3 times, most recently from 191232a to 08739a2 Compare August 11, 2026 13:56
@zoharma

zoharma commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor Author

@douglaswinter Have updated a few things:

  • Fixed WithAppBar story: selection state was hardcoded to "Acquisition" and now fixed.
  • Split SecondaryNav content from its responsive layout (added to NavigationLayout), making it reusable (such as in modals)
  • Fixed mobile navigation so selecting a secondary item closes both sidebars and shows the main content.
  • Updated tests and stories.
  • Fixed how NavigationLayout looks and works on the docs page

@zoharma
zoharma force-pushed the zma/sidebar-expansion branch from 75332bf to eb52c53 Compare August 11, 2026 15:30

@douglaswinter douglaswinter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks good, but I think it could do with some refactoring.

zoharma added a commit that referenced this pull request Aug 24, 2026
Addresses PR #262 review feedback:
- SidebarNav now owns the responsive primary/secondary panel coordination directly instead of through a separate NavigationLayout component, and the secondary-panel component
is renamed to SubNav for clarity.
- Also consolidates shared nav item types, drops the id field in favour of generated keys, replaces the search prop with a searchSlot, now showing of SidebarNav stories, and updated test statements
@zoharma
zoharma force-pushed the zma/sidebar-expansion branch 4 times, most recently from 3586798 to f7d28a9 Compare August 24, 2026 15:35
zoharma added a commit that referenced this pull request Aug 24, 2026
* Move responsive primary/secondary panel coordination into `SidebarNav`
* Rename the secondary panel component to `SubNav`
* Consolidate shared nav item types and use generated keys instead of `id`
* Replace the `search` prop with `searchSlot`
* Improve `SidebarNav` story coverage and clean up story canvases
* Update test assertions
* Fix drawer/content height mismatch
@zoharma
zoharma force-pushed the zma/sidebar-expansion branch from f7d28a9 to bec981b Compare August 24, 2026 15:40
zoharma added a commit that referenced this pull request Aug 24, 2026
- Move responsive primary/secondary panel coordination into `SidebarNav`
- Rename the secondary panel component to `SubNav`
- Consolidate shared nav item types and use generated keys instead of `id`
- Replace the `search` prop with `searchSlot`
- Improve `SidebarNav` story coverage and clean up story canvases
- Update test assertions
- Fix drawer/content height mismatch
@zoharma
zoharma force-pushed the zma/sidebar-expansion branch 4 times, most recently from 0914e44 to f5e858c Compare August 24, 2026 16:17
@zoharma

zoharma commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

@douglaswinter Went through this today:

In two commits here are the changes:

Address SidebarNav review feedback:

  • Move responsive primary/secondary panel coordination into SidebarNav
  • Rename the secondary panel component to SubNav
  • Consolidate shared nav item types and use generated keys instead of id
  • Replace the search prop with searchSlot
  • Improve SidebarNav story coverage and clean up story canvases
  • Update test assertions
  • Added and fixed story docs for SidebarNav and SubNav

Additional changes and fixes:
Add SubNav slots and make AppBar spacer opt-in

  • Replace SubNav's searchSlot with beforeNavSlot, afterNavSlot, and footerSlot
  • Add hasAppBar to SidebarNav, defaulting to false, so the Toolbar spacer is only rendered when needed
  • Align subheaders, expandable-item children, and slot content with nav item text
  • Replace the expand/collapse chevron with Lucide's ChevronDown
  • Expand SidebarNav and SubNav story docs with usage guidance

@zoharma zoharma changed the title New component: Secondary Nav (Sidebar expansion) New component: SubNav (Sidebar expansion) Aug 26, 2026
@zoharma zoharma added v0.7.1 and removed v0.7.0 labels Sep 1, 2026
@zoharma zoharma added this to the 0.6.4 milestone Sep 1, 2026
@zoharma zoharma removed the v0.7.1 label Sep 1, 2026
@zoharma zoharma modified the milestones: 0.7.1, 0.8.0 Sep 2, 2026
@zoharma zoharma modified the milestones: 0.10.0, 0.9.0 Oct 6, 2026
zoharma added a commit that referenced this pull request Nov 9, 2026
- Move responsive primary/secondary panel coordination into `SidebarNav`
- Rename the secondary panel component to `SubNav`
- Consolidate shared nav item types and use generated keys instead of `id`
- Replace the `search` prop with `searchSlot`
- Improve `SidebarNav` story coverage and clean up story canvases
- Update test assertions
- Fix drawer/content height mismatch
@zoharma
zoharma force-pushed the zma/sidebar-expansion branch from f5e858c to 9e882ee Compare November 9, 2026 11:01
@zoharma zoharma added the priority/p2-medium Planned, should do label Nov 9, 2026
…vigation

- Introduce `SecondaryNav` and `NavigationLayout` components to support a secondary, contextual navigation panel alongside the primary SidebarNav.
- Extract shared `LinkProps` into types.ts so both nav components can reuse it.
… presentation

- fixed `WithAppBar` story: selection state was hardcoded to "Acquisition" and now fixed.
- Split `SecondaryNav` content from its responsive layout, making it reusable (such as in modals).
- Fixed mobile navigation so selecting a secondary item closes both sidebars and shows the main content.
- Updated tests and stories.
- Move responsive primary/secondary panel coordination into `SidebarNav`
- Rename the secondary panel component to `SubNav`
- Consolidate shared nav item types and use generated keys instead of `id`
- Replace the `search` prop with `searchSlot`
- Improve `SidebarNav` story coverage and clean up story canvases
- Update test assertions
- Fix drawer/content height mismatch
- Replace `SubNav`'s `searchSlot` with `beforeNavSlot`, `afterNavSlot`, and `footerSlot`
- Add `hasAppBar` to `SidebarNav`, defaulting to `false`, so the Toolbar spacer is only rendered when needed
- Align subheaders, expandable-item children, and slot content with nav item text
- Replace the expand/collapse chevron with Lucide's `ChevronDown`
- Expand SidebarNav and SubNav story docs with usage guidance
…debarNav

- Add `titleEndSlot` to `SubNavContent` for a collapse button beside the title
- Add `WithTitleButton` and `DesktopCollapsible` stories, including focus hand-off
- Label the `SidebarNav` secondary panel and mobile drawer as `<nav>` landmarks
- Use Lucide `ArrowLeft` and adjust auto-expand state during render
- Add space above the divider between subheader groups
- Remove top spacer from the `DesktopSideBySide` story
- Import stories from `@storybook/react-webpack5`
@zoharma
zoharma force-pushed the zma/sidebar-expansion branch from 9e882ee to e6d2977 Compare November 17, 2026 10:56
@zoharma

zoharma commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

@douglaswinter Have made some updates taken from design-system and brought up to date:

Main changes

  • Add titleEndSlot to SubNavContent for a collapse button beside the title
  • Add WithTitleButton and DesktopCollapsible stories, including focus hand-off
  • Label the SidebarNav secondary panel and mobile drawer as <nav> landmarks

Fixes

  • Use Lucide ArrowLeft and adjust auto-expand state during render
  • Add space above the divider between subheader groups
  • Remove top spacer from the DesktopSideBySide story
  • Import stories from @storybook/react-webpack5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New components: SecondaryNav and NavigationLayout for contextual secondary navigation

2 participants