-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(ui): add NotificationProvider #7967
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 moves the NotificationProvider
(and its hook) into the ui-components
package, removes outdated site‐specific implementations/tests, and updates the site app to consume the shared provider.
- Introduce
NotificationProvider
anduseNotification
inui-components
- Remove local
notificationProvider
and hook implementations/tests from the site app - Update site app to import and use the new provider/hook and clean up obsolete dependencies
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/ui-components/src/Providers/NotificationProvider.tsx | Implement shared NotificationProvider and useNotification hook |
packages/ui-components/src/Providers/tests/NotificationProvider.test.jsx | Add tests for useNotification behavior within and outside the provider |
apps/site/package.json | Remove now-unnecessary @radix-ui/react-toast dependency |
apps/site/layouts/Base.tsx | Switch import to use NotificationProvider from ui-components |
apps/site/components/Common/CodeBox.tsx | Remove obsolete site-specific useNotification import |
apps/site/hooks/react-client/index.ts | Remove useNotification export |
apps/site/hooks/react-server/index.ts | Remove useNotification export |
apps/site/hooks/react-client/useNotification.ts (deleted) | Delete local client hook implementation |
apps/site/hooks/react-server/useNotification.ts (deleted) | Delete local server hook stub |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)
packages/ui-components/src/Providers/tests/NotificationProvider.test.jsx:3
- The test is importing
describe
andit
fromnode:test
while using@testing-library/react
. Consider using your test runner's globaldescribe
/it
(e.g., Jest) or adjust your setup to avoid mixing frameworks.
import { describe, it } from 'node:test';
packages/ui-components/src/Providers/tests/NotificationProvider.test.jsx:32
- This test expects
useNotification()
outside the provider to return null, but the default context value for dispatch is a no-op function (truthy). Update the test to match the implementation or change the default context tonull
.
it('should return null outside NotificationProvider', () => {
apps/site/components/Common/CodeBox.tsx:6
- The imported
useNotification
hook is not used in this file. Consider removing the unused import to clean up the code.
import { useNotification } from '@node-core/ui-components/Providers/NotificationProvider';
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #7967 +/- ##
==========================================
- Coverage 73.66% 73.03% -0.64%
==========================================
Files 96 95 -1
Lines 8354 8347 -7
Branches 220 218 -2
==========================================
- Hits 6154 6096 -58
- Misses 2199 2250 +51
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Ref: nodejs/api-docs-tooling#285 (comment)
This moves the NotificationProvider into
ui-components
so it can be used in our documentation generator