Repository navigation
Restore: Show up to three report fields per row and edit them inline - #104124
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
|
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot please fix this 2 blockers #103860 |
|
🤖 Web test steps verification results: Inline editing works for Date, List, and multi-report navigation, and field deletion works, but clearing a required Text field does not save as empty. It silently reverts, so no "required" violation ever appears. This PR has no test steps of its own, so I ran the web QA steps from Restore: Show up to three report fields per row and edit them inline, skipping the Android/mWeb-only steps 8 and 10. |
Co-authored-by: daledah <daledah@users.noreply.github.com>
…t scroll the report Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I pushed fixes for both blockers to this branch:
The second fix removes inline editing from one-expense reports. That view sits inside the inverted report list, where an input that opens the keyboard makes the list scroll. The table view isn't inverted, so it keeps inline editing. If you'd rather keep inline editing on one-expense reports, the list scroll itself needs fixing first, in Android - Report auto scrolls to bottom when the keyboard opens for an input inside the report. I didn't test either fix on a device. Both bugs only happen in the native apps, and this run could only test on web. Changes and checks
|
Co-authored-by: daledah <daledah@users.noreply.github.com>
|
Fixed the failing
|
|
@MelvinBot please continue with blockers #103913 #103922 |
Enter now only blurs the text input, so the save runs once from onBlur instead of from both onSubmitEditing and onBlur, which posted two identical system messages on iOS and Android. A cleared field is no longer saved, matching the report field editor page before inline editing. The input goes back to its saved value, and useSaveReportField skips empty values for every field, so no 'set <field> to ""' message is posted. Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I pushed fixes for both blockers to this branch in 87ad773:
The second fix changes behavior on purpose. Before, a cleared required field saved as empty and showed a "required" violation. Now it can't be cleared at all. QA flagged empty saves twice, here and in Expense - Empty report field can be saved, so I matched production. If you want clearing to work, the field change system message first needs new "removed" wording, in every language. I updated the two tests that expected empty saves and added one for Enter. All 53 tests in the report field test files pass, and lint, oxfmt, typecheck, and the React Compiler check pass. I didn't test in the app. The double save only happens on iOS and Android, and the web test tool can't press Enter. |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
@MelvinBot please fix blockers #103918 #103926 |
Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I pushed a fix for both blockers in e655bc1:
Cause: On an empty report, the report fields sit inside a Fix: I added Not verified on device: Both bugs happen only on iOS native, and I could only test on web, so please confirm on iOS. AI tests
|
|
@MelvinBot please merge main |
…idInlineEditing-restoreAgain Co-authored-by: daledah <daledah@users.noreply.github.com>
|
🤖 Merged |
@MelvinBot Please allow users to save a text field with an empty value, as OldDot supports this behavior. Also add a "removed {field} (previously …)" message for an empty newValue, with translations. |
Co-authored-by: daledah <daledah@users.noreply.github.com>
|
🤖 Clearing a text field now saves an empty value, and the report history shows
Notes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b99dd13fad
ℹ️ 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".
| // Only fields that are no longer on the workspace can be deleted. Their `deletable` flag is not | ||
| // checked: once the workspace drops a field, whether it was required no longer applies, and the | ||
| // report's copy of a date field can still be flagged as not deletable. | ||
| isFieldDeletable: field.fieldID !== CONST.REPORT_FIELD_TITLE_FIELD_ID && !isFieldOnPolicy && isEditable, |
There was a problem hiding this comment.
Don't treat reduced invoice fields as deleted
For an editable invoice viewed by its receiver/approver, the receiver's reduced policy can omit the sender's invoice field list, while the fields themselves are loaded from report name-value pairs. Consequently isFieldOnPolicy is false for every legitimate invoice field and this exposes delete buttons—even for required fields because deletable is intentionally ignored—allowing the receiver to remove fields that still exist on the sender's workspace. Distinguish reduced invoice policies from fields actually deleted from the workspace before enabling deletion.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I checked it, and I don't think a change is needed here. The invoice receiver can't edit invoice fields, so they never see a delete button.
Codex is right about one part. The receiver gets a reduced copy of the sender's policy without the invoice field list, so isFieldOnPolicy is false for every field. But line 177 also requires isEditable, and that is false for the receiver.
Why the receiver can't edit
isReportFieldDisabledForUserdisables a field for anyone who failsisAdminOwnerApproverOrReportOwner.- The receiver fails every part of that check:
- They aren't an admin or owner of the sender's workspace.
- They aren't the report owner. The sender is.
- The approver check needs
isMoneyRequestReport, which isfalsefor invoices.
- So
isEditableisfalseat line 157, andisFieldDeletableisfalse. - The one exception is a formula field with
deletable: true. The receiver can already delete that one from the edit page onmain, so this PR doesn't change it.
One related point is your call. The inline delete ignores deletable on purpose, as the comment at lines 174-176 explains. The edit page still checks it at DynamicEditReportFieldPage.tsx:136. So when a required field is removed from the workspace, it gets a delete button inline but not on its edit page. Tell me if you want the two checks to match.
|
@MelvinBot please resolve conflict |
|
@MelvinBot please remove #103909 from the |
…idInlineEditing-restoreAgain Co-authored-by: daledah <daledah@users.noreply.github.com> # Conflicts: # config/eslint/eslint.seatbelt.tsv
|
I merged
ESLint matches these counts, and |
|
I updated the PR description to drop Android - Expense - App scrolls down to mid report view when text report field is focused:
The |
|
@AndrewGable all yours 🙏 |
trjExpensify
left a comment
There was a problem hiding this comment.
Third time's a charm! 👍
|
🚧 AndrewGable 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 9.5.15-1 🚀
|
|
No help site update is needed: no article in |
|
Deploy Blocker #104507 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀
Bundle Size Analysis (Sentry): |


















