[Card Rules] Hide deactivated cards from rule summary and selection#87679
[Card Rules] Hide deactivated cards from rule summary and selection#87679
Conversation
Filter out deactivated/inactive card IDs before building display summaries in SpendRulesSection and SpendRulePageBase. Rules with only deactivated cards are hidden entirely from the rules list. Co-authored-by: Carlos Martins <luacmartins@users.noreply.github.com>
|
The failing check Analysis: The Android build itself completes successfully (APK downloaded from S3 cache), but the subsequent artifact-path detection step fails because the Evidence: This PR only modifies Re-running the check or waiting for a CI fix should resolve this. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 190580dcae
ℹ️ 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".
|
@luacmartins 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] |
|
I’ll start checking this one in an hour |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-04-14.at.20.16.12.5.mp4Android: mWeb ChromeCleanShot.2026-04-14.at.20.21.19.6.mp4iOS: HybridAppCleanShot.2026-04-14.at.20.11.25.4.mp4iOS: mWeb SafariCleanShot.2026-04-14.at.20.10.17.3.mp4MacOS: Chrome / SafariCleanShot.2026-04-14.at.20.07.04.1.mp4Offline CleanShot.2026-04-14.at.20.09.13.2.mp4 |
|
I’m still facing an issue where CleanShot.2026-04-14.at.20.26.12.1.mp4 |
Explanation of Change
When a virtual card is deactivated, spend rules that reference it still show the raw card ID in the rule summary and edit page. This happens because
cardsListis fetched withfilterInactiveCards(which correctly excludes deactivated cards), but when a card ID isn't found incardsList, the code falls back to displaying the raw numeric ID instead of hiding it.This PR filters out deactivated card IDs (those not present in the active
cardsList) before building display summaries:SpendRulesSection.tsx— FiltersformValues.cardIDsto only active cards before building the summary. Rules with zero active cards are hidden entirely.SpendRulePageBase.tsx— Filters out inactive card IDs ingetCardsMenuTitleso deactivated cards don't appear as raw IDs.Fixed Issues
$ #87669
PROPOSAL: #87669 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screen.Recording.2026-04-13.at.2.02.44.PM.mov
Android: Native
N/A - Logic-only change, no UI layout modifications
Android: mWeb Chrome
N/A - Logic-only change, no UI layout modifications
iOS: Native
N/A - Logic-only change, no UI layout modifications
iOS: mWeb Safari
N/A - Logic-only change, no UI layout modifications
MacOS: Chrome / Safari
N/A - Logic-only change, no UI layout modifications
Checks run
npm run typecheck