Skip to content

feat(settings): add Firefox mobile install/switch promo banner#20777

Open
vbudhram wants to merge 1 commit into
mainfrom
fxa-13220
Open

feat(settings): add Firefox mobile install/switch promo banner#20777
vbudhram wants to merge 1 commit into
mainfrom
fxa-13220

Conversation

@vbudhram

@vbudhram vbudhram commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Because

  • FxA settings should nudge users toward Firefox: install it on mobile when they’re already on Firefox desktop, or switch to Firefox when they’re on another browser.

This pull request

  • Adds FirefoxPromoBanner with two variants (connect-mobile, switch-to-Firefox), a pure bannerState.ts selector, Storybook story, FTL strings, and SVG art (kit-mirror.svg, heart-foxes.svg).
  • Gates the desktop Firefox “Connect a device” variant on the browser’s Sync sign-in state; threads isSignedIntoFirefox from AppSettingsRoutesSettingsPageSettings → banner, reusing the existing WebChannel fxa_status result.
  • Wires the banner into PageSettings with the shared promo-dismissal pattern; recovery promos take over when the Firefox promo is suppressed.

Behavior matrix

Browser Device Signed into browser? Banner CTA → target
Firefox Desktop Signed in ✅ Shown Connect a device → /pair
Firefox Desktop Signed out ❌ Hidden
Firefox Mobile Either ❌ Hidden — (app already installed)
Non-Firefox Desktop N/A ✅ Shown Switch to Firefox → firefox.com/en-US
Non-Firefox Mobile N/A ✅ Shown Switch to Firefox → app store*

Glean metrics

Event Glean id Fires when Extra
connectMobileView firefox_promo.connect_mobile_view Banner shown (signed-in desktop Firefox) mobile_device_count
connectMobileSubmit firefox_promo.connect_mobile_submit “Connect a device” clicked mobile_device_count
connectMobileDismiss firefox_promo.connect_mobile_dismiss Banner dismissed (Firefox variant) mobile_device_count
switchToFirefoxView firefox_promo.switch_to_firefox_view Banner shown (non-Firefox) mobile_device_count
switchToFirefoxSubmit firefox_promo.switch_to_firefox_submit “Switch to Firefox” clicked mobile_device_count
switchToFirefoxDismiss firefox_promo.switch_to_firefox_dismiss Banner dismissed (switch variant) mobile_device_count

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-13220

Checklist

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

Other information

How to test:

  1. Firefox signed into Sync → Settings → “Get Firefox wherever you are” / “Connect a device” → /pair.
  2. Firefox not signed into the browser → banner hidden (a recovery promo may show instead).
  3. Non-Firefox desktop → “Fast to switch…” / “Switch to Firefox” → firefox.com.
  4. Verified locally: glean-lint, build-ts, full unit suites, and 5/5 functional Playwright tests pass.

@vbudhram vbudhram requested review from a team as code owners June 22, 2026 16:25
@vbudhram vbudhram force-pushed the fxa-13220 branch 3 times, most recently from 2442e81 to b4917e5 Compare June 23, 2026 16:12
@vbudhram vbudhram self-assigned this Jun 23, 2026
Because:

* Firefox Accounts settings should encourage users to install Firefox on
  mobile (when already signed into Firefox on desktop) or switch to
  Firefox (when on another browser), with the variant chosen by the
  user's browser, device, and Sync sign-in state.
* Validating the feature needs a full per-variant funnel: view, CTA
  submit, and dismiss.

This commit:

* Adds the FirefoxPromoBanner component with connect-mobile and
  switch-to-Firefox variants, presentational banner state, Storybook
  story, FTL strings, and SVG artwork (kit-mirror, heart-foxes).
* Gates the desktop Firefox "connect a device" variant on the browser's
  Sync sign-in state; threads isSignedIntoFirefox from App through
  SettingsRoutes, Settings, and PageSettings, reusing the existing
  WebChannel result. Non-Firefox users are unaffected.
* Wires the banner into PageSettings with the shared promo dismissal
  pattern; recovery promos take over when the Firefox promo is hidden.
* Adds six firefox_promo Glean events (view, submit, dismiss for each
  variant), each carrying a mobile_device_count extra, generated from
  fxa-ui-metrics.yaml. Dismiss fires from an explicit handler, replacing
  a non-functional data-glean-id.
* Adds unit tests for banner state, component, PageSettings ordering, and
  Glean wiring, plus a functional test that simulates the browser Sync
  session over WebChannel.
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