Skip to content

[Home Page] Add Remaining limit slot for the Expensify Card#82772

Merged
mountiny merged 8 commits intoExpensify:mainfrom
software-mansion-labs:home-page/assigned-cards-section
Feb 20, 2026
Merged

[Home Page] Add Remaining limit slot for the Expensify Card#82772
mountiny merged 8 commits intoExpensify:mainfrom
software-mansion-labs:home-page/assigned-cards-section

Conversation

@WojtekBoman
Copy link
Contributor

@WojtekBoman WojtekBoman commented Feb 18, 2026

Explanation of Change

This PR introduces a new widget on the home page that displays the user's assigned cards. Each card shows its title, last four digits, formatted remaining spend with currency, and a circular SVG progress indicator visualizing how much of the card limit has been used.

Fixed Issues

$ #81526
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Prerequisites

  • Log in with an account that has at least one assigned Expensify card with an active state and a spending limit set.

Visibility

  1. Navigate to the Home page.
  2. Verify the "Assigned cards" section appears in the right column on wide screens, or below other sections on narrow screens.
  3. Log in with an account that has no assigned cards and verify the section is not shown.

Card content

  1. For each displayed card, verify the description shows the card name followed by the last four digits (e.g. "Physical card 1234").
  2. Verify the bold title shows the remaining spend amount with a currency symbol followed by "remaining" (e.g. "$9,201.54 remaining").
  3. Verify the card icon on the left has rounded corners and is vertically centered in the row.

Remaining limit circle

  1. For a card that has a spending limit configured, verify a circular progress indicator appears to the left of the chevron arrow.
  2. Verify the green arc of the circle reflects how much of the limit is still available.
  3. For a card without a spending limit, verify the circle is not shown.

Hover behavior

  1. Hover over a card row and verify the chevron arrow changes color.
  2. Verify the color change happens when hovering anywhere on the row, not just on the arrow itself.

Navigation

  1. Click/tap on a card row.
  2. Verify it navigates to the card details page.

Responsive layout

  1. View the Home page on a wide screen and verify the section has appropriate spacing.
  2. Resize to a narrow screen and verify the layout adjusts with tighter spacing.

Card types

  1. Verify that Expensify cards, company cards, and personal cards all appear in the section.
  2. Verify that only active cards are displayed.

Offline tests

QA Steps

  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • 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
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-02-18.at.13.49.04.mov

@melvin-bot
Copy link

melvin-bot bot commented Feb 18, 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

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

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

Files with missing lines Coverage Δ
src/libs/CardUtils.ts 79.44% <100.00%> (+2.16%) ⬆️
src/pages/home/HomePage.tsx 100.00% <100.00%> (ø)
src/styles/index.ts 46.35% <66.66%> (+0.03%) ⬆️
...home/AssignedCardsSection/RemainingLimitCircle.tsx 57.14% <57.14%> (ø)
src/pages/home/AssignedCardsSection/index.tsx 26.66% <26.66%> (ø)
... and 11 files with indirect coverage changes

@WojtekBoman
Copy link
Contributor Author

@codex

Copy link

@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: 041442ffd8

ℹ️ 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 on lines +64 to +65
const hasLimitData = !!card.availableSpend && !!unapprovedExpenseLimit;
const spentFraction = hasLimitData ? 1 - (card.availableSpend ?? 0) / (unapprovedExpenseLimit ?? 1) : 0;

Choose a reason for hiding this comment

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

P2 Badge Treat zero available spend as valid limit data

The limit-visibility check uses truthiness (!!card.availableSpend), so a card at exactly 0 remaining spend is treated as if limit data is missing; in that case the circular indicator is hidden and spentFraction is forced to 0 even though the card has a configured limit. This breaks the widget for fully-spent cards, which are the most important case to visualize.

Useful? React with 👍 / 👎.

