Repository navigation
Refactor ReportField logic to simplify report editability condition - #105939
puneetlath merged 7 commits into
Conversation
|
@ikevin127 @thelullabyy One of you needs to 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] |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75c10a4b29
ℹ️ 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".
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-11-05.at.16.08.18.mov |
trjExpensify
left a comment
There was a problem hiding this comment.
When you don't have any eligible reports, it doesn't seem like there's a "None" option in the dropdown to have the expense created unreported.
No existing eligible reports:
- Create report [Default]
- None <— the option to create it unreported.
ikevin127
left a comment
There was a problem hiding this comment.
Looks good overall, only 2 comments.
…ense, allowing users to save expenses without associating them with a report
|
@trjExpensify Can you confirm this is your expectation? Screen.Recording.2026-11-06.at.15.51.31.mov |
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.
|
You have auto-reporting enabled here, right? If so why is "New report" the default in the preview (first screenshot), if you seemingly also have eligible reports (second screenshot)?
|
|
@trjExpensify The expense is going to my default workspace (Dylandylan's Workspace, the one under "Create report"), and that workspace has no open report yet, so the preview defaults to "New report". The three reports in the list are on W3 and W2. When you create from global create we list open reports from every workspace, so you can pick one of those, and that moves the expense to that workspace too. If the default workspace had an open report, the preview would show that report instead of "New report". This matches what main does today. This PR doesn't change how the default report is picked. |
ikevin127
left a comment
There was a problem hiding this comment.
Request changes - Blocker: QA step 7 doesn't match what the picker now shows. It lists only an outstanding report and "Create report", but there is now a "None" option, and QA runs the steps verbatim. Please add steps for None, the zero-report case, the locked cases and offline behavior.
The two 🟢 inline comments are small cleanups.
| const ownerAccountID = reportOwnerAccountID ?? (isEditing ? undefined : session?.accountID); | ||
| const ownerPersonalDetails: CurrentUserPersonalDetails = {...getPersonalDetailsForAccountID(ownerAccountID, personalDetails), accountID: ownerAccountID ?? CONST.DEFAULT_NUMBER_ID}; | ||
| const isPerDiemTransaction = isPerDiemRequest(transaction); | ||
| const isTimeTransaction = isTimeRequestUtil(transaction); |
There was a problem hiding this comment.
🟢 isTimeTransaction is now defined here, but isTimeRequest in the returned props still calls isTimeRequestUtil(transaction) again. Can we reuse it there?
isTimeRequest: isTimeTransaction,👁️ Written by AI, reviewed by Kevin.
| // The form this page was opened from sits right below it in the stack and reads the expense type from its own route. | ||
| const setFormIOUType = (formIOUType: IOUType) => { | ||
| const {routes} = navigation.getState(); | ||
| const formRoute = routes.at(routes.findIndex((stackRoute) => stackRoute.key === route.key) - 1); |
There was a problem hiding this comment.
🟢 If route.key is the first route in the stack, findIndex(...) - 1 is -1 and .at(-1) returns the last route, which is not the form. Can we return early when the index is <= 0?
The formRoute.key === route.key check only covers the case where this page is the last route.
👁️ Written by AI, reviewed by Kevin.
Thanks for the explanation! 👍 |
ikevin127
left a comment
There was a problem hiding this comment.
🟢 LGTM - Thanks for the updates, both of my remaining comments are fixed. Nothing else open from my side.
|
🚧 puneetlath 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/puneetlath in version: 9.5.37-0 🚀
|
|
Help site update needed — Report > None adds a new, non-beta workflow for saving workspace expense drafts in personal space without a report. Created a one-sentence update: Document saving workspace expense drafts without reports. The PR is draft, labeled @DylanDylann, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
Deploy Blocker #106693 was identified to be related to this PR. |
|
Deploy Blocker #106696 was identified to be related to this PR. |
|
Deploy Blocker #106697 was identified to be related to this PR. |
|
Deploy Blocker #106701 was identified to be related to this PR. |
|
@DylanDylann @ikevin127 this was reverted FYI. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.37-1 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 9.5.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.39-2 🚀
|


Explanation of Change
From #105028 (comment)
When you create an expense, the report list now always starts with two options: Create report and None.
moveMoneyRequestDraftToSelfDM, so the participant picker and the None option share it.This PR doesn't change the default report. It's still the open report on the expense's workspace, or New report when that workspace has none.
Fixed Issues
$ #101573
PROPOSAL:
Tests
Offline tests
QA Steps
Precondition: two workspaces, A (your default) and B, where B has no open report.
anchoredFieldDropdownsbeta, or on a narrow screen). Verify the same result.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-11-06.at.15.51.31.mov