Skip to content

Replace user-facing "Magic code" copy with "Security code"#96181

Merged
NikkiWines merged 8 commits into
mainfrom
claude-magicCodeToSecurityCopy
Jul 22, 2026
Merged

Replace user-facing "Magic code" copy with "Security code"#96181
NikkiWines merged 8 commits into
mainfrom
claude-magicCodeToSecurityCopy

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This is a front-end copy-only change: it renames every user-facing "Magic code" reference to "Security code" across NewDot (sign-in, onboarding, one-time verification gates, per-action confirmations, and error messages).

Per the internationalization workflow, src/languages/en.ts is the single source of truth and every other locale file is auto-generated. So this PR edits only src/languages/en.ts (26 string values). The Generate static translations workflow runs automatically on PRs that touch en.ts and will regenerate de/es/fr/it/ja/nl/pl/pt-BR/zh-hans from the updated English source.

Only string values were changed — translation keys (magicCode, enterMagicCode, etc.), routes (.../confirm-magic-code), component names (MagicCodeInput), and code identifiers are intentionally left unchanged, since those are not user-facing and changing them would be a behavior change (out of scope).

Fixed Issues

$ #96180
PROPOSAL:

Tests

Nagivated through the app and confirmed references to magic codes were replaced with security codes

  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

N/A Copy Update
// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: Lauren <laurenreidexpensify@users.noreply.github.com>
@OSBotify

This comment has been minimized.

Co-authored-by: Lauren <laurenreidexpensify@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed the failing Oxfmt check and pushed to the branch.

What was failing: oxfmt --write . produced a diff on src/languages/en.ts, so the "Verify there's no Oxfmt diff" step failed. Renaming "Magic code""Security code" pushed the revoke.explanation string from 188 to 191 characters, crossing the 190 printWidth. Oxfmt then wraps the value onto its own line:

explanation:
    'Face/fingerprint or passkey verification are enabled on one or more devices. Revoking access will require a security code for the next verification on that device.',

I ran oxfmt 0.55.0 (the pinned version) locally, committed only that reformat, and pushed — the check should pass on the next run.

Still red — but not code-related: the checklist failure is the PR Author Checklist, which just needs a human to tick the boxes in the PR description. I can't complete that on your behalf.

@OSBotify

This comment has been minimized.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

👋 I looked into the failing checks. The only check that's actually failing is PR Author Checklist / checklist, and it's failing for a non-code reason — there's nothing in the diff to fix.

Why it fails: the check reports You completed 0 out of 38 checklist items with 38 unfinished items. The author checklist boxes in the PR description just aren't ticked. It's a known non-blocking check that always fails on MelvinBot-authored PRs.

Why there's no code fix: this PR only changes src/languages/en.ts — pure English copy (Magic codeSecurity code). Every substantive check passes (Bun tests, all 8 Jest test shards, ESLint, Oxfmt, generateTranslations, spellcheck, Storybook, knip, etc.), and no test asserts on the changed strings. typecheck and the perf-test jobs were still running when I checked, but a copy-only change can't affect typing or render performance.

To make it green: the author checklist is meant to be completed by a human author, so I didn't auto-tick it. Please review and check the boxes in the PR description (or confirm you'd like me to). It won't block review or merge either way.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Following up — the status is unchanged, and there's still no code fix to push.

The single red check is PR Author Checklist / checklist (You completed 0 out of 38 checklist items). It's failing purely because the author-checklist boxes in the PR description are unticked — not because of anything in the diff. This PR only changes English copy in src/languages/en.ts, and every substantive check passes (Bun tests, all 8 Jest test shards, ESLint, Oxfmt, generateTranslations, spellcheck, Storybook, knip). typecheck and the perf-test jobs were still running, but a copy-only change can't affect typing or performance.

To turn it green: the author checklist is a human-author responsibility (it attests to manual testing/QA), so I can't complete it on your behalf. Please review and tick the boxes in the PR description. Once they're checked, the checklist job will re-run and pass — it won't block review or merge in the meantime.

@laurenreidexpensify

Copy link
Copy Markdown
Contributor

@NikkiWines @chuckdries could you take a look here when you have a moment?

This PR is now just focused on the front end copy, but it feels like we should probably also change the constants - eg

magicCode: 'Security code',

do you see any reason why we couldn't update magicCode to securityCode for example?