>
{displayableCards.map((card) => {
const cardTitle = card.nameValuePairs?.cardTitle ?? getCardDescription(card, translate);
const description = card.lastFourPAN ? `${cardTitle} ${card.lastFourPAN}` : cardTitle;

Choose a reason for hiding this comment

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

P3 Badge Avoid duplicating last-four digits in card description

When nameValuePairs.cardTitle is absent, cardTitle falls back to getCardDescription(card, translate), which already includes the PAN suffix for non-personal/non-Plaid cards (e.g., "Bank - 1234"), and then this line appends card.lastFourPAN again. Users in that data shape will see duplicated digits in the subtitle (e.g., "Bank - 1234 1234").

Useful? React with 👍 / 👎.

@WojtekBoman WojtekBoman force-pushed the home-page/assigned-cards-section branch from 041442f to 8bae2bf Compare February 18, 2026 11:49
@OSBotify

This comment has been minimized.

@OSBotify
Copy link
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

The diff is too large to include in this comment (77KB), so I've created a gist for you:

📋 View the translation diff here 📋

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply, or directly by running gh gist view --raw 4a6e582cd3f17f2e538f4de3bff97f63 | git apply 😉

View workflow run

@WojtekBoman WojtekBoman force-pushed the home-page/assigned-cards-section branch 2 times, most recently from 6868dfe to 43d9fc4 Compare February 18, 2026 12:47
@WojtekBoman WojtekBoman marked this pull request as ready for review February 18, 2026 13:16
@WojtekBoman WojtekBoman requested review from a team as code owners February 18, 2026 13:16
@melvin-bot melvin-bot bot requested review from ZhenjaHorbach and joekaufmanexpensify and removed request for a team February 18, 2026 13:16
@melvin-bot
Copy link

melvin-bot bot commented Feb 18, 2026

@ZhenjaHorbach 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 February 18, 2026 13:16
@WojtekBoman WojtekBoman force-pushed the home-page/assigned-cards-section branch from 43d9fc4 to 76aa0cd Compare February 18, 2026 13:26
Copy link
Contributor

@grgia grgia left a comment

Choose a reason for hiding this comment

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

Running a build

@github-actions
Copy link
Contributor

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

@github-actions

This comment has been minimized.

Copy link
Contributor

@grgia grgia left a comment

Choose a reason for hiding this comment

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

Couple of things

Image
  • use instead of - between card # and title
Image
  • can we make this circle show the percentage left?
image Image
  • this card testing account has only 3 card slots, but 4 show up on the home page

@grgia
Copy link
Contributor

grgia commented Feb 18, 2026

Note

There was a fixed limit card in there
image

@grgia
Copy link
Contributor

grgia commented Feb 18, 2026

image

@WojtekBoman got it working for a limit card


const unapprovedExpenseLimit = card.nameValuePairs?.unapprovedExpenseLimit;
const hasLimitData = !!unapprovedExpenseLimit;
const spentFraction = hasLimitData ? 1 - (card.availableSpend ?? 0) / unapprovedExpenseLimit : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

@WojtekBoman gonna DM about this one the data that wasnt working for my limit card

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@joekaufmanexpensify joekaufmanexpensify left a comment

Choose a reason for hiding this comment

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

Good for product. Excited for this!

@shawnborton
Copy link
Contributor

Wowee! Can we run a test build for easier testing?

@WojtekBoman WojtekBoman force-pushed the home-page/assigned-cards-section branch from 6b0f732 to c0d662a Compare February 20, 2026 10:44
@WojtekBoman
Copy link
Contributor Author

WojtekBoman commented Feb 20, 2026

NAB - Animation is abrupt

I suppose it's an easy fix Probably we just need to navigate to ROUTES.SETTINGS_WALLET and then to ROUTES.SETTINGS_WALLET_DOMAIN_CARD

Yeah, but currently we're removing the interaction manager (it would be useful here) and with these 2 navigation actions users on native platforms we'll see 2 transitions between screens

@ZhenjaHorbach
Copy link
Contributor

LGTM!

@melvin-bot melvin-bot bot requested a review from grgia February 20, 2026 11:09
@WojtekBoman WojtekBoman force-pushed the home-page/assigned-cards-section branch from ce8235b to 1984624 Compare February 20, 2026 11:54
@github-actions
Copy link
Contributor

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

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Looks good codewise

Copy link
Contributor

@grgia grgia left a comment

Choose a reason for hiding this comment

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

Nice work on this! This is a rad feature @WojtekBoman

@mountiny mountiny merged commit a8f2d3a into Expensify:main Feb 20, 2026
31 checks passed
@github-actions
Copy link
Contributor

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

@OSBotify
Copy link
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
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.24-1 🚀

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

@m-natarajan
Copy link

@WojtekBoman @grgia @ZhenjaHorbach We are blocked from using expensify cards and can't test Remaining limit circle scenario. Can this one please be tested internally

@jponikarchuk
Copy link

This PR failing because of the issue
This issue is reproducible in: All platforms

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.24-3 🚀

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

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.

10 participants