Skip to content

Sidebar Updates #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Sidebar Updates #41

wants to merge 3 commits into from

Conversation

danielguillan
Copy link
Contributor

  • Adds the active link in the header as the sidebar title and the root item for breadcrumbs.
  • Updates styles to match current primer.style
  • Makes group headings link to the index page (now uses Mona Sans, update font sizes, visible dividers, ...)

@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 09:26
@danielguillan danielguillan requested a review from a team as a code owner June 5, 2025 09:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the sidebar by displaying the active header link as its title, updates styling to match primer.style, and makes group headings navigable.

  • Adds activeHeaderLink to sidebar and root breadcrumbs
  • Updates typography and spacing in Sidebar.module.css
  • Wraps group headings in links to their index pages

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/theme/components/layout/sidebar/Sidebar.tsx Show active header link as sidebar title; wrap group headings in <NextLink>; add NavListItem class
packages/theme/components/layout/sidebar/Sidebar.module.css Adjust font sizes, remove hidden dividers, and scope NavList styling
packages/theme/components/layout/root-layout/Theme.tsx Update root breadcrumbs to use activeHeaderLink title
Comments suppressed due to low confidence (4)

packages/theme/components/layout/sidebar/Sidebar.tsx:80

  • [nitpick] You’re supplying both the title prop and a custom <NavList.GroupHeading>, which may render duplicate headings. Remove the title prop if you intend to use the custom heading element.
<NavList.Group title={subNavName} key={item.name} sx={{mb: 24}}>

packages/theme/components/layout/root-layout/Theme.tsx:141

  • New breadcrumb logic now prefers activeHeaderLink over siteTitle. Consider adding a test to cover both scenarios (with and without an active header link).
{(activeHeaderLink || siteTitle) && (

packages/theme/components/layout/sidebar/Sidebar.tsx:24

  • It looks like useConfig isn't imported in this file. Add import {useConfig} from '../../context/useConfig' alongside the other hooks to avoid a runtime error.
const {headerLinks, sidebarLinks} = useConfig()

packages/theme/components/layout/sidebar/Sidebar.module.css:22

  • The .NavList__Container selector may not match the actual DOM from <NavList>. Verify the rendered markup or adjust to .NavList .NavListItem a to ensure this rule applies.
.NavList__Container li a,

@rezrah
Copy link
Collaborator

rezrah commented Jun 6, 2025

Code looks good @danielguillan 🙌. As you're not using this feature in the preview site, could we instead share screenshots in the PR to more easily see how it looks please (next time is fine).

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.

2 participants