Add selection mode Submit/Approve/Pay actions for mobile layout.#85796
Add selection mode Submit/Approve/Pay actions for mobile layout.#85796Krishna2323 wants to merge 24 commits intoExpensify:mainfrom
Conversation
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>
…2502-3 Made-with: Cursor # Conflicts: # src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
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: b74539f3f8
ℹ️ 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/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Code ReviewCI Status
Failing TestThe test const hasActualPaymentOptions = paymentButtonOptions.some((opt) =>
Object.values(CONST.IOU.PAYMENT_TYPE).some((type) => type === opt.value)
);
const hasPayInSelectionMode = allExpensesSelected && hasPayAction && hasActualPaymentOptions;Since the mock returns an empty array, Code Observations1. Logic duplication between The new hook ( Ideally, 2. Heavy Onyx subscription load The hook creates ~20 3. The same check 4. Minor: The change from SummaryThe overall approach of extracting selection mode logic into a reusable hook for mobile narrow layout is sound. The main concerns are:
|
|
Please address AI reviews and still add production gate (both web and mobile) to avoid revert. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ede93d634
ℹ️ 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".
|
Kicked off an adhoc. I'll have to come back to this one. |
|
🚧 @JmillsExpensify 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! 🧪🧪
|
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>
|
@trjExpensify can you help with this PR while I'm out? |
…r usage Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Yep! CC: @puneetlath as well as you authored the parent issue. This is the mobile PR that follows adding it for web.
Instead of this. If ya'll are worried this PR is big, it would be better to try and split it up. Maybe smaller PRs for each of the Submit > Approve > Pay actions in turn? |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@trjExpensify The three actions share too much infrastructure (KYC wall, hold menu state, payment options, hook setup) to split cleanly — Submit alone would carry ~80% of the diff. I think it's better to keep the production gate (or add a beta check) so we have a quick kill switch if anything goes wrong post-merge. |
@situchan can't repro this: Monosnap.screencast.2026-04-02.03-19-49.mp4 |
|
ok let's not block on this. Please ping me when ready for review |
|
@situchan it's ready for review, will fix the failing test shortly. |
…te re-render loop Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
I'll defer to @puneetlath here ultimately. |
Code Review (Updated)CI StatusAll checks are now passing. Code Observations1. At const handlePaySelected = useCallback(() => {}, []);This is assigned to the Pay action's 2.
const hasActualPaymentOptions = paymentButtonOptions.some((opt) => Object.values(CONST.IOU.PAYMENT_TYPE).some((type) => type === opt.value));
const hasActualPaymentOptions = paymentButtonOptions.some((opt) => Object.values(CONST.IOU.PAYMENT_TYPE).some((type) => type === opt.value));Consider extracting this into a small utility (e.g. 3. Four redundant Onyx subscriptions The hook subscribes to 4. The base version had SummaryThe feature is well-gated behind the |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@MelvinBot find any inconsistent/missing logic in |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Inconsistencies Between
|
| # | Issue | Desktop | Hook (Mobile) | Severity |
|---|---|---|---|---|
| 1 | shouldBlockDirectPayment |
Checked | Missing | High |
| 2 | onSubmitted/onApproved/onPaid callbacks |
Passed (skipped in selection mode) | Not passed | Medium |
| 3 | Hold menu transactions + onNonReimbursablePaymentError |
Passed | Missing | Medium |
| 4 | Hold menu requestType guard |
requestType !== undefined |
Missing | Low |
| 5 | Hold menu close resets selection mode state | Resets isSelectionModePaymentRef |
No equivalent | Low |
| 6 | Richer button text | submitButtonText/approveButtonText |
Raw translate() |
Low (UX) |
| 7 | Beta gate | None (removed) | isSelectionModeReportActionsEnabled |
Intentional? |
@Krishna2323 please apply changes from #83329 which was recently merged. And address remaining concerns in #85796 (comment) and #85796 (comment) if applicable. And fix React Compiler issue |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…in favor of React Compiler auto-memoization Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Please also note that |
…yReportHoldMenu, and guard hold menu render Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…ument handlePaySelected no-op Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@MelvinBot made the changes, review again and find inconsistencies if any. |
Review — Inconsistency Check (Updated)Good progress — several issues from the previous review are now fixed:
Remaining Issues1. React Compiler — hook is still not compiled (flagged by The hook has several patterns that prevent React Compiler from optimizing it:
This is the main open reviewer concern — 2. Missing animation callbacks (Low — likely intentional)
3. Beta gate divergence (Likely intentional — confirm) Desktop ( |
intentional
intentional @situchan ready for review. |

Explanation of Change
Fixed Issues
$ #72502
PROPOSAL:
Tests
Same as QA Steps
Verify that no errors appear in the JS console
Offline tests
QA Steps
1. Submit action via selection mode (Mobile)
MoneyRequestReportActionsList)2. Approve action via selection mode (Mobile)
3. Pay action via selection mode (Mobile)
4. Approve with delegate restriction (Mobile)
5. Approve with held expenses (Mobile)
6. Pay as business (Mobile)
7. Partial selection — no report-level actions (Mobile)
ButtonWithDropdownMenu(not the KYC dropdown)8. KYC dropdown vs plain dropdown rendering (Mobile-specific)
MoneyReportHeaderKYCDropdown(KYC-integrated)ButtonWithDropdownMenu9. Offline behavior (Mobile)
10. Submit blocked by policy rules (Mobile)
preventSelfApprovalis enabled and the submitter is the next approverPR 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
test_1-2-3.mp4
test_4.1.mp4
test_4.mp4
test_5.mp4
test_6.mp4
test_8.mp4
test_9.mp4
test_10.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4