Skip to content

[Internal QA] Add credits balance to subscription settings#87790

Merged
cristipaval merged 14 commits intoExpensify:mainfrom
allgandalf:add-freebie-credits-to-newdot
Apr 20, 2026
Merged

[Internal QA] Add credits balance to subscription settings#87790
cristipaval merged 14 commits intoExpensify:mainfrom
allgandalf:add-freebie-credits-to-newdot

Conversation

@allgandalf
Copy link
Copy Markdown
Contributor

@allgandalf allgandalf commented Apr 13, 2026

Explanation of Change

Surfaces the private_freebieCredits NVP (prepaid credit balance) in NewDot's subscription settings details page, matching existing Classic behavior. When a user has a positive credit balance, a "Credit balance" menu item appears between the Expensify Code and Tax Exempt sections showing the formatted amount.

Depends on Auth PR: https://github.com/Expensify/Auth/pull/21036

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/622655

Tests

  1. Go to https://www.expensify.com.dev/_support/awardCredits
  2. In the "Update Freebie Credits" section, enter the email of the user you will log into NewDot with and assign credits (e.g. 456)
  3. Log into NewDot with that user
  4. Navigate to Settings > Subscription > Subscription details
  5. Verify a "Credit balance" row appears between "Expensify code" and "Request tax exempt status" showing the formatted credit amount (e.g. "$4.56")
  6. Verify it does not appear for accounts with 0 or no credits
  • Verify that no errors appear in the JS console

Offline tests

  1. Award credits to an account using the steps above
  2. Open subscription settings details while online, verify credits display
  3. Go offline
  4. Navigate away and back to subscription settings details
  5. Verify credits still display from cached Onyx data

QA Steps

  1. Go to https://www.expensify.com.dev/_support/awardCredits
  2. In the "Update Freebie Credits" section, enter the email of the test account and assign credits (e.g. 456)
  3. Log into NewDot with that account
  4. Navigate to Settings > Subscription > Subscription details
  5. Verify a "Credit balance" row appears between "Expensify code" and "Request tax exempt status"
  6. Verify it does not appear for accounts with 0 or no credits
  • 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 any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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.
Screenshot 2026-04-15 at 1 10 38 AM Screenshot 2026-04-20 at 2 07 22 PM Screenshot 2026-04-20 at 2 08 22 PM

@allgandalf allgandalf requested review from a team as code owners April 13, 2026 20:16
@melvin-bot melvin-bot Bot requested review from abdulrahuman5196 and joekaufmanexpensify and removed request for a team April 13, 2026 20:16
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented Apr 13, 2026

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented Apr 13, 2026

@abdulrahuman5196 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]

@melvin-bot melvin-bot Bot removed the request for review from a team April 13, 2026 20:16
@allgandalf allgandalf changed the title Add credits balance to subscription settings [Internal QA] Add credits balance to subscription settings Apr 13, 2026
@allgandalf allgandalf removed the request for review from abdulrahuman5196 April 13, 2026 20:21
@allgandalf allgandalf marked this pull request as draft April 13, 2026 20:21
Copy link
Copy Markdown

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

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: ed7b57edc5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/ONYXKEYS.ts Outdated

/** The amount owed by the workspace’s owner. */
NVP_PRIVATE_AMOUNT_OWED: 'nvp_private_amountOwed',
NVP_PRIVATE_AMOUNT_OWED: nvp_private_amountOwed,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Replace smart quotes in ONYX key literal

The string assigned to NVP_PRIVATE_AMOUNT_OWED uses typographic quotes (‘…’) instead of ASCII quotes, which makes src/ONYXKEYS.ts fail to parse (TS1127: Invalid character) and breaks TypeScript builds/tests in every environment. This blocks the app from compiling until the delimiter is changed back to a normal JavaScript string quote.

Useful? React with 👍 / 👎.

