Skip to content

chore(toast): migrate from react-hot-toast to sonner and remove shared toast library#2632

Merged
TheoGrandin74 merged 4 commits intonew-navigationfrom
feat/migration-sonner
Apr 29, 2026
Merged

chore(toast): migrate from react-hot-toast to sonner and remove shared toast library#2632
TheoGrandin74 merged 4 commits intonew-navigationfrom
feat/migration-sonner

Conversation

@TheoGrandin74
Copy link
Copy Markdown
Contributor

@TheoGrandin74 TheoGrandin74 commented Apr 27, 2026

Summary

  • Removed the deprecated react-hot-toast dependency and replaced it with sonner for toast notifications.
  • Updated toast usage across the application to align with the new library's API.
  • Deleted the shared/toast library as it is no longer needed.
  • Adjusted toast error handling to simplify parameters and improve functionality.

Video

Screenshots / Recordings

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 44.73684% with 21 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (new-navigation@d9adfb2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ai-copilot-config/use-update-ai-copilot-config.tsx 0.00% 3 Missing ⚠️
...ared/ui/src/lib/components/toast/toast.stories.tsx 0.00% 3 Missing ⚠️
...b/hooks/use-create-variable/use-create-variable.ts 0.00% 2 Missing ⚠️
...ring-task/use-delete-ai-copilot-recurring-task.tsx 0.00% 2 Missing ⚠️
...ring-task/use-toggle-ai-copilot-recurring-task.tsx 0.00% 2 Missing ⚠️
...ture/src/lib/cluster-terminal/cluster-terminal.tsx 0.00% 1 Missing ⚠️
...ronment/use-cancel-deployment-queue-environment.ts 0.00% 1 Missing ⚠️
.../alert-rules-action-bar/alert-rules-action-bar.tsx 0.00% 1 Missing ⚠️
.../src/lib/onboarding-project/onboarding-project.tsx 0.00% 1 Missing ⚠️
...src/lib/settings-members/row-member/row-member.tsx 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@                Coverage Diff                @@
##             new-navigation    #2632   +/-   ##
=================================================
  Coverage                  ?   44.90%           
=================================================
  Files                     ?     1137           
  Lines                     ?    23789           
  Branches                  ?     6901           
=================================================
  Hits                      ?    10683           
  Misses                    ?    11233           
  Partials                  ?     1873           
Flag Coverage Δ
unittests 44.90% <44.73%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TheoGrandin74 TheoGrandin74 force-pushed the feat/migration-sonner branch from 1a2f200 to 99729c0 Compare April 27, 2026 15:26
Comment thread libs/shared/ui/src/lib/utils/toast.tsx Outdated
Comment thread libs/shared/ui/src/lib/components/toast/toast.tsx Outdated
Comment thread libs/shared/ui/src/lib/components/toast/toast.tsx Outdated
Comment thread libs/shared/ui/src/lib/components/toast/toast.spec.tsx Outdated
Copy link
Copy Markdown
Member

@RemiBonnet RemiBonnet left a comment

Choose a reason for hiding this comment

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

LGTM 👍
I feel it’s a bit too slow, I wonder if you could improve how fast it appear and disappear 🤔

@TheoGrandin74 TheoGrandin74 merged commit 4ccc25f into new-navigation Apr 29, 2026
11 checks passed
@TheoGrandin74 TheoGrandin74 deleted the feat/migration-sonner branch April 29, 2026 13:18
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.

2 participants