Improve Form-SubmitButton INP#95783
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@ikevin127 Please 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] |
|
@nabi-ebrahimi You mentioned 3 |
|
@ikevin127 I’ve added the missing tests and fixed the TS issue. Could you please take another look? Thanks! |
Reviewer Checklist
Screenshots/VideosiOS: NativeSimulator.Screen.Recording.-.iPhone.17.Pro.Max.-.2026-07-11.at.16.11.18.movMacOS: Chrome / SafariScreen.Recording.2026-07-11.at.14.49.50.mov |
🧪 Test coverage of the diff —
|
|
@nabi-ebrahimi Completed the review, got 3 comments above that should be addressed before approval 🙌 |
|
@ikevin127 Addressed your feedback and added the missing tests. Could you take another look? thanks! |
There was a problem hiding this comment.
🟢 LGTM: Tests well - Thanks for addressing the comments 🙌
Note
One small note (not a regression, just an observation):
The MockFormWrapperProps type was expanded to include isAlertVisible, serverErrorFields, serverErrorMessage, but the mock's render body still only destructures {children, onSubmit, isLoading}.
That's fine and intentional — the new assertions read from mockFormWrapper.mock.calls, not the rendered output, so the extra props don't need rendering. No action needed ✅
@nabi-ebrahimi Noticing some conflicts, please address before CME's final review to help streamline the process to merge. Thank you!
|
@rlinoz, resolved the conflicts. All yours. Thanks! |
|
@rlinoz, could you please take a look at this pr when you get a chance. thanks. |
|
Sorry, yes, reviewing now. |
|
🚧 rlinoz 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/rlinoz in version: 9.4.36-0 🚀
|
|
🤖 I reviewed the changes in this PR against Expensify's help site content under No help site changes are required. This PR is an internal performance refactor of the shared The change is purely implementation-level:
Help site articles document user-facing product features, settings, and workflows — none of which change here. There are no new or renamed features, tabs, settings labels, or buttons to document, so no draft PR was created. @nabi-ebrahimi, since no help site PR was needed, there's nothing to review here. If you believe this refactor does change documented behavior, let me know and I'll take another look. |
Explanation of Change
This PR reduces redundant Onyx work in the shared
Form-SubmitButtonsubmit path.FormWrapperno longer subscribes to the same form Onyx key asFormProvider, andonValidate()now avoids clearing server errors and server error fields when no Onyx-backed errors exist. The submit alert state, server error message, server field errors, and combined loading state are derived once inFormProviderand passed toFormWrapper, while preserving the existing “fix the errors” focus behavior. No submit timing, offline handling, or form semantics were intentionally changed.Fixed Issues
$ #94720
PROPOSAL: #94720 (Comment)
Tests
Settings > Profile > Display name.Save.Error flow
Settings > Profile > Display name.Save.Offline tests
Same as tests
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Screen.Recording.2026-07-10.at.9.51.09.PM.mov
Android: mWeb Chrome
Screen_Recording_20260710_213915_Chrome.mp4
iOS: Native
Screen.Recording.2026-07-10.at.9.02.54.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-07-10.at.10.07.01.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-10.at.9.59.10.PM.mov