feat(onboarding): link Google 2FA help from Gmail app-password step #115

Merged
JMR-dev merged 2 commits from feat-onboarding-2fa-link into main 2026-07-02 08:29:03 +00:00
JMR-dev commented 2026-07-02 07:37:00 +00:00 (Migrated from github.com)

Summary

The Gmail app-password setup screen's intro text tells the user that Gmail requires 2-Step Verification before an app password can be created, but the only outbound link is the "Create an app password" button, which opens https://myaccount.google.com/apppasswords — the page that itself bounces accounts without 2FA enabled. A user without 2FA gets a dead end.

This adds a second, Gmail-only link to Google's official "Turn on 2-Step Verification" help article so those users have a way to satisfy the prerequisite.

Changes

  • MailProvider: new nullable twoFactorHelpUrl field, set only for Gmail (https://support.google.com/accounts/answer/185839); null for Yahoo/iCloud, which gate nothing on 2FA.
  • AppPasswordSetupScreen: factored the existing UriHandler + runCatching/snackbar open-URL logic into one shared lambda, and added a second OutlinedButton shown only when twoFactorHelpUrl is non-null (i.e. Gmail), directly under the existing app-password button. Browser-open failures route through the same inline snackbar.
  • strings.xml: new app_password_2fa_help following the existing app_password_* naming.
  • Tests: MailProviderTest asserts only Gmail exposes an https 2FA URL (Yahoo/iCloud null); OnboardingFlowTest asserts the Gmail screen shows the 2FA link and a new case asserts the Yahoo screen does not.

Yahoo and iCloud setup screens are unaffected.

Closes #98

🤖 Generated with Claude Code

## Summary The Gmail app-password setup screen's intro text tells the user that Gmail requires 2-Step Verification before an app password can be created, but the only outbound link is the "Create an app password" button, which opens `https://myaccount.google.com/apppasswords` — the page that itself bounces accounts without 2FA enabled. A user without 2FA gets a dead end. This adds a second, Gmail-only link to Google's official "Turn on 2-Step Verification" help article so those users have a way to satisfy the prerequisite. ## Changes - `MailProvider`: new nullable `twoFactorHelpUrl` field, set only for Gmail (`https://support.google.com/accounts/answer/185839`); `null` for Yahoo/iCloud, which gate nothing on 2FA. - `AppPasswordSetupScreen`: factored the existing `UriHandler` + `runCatching`/snackbar open-URL logic into one shared lambda, and added a second `OutlinedButton` shown only when `twoFactorHelpUrl` is non-null (i.e. Gmail), directly under the existing app-password button. Browser-open failures route through the same inline snackbar. - `strings.xml`: new `app_password_2fa_help` following the existing `app_password_*` naming. - Tests: `MailProviderTest` asserts only Gmail exposes an https 2FA URL (Yahoo/iCloud null); `OnboardingFlowTest` asserts the Gmail screen shows the 2FA link and a new case asserts the Yahoo screen does not. Yahoo and iCloud setup screens are unaffected. Closes #98 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.