chore(ui): simplify CodeBox-like UI components#7793
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
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. <cwunder@gnome.org> Signed-off-by: Aviv Keller <me@aviv.sh>
This PR does a 2 similar things in order to enhance the integration with nodejs/doc-kit#285
BaseCodeBoxnot part of the actual UI componentMDXCodeTabsto the UI components