Repository navigation
Conversation
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ 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". |
| }, [originalCurrency]); | ||
|
|
||
| const navigateBack = () => { | ||
| const navigateBack = useCallback(() => { |
There was a problem hiding this comment.
❌ CLEAN-REACT-PATTERNS-0 (docs)
React Compiler is enabled in this codebase and automatically memoizes closures based on their captured variables. The new useCallback wrapping around navigateBack is redundant and interferes with the compiler's optimization model.
Remove the useCallback wrapper and use a plain function:
const navigateBack = () => {
Navigation.goBack(backTo);
};Reviewed at: adb2075 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
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.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-06-16.at.18.48.15.mov |
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required.
| allPersonalDetails, | ||
| conciergeReportID, | ||
| reportAttributesReports, | ||
| allReportDrafts?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT}${participant.reportID}`], |
There was a problem hiding this comment.
Just to verify, earlier the same draftReport was used here for all participants and now specific to participant reportID. Will this change create any issues?
There was a problem hiding this comment.
In a 1:1 DM or single policy expense chat the two resolve to the same draft anyway, but in a multi-participant flow this could cause an issue. So reverted this to use the same single screen derived reportDraft.
cristipaval
left a comment
There was a problem hiding this comment.
On you now, @Julesssss
|
🚧 @Julesssss 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/Julesssss in version: 9.4.10-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. I reviewed the changes in this PR against the help site files under Why no docs changes are neededThe PR only touches internal implementation:
There are no changes to user-facing copy, feature names, tab/setting labels, buttons, or If you believe a help article should still be updated, reply with |
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.4.12-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. I reviewed the changes in this PR against the help site files under This is a performance/internal refactor only — it has no user-facing impact:
There are no new features, no changed UI labels, tabs, settings, or buttons, and no behavioral changes that the help site documents. The expense creation/editing flows described in the docs continue to work exactly as before, so nothing in @OlimpiaZurek, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR (Note: no help site PR was created because no documentation changes are needed for this change.) |
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.4.14-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.14-1 🚀
|
tgolen
left a comment
There was a problem hiding this comment.
Sorry for the bad news. I wish I had been pinged for review before this was merged, as I still don't think the cleanup was done correctly. Can you please be sure to add me as reviewer for the next PR?
| navigateBack(); | ||
| } | ||
|
|
||
| export {submitAmount, getIsP2PForAmount, getReportOrReportDraftForAmount}; |
There was a problem hiding this comment.
I don't think getReportOrReportDraftForAmount should be exported, it is only referenced inside this file.
| const iouOrExpenseReport = useReportOrReportDraft(report?.chatReportID); | ||
| const actualChatReportID = iouOrExpenseReport && isMoneyRequestReport(iouOrExpenseReport) ? iouOrExpenseReport.chatReportID : undefined; | ||
| const actualChatReport = useReportOrReportDraft(actualChatReportID); | ||
| const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.parentReportID)}`); |
There was a problem hiding this comment.
All of these were following the correct pattern already, why are they being moved to module-scoped values read with Onyx.connectWithoutView()?
That is not the right pattern.
IOURequestStepAmount is a view, so using Onyx.connectWithoutView() to gather Onyx data needed for any of it's functions is a contradiction (and it's why we named it that way specifically).
All of these should go back to using useOnyx() and have the data passed as parameters to the functions that need them.
| @@ -1,13 +1,56 @@ | |||
| import {hasSeenTourSelector} from '@selectors/Onboarding'; | |||
There was a problem hiding this comment.
I don't quite understand this AmountSubmission file. It's not a component, yet it's in the /pages directory.
It doesn't call the API layer directly, but it does call other action methods, so it's not an action file itself.
I think this is something more like a utils file, which should live in /src/libs.
| allReportNVPs, | ||
| duplicateTransactions, | ||
| duplicateTransactionViolations, | ||
| }: SubmitAmountArgs): void { |
There was a problem hiding this comment.
This is an extremely large function. Can it be simplified? Some suggestions:
- Move
navigateToNextPage()outside of the function and pass arguments to it - Move the early returns to be as early as possible
In general, I think mixing navigation with other functionality makes code more complex and harder to maintain, and can also lead to regressions. It would be really great if all the logic for navigation could be separate from all the rest of the logic.
@tgolen Thanks for flagging these. I addressed most of them in this PR :#94295
On |
Explanation of Change
This PR moves the submit handler into the same module that already holds the helpers, and caches the simple/derived/singleton-shaped submit-only state at module scope so it no longer triggers a
useOnyxsetup on every screen mount.IOURequestStepAmounthad ~21 submit-onlyuseOnyxsubscriptions — values consumed only inside the submit handler, never during render — yet each was a lifetime subscription created on every mount.This PR moves the submit handler into the same module that already holds the helpers, and caches the simple/derived/singleton-shaped submit-only state at module scope so it no longer triggers a
useOnyxsetup on every screen mount.Net effect: −11 mount-time Onyx subscriptions on
IOURequestStepAmount.A follow-up PR will handle the remaining collection-shaped submit data (transaction collections, NVPs, etc.) and drop the corresponding screen-side subscriptions.
Fixed Issues
$ #92411
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari