Add View transactions shortcut under Current balance#90402
Add View transactions shortcut under Current balance#90402neerajbachani wants to merge 4 commits into
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. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
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. |
|
@aldo-expensify Needed your help to verify the filter for the search API call. It seems when we apply all three filters we don't get any result. Feed working for @joekaufmanexpensify and I tried the Withdrawn filters it works fine too. The combination of 3 filters doesn't work, so wanted to check if we're missing something? |
|
cc @JS00001 too as you helped implement the new filter |
| import ROUTES from '@src/ROUTES'; | ||
| import type SCREENS from '@src/SCREENS'; | ||
|
|
||
| const EXPENSIFY_CARD_TRANSACTIONS_SEARCH_QUERY_FRAGMENTS = { |
There was a problem hiding this comment.
why's this needed? lets just build the query directly, this is prob overcomplicating it
| const handleViewTransactionsPress = () => { | ||
| const fundIDForFeedKey = defaultFundID === CONST.DEFAULT_NUMBER_ID ? undefined : String(defaultFundID); | ||
| const feedKey = createCardFeedKey(fundIDForFeedKey, CONST.EXPENSIFY_CARD.BANK, undefined); | ||
| const query = `${EXPENSIFY_CARD_TRANSACTIONS_SEARCH_QUERY_FRAGMENTS.TYPE_EXPENSE} feed:"${feedKey}" ${EXPENSIFY_CARD_TRANSACTIONS_SEARCH_QUERY_FRAGMENTS.WITHDRAWN_NEVER} ${EXPENSIFY_CARD_TRANSACTIONS_SEARCH_QUERY_FRAGMENTS.WITHDRAWAL_STATUS_PENDING}`; |
There was a problem hiding this comment.
Lets not build this as a string. Lets use
buildQueryStringFromFilterFormValues({
type: CONST.SEARCH.DATA_TYPES.TRANSACTION,
...
})Use buildQueryStringFromFilterFormValues instead of manual query fragments. Add unit test for feed + withdrawn:never + withdrawalStatus:pending query shape.
|
@JS00001 Addressed review: removed query fragment constant and switched to @mananjadhav @joekaufmanexpensify On the empty combined results: individual filters seem to work, so I suspect backend filter combination rather than a bad link. Open to changing filters once we confirm the expected search API behavior. Thanks! |
@JS00001 Can you confirm this? |
|
@joekaufmanexpensify could you dm me the email youre testing on? |
|
@JS00001 done! |
|
Looking into this, haven't been able to find the issue yet |
But is this something to be fixed from the backend? |
|
It would be, yes |
|
Hmm, I'm not sure this search query is the correct one to get all of the transactions that haven't been withdrawn yet |
Can you help us with the query so that we can modify? |
|
Yeah Im trying to think of how we need to change it. Currently, withdrawn:never and withdrawal-status:pending are contradictory. Since withdrawn:never means that the row has no withdrawal associated with it. However, withdrawal-status means the row has a withdrawal associated with it, but its pending |



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