Skip to content

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Dec 30, 2025

Closes #8458
Fixes #8357

This PR removes the NotificationProvider in favor of inline feedback, and removes the un-used showCopyButton property from CodeBox

Copilot AI review requested due to automatic review settings December 30, 2025 19:13
@avivkeller avivkeller requested review from a team as code owners December 30, 2025 19:13
@vercel
Copy link

vercel bot commented Dec 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nodejs-org Ready Ready Preview Dec 30, 2025 9:47pm

@github-actions
Copy link
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website @nodejs/web-infra

Please review the changes when you have a chance. Thank you! 🙏

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.27%. Comparing base (011eda1) to head (18d7511).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8493      +/-   ##
==========================================
+ Coverage   73.70%   74.27%   +0.57%     
==========================================
  Files         108      106       -2     
  Lines        9210     9112      -98     
  Branches      313      307       -6     
==========================================
- Hits         6788     6768      -20     
+ Misses       2420     2342      -78     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

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 refactors the code feedback mechanism by removing the global NotificationProvider toast system in favor of inline feedback within code blocks. The copy button now shows immediate visual feedback by changing its icon and text directly, eliminating the need for a separate notification system.

  • Removes NotificationProvider and Notification components along with the @radix-ui/react-toast dependency
  • Refactors BaseCodeBox API to accept buttonContent (ReactNode) instead of buttonText (string), enabling dynamic button content
  • Updates CodeBox to use useCopyToClipboard hook for inline state management and conditional button rendering

Reviewed changes

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

Show a summary per file
File Description
pnpm-lock.yaml Removes @radix-ui/react-toast dependency from lockfile
packages/ui-components/src/Providers/NotificationProvider/index.tsx Deletes NotificationProvider context and component
packages/ui-components/src/Providers/NotificationProvider/index.module.css Deletes NotificationProvider styles
packages/ui-components/src/Providers/NotificationProvider/tests/index.test.jsx Deletes NotificationProvider tests
packages/ui-components/src/Common/Notification/index.tsx Deletes Notification component
packages/ui-components/src/Common/Notification/index.stories.tsx Deletes Notification stories
packages/ui-components/src/Common/Notification/index.module.css Deletes Notification styles
packages/ui-components/src/Common/CodeTabs/index.stories.tsx Updates story to use new buttonContent prop
packages/ui-components/src/Common/BaseCodeBox/index.tsx Changes API from buttonText to buttonContent, removes showCopyButton prop, adds unused copied prop
packages/ui-components/src/Common/BaseCodeBox/index.stories.tsx Removes story variant, missing required props for updated API
packages/ui-components/src/Common/BaseCodeBox/index.module.css Removes unused icon styles
packages/ui-components/package.json Bumps version to 1.5.0 and removes @radix-ui/react-toast dependency
packages/ui-components/.storybook/preview.tsx Removes NotificationProvider decorator from Storybook
packages/rehype-shiki/src/plugin.mjs Removes showCopyButton metadata handling
apps/site/next.config.mjs Removes @radix-ui/react-toast from transpilation config
apps/site/layouts/Base.tsx Removes NotificationProvider wrapper and 'use client' directive
apps/site/components/MDX/CodeBox/index.tsx Removes showCopyButton prop handling
apps/site/components/Common/CodeBox.tsx Implements inline feedback using useCopyToClipboard hook with conditional icon/text rendering
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

SGTM with a few suggstions

@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2025

📦 Build Size Comparison

Summary

Metric Value
Old Total Size 3.72 MB
New Total Size 3.75 MB
Delta 36.89 KB (+0.97%)

Changes

➕ Added Assets (12)
Name Size
.next/static/chunks/a5a0cb3749163fe4.js 39.12 KB
.next/static/chunks/1030a5a482b08816.js 49.96 KB
.next/static/chunks/e3219d434886c066.js 9.46 KB
.next/static/chunks/d167914a48a2b57e.js 48.30 KB
.next/static/chunks/7470414caba241f0.js 118.27 KB
.next/static/chunks/36e40e7a3a72525b.js 135.00 KB
.next/static/chunks/93a1a14fca310be3.js 205.09 KB
.next/static/chunks/19d2c0747254c852.js 118.27 KB
.next/static/chunks/65e054ebaac0fb6f.js 561.44 KB
.next/static/chunks/727706135de32a54.js 118.27 KB
.next/static/chunks/ccec96062a824eff.js 561.44 KB
.next/static/chunks/0b47703056a93d50.js 118.27 KB
➖ Removed Assets (12)
Name Size
.next/static/chunks/142c8025efba9f25.js 42.60 KB
.next/static/chunks/3bddc6770bea2e75.js 46.49 KB
.next/static/chunks/9451cf7726702eea.js 22.82 KB
.next/static/chunks/d30c92f7fd1a5413.js 64.90 KB
.next/static/chunks/9d21ed06a862ee27.js 205.09 KB
.next/static/chunks/cd7a9c7e77c6d4f1.js 134.63 KB
.next/static/chunks/0ca5a898d74e1320.js 101.75 KB
.next/static/chunks/cfe08bb0319e2089.js 101.75 KB
.next/static/chunks/8288238ba8b20c26.js 561.22 KB
.next/static/chunks/6b300a14476c7ff2.js 101.75 KB
.next/static/chunks/74fbea75b8b661b2.js 561.22 KB
.next/static/chunks/7bec94e88ee60b41.js 101.75 KB

@ovflowd
Copy link
Member

ovflowd commented Dec 30, 2025

36.81 KB (+0.97%)

Interestingly the bundle became bigger?

@ovflowd
Copy link
Member

ovflowd commented Dec 30, 2025

Now we have a funny situation, technically speaking these changes (some of them) come from another PR that has been there for days (also the original commit comes from a commit you authored on that same PR). So technically speaking this isn't a fresh PR.

@nodejs/nodejs-website do y'all agree into fast-tracking this? This PR can also sit and wait.

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.

Replace Toast notifications with inline feedback for "Code Copied" action

3 participants