Skip to content

fix(NavList): merge sx and non-sx scenarios #6264

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 5 commits into
base: main
Choose a base branch
from

Conversation

joshblack
Copy link
Member

Closes https://github.com/github/primer/issues/5391

Update the NavList.Group component to have the same result when both sx and no sx prop is provided. This change has an unintended side-effect which is that in the sx case no divider was being rendered 😅

Changelog

New

Changed

  • Consolidate sx and no-sx scenarios into single return for NavList.Group

Removed

Rollout strategy

  • Patch release

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 21:03
@joshblack joshblack requested a review from a team as a code owner July 1, 2025 21:03
@joshblack joshblack requested a review from hectahertz July 1, 2025 21:03
Copy link

changeset-bot bot commented Jul 1, 2025

🦋 Changeset detected

Latest commit: 864dc68

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the staff Author is a staff member label Jul 1, 2025
Copy link
Contributor

@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 updates the NavList.Group component to consolidate the sx and no‑sx scenarios into a single render path and ensures that a divider is always rendered.

  • Changed the component from an arrow function with conditional rendering to a standard function with a unified return
  • Switched from using Box to BoxWithFallback when rendering ActionList.Group
  • Updated the changeset to reflect the patch release

Reviewed Changes

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

File Description
packages/react/src/NavList/NavList.tsx Unified NavList.Group rendering and ensured the divider is shown
.changeset/kind-pants-march.md Documented the changeset for the patch release
Comments suppressed due to low confidence (1)

packages/react/src/NavList/NavList.tsx:291

  • [nitpick] Consider adding a comment to explain that <ActionList.Divider /> is intentionally rendered unconditionally to harmonize the visual output between the sx and no‑sx scenarios.
      <ActionList.Divider />

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 1, 2025
Copy link
Contributor

github-actions bot commented Jul 1, 2025

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@joshblack joshblack changed the title Fix/update navlist group divider fix(NavList): merge sx and non-sx scenarios Jul 1, 2025
Copy link
Contributor

github-actions bot commented Jul 1, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.32 KB (-0.08% 🔽)
packages/react/dist/browser.umd.js 92.52 KB (+0.04% 🔺)

return (
<>
<ActionList.Divider />
<ActionList.Group {...props}>
<BoxWithFallback as={ActionList.Group} {...rest} sx={sx}>
Copy link
Member

Choose a reason for hiding this comment

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

I was thinking we probably don't need boxwithfallback here since ActionList.Group would have BoxWithFallback?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooo great point, will update 👍

@github-actions github-actions bot requested a deployment to storybook-preview-6264 July 3, 2025 16:33 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-6264 July 3, 2025 17:58 Abandoned
@jonrohan jonrohan enabled auto-merge July 3, 2025 22:23
@joshblack joshblack disabled auto-merge July 3, 2025 22:26
@joshblack
Copy link
Member Author

I think I need to coordinate this with: https://github.com/github/primer/issues/5407 in order to land in a release and not disrupt memex 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants