Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Nimbus experiment for QR mobile-promo messaging and branch-specific attribution.
Changes:
- Adds nine experiment branches with localized headings and QR mappings.
- Redesigns the promo and expands Glean telemetry.
- Adds component tests and Storybook variants.
Reviewed changes
Copilot reviewed 11 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
configs/nimbus.yaml |
Declares the experiment feature. |
packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml |
Defines telemetry extras. |
packages/fxa-shared/metrics/glean/web/index.ts |
Adds the branch event property. |
packages/fxa-shared/metrics/glean/web/promoQrMobile.ts |
Updates generated event typing. |
packages/fxa-settings/src/lib/glean/index.ts |
Forwards experiment telemetry. |
packages/fxa-settings/src/models/contexts/NimbusContext.ts |
Exports Nimbus context. |
packages/fxa-settings/src/components/PromoQrMobile/branches.ts |
Maps branches to copy and QR assets. |
packages/fxa-settings/src/components/PromoQrMobile/index.tsx |
Implements experiment rendering and reporting. |
packages/fxa-settings/src/components/PromoQrMobile/index.test.tsx |
Tests branches, visibility, and telemetry. |
packages/fxa-settings/src/components/PromoQrMobile/index.stories.tsx |
Adds visual branch scenarios. |
packages/fxa-settings/src/components/PromoQrMobile/en.ftl |
Adds localized experiment copy. |
packages/fxa-settings/src/components/PromoQrMobile/control.svg |
Adds the control QR asset. |
packages/fxa-settings/src/components/PromoQrMobile/treatment-b.svg |
Adds a treatment QR asset. |
packages/fxa-settings/src/components/PromoQrMobile/fox-body.svg |
Adds decorative artwork. |
packages/fxa-settings/src/components/PromoQrMobile/fox-tail.svg |
Adds decorative artwork. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const cmsQr = | ||
| promoQrImageUrl && isValidCmsUrl(promoQrImageUrl) ? promoQrImageUrl : null; | ||
|
|
||
| const feature = experiments?.features?.['promo-qr-mobile']; | ||
| const enrolled = !cmsQr && feature?.['enabled'] === true; |
| GleanMetrics.promoQrMobile.view(); | ||
| GleanMetrics.promoQrMobile.view({ | ||
| event: { | ||
| nimbusUserId: experiments?.nimbusUserId, |
| extra_keys: | ||
| nimbus_user_id: | ||
| description: Nimbus user ID | ||
| type: string | ||
| branch: | ||
| description: The value proposition experiment branch shown to the user |
|
|
||
| <FtlMsg id="promo-qr-mobile-description-v2"> | ||
| <p className="py-1 text-sm text-grey-900 dark:text-grey-100"> | ||
| Scan to download mobile app |
| promoQrMobile.view.record({ | ||
| branch: gleanPingMetrics?.event?.['branch'] || '', | ||
| nimbus_user_id: gleanPingMetrics?.event?.['nimbusUserId'] || '', |
There was a problem hiding this comment.
🟡 Changes recommended
Correct initial exposure recording, resolve the CTA copy decision, and complete the telemetry data review and identifier documentation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
packages/fxa-settings/src/components/PromoQrMobile/index.tsx:62
- Both upstream states start with
loading: falseand only flip to true in effects (NimbusContext.ts:87,125andmodels/hooks.ts:615-630). On the initial render this therefore paints and records the control before either request starts; the promo is then hidden and later swaps to the assigned branch, buthasLoggedViewprevents recording that real exposure. Make the providers report the initial request as pending synchronously (or expose an explicit settled state), and cover the provider-integrated initial render.
// The CMS image decides enrollment, so reporting before it lands would stamp a
// treatment on a user who ends up seeing the CMS control.
const loading = nimbusLoading || cmsLoading;
- Files reviewed: 14/26 changed files
- Comments generated: 2
- Review effort level: Balanced
| nimbus_user_id: | ||
| description: Nimbus user ID | ||
| type: string |
| # Value proposition variant. Refers to a calmer browsing experience on the phone. | ||
| promo-qr-mobile-heading-treatment-h = Take a calmer way to browse with you | ||
| # Appears below a QR code that a user can scan to download the Firefox mobile app | ||
| promo-qr-mobile-description-v2 = Scan to download mobile app |
| variants: | ||
| control: | ||
| description: Control. | ||
| treatment-a: |
There was a problem hiding this comment.
Why do these have over lapping descriptions. e.g. a & b are the same?
There was a problem hiding this comment.
Let me clean this up, it is what appears in nimbu sto give description of the treatment. I will also add text of what is in the QR.
| setExperiments({ | ||
| features: features, | ||
| nimbusUserId: uniqueUserId, | ||
| // The ID Cirrus enrolled with, not uniqueUserId: analysis joins |
There was a problem hiding this comment.
I'm not sure what 'analysis' means in this context.
| 'mobile_device_count', | ||
| 'supported', | ||
| 'has_passkey_option', | ||
| 'branch', |
There was a problem hiding this comment.
should this be more explicit? This refers to the branch of the nimbus experiment right?
Because: - The mobile download rate from desktop auth traffic needs a lift, and no FxA Nimbus experiment has run before. - The updated promo design makes room for the longer headings the test needs. This commit: - Declares promo-qr-mobile in the FML, with branch typed as a BranchSlug enum so Experimenter rejects a misspelled arm instead of serving the control. - Names each enum variant by its value proposition and CTA, so the nine arms are distinguishable in the Experimenter form. - Adds 9 literal FTL heading ids and a per-branch QR, resolved at runtime. - Rebuilds the promo to the updated design: no logo, CTA below the QR, and real fox vectors in place of the 230KB kit. - Reports branch and nimbus_user_id on promo_qr_mobile.view, and holds the render until Nimbus and the CMS both resolve.
Because
This pull request
promo-qr-mobilefeature inconfigs/nimbus.yamlwith two variables,enabledandbranch. Every channel defaults to the control, so a Cirrus failure is a no-opbranches.ts, mapping each branch slug to its heading and its own QR code. One slug drives both, because each QR scans to a distinct Bitly link and a mismatched pair would misattribute the download. An unknown slug falls back to the controlen.ftlso l10n extraction finds them, and picks one at runtime withuseFtlMsgResolver. The CTA moves below the QR and changes wording, so it takes a newpromo-qr-mobile-description-v2idindex.tsxto the updated design. Drops the logo above the heading, since the Bitly QR already embeds the Firefox glyph. Replaces the 230KBqr-mobile-kit.svgwithfox-body.svg,fox-tail.svg, and a per-branch QR, roughly a 10x reductionbranchandnimbus_user_idextra keys topromo_qr_mobile.view. Cirrus reports enrollment itself, so the app must stampnimbus_user_idon its own events for analysis to join themNimbusContextso tests and stories can supply a branch without a network fetchIssue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-14273
Checklist
Other information
npx jest src/components/PromoQrMobile: 52 passed, 0 failed.npx jest src/lib/glean src/models/contexts: 188 passed, 0 failed.How to test:
NIMBUS_ENABLED=truein the root.envand bring up infrastructure so thecirruspm2 process runsaccounts.cirrus, featurepromo-qr-mobile, 9 branches?nimbusPreview=trueat 1024px or wider, on/,/signin, or/signuppromo_qr_mobile.viewcarriesbranchandnimbus_user_idBranch records come from Remote Settings, so enrollment cannot be hand-authored locally. Storybook has
Control,TreatmentB, andTreatmentAstories covering 1, 2, and 3-line headings without a Nimbus fetch.Needs a decision before merge: the CTA reads "Scan to download mobile app" per the Figma design, but the ticket table says "Scan to get the app" in all 9 rows. The CTA is constant across branches so it does not confound the experiment, but it does change shipped copy in every branch including the control.
Needs data review: the two new Glean extra keys.