@NikkiWines

NikkiWines commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@laurenreidexpensify yeah securityCode works there since that is specifically for the copy "Security code" 👍

@NikkiWines

NikkiWines commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Noting here that we have a bunch of components and files that use MagicCode in them (E.g. MagicCodeInput.tsx, ChooseSSOOrMagicCodeProps and variable names like setIsUsingMagicCode etc.

Those should all use our internal term, validateCode (you can see we already have a mix of terminology in the front end). "Magic Code" was always just supposed to be a marketing term, but things have diverged 😵‍💫

However, to keep things simpler, let's update the user-facing copy to use security code (and update the language/ consts as well to use that term), and then after that's updated, we can do a find and replace for magicCode in the App to update files, components, and variable names to use validateCode accordingly.

thoughts cc: @laurenreidexpensify @chuckdries

@chuckdries

Copy link
Copy Markdown
Contributor

I agree, let's tackle the user facing localization strings separately from renaming all the source code files and constants, since doing that refactor is riskier and has no user-visible benefit

@laurenreidexpensify
laurenreidexpensify marked this pull request as ready for review July 16, 2026 09:26
@laurenreidexpensify
laurenreidexpensify requested review from a team as code owners July 16, 2026 09:26
@melvin-bot
melvin-bot Bot requested review from trjExpensify and removed request for a team July 16, 2026 09:26
@laurenreidexpensify

Copy link
Copy Markdown
Contributor

Okay @Pujan92 over to you to review Melvin's code and get us ready for merge here please :)

@melvin-bot
melvin-bot Bot requested review from justinpersaud and removed request for a team July 16, 2026 09:26
@melvin-bot

melvin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

@justinpersaud Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6aa5268851

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/languages/en.ts Outdated
@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only failing checks are the two checklist checks, and there's nothing for me to fix in code here:

  • PR Author Checklist / checklistrun
  • PR Reviewer Checklist / checklistrun

These aren't CI/build failures — they fail by design until the checkboxes in the PR body (Author) and the reviewer's checklist (Reviewer) are ticked off. Every actual code/build/test check is green (Bun tests, ESLint, Oxfmt, typecheck, test jobs 1–8, generateTranslations, Storybook, perf, builds, etc.).

To turn these green: the PR author needs to complete the PR Author Checklist (fill in the Tests/QA Steps sections — or add [No QA] to the title if QA doesn't apply — and check the boxes), and the reviewer needs to complete their checklist. Pushing a commit won't clear them; a human has to fill them out.

@NikkiWines

Copy link
Copy Markdown
Contributor

taking over for justin since i have context

@NikkiWines
NikkiWines requested review from NikkiWines and removed request for justinpersaud July 16, 2026 12:47
@Pujan92

Pujan92 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot merge main and fix conflicts

@melvin-bot

melvin-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

I can't run change requests for your access level. I can investigate, or file an issue in Expensify/Expensify instead.


Failed after 0s · 0 tools used · view debug log

@NikkiWines

Copy link
Copy Markdown
Contributor

taking over implementing the code changes since it's getting a bit hairy to do via the GH UI.

@NikkiWines NikkiWines self-assigned this Jul 21, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Claude's API is currently overloaded (HTTP 529). This is a temporary issue on Anthropic's side. Try again in a few minutes, or check status.anthropic.com.

Run details

@Pujan92

Pujan92 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
96181-04-backend-still-says-magic-code

Are we going to update BE error later?

Co-authored-by: Nikki Wines <NikkiWines@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only real failure was ESLint check, and it was a transient CI infrastructure failure — not a problem with this PR's code.

What happened: ESLint crashed with ERR_WORKER_OUT_OF_MEMORY ("Worker terminated due to reaching memory limit: JS heap out of memory") on ESLint 9.36.0. It retried after clearing its cache and OOM'd again, so linting never actually ran to completion. This is unrelated to the changes here, which only edit string values in src/languages/en.ts.

The other failing check, PR Author Checklist / checklist, is an author-completed checklist and isn't a code issue.

Fix: I pushed an empty commit to re-trigger the checks. gh run rerun isn't available to me in this environment, so a no-op commit was the way to re-queue CI. If ESLint OOMs again on the re-run, that points to a CI runner memory limit rather than anything in this PR.

@NikkiWines

Copy link
Copy Markdown
Contributor

Are we going to update BE error later?

yes, eventually 🏃

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I analyzed the checks — there's no code fix to push. Every substantive check is green; the only failing check is the PR Author Checklist, which fails only because the checklist boxes in the PR description haven't been ticked yet. That's a manual author step, not a code problem.

Failing:

  • PR Author Checklist / checklist"PR Author Checklist is not completely filled out. Please check every box." Ticking the boxes in the PR body will clear it.

Passing: typecheck, ESLint check, all test jobs, generateTranslations, spellcheck, Storybook tests, Oxfmt check, React Compiler Compliance, validateSchemas, Bun tests, Compare knip issues against main, actionlint, verifySignedCommits, dryRun, and more.

Still running (unrelated to a fix): the two Android build (...) jobs and validate-perf-tests. These are infra-bound native builds / perf comparisons — a copy-only string change can't affect them, and typecheck already passed with no dangling translation-key references.

Since this is a copy-only change (en.ts values plus consistent magicCodesecurityCode key renames, with all usages updated across src/ and tests/), I didn't find anything that requires a code change. Let me know if you'd like me to dig into any specific check.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only failing check is PR Author Checklist / checklist, and it can't be fixed with a code push — it fails because the checklist boxes in the PR description aren't checked:

You completed 0 out of 38 checklist items with 38 unfinished items
##[error]PR Author Checklist is not completely filled out. Please check every box to verify you've thought about the item.

Every other check is passing (the one remaining build (developmentDebug, false) is still in progress, not failed).

What's needed: This is a human action. Please fill in the Tests / QA Steps sections and check off the boxes in the PR Author Checklist (or add [No QA] to the title if QA doesn't apply), then the check will re-run and pass. I didn't push any code since there's no code-level failure to fix here.

@NikkiWines

Copy link
Copy Markdown
Contributor

@Pujan92 and @chuckdries would you mind giving this a review? 🙇

@chuckdries chuckdries left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Regarding error handling, looks like we actually do use locale strings for security code errors in some flows, but not others. Would be cool to standardize, but that's definitely out of scope for this change!

@Pujan92 Pujan92 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes looks good to me!

@melvin-bot

melvin-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #96180 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@chuckdries

Copy link
Copy Markdown
Contributor

Looks like we just need an assignee to fill out the author checklist and QA steps

@NikkiWines
NikkiWines dismissed their stale review July 22, 2026 16:09

it's my own review

@NikkiWines
NikkiWines merged commit 75cd994 into main Jul 22, 2026
45 of 47 checks passed
@NikkiWines
NikkiWines deleted the claude-magicCodeToSecurityCopy branch July 22, 2026 16:09
@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only failing check is PR Author Checklist / checklist, and there's nothing to push a fix for:

  • It's not a CI/code failure. The check just verifies the PR body's author checklist boxes are ticked — it failed on the very first commit with You completed 0 out of 38 checklist items before the boxes were filled in. It can't be fixed by a code change.
  • A later run of the same check already passed (run 29936727589) once the checklist was completed. The stale failing entry is from the original run.
  • This PR is already merged. Every substantive check (tests, typecheck, ESLint, generateTranslations, Storybook, perf, builds) passed.

No action needed — the failing entry is a leftover from before the checklist was filled out, not a real failure.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 NikkiWines has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/NikkiWines in version: 9.4.43-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Help site changes required ✅

This PR renamed user-facing "Magic code" → "Security code" across NewDot, so the New Expensify help articles that still reference "magic code" no longer match the live UI. I've drafted the doc updates.

Draft PR: #96793

What changed

Updated 10 new-expensify/ articles (settings, domains, expensify-card) to use security code in prose and Security code as labels/headings, matching the exact new UI strings in src/languages/en.ts (including button labels like Didn't receive a security code? and Use security code).

Expensify Classic articles were intentionally left unchanged — this PR only touched NewDot copy, so Classic still correctly says "Magic Code".

⚠️ One thing to verify

This source PR was frontend-only and did not touch backend email templates. A couple of doc references describe the login-code email itself (e.g. "Search for Expensify security code" in Login-Troubleshooting.md). I updated them for consistency, but please confirm the actual login-code email subject now says "security code" before merging — details are called out in the draft PR body.


@NikkiWines, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.43-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.

7 participants