Skip to content

Fix Submit plan welcome modal: navigate to existing Submit workspace and remove double bottom safe-area padding#96459

Merged
iwiznia merged 3 commits into
Expensify:mainfrom
abzokhattab:fix/submit-plan-modal-96121-96123
Jul 22, 2026
Merged

Fix Submit plan welcome modal: navigate to existing Submit workspace and remove double bottom safe-area padding#96459
iwiznia merged 3 commits into
Expensify:mainfrom
abzokhattab:fix/submit-plan-modal-96121-96123

Conversation

@abzokhattab

@abzokhattab abzokhattab commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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-welcome deep link) after a Submit workspace was already created, useAutoCreateSubmitWorkspace skips workspace creation (hasEditableGroupPolicy is true) and falls back to onboardingPolicyID, which is empty for an already-onboarded user. navigateToSubmitWorkspaceAfterOnboarding then receives undefined and 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 the completeOnboarding payload 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 (via useBottomSafeSafeAreaPaddingStyle, which adds the inset on top of the modal's zeroed pb0), and once by FeatureTrainingContent's ScrollView content padding (getScrollableFeatureTrainingModalStyles = pb5 + inset). The result was a pb5 + 2×inset empty band under the buttons — invisible on web where the inset is 0.

Fix: add an addBottomSafeAreaPadding prop (default true) to CenteredModalLayout so consumers whose children already handle the inset can opt out, and pass false from SubmitPlanWelcomeModal. Existing consumers are unaffected by default. Note: MigratedUserWelcomeModal, AutoSubmitModal, and ChangePolicyEducationalModal use 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:

  1. Enable the SUBMIT_2026 beta for your account.
  2. Log in with an account that has no workspaces, open any chat, and send the link https://dev.new.expensify.com:8082/workspaces/submit-plan-welcome.
  3. Click the link and click Get the free plan. Verify a Submit workspace is created and you land on Workspace → Categories.
  4. Go back to the chat, click the same link again, and click Get the free plan.
  5. Verify you are taken to the Categories page of the existing Submit workspace (not the Home page), and no duplicate workspace is created.

#96121 — no empty space at the bottom (Android):

  1. On an Android device with gesture navigation (bottom inset), open any chat and send the link https://dev.new.expensify.com:8082/workspaces/submit-plan-welcome.
  2. Tap the link.
  3. Verify the modal shows no empty band below the "Get the free plan" / "No thanks" buttons.
  4. On web/desktop, verify the modal layout is unchanged.

Offline tests

  1. With an account that already has a Submit workspace, go offline.
  2. Open the modal via the deep link and tap Get the free plan.
  3. Verify you are navigated to the existing Submit workspace's Categories page and no duplicate workspace is created optimistically.

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

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

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).
@abzokhattab
abzokhattab marked this pull request as ready for review July 19, 2026 16:08
@abzokhattab
abzokhattab requested review from a team as code owners July 19, 2026 16:08
@melvin-bot
melvin-bot Bot requested review from a team, joekaufmanexpensify and mkhutornyi and removed request for a team July 19, 2026 16:08
@melvin-bot

melvin-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

@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]

@melvin-bot
melvin-bot Bot requested review from heyjennahay and removed request for a team July 19, 2026 16:08
@abzokhattab

Copy link
Copy Markdown
Contributor Author

this is ready for review @hungvu193

@hungvu193
hungvu193 requested review from hungvu193 and removed request for mkhutornyi July 19, 2026 16:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/hooks/useAutoCreateSubmitWorkspace.ts Outdated

@joekaufmanexpensify joekaufmanexpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing Deploy Blockers

@hungvu193

Copy link
Copy Markdown
Contributor

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.
@abzokhattab

Copy link
Copy Markdown
Contributor Author

Merged latest main and fixed the ESLint failure @hungvu193

@hungvu193

hungvu193 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-07-22.at.12.12.03.mov
Android: mWeb Chrome
iOS: HybridApp
Screen.Recording.2026-07-22.at.12.26.57.mov
iOS: mWeb Safari
Screen.Recording.2026-07-22.at.12.22.16.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-22.at.11.48.37.mov

@hungvu193
hungvu193 requested a review from iwiznia July 22, 2026 06:09
@iwiznia
iwiznia merged commit a93e446 into Expensify:main Jul 22, 2026
35 of 36 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 iwiznia has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/iwiznia in version: 9.4.43-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 I reviewed the changes in this PR against the help site content under docs/articles.

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 Ready for review — since no docs change was needed here, there is no linked help site PR to review.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.43-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants