Skip to content

refactor(web): migrate auth toast calls to ui toast#33744

Merged
lyzno1 merged 2 commits intomainfrom
codex/migrate-toast-direct-calls
Mar 19, 2026
Merged

refactor(web): migrate auth toast calls to ui toast#33744
lyzno1 merged 2 commits intomainfrom
codex/migrate-toast-direct-calls

Conversation

@lyzno1
Copy link
Member

@lyzno1 lyzno1 commented Mar 19, 2026

Motivation

  • Migrate legacy direct Toast.notify(...) usages to the new overlay primitive API so auth flows use @/app/components/base/ui/toast per the overlay migration guide.

Description

  • Replaced imports of the deprecated @/app/components/base/toast with import { toast } from '@/app/components/base/ui/toast' in multiple signin/signup/reset-password/forgot-password and webapp auth pages.
  • Replaced Toast.notify({...}) call sites with toast.add({...}) and mapped legacy message payloads to the new API title field where required.
  • Updated call shapes to the new ToastAddOptions (e.g. type + title) and adjusted small helper wrappers that surfaced message to pass title instead.
  • Pruned obsolete no-restricted-imports suppressions from web/eslint-suppressions.json for the migrated files to reflect removal of legacy imports.

Testing

  • Ran lint and auto-fixes with pnpm -C web lint:fix --prune-suppressions <changed-files> and verified ESLint ran (warnings only) and fixes applied successfully.
  • Performed type checking with pnpm -C web type-check:tsgo and resolved shape mismatches so the type-check completed without errors.
  • Pre-commit hooks (ESLint + type-check) and the repo checks executed as part of the local change flow and passed on the final patch.

@lyzno1 lyzno1 requested review from douxc and iamjoel as code owners March 19, 2026 07:48
Copilot AI review requested due to automatic review settings March 19, 2026 07:48
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 19, 2026
@github-actions github-actions bot added the web This relates to changes on the web. label Mar 19, 2026
@dosubot dosubot bot added javascript Pull requests that update javascript code refactor labels Mar 19, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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

  • Toast API Migration: Migrated legacy Toast.notify(...) calls to the new toast.add(...) API, aligning authentication flows with the updated overlay primitive.
  • Payload Transformation: Mapped the message payload field from the old API to the title field in the new ToastAddOptions structure.
  • ESLint Configuration Update: Pruned obsolete no-restricted-imports suppressions from web/eslint-suppressions.json for the migrated files.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

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

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/toast imports with import { toast } from '@/app/components/base/ui/toast' across signup/signin/reset/forgot-password flows (including shareLayout variants).
  • Updated legacy Toast.notify({ message }) call sites to toast.add({ title }) using the new ToastAddOptions shape.
  • Pruned no-restricted-imports suppressions in web/eslint-suppressions.json for 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
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.86%. Comparing base (79e5253) to head (eb7d18f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ebapp-signin/components/mail-and-password-auth.tsx 0.00% 6 Missing ⚠️
...pp/(shareLayout)/webapp-signin/check-code/page.tsx 0.00% 3 Missing ⚠️
web/app/signup/components/input-mail.tsx 50.00% 1 Missing ⚠️
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     
Flag Coverage Δ
web 77.86% <9.09%> (+<0.01%) ⬆️

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.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 19, 2026
@lyzno1 lyzno1 merged commit ef9803f into main Mar 19, 2026
20 of 21 checks passed
@lyzno1 lyzno1 deleted the codex/migrate-toast-direct-calls branch March 19, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex javascript Pull requests that update javascript code lgtm This PR has been approved by a maintainer refactor size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants