Skip to content

feat: make SidebarNav spacing configurable - #353

Open
swara030 wants to merge 3 commits into
DiamondLightSource:mainfrom
swara030:fix/sidebar-nav-configurable-spacing
Open

swara030 wants to merge 3 commits into
DiamondLightSource:mainfrom
swara030:fix/sidebar-nav-configurable-spacing

Conversation

@swara030

Copy link
Copy Markdown

This PR addresses [Issue #334](#334) by making the spacing in SidebarNav configurable.

Changes Made

  • Added an optional topSpacing prop to configure the spacing at the top of the sidebar navigation.
  • Added an optional bottomSpacing prop to configure spacing at the bottom of the navigation content.
  • Preserved the existing default behavior when the new props are omitted.
  • Updated the Storybook example to demonstrate configurable spacing.
  • Added tests to cover default behavior, custom spacing, desktop and mobile layouts, and footer placement.
  • Added an entry to changelog.md.

Testing

  • SidebarNav tests passed (16/16).
  • Focused ESLint checks passed.
  • TypeScript check passed.
  • git diff --check passed.

Note: The full-repository lint check reports CRLF/Prettier line-ending errors. The focused ESLint checks for the changed source files passed.

Closes #334

@swara030
swara030 requested a review from a team October 12, 2026 04:25
@swara030

Copy link
Copy Markdown
Author

Hi maintainers,

I noticed that this PR is currently blocked because it requires an approving review and the two GitHub Actions workflows are awaiting maintainer approval.

Could someone please review the changes and approve the workflows when convenient? I’m happy to make any changes required based on your feedback.

Thank you for your time and consideration!

@zoharma
zoharma requested a review from douglaswinter October 27, 2026 10:59
@zoharma zoharma added the priority/p2-medium Planned, should do label Oct 27, 2026
@zoharma
zoharma force-pushed the fix/sidebar-nav-configurable-spacing branch 2 times, most recently from adcf50d to 0d4ddaa Compare December 3, 2026 14:25
- Taking over this PR from the original contributor (swara030)
- Custom topSpacing now renders a plain Box, because Toolbar's 64px min-height media rule ignored smaller values from 600px up
- Numeric spacing is always pixels; sx read 0 to 1 as percentages
- Share the spacer code between the permanent and temporary drawers
- Move the changelog entry under Added
- Tests fail if a custom top spacer goes back to being a Toolbar, which jsdom can't catch through its media queries
- JSDoc says a custom topSpacing stays fixed while the default changes with screen size
- Label the menu button in the CustomSpacing story
@zoharma

zoharma commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

I'm taking this over to get it merged. I rebased onto main, then:

  • Fixed topSpacing below 64px having no effect on screens 600px and wider. MUI's Toolbar minimum height was overriding it.
  • Made numbers always mean pixels. Values from 0 to 1 used to become percentages.
  • Added tests for both, and moved the changelog entry under "Added".

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

priority/p2-medium Planned, should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spacing at the top of SidebarNav should be configurable

3 participants