-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
chore(ui): simplify CodeBox-like UI components #7793
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 simplifies the UI components used for code display by removing non-UI logic from BaseCodeBox and moving MDXCodeTabs into the UI components package. The key changes are:
- Upgrading the Radix UI Tabs dependency in package.json.
- Updating import paths in MDXCodeTabs to reflect the new component location.
- Removing unnecessary notification elements and simplifying the onCopy API in BaseCodeBox, with corresponding adjustments in CodeBox.
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/ui-components/package.json | Upgraded @radix-ui/react-tabs dependency version from 1.1.3 to 1.1.9 |
packages/ui-components/MDX/CodeTabs.tsx | Updated import path for CodeTabs to use the alias "#ui" |
packages/ui-components/Common/CodeTabs/index.stories.tsx | Replaced copyText and copiedText with buttonText in story props |
packages/ui-components/Common/BaseCodeBox/index.tsx | Removed unused icons and simplified the onCopy API signature |
packages/ui-components/Common/BaseCodeBox/index.module.css | Removed the unused .notification CSS rules |
apps/site/next.mdx.use.client.mjs | Updated MDXCodeTabs import to use the UI components package |
apps/site/components/Common/CodeBox.tsx | Adjusted onCopy implementation to align with the new BaseCodeBox API |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
packages/ui-components/MDX/CodeTabs.tsx:4
- Ensure that the alias '#ui' is properly configured in the project to resolve the CodeTabs component.
import CodeTabs from '#ui/Common/CodeTabs';
packages/ui-components/Common/BaseCodeBox/index.tsx:69
- The onCopy API has been simplified by removing the message parameter; please verify that all consumers have been updated to use the new signature.
onCopy: (text: string) => void;
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #7793 +/- ##
==========================================
+ Coverage 75.34% 75.37% +0.02%
==========================================
Files 96 96
Lines 7862 7862
Branches 192 192
==========================================
+ Hits 5924 5926 +2
+ Misses 1937 1935 -2
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Lighthouse Results
|
Co-authored-by: Claudio W. <[email protected]> Signed-off-by: Aviv Keller <[email protected]>
This PR does a 2 similar things in order to enhance the integration with nodejs/api-docs-tooling#285
BaseCodeBox
not part of the actual UI componentMDXCodeTabs
to the UI components