Explanation of Change
This PR restores the reverted work and fixes the deploy blockers that caused the revert. It reverts Revert "Restore: Show up to three report fields per row and edit them inline", which backed out Restore: Show up to three report fields per row and edit them inline after 7 deploy blockers.
This PR fixes these deploy blockers:
removed {field} (previously "…").#103917 was demoted because it also happens in production.
The restore is
git revert -m 1of the revert's merge commit (c456cd8) on currentmain. Two files conflicted with changes made onmainsince then:src/components/DatePicker/index.tsx:mainadded aniconprop. I kept it alongside the restoredshouldEnableMonthYearBackdropInNarrowPaneandtextInputContainerStylesprops. The calendar icon now uses the restored hide rule and still falls back toicon ?? icons.Calendar.config/eslint/eslint.seatbelt.tsv: kept the restoredMoneyReportView.tsxno-unsafe-type-assertioncount of1. The lint run then removed theno-deprecated/MenuItemWithTopDescriptionentries forMoneyReportView.tsxandMoneyRequestViewReportFields.tsx, because the restored code no longer uses that component.Fixed Issues
$ #100259
$ #103860
$ #103913
$ #103918
$ #103922
$ #103926
PROPOSAL:
Tests
Precondition: A Control workspace with Report fields enabled and these report fields:
Text A: Text, with initial valuexText B: Text, with any initial valueDate: DateList: List, with at least 8 valuesFormula: FormulaText A, type a new value, and click away. Verify the value saves without leaving the report, and one system message shows the change.Text A, type another value, and press Enter. Verify the input loses focus and only one system message is added.Text Aand click away. Verify the empty value saves, and the system message readsremoved Text A (previously "…"), notset Text A to "". Verify a "required" violation shows under the field.Text Ais still empty.Date. Verify the calendar opens in place. Click the month or year header and verify the Month/Year picker opens with the background dimmed. Pick a date and verify it saves.List. Verify the option list opens under the field with a search input, and stays open. Pick a value and verify it saves.Text Bso the keyboard is open, then tapList. Verify the option list opens and stays open.Formulais read-only.Text Aso the keyboard is open, then tapText B. VerifyText Bgets focus on the first tap.List, type in the search input, and tap the clear button while the keyboard is open. Verify the search input clears.Text BandDate. Go back to the report from step 1.Text BandDatestill show their values, each with a trash button on the right edge. VerifyListandFormulahave no trash button.Dateand confirm "Delete field". Verify the field is removed. Repeat forText B.Text BandDatestay removed.Offline tests
Text Aand pick a newListvalue. Verify both values show right away.List. Verify there is no extra blank space at the bottom of the option list.QA Steps
Same as Tests and Offline tests.
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)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
See the test videos in the reviewer checklist.
Android: Native
See the reviewer checklist.
Android: mWeb Chrome
See the reviewer checklist.
iOS: Native
See the reviewer checklist.
iOS: mWeb Safari
See the reviewer checklist.
MacOS: Chrome / Safari
See the reviewer checklist.