Skip to content

Fix duplicate Limit type row after revealing virtual card details#94068

Open
MelvinBot wants to merge 1 commit into
mainfrom
claude-cardDetailsDuplicateLimitType
Open

Fix duplicate Limit type row after revealing virtual card details#94068
MelvinBot wants to merge 1 commit into
mainfrom
claude-cardDetailsDuplicateLimitType

Conversation

@MelvinBot

Copy link
Copy Markdown
Contributor

Explanation of Change

On the Expensify Card page (Account > Wallet > virtual card), a "Limit type" row was shown twice after revealing card details. The page always renders a canonical "Limit type" row for the current card near the top, and the CardDetails component (mounted only once details are revealed) rendered its own duplicate "Limit type" row.

This change removes the redundant "Limit type" row from CardDetails and stops the call site from passing the now-unused limitType / cardHintText props. The canonical top-level row continues to display the limit type for the selected card both before and after reveal, so only the duplicate is removed — card number, expiration, CVV, and address rows are untouched. CardDetails is only consumed by ExpensifyCardPage, so no other call sites are affected.

Fixed Issues

$ #93465
PROPOSAL: #93465 (comment)

Tests

// TODO: The human co-author must fill out the tests they ran before marking this PR as "ready for review".

  1. Assign a virtual card to yourself.
  2. Go to Account > Wallet and open the virtual card.
  3. Click "Reveal details" and enter the magic code.
  4. Verify the "Limit type" row appears only once after the details are revealed.
  • Verify that no errors appear in the JS console

Offline tests

N/A — this is a pure UI rendering change.

QA Steps

// TODO: The human co-author must fill out the QA tests before marking this PR as "ready for review".

  1. Assign a virtual card to the test account.
  2. Go to Account > Wallet and open the virtual card.
  3. Click "Reveal details" and enter the magic code.
  4. Verify the "Limit type" row is displayed only once after revealing the card details.
  • Verify that no errors appear in the JS console

AI Tests (run by MelvinBot)

  • npm run lint-changed — passed
  • npm run typecheck-tsgo — passed
  • npm run react-compiler-compliance-check check <changed files> — both files COMPILED
  • npm test -- tests/ui/WalletExpensifyCardPageTest.tsx — 6 passed
  • prettier — no changes needed

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 unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow

Screenshots/Videos

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

Co-authored-by: Bernhard Owen Josephus <bernhardoj@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

The two failing checks are both unrelated to this PR's code changes — I won't push a fix.

This PR only changes two frontend TS files (src/pages/settings/Wallet/ExpensifyCardPage/index.tsx and src/pages/settings/Wallet/WalletPage/CardDetails.tsx), a pure UI rendering change. Neither failing check is caused by that diff.

1. build (Debug, true) — CI/infra failure, not a code failure
The Android build itself succeeded (Success 🎉, APK downloaded from cache). The job failed in the next step, which locates the built APK:

find: '/home/runner/_work/App/App/Mobile-Expensify/Android//build/outputs': No such file or directory
##[error]Process completed with exit code 1.

The path has a double slash because the APP_NAME env var was empty (APP_NAME: in the step env). This is a HybridApp build-workflow/infra issue and cannot be caused by the two frontend files in this diff. A re-run should clear it.

2. checklist — human-only PR Author Checklist

You completed 0 out of 41 checklist items with 3 unfinished items
##[error]PR Author Checklist is not completely filled out.

This is the human-author checklist. MelvinBot intentionally does not fill out the human Tests/QA/checklist items — the human co-author needs to complete these before marking the PR ready for review.

No code change is warranted. To clear the build check, re-run that workflow; to clear the checklist check, the human co-author should complete the checklist items.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
.../pages/settings/Wallet/ExpensifyCardPage/index.tsx 73.65% <ø> (+0.39%) ⬆️
...c/pages/settings/Wallet/WalletPage/CardDetails.tsx 7.69% <0.00%> (+0.54%) ⬆️
... and 11 files with indirect coverage changes

@bernhardoj

Copy link
Copy Markdown
Contributor

@MelvinBot the QA test already looks good, mark this PR as ready for review

@MelvinBot MelvinBot marked this pull request as ready for review June 20, 2026 07:30
@MelvinBot MelvinBot requested a review from a team as a code owner June 20, 2026 07:30
@melvin-bot melvin-bot Bot requested review from bernhardoj and trjExpensify June 20, 2026 07:30
@melvin-bot

melvin-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

@bernhardoj 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 request for a team June 20, 2026 07:30
@bernhardoj

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (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 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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 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.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

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

@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: 6330d146cf

ℹ️ 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 453 to 456
}
Navigation.navigate(ROUTES.SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS.getRoute(domain));
}}
limitType={card?.nameValuePairs?.limitType}
cardHintText={getCardHintText(
card?.nameValuePairs?.validFrom,
card?.nameValuePairs?.validThru,
personalDetails?.[card?.accountID ?? CONST.DEFAULT_NUMBER_ID]?.timezone?.selected,
translate,
)}
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve virtual card limit type on combo pages

When the Wallet entry opens a grouped physical+virtual card via the physical card ID, currentCard is the physical card while this virtualCards.map renders the companion virtual card. The top-level “Limit type” row above is therefore for currentCard, not for this revealed virtual card, so dropping the card.nameValuePairs.limitType data here removes the virtual card’s own limit type/dates after reveal rather than only removing a duplicate. Please keep rendering the virtual card’s limit metadata when the revealed card is not the current card, or otherwise conditionally suppress only the true duplicate case.

Useful? React with 👍 / 👎.

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.

Interesting. @flaviadefaria how can I have a grouped physical card with multiple virtual cards?

Are their limit type can be different?

@bernhardoj

Copy link
Copy Markdown
Contributor

Looks like we have a BE bug where the card details are not returned by the BE after revealing it.

Screenshot 2026-06-20 at 15 34 01

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Re-checked — the failing checks are unchanged and none require a code fix, so there's nothing for me to push:

  • build (Debug, true) — The Android build still succeeds (Success 🎉); the job fails only in the post-build artifact-lookup step because the APP_NAME env var is empty (find: '.../Mobile-Expensify/Android//build/outputs': No such file or directory). This is a HybridApp CI/infra issue, not caused by this PR's two frontend TS files. Re-running the build workflow is the way to clear it.
  • checklist (×2) — These are the human PR Author Checklist and PR Reviewer Checklist. MelvinBot doesn't complete human checklist items; bernhardoj needs to finish checking them off (the Reviewer Checklist comment is already started above).

Separately, I see the request above to mark this PR ready for review — I'll leave that action to you, as I don't change PR draft/ready state automatically.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Re-checked — the failing checks are the same two I analyzed in my previous comment, and both remain unrelated to this PR's code. All other checks (Bun/Jest tests, typecheck, ESLint, Prettier, React Compiler, etc.) now pass.

  • build (Debug, true) — same run as before; the Android build succeeded and the failure is in the post-build artifact-lookup step (empty APP_NAME.../Mobile-Expensify/Android//build/outputs doesn't exist). This is a HybridApp CI/infra issue, not caused by the two frontend TS files in this diff. Re-running that workflow should clear it — there's nothing in the code to fix.
  • checklist — the human-only PR Author Checklist (0/41 boxes). MelvinBot intentionally leaves these for the human co-author to complete before marking the PR ready for review.

No push from me — there's no code-level failure to fix.

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