-
Notifications
You must be signed in to change notification settings - Fork 625
Add className support to UnderlineNav.Item component #6129
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
Conversation
🦋 Changeset detectedLatest commit: 37a7ff6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com>
👋 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! |
There was a problem hiding this 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 fixes the issue where passing a className
to UnderlineNav.Item
wasn’t merged with the default styling. It updates the internal UnderlineItem
component to use clsx
for class merging and adds a test to verify the behavior.
- Use
clsx
to combineclasses.UnderlineItem
with any passedclassName
- Added a test in
UnderlineNav.test.tsx
to assert both default and custom classes are applied
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/react/src/internal/components/UnderlineTabbedInterface.tsx | Destructure and merge className using clsx |
packages/react/src/UnderlineNav/UnderlineNav.test.tsx | New test asserting className is combined properly |
Comments suppressed due to low confidence (2)
packages/react/src/internal/components/UnderlineTabbedInterface.tsx:114
- Ensure that
clsx
is imported at the top of this file (e.g.,import clsx from 'clsx';
), otherwise the build will fail.
className={clsx(classes.UnderlineItem, className)}
packages/react/src/internal/components/UnderlineTabbedInterface.tsx:104
- Consider updating the
UnderlineItemProps
TypeScript definition or JSDoc for this component to explicitly includeclassName
, so IDE users know it’s supported.
className,
size-limit report 📦
|
@copilot Can you fix these lint and format CI errors? |
Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@copilot fix the broken test |
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/380523 |
🔴 golden-jobs completed with status |
Changes
The
UnderlineNav.Item
component was not properly combining custom className props with the default styling. This PR fixes the issue by:Modifying the
UnderlineItem
component inUnderlineTabbedInterface.tsx
to:Added a test case to verify that className props are correctly combined with the default classes
This change aligns with our contribution guidelines:
Before
After
Fixes #6128.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.