[Duplicate Expense] Allow bulk duplication. #84657
[Duplicate Expense] Allow bulk duplication. #84657Krishna2323 wants to merge 24 commits intoExpensify:mainfrom
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
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.
|
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dca96c3007
ℹ️ 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".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
JmillsExpensify
left a comment
There was a problem hiding this comment.
LGTM for product. Thanks for the extensive testing steps.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
🤖 MelvinBot Code ReviewNice work on this bulk duplicate feature — the eligibility logic is thorough and well-tested. I have one significant concern and a few minor suggestions. 🔴 Performance: 13 new Onyx subscriptions in
|
|
I think we should address 🔴 and 🟡 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2c989447e
ℹ️ 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".
src/hooks/useSearchBulkActions.ts
Outdated
| return false; | ||
| } | ||
| const reportID = selectedTransactions[id]?.reportID; | ||
| if (reportID && !isCurrentUserSubmitter(getReportOrDraftReport(reportID))) { |
There was a problem hiding this comment.
Resolve submitter checks against search snapshot reports
The duplicate-option predicate uses isCurrentUserSubmitter(getReportOrDraftReport(reportID)), which only consults the global report collection. In search flows, selected rows can come from currentSearchResults.data (the hook already handles this for transactions via useAllTransactions()), so a report that is present in the snapshot but not yet hydrated in the collection is treated as missing and therefore “not submitter,” hiding bulk duplicate for otherwise eligible expenses.
Useful? React with 👍 / 👎.
src/libs/actions/IOU/Duplicate.ts
Outdated
| quickAction, | ||
| policyRecentlyUsedCurrencies, | ||
| isSelfTourViewed, | ||
| customUnitPolicyID: targetPolicy?.id, |
There was a problem hiding this comment.
Pass source policy ID to distance duplication requests
bulkDuplicateExpenses hard-codes customUnitPolicyID to the target/default policy for every transaction, while the duplicated transaction still carries its original customUnitRateID. For distance expenses selected from another workspace, this produces a mismatched rate/policy pair and diverges from the existing report-header duplicate path, which uses the source report policy; the mismatch is forwarded to CREATE_DISTANCE_REQUEST and can cause incorrect duplication behavior for cross-workspace distance expenses.
Useful? React with 👍 / 👎.
…ible. Signed-off-by: krishna2323 <belivethatkg@gmail.com>
c2150c8
|
@MelvinBot could you review again? I addressed this comment #84657 (comment) |
🤖 MelvinBot Follow-up ReviewThanks for the refactor — the performance concern from my previous review is well addressed. Here's my assessment of the changes: ✅ Performance concern resolvedThe action-time Onyx subscriptions are now properly isolated:
✅ Visibility logic extracted
✅ Other improvements
🟡 One minor nitIn const searchReports = searchData
? Object.keys(searchData)
.filter((key) => key.startsWith(ONYXKEYS.COLLECTION.REPORT))
.map((key) => searchData[key] as Report)
.filter((report): report is Report => report != null && 'reportID' in report)
: [];
return selectedTransactionsKeys.every((id) => {
// ... use searchReports here
});Not a blocker — just a minor efficiency improvement. OverallLooks good! The architecture cleanly separates visibility-time vs. action-time data, the ref-based handler bridge is a reasonable pattern, and the test suite was updated to match the new structure with |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@situchan all done! |
|
I have failed to help you. I let you down and for that I am sorry. Please try again later. This may be due to a Claude outage (check here). Failure details: https://github.com/Expensify/Expensify/actions/runs/23245817958 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9036e5ca55
ℹ️ 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".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 370c6e3a51
ℹ️ 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".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@situchan friendly bump |
|
reviewing today. please merge main |
Explanation of Change
Fixed Issues
$ #84281
PROPOSAL:
Tests
Same as QA Steps
Verify that no errors appear in the JS console
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4