Add View transactions shortcut under Current balance#90402
Conversation
|
@mananjadhav 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] |
|
|
||
| const handleViewTransactionsPress = useCallback(() => { | ||
| const feedKey = createCardFeedKey(String(defaultFundID), CONST.EXPENSIFY_CARD.BANK); | ||
| const query = `type:expense feed:"${feedKey}" withdrawn:never withdrawal-status:pending`; |
There was a problem hiding this comment.
❌ CONSISTENCY-2 (docs)
The query string contains magic filter keywords (type:expense, withdrawn:never, withdrawal-status:pending) that are not self-explanatory and are not defined as named constants anywhere in the codebase. If these search filter tokens change or need to be reused elsewhere, every occurrence must be found and updated manually.
Extract the search filter components into named constants, for example:
// In CONST or a relevant constants file
const SEARCH_FILTERS = {
TYPE_EXPENSE: 'type:expense',
WITHDRAWN_NEVER: 'withdrawn:never',
WITHDRAWAL_STATUS_PENDING: 'withdrawal-status:pending',
};
// Usage
const query = `${SEARCH_FILTERS.TYPE_EXPENSE} feed:"${feedKey}" ${SEARCH_FILTERS.WITHDRAWN_NEVER} ${SEARCH_FILTERS.WITHDRAWAL_STATUS_PENDING}`;Reviewed at: 38c6aa3 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
@mananjadhav thanks for the follow up. pulled the type:expense, withdrawn:never, and withdrawal-status:pending fragments into small file-local named constants for readability.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38c6aa38fe
ℹ️ 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".
| }; | ||
|
|
||
| const handleViewTransactionsPress = useCallback(() => { | ||
| const feedKey = createCardFeedKey(String(defaultFundID), CONST.EXPENSIFY_CARD.BANK); |
There was a problem hiding this comment.
Preserve missing fund ID when building feed key
useDefaultFundID() falls back to CONST.DEFAULT_NUMBER_ID (0) before a real feed is resolved, but String(defaultFundID) converts that fallback into a truthy value. That makes createCardFeedKey() generate "0_expensify" instead of using its no-fund fallback ("expensify"), so the feed: filter can point to a non-existent feed and return no transactions when users click quickly during initial load (or whenever the fallback is still in effect).
Useful? React with 👍 / 👎.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@mananjadhav updated per review: fixed createCardFeedKey (3 args + fund handling for default id), dropped redundant useCallback, and named the search query fragments locally. |
|
@neerajbachani I don't see any screenshots/videos uploaded. Can you please upload them and tag when everything in the checklist is thoroughly verified/completed? |
|
@mananjadhav Added screenshots/videos for all platforms to the PR description. Please let me know if anything else is needed! |
|
🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Code LGTM, testing it. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safariweb-view-transactions.mov |
|
@joekaufmanexpensify Can we confirm if But when I compare the other filters: |
mananjadhav
left a comment
There was a problem hiding this comment.
Approving so that @aldo-expensify can help with the filter check
It works for me. When I select
|
|
@mananjadhav there are some items in your checklist remaining to be check. |
|
BE changes are done. We added a new |
|
@joekaufmanexpensify Thanks! I'll update the shortcut to use |
|
Thanks! Bumped that PR just now |
|
@neerajbachani the PR above is merged |
|
@neerajbachani Do you now have what is needed to make progress? |
|
@mananjadhav Yes #93895 is merged and I've pushed the update in commit a907fa4. The shortcut now uses withdrawal-status:never,pending (removed withdrawn:never) per @joekaufmanexpensify's feedback. Unit test updated and passing locally. @joekaufmanexpensify Could you re-test on adhoc when you get a chance? |
|
🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Tested on a few accounts and largely working well! |
|
I did find one test account where the query seems to be pulling in a bunch of transactions that are between 4-5 years old. When I manually selected only transactions from this year, they exactly match the balance. However, it's unclear to me why there are also these really old Expensify card transactions being listed on the spend page. @JS00001 if I DM you the account, could you assist with taking a look?
|
|
Chatted with @JS00001, we might need to clean up one of the backend queries related to these filters. We think there might be a historical issue from when we originally launched the Expensify card in NewDot. That said, given these filters are already live in the product we don't need to block this app PR on it. It's unlikely this has much impact. |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good from my perspective 👍
|
@mananjadhav I think we may need a checklist |
|
Yes. I was waiting on this comment. I'll work on testing this once on my end. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safariweb-view-transactions.mov |
mananjadhav
left a comment
There was a problem hiding this comment.
Still don't have the exact card with transactions, but verify the UI and other parts of the search filter.
And I can see @joekaufmanexpensify checked with a valid card.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.4.36-0 🚀
|
Help site review — changes required ✅This PR adds a user-facing View transactions link under the Current balance amount on the workspace Expensify Card page ( The existing help article that documents the workspace Expensify Card page (Set Up and Manage the Expensify Card) didn't mention this shortcut, so a docs update is warranted. Draft help site PR: #96357 What the docs PR does
Note: I couldn't set you as the assignee — GitHub rejected the assignment ( @neerajbachani, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |





Explanation of Change
Adds a View transactions
TextLinkunder the Current balance amount on the workspace Expensify Card page. On press, navigates to Search with a canned query usingcreateCardFeedKey(fundID, CONST.EXPENSIFY_CARD.BANK)andROUTES.SEARCH_ROOT.getRoute({ query }), matching the issue spec (type:expense,feed:…,withdrawn:never,withdrawal-status:pending). The link is shown only when the label type is Current balance (not for remaining limit or cash back). Copy uses existingworkspace.common.viewTransactions.Fixed Issues
$ #88116
PROPOSAL: #88116 (comment)
Tests
type:expense, the correctfeed:"…"key,withdrawn:never, andwithdrawal-status:pending.Offline tests
QA Steps
Same as Tests (workspace Expensify Card page: link placement, navigation to Search, query contents).
PR Author Checklist
TestssectionOffline stepssectionQA stepssection### Fixed Issuessection abovetoggleReportand 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
Android: Native
Android: mWeb Chrome
lv_0_20260518170928.mp4
iOS: Native
iOS: mWeb Safari
lv_0_20260518163408.online-video-cutter.com.mp4
MacOS: Chrome / Safari
lv_0_20260518163027.mp4