Fix Submit plan welcome modal: navigate to existing Submit workspace and remove double bottom safe-area padding#96459
Conversation
Fixes two issues reported against the Submit plan welcome modal: - Navigate to the existing Submit workspace instead of Home when an already-onboarded user confirms the modal while an editable Submit workspace already exists (Expensify#96123). The fallback is scoped to callers that skip onboarding completion so the onboarding flows are untouched. - Stop applying the bottom safe-area inset twice on Android by letting CenteredModalLayout consumers opt out of the wrapper inset when their content (FeatureTrainingContent's ScrollView) already includes it, removing the empty band under the modal buttons (Expensify#96121).
|
@mkhutornyi 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] |
|
this is ready for review @hungvu193 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0504da1c11
ℹ️ 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".
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Fixing Deploy Blockers
|
LGTM @abzokhattab Can you merge main again? I think we have eslint failing |
Pass currentUserEmail to canEditWorkspaceSettings so the per-employee role fallback covers partially-loaded Submit policies without a top-level role (Codex review). Share a single useOnyx mock cast in the hook test to keep the file within its eslint-seatbelt allowance.
|
Merged latest main and fixed the ESLint failure @hungvu193 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-07-22.at.12.12.03.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-07-22.at.12.26.57.moviOS: mWeb SafariScreen.Recording.2026-07-22.at.12.22.16.movMacOS: Chrome / SafariScreen.Recording.2026-07-22.at.11.48.37.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 iwiznia 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/iwiznia in version: 9.4.43-0 🚀
|
|
🤖 I reviewed the changes in this PR against the help site content under No help site changes are required. No draft PR was created. Why: This PR is a pair of internal bug fixes to the Submit plan welcome modal — it does not add or change any documented, user-facing behavior:
The one related article, Difference between Classic Track, Classic Submit, Submit plan, Collect, and Control, documents what the plan types are — not the welcome modal's navigation target or its padding — so it remains accurate as-is. There is no help site content describing the "Get the free plan" modal flow that these fixes would affect. @abzokhattab, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.43-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Fixes the two bugs reported against the Submit plan welcome modal introduced in #95099.
1. Home page opens after clicking "Get the free plan" when a Submit workspace already exists (#96123)
When the modal is opened again (via the
/workspaces/submit-plan-welcomedeep link) after a Submit workspace was already created,useAutoCreateSubmitWorkspaceskips workspace creation (hasEditableGroupPolicyistrue) and falls back toonboardingPolicyID, which is empty for an already-onboarded user.navigateToSubmitWorkspaceAfterOnboardingthen receivesundefinedand lands on Home.Fix: add a second policy-collection selector that resolves the ID of the user's existing editable Submit workspace, and use it as the navigation fallback. The fallback is scoped to already-onboarded callers (
shouldCompleteOnboarding === false, i.e. only the welcome modal): the three onboarding call sites (BaseOnboardingPurpose,BaseOnboardingPersonalDetails,BaseOnboardingWorkspaces) keep their exact current behavior, and thecompleteOnboardingpayload is untouched, so there is no regression surface for the onboarding flows.2. Free plan modal shows empty space at the bottom on Android (#96121)
The bottom safe-area inset was applied twice on devices with a bottom inset (e.g. Android gesture bar): once by
CenteredModalLayout's content wrapper (viauseBottomSafeSafeAreaPaddingStyle, which adds the inset on top of the modal's zeroedpb0), and once byFeatureTrainingContent's ScrollView content padding (getScrollableFeatureTrainingModalStyles=pb5 + inset). The result was apb5 + 2×insetempty band under the buttons — invisible on web where the inset is 0.Fix: add an
addBottomSafeAreaPaddingprop (defaulttrue) toCenteredModalLayoutso consumers whose children already handle the inset can opt out, and passfalsefromSubmitPlanWelcomeModal. Existing consumers are unaffected by default. Note:MigratedUserWelcomeModal,AutoSubmitModal, andChangePolicyEducationalModaluse the same pattern and share this latent double-inset; they can opt in via the same prop in a follow-up once verified on device.Also adds two unit tests covering the navigation fallback (modal path navigates to the existing Submit workspace; onboarding path behavior unchanged).
Fixed Issues
$ #96121
$ #96123
PROPOSAL:
Tests
#96123 — navigation to existing Submit workspace:
SUBMIT_2026beta for your account.https://dev.new.expensify.com:8082/workspaces/submit-plan-welcome.#96121 — no empty space at the bottom (Android):
https://dev.new.expensify.com:8082/workspaces/submit-plan-welcome.Offline tests
QA Steps
Same as tests.
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-19.at.18.00.48.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-07-19.at.17.58.25.mov
iOS: mWeb Safari
Screen.Recording.2026-07-19.at.17.59.46.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-19.at.17.52.32.mov