Fix: show "Personal card" for personal cards in group-by-card feed name#92631
Fix: show "Personal card" for personal cards in group-by-card feed name#92631MelvinBot wants to merge 2 commits into
Conversation
Personal card groups on the Spend page rendered as "Deleted feed" because getCardSections resolved every group's feed via getFeedNameForDisplay, a company-feed helper. Detection requires the card's fundID, so the grouped section builders now receive the unfiltered PERSONAL_AND_WORKSPACE_CARD_LIST and label personal cards via isPersonalCard. Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
The failing checks are not related to this PR's changes — no code fix is needed. 1. The failure is a Jest timeout, not an assertion failure:
It occurred in This PR only touches Search card-feed code ( Recommended action: re-run the failed job ( 2. This fails because the human-only Tests / QA Steps sections and the author checklist are still unchecked. I deliberately don't fill those out on a person's behalf — the human co-author should complete them before marking the PR ready for review. |
|
Re-checked — the state is unchanged from my previous comment, and there is still no code fix to push. Both failing checks are unrelated to this PR's Search card-feed changes:
The single blocker is the flaky timeout, which just needs a CI re-run. I tried to trigger it automatically twice ( |
|
@MelvinBot please resovle conflict |
…edNameGroupByCard Co-authored-by: daledah <daledah@users.noreply.github.com> # Conflicts: # src/hooks/useSearchSections.ts
|
🤖 Resolved the merge conflict by merging the latest Conflict: Resolution: Kept this PR's Verification
PR is now mergeable (no conflicts). Please re-test if needed before marking ready for review. |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
🤖 I looked into the failing checks. No code fix is needed — every substantive check passes (typecheck, all 8 The only red check is PR Author Checklist / checklist, which fails with:
This isn't a code failure — it's gating on the human-authored sections of the PR. To make it pass, the human co-author needs to:
I can't tick those boxes or fill out those sections on your behalf — they're a human attestation. Once they're completed, this check will go green. |
Explanation of Change
On the Spend page with Group-by: Card, a personal card group rendered its feed label as "Deleted feed" instead of "Personal card".
getCardSectionsresolved every group'sformattedFeedNamethroughgetFeedNameForDisplay, a company-card-feed helper. A personal card'sbankis never present in the companycardFeedscollection, sodoesCardFeedExistreturnedfalseand the helper short-circuited to theworkspace.companyCards.deletedFeedlabel.The only reliable signal for "this is a personal card" is the card's missing
fundID(isPersonalCard), which lives on theCardrecord — not on the backend group row. The card list threaded intogetCardSectionswasNON_PERSONAL_AND_WORKSPACE_CARD_LIST, which filters personal cards out, so a naiveisPersonalCard(cardList?.[cardGroup.cardID])check could not work: the lookup isundefinedfor personal cards, andisPersonalCard(undefined)returnstrue(which would also mislabel genuinely-deleted company feeds whose card record is gone).This PR therefore makes two coordinated changes:
PERSONAL_AND_WORKSPACE_CARD_LIST(insrc/components/Search/index.tsxandsrc/hooks/useSearchSections.ts) so personal cards are resolvable bycardGroup.cardID. The existing per-rownonPersonalAndWorkspaceCardsprop is left untouched.getCardSections, look upconst card = cardList?.[cardGroup.cardID]and, whencard && isPersonalCard(card), usetranslate('cardTransactions.personalCard'). Otherwise fall through to the existinggetFeedNameForDisplay(...)call.The
card &&guard keeps the legitimate "Deleted feed" message intact for removed company feeds (with or without a card record), while valid personal-card groups now show "Personal card".🤖 AI Tests run locally by MelvinBot
npm test -- tests/unit/Search/SearchUIUtilsTest.ts— 361 passed (includes a new regression test asserting personal cards → "Personal card", CSV personal cards → "Personal card", and removed company feeds → "Deleted feed")npm test -- tests/unit/hooks/useSearchSections.test.ts— 3 passednpm run typecheck-tsgo— passednpm run lint-changed— passednpm run prettier-changed— no changesnpm run react-compiler-compliance-check check ...—useSearchSections.tscompiles;Search/index.tsxreports the same 9 pre-existing errors onorigin/main(no regression introduced)Fixed Issues
$ #92523
PROPOSAL:
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
Offline tests
This is a pure display derivation over already-synced Onyx data, so behavior is unchanged offline.
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionmainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari