refactor(web): migrate auth toast calls to ui toast#33744
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the web application's authentication-related pages and components to use a new, standardized toast notification system. The change involves updating import paths and method calls for toast messages across various sign-in, sign-up, and password reset flows, ensuring consistency and adherence to the latest UI primitive API. This migration improves maintainability and aligns the codebase with current best practices for displaying user feedback. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a solid refactoring that successfully migrates legacy Toast.notify calls to the new toast.add API across various authentication flows. The changes are consistent, correctly mapping the message property to title, and the cleanup of ESLint suppressions is a welcome improvement. I've identified a few instances where error messages are hardcoded, and I've suggested using the i18n translation mechanism to enhance maintainability and internationalization.
There was a problem hiding this comment.
Pull request overview
Migrates auth-related pages from the legacy Toast.notify(...) API to the new overlay-based toast manager (@/app/components/base/ui/toast) and cleans up ESLint suppression entries that were only needed for the deprecated imports.
Changes:
- Replaced deprecated
@/app/components/base/toastimports withimport { toast } from '@/app/components/base/ui/toast'across signup/signin/reset/forgot-password flows (including shareLayout variants). - Updated legacy
Toast.notify({ message })call sites totoast.add({ title })using the newToastAddOptionsshape. - Pruned
no-restricted-importssuppressions inweb/eslint-suppressions.jsonfor the migrated files.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| web/eslint-suppressions.json | Removes now-unneeded no-restricted-imports suppressions for auth pages after migrating off the deprecated toast module. |
| web/app/signup/set-password/page.tsx | Migrates error/success toasts to toast.add({ type, title }). |
| web/app/signup/components/input-mail.tsx | Migrates validation toasts to toast.add. |
| web/app/signup/check-code/page.tsx | Migrates verification toasts to toast.add. |
| web/app/signin/normal-form.tsx | Migrates error toast display to toast.add. |
| web/app/signin/components/sso-auth.tsx | Migrates invalid-protocol toast to toast.add. |
| web/app/signin/components/mail-and-code-auth.tsx | Migrates email validation toasts to toast.add. |
| web/app/signin/check-code/page.tsx | Migrates code validation toasts to toast.add. |
| web/app/reset-password/set-password/page.tsx | Migrates error toasts to toast.add. |
| web/app/reset-password/page.tsx | Migrates validation and API error toasts to toast.add. |
| web/app/reset-password/check-code/page.tsx | Migrates code validation toasts to toast.add. |
| web/app/forgot-password/ChangePasswordForm.tsx | Migrates error toasts to toast.add. |
| web/app/(shareLayout)/webapp-signin/components/sso-auth.tsx | Migrates redirect/protocol error toasts to toast.add. |
| web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx | Migrates validation/auth-failure toasts to toast.add. |
| web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx | Migrates email validation toasts to toast.add. |
| web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx | Migrates helper toast function to toast.add. |
| web/app/(shareLayout)/webapp-signin/check-code/page.tsx | Migrates code/redirect validation toasts to toast.add. |
| web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx | Migrates error toasts to toast.add. |
| web/app/(shareLayout)/webapp-reset-password/page.tsx | Migrates validation and API error toasts to toast.add. |
| web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx | Migrates code validation toasts to toast.add. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #33744 +/- ##
=======================================
Coverage 77.85% 77.86%
=======================================
Files 3031 3031
Lines 69500 69500
Branches 20376 20376
=======================================
+ Hits 54110 54116 +6
+ Misses 15390 15384 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Motivation
Toast.notify(...)usages to the new overlay primitive API so auth flows use@/app/components/base/ui/toastper the overlay migration guide.Description
@/app/components/base/toastwithimport { toast } from '@/app/components/base/ui/toast'in multiple signin/signup/reset-password/forgot-password and webapp auth pages.Toast.notify({...})call sites withtoast.add({...})and mapped legacymessagepayloads to the new APItitlefield where required.ToastAddOptions(e.g.type+title) and adjusted small helper wrappers that surfacedmessageto passtitleinstead.no-restricted-importssuppressions fromweb/eslint-suppressions.jsonfor the migrated files to reflect removal of legacy imports.Testing
pnpm -C web lint:fix --prune-suppressions <changed-files>and verified ESLint ran (warnings only) and fixes applied successfully.pnpm -C web type-check:tsgoand resolved shape mismatches so the type-check completed without errors.