Comment thread src/languages/fr.ts Outdated
confirm: 'Supprimer l’(les) espace(s) de travail et rétrograder',
},
viewPaymentHistory: 'Voir l’historique des paiements',
viewPaymentHistory: ‘Voir l’historique des paiements’,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Restore valid quotes in French translation entry

The viewPaymentHistory value in the French locale also uses typographic quotes (‘…’), which is invalid JavaScript/TypeScript syntax and triggers parser errors (TS1127, TS1136) when loading src/languages/fr.ts. Because locales are imported at startup, this breaks builds/runtime initialization universally until corrected.

Useful? React with 👍 / 👎.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/ONYXKEYS.ts 100.00% <ø> (ø)
...ttings/Subscription/SubscriptionSettings/index.tsx 0.00% <0.00%> (ø)
... and 13 files with indirect coverage changes

@allgandalf allgandalf added Internal Requires API changes or must be handled by Expensify staff InternalQA This pull request required internal QA and removed Internal Requires API changes or must be handled by Expensify staff labels Apr 14, 2026
@allgandalf allgandalf requested a review from trjExpensify April 14, 2026 19:43
@allgandalf allgandalf requested review from cristipaval and removed request for joekaufmanexpensify April 14, 2026 19:43
Comment thread src/languages/es.ts
details: {
title: 'Datos de suscripción',
annual: 'Suscripción anual',
creditBalance: 'Saldo de crédito',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@allgandalf allgandalf marked this pull request as ready for review April 14, 2026 19:49
Copy link
Copy Markdown
Contributor

@trjExpensify trjExpensify left a comment

Choose a reason for hiding this comment

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

Good from me on the product change. 👍

Copy link
Copy Markdown
Contributor

@cristipaval cristipaval left a comment

Choose a reason for hiding this comment

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

Code looks good, but given that we're adding a new component, let's

  • ask for @Expensify/design approval
  • Add screenshots for all platforms

@allgandalf
Copy link
Copy Markdown
Contributor Author

Code looks good, but given that we're adding a new component, let's

  • ask for @Expensify/design approval
  • Add screenshots for all platforms

Will do, thanks !

@cristipaval can you trigger adhoc build for this please

@allgandalf
Copy link
Copy Markdown
Contributor Author

label didn't work, i think you need to trigger it :(

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@shawnborton
Copy link
Copy Markdown
Contributor

Screenshot looks good to me 👍

@cristipaval
Copy link
Copy Markdown
Contributor

@allgandalf, could you test all platforms and add the screenshots?

@allgandalf
Copy link
Copy Markdown
Contributor Author

@cristipaval We block showing details of subscription page on Mobile native, i added screenshots showing that , can you please review and test, thanks !

@allgandalf allgandalf requested a review from cristipaval April 20, 2026 08:39
@cristipaval cristipaval merged commit e9ad02d into Expensify:main Apr 20, 2026
36 checks passed
@cristipaval
Copy link
Copy Markdown
Contributor

Thanks @allgandalf

@github-actions
Copy link
Copy Markdown
Contributor

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

@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.

@OSBotify
Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/cristipaval in version: 9.3.61-0 🚀

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

Bundle Size Analysis (Sentry):

@MelvinBot
Copy link
Copy Markdown
Contributor

Yes, help site changes are needed. PR #87790 adds a Credit balance row to Settings > Subscription > Subscription details, but the corresponding help article (Add-a-payment-card-and-view-your-subscription.md) didn't mention it.

I've created a draft PR with the update: #88405

Change: Added a bullet for Credit balance to the "How to manage your subscription details" section, noting it appears only when the account has a positive prepaid credit balance.

Note: I was unable to add the PR to GitHub project 196 due to permissions — please add it manually.

@trjExpensify
Copy link
Copy Markdown
Contributor

Tested a customer account, you can see in #deployers here: https://expensify.slack.com/archives/C07J32337/p1776786820584229?thread_ts=1776769854.658039&cid=C07J32337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

InternalQA This pull request required internal QA Ready To Build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants