Repository navigation
feat(client): migrate notifications from react-toastify to coss-ui toast - #3
Conversation
- init shadcn CLI in JS mode (components.json tsx:false, @ alias, cn helper) - re-map index.css tokens to site palette; add Matrix toast keyframes - wire ToastProvider + AnchoredToastProvider in App.jsx (top-center) - route all toasts through components/notification.js (showToast + toast helpers); migrate Login/Register/Profile imports - remove react-toastify dependency
|
@Sumitr995 is attempting to deploy a commit to the omamberkar's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
This PR migrates the client’s notification system away from react-toastify to a new toast implementation built on @base-ui/react (aligned with the “coss-ui toast” / shadcn setup), while also introducing shadcn-related tooling and design tokens to support the new UI components.
Changes:
- Replace
react-toastifyusage with a centralized toast API (components/notification.js) backed by@base-ui/react/toast, and wire providers intoApp.jsx. - Add shadcn/base UI utilities and components (toast, button, spinner,
cn()helper) plus Vite@alias support. - Update global styles/tokens and add toast animation keyframes.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| client/vite.config.js | Adds @ alias resolution for Vite to support new absolute imports. |
| client/src/pages/Register.jsx | Switches toast import to the new notification wrapper. |
| client/src/pages/Profile.jsx | Switches toast import to the new notification wrapper. |
| client/src/pages/Login.jsx | Switches toast import to the new notification wrapper. |
| client/src/lib/utils.js | Adds cn() helper for class merging (clsx + tailwind-merge). |
| client/src/index.css | Adds shadcn/tw-animate imports, updates tokens, and introduces toast animation keyframes. |
| client/src/components/ui/toast.jsx | Introduces Base UI toast providers and rendering (standard + anchored). |
| client/src/components/ui/spinner.jsx | Adds a lucide-based spinner component used by buttons/toasts. |
| client/src/components/ui/button.jsx | Adds a Base UI-compatible button with variants and loading state. |
| client/src/components/notification.js | Replaces react-toastify wrapper with toastManager-backed helpers (showToast, toast.*). |
| client/src/App.jsx | Replaces ToastContainer with ToastProvider + AnchoredToastProvider. |
| client/package.json | Adds Base UI + shadcn dependencies and removes react-toastify. |
| client/jsconfig.json | Adds @/* path mapping for JS tooling/editor support. |
| client/components.json | Adds shadcn CLI configuration and registry/alias mappings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (3)
client/src/components/ui/toast.jsx:62
z-60andmax-w-90are not part of Tailwind's default utility set (and there is no Tailwind config in this repo to extend them), so these classes will be ignored and the viewport may end up with the wrong stacking/width. Use arbitrary values (or standard utilities) so the generated CSS is guaranteed.
className={cn(
"fixed z-60 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] max-w-90 [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]",
// Vertical positioning
client/src/components/ui/toast.jsx:225
- Same issue as the non-anchored toast:
toast.actionPropsisn't spread intoToast.Action, so any handlers/attributes provided for the action are dropped.
{toast.actionProps && (
<Toast.Action className={buttonVariants({ size: "xs" })} data-slot="toast-action">
{toast.actionProps.children}
</Toast.Action>
client/src/components/ui/toast.jsx:150
toast.actionPropsis checked and its children are rendered, but the props themselves (e.g., onClick/aria attributes) are never passed toToast.Action, so actions won't behave as intended. Spreadtoast.actionPropsintoToast.Action(and do the same in the anchored variant).
This issue also appears on line 222 of the same file.
{toast.actionProps && (
<Toast.Action className={buttonVariants({ size: "xs" })} data-slot="toast-action">
{toast.actionProps.children}
</Toast.Action>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pull request was converted to draft
Pull request was closed
|
The login and register was not functioning, need to work on that part with the proper fix before merge |
init shadcn CLI in JS mode (components.json tsx:false, @ alias, cn helper)
re-map index.css tokens to site palette; add Matrix toast keyframes
wire ToastProvider + AnchoredToastProvider in App.jsx (bottom-right)
route all toasts through components/notification.js (showToast + toast helpers); migrate Login/Register/Profile imports
remove react-toastify dependency