Skip to content

fix: aligned the spacing for the FeatureTraining, 2FA, FocusMode, DecisionModal, and ConfirmModal #61181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

linhvovan29546
Copy link
Contributor

@linhvovan29546 linhvovan29546 commented Apr 30, 2025

Explanation of Change

In this PR, we aligned the spacing for the FeatureTraining, 2FA, DecisionModal, and ConfirmModal to a consistent 20px.

Fixed Issues

$ #60779
PROPOSAL: #60779 (comment)

Tests

Precondition: Create a new Expensifail account on Web.

  1. Open the Expensify app
  2. Log in with the Expensifail account
  3. Wait until the "Welcome to Expensify" modal appears
  4. Verify that the modal's bottom spacing is correct (i.e., not too large).

We should also test other bottom modals such as the Focus Mode modal, the Two-Factor Authentication Required modal, Confirm modal. Please refer to the screenshot for more details.

  • Verify that no errors appear in the JS console

Offline tests

Same as above

QA Steps

Same as above

  • 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
    • MacOS: Desktop
  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Screenshot_1746019688

Screenshot_1746019669

Screenshot_1746057129

Screenshot_1746095333

Screen.Recording.2025-05-06.at.21.22.41.mov
Android: mWeb Chrome

Screenshot_1746019642

Screenshot_1746019473

Screenshot_1746057209

Screenshot_1746095355

Uploading Screen Recording 2025-05-06 at 21.22.41.mov…

iOS: Native

Simulator Screenshot - iPhone 16 Pro Max - 2025-04-30 at 20 24 20

Simulator Screenshot - iPhone 16 Pro Max - 2025-04-30 at 20 24 02

Simulator Screenshot - iPhone 16 Pro Max - 2025-05-01 at 17 22 14

Simulator Screenshot - iPhone 16 Pro Max - 2025-05-01 at 17 27 11

Screen.Recording.2025-05-06.at.21.25.23.mov
iOS: mWeb Safari

Simulator Screenshot - iPhone 16 Pro Max - 2025-04-30 at 20 23 31

Simulator Screenshot - iPhone 16 Pro Max - 2025-04-30 at 20 23 16

Simulator Screenshot - iPhone 16 Pro Max - 2025-05-01 at 17 21 45

Simulator Screenshot - iPhone 16 Pro Max - 2025-05-01 at 17 27 42

Screen.Recording.2025-05-06.at.21.26.51.mov
MacOS: Chrome / Safari Screenshot 2025-04-30 at 20 22 37 Screenshot 2025-04-30 at 20 22 49 Screenshot 2025-05-01 at 06 51 47 Screenshot 2025-05-01 at 17 28 06
Screen.Recording.2025-05-06.at.21.20.22.mov
MacOS: Desktop Screenshot 2025-04-30 at 20 29 59 Screenshot 2025-04-30 at 20 29 44 Screenshot 2025-05-01 at 17 31 30 Screenshot 2025-05-01 at 17 32 15
Screen.Recording.2025-05-06.at.21.28.57.mov

@linhvovan29546 linhvovan29546 force-pushed the fix/60779-extra-padding-bottom-in-bottom-modal branch from a37f086 to 77d4980 Compare April 30, 2025 12:39
@linhvovan29546
Copy link
Contributor Author

linhvovan29546 commented Apr 30, 2025

Hi @Expensify/design I need to confirm the bottom spacing applied in the bottom modals addressed in this PR..
The bottom padding for the Welcome Video modal is 20px. However, in other places—such as the Context Menu—we are using 16px.

Could we clarify the expected spacing for consistency?
Specifically:

  • When should we apply 20px?

  • When should we apply 16px?

Context menu Welcome Modal
Screenshot 2025-04-30 at 19 47 40 Screenshot 2025-04-30 at 19 53 45

|


and the Focus Mode modal has 36px. Could you please advise which bottom spacing I should use here as well?

Screenshot 2025-04-30 at 19 59 37

@linhvovan29546 linhvovan29546 marked this pull request as ready for review April 30, 2025 23:54
@linhvovan29546 linhvovan29546 requested a review from a team as a code owner April 30, 2025 23:54
@melvin-bot melvin-bot bot requested review from hoangzinh and removed request for a team April 30, 2025 23:54
Copy link

melvin-bot bot commented Apr 30, 2025

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

@hoangzinh
Copy link
Contributor

hoangzinh commented May 1, 2025

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
    • MacOS: Desktop
  • 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 there are no new alerts related to the canBeMissing param for useOnyx
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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.2025-05-01.at.19.32.14.android.mov
Android: mWeb Chrome
Screen.Recording.2025-05-01.at.20.46.50.android.chrome.mov
iOS: HybridApp
Screen.Recording.2025-05-01.at.20.44.31.ios.mov
iOS: mWeb Safari
Screen.Recording.2025-05-01.at.20.45.53.ios.safari.mov
MacOS: Chrome / Safari
Screen.Recording.2025-05-01.at.19.25.08.web.mov
MacOS: Desktop
Screen.Recording.2025-05-01.at.19.32.14.android.mov

@hoangzinh
Copy link
Contributor

@linhvovan29546 can you update the PR title to reflect what we're fixing here? The current PR title has a large scope.

@linhvovan29546 linhvovan29546 changed the title fix: extra padding bottom in bottom modal fix: remove extra bottom spacing in welcome, two-factor required, focus mode modal May 1, 2025
@linhvovan29546
Copy link
Contributor Author

I've updated it, does the title look correct now?

@hoangzinh
Copy link
Contributor

Look good. I found that the changes you made also affect BookTravelButton. Can you take a look to ensure we won't cause any regression issues there? Thank you.

@linhvovan29546
Copy link
Contributor Author

linhvovan29546 commented May 1, 2025

Yes, I tested it locally. Do you think we should provide a screenshot for reference?
Added screenshots

@linhvovan29546 linhvovan29546 changed the title fix: remove extra bottom spacing in welcome, two-factor required, focus mode modal fix: remove extra bottom spacing in welcome(feature training), two-factor required, focus mode modal May 1, 2025
@melvin-bot melvin-bot bot requested a review from mollfpr May 1, 2025 13:48
@mollfpr
Copy link
Contributor

mollfpr commented May 1, 2025

I think the confirmation here #61181 (comment) is important. Let's wait for them.

@linhvovan29546
Copy link
Contributor Author

Hi @Expensify/design team. Could you please help confirm the comment above^ #61181 (comment) In this PR, I used a bottom spacing of 20px. However, in other places—such as the ConfirmModal below, we use 36px (The spacing is the same as the top). Just want to ensure we're aligned on the correct spacing value
Screenshot 2025-05-02 at 07 24 48

@dubielzyk-expensify
Copy link
Contributor

I just looked over the app to find a more appropriate example, but I now see that it looks like all the confirmation modals have the wrong padding at the top:

image

This looks like a regression of sorts to me or are my eyes fooling me @Expensify/design ?

This is the measurements we use in Figma for confirmation modals on desktop and mobile:

image

@dubielzyk-expensify
Copy link
Contributor

It's also worth mentioning that the modals outlined in the example in this comment are actually 3 separate and different modals than the confirmation modal so they will follow slightly different paddings.

@shawnborton
Copy link
Contributor

Good eye Jon, I agree it seems like we're dealing with a regression here and we should try to align with what we have in Figma.

As for mobile's bottom padding, I think the idea is that we always use a standard 20px + whatever the SafeSpace is that we need depending on the platform?

cc @blazejkustra who has been making lots of modal changes recently, perhaps you have an idea what's going on here?

@blazejkustra
Copy link
Contributor

cc @blazejkustra who has been making lots of modal changes recently

Good callout! I checked whether our recent updates to bottom modals caused this regression, but it turns out they’re not related.

Perhaps you have an idea what's going on here?

For the 2fa and feature training modals, safe area paddings were being applied twice — this has already been fixed in this PR.

As for the confirm modal (which hasn’t been migrated yet — see this PR). I suspect margin is applied in multiple places and the final amount it > 20px. It doesn’t appear to be a recent regression. Most likely it had this amount of margin for a while already.

@shawnborton
Copy link
Contributor

Okay cool, thanks for confirming!

@linhvovan29546
Copy link
Contributor Author

What’s the next step here? Should we update the spacing in the ConfirmModal to 20px? cc @mollfpr @hoangzinh

@shawnborton
Copy link
Contributor

That would be my vote, yup. We should make these all consistent.

@linhvovan29546 linhvovan29546 changed the title fix: remove extra bottom spacing in welcome(feature training), two-factor required, focus mode modal fix: aligned the spacing for the FeatureTraining, 2FA, DecisionModal, and ConfirmModal May 6, 2025
@linhvovan29546 linhvovan29546 changed the title fix: aligned the spacing for the FeatureTraining, 2FA, DecisionModal, and ConfirmModal fix: aligned the spacing for the FeatureTraining, 2FA, FocusMode, DecisionModal, and ConfirmModal May 6, 2025
@linhvovan29546
Copy link
Contributor Author

@shawnborton I've updated the spacing in the ConfirmModal for consistent, and also applied the same update to the DecisionModal. You might want to trigger an ad-hoc run for testing.

@linhvovan29546 linhvovan29546 requested a review from hoangzinh May 6, 2025 14:39
@shawnborton
Copy link
Contributor

Can do!

Copy link
Contributor

github-actions bot commented May 6, 2025

🚧 @shawnborton has triggered a test app build. You can view the workflow run here.

Copy link
Contributor

github-actions bot commented May 6, 2025

🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪

Android 🤖 iOS 🍎
Android 🤖🔄 iOS 🍎🔄
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/61181-hybrid/index.html https://ad-hoc-expensify-cash.s3.amazonaws.com/ios/61181-hybrid/index.html
Android iOS
Desktop 💻 Web 🕸️
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/61181/NewExpensify.dmg https://61181.pr-testing.expensify.com
Desktop Web

👀 View the workflow run that generated this build 👀

@shawnborton
Copy link
Contributor

Let us know when new screenshots/videos are ready to review as well.

@linhvovan29546
Copy link
Contributor Author

The screenshots/videos have already been updated. #61181 (comment)

@shawnborton
Copy link
Contributor

Nice, feeling good to me 👍

@mollfpr
Copy link
Contributor

mollfpr commented May 7, 2025

Thank you all for the design review! @hoangzinh Could you do another review round? Thanks!

Copy link
Contributor

@hoangzinh hoangzinh left a comment

Choose a reason for hiding this comment

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

LGTM. Tested again on new changes

@mollfpr mollfpr merged commit fdc8093 into Expensify:main May 7, 2025
22 checks passed
@linhvovan29546 linhvovan29546 deleted the fix/60779-extra-padding-bottom-in-bottom-modal branch May 7, 2025 10:41
@OSBotify
Copy link
Contributor

OSBotify commented May 7, 2025

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

Copy link
Contributor

github-actions bot commented May 8, 2025

🚀 Deployed to staging by https://github.com/mollfpr in version: 9.1.42-0 🚀

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

Copy link
Contributor

github-actions bot commented May 9, 2025

🚀 Deployed to staging by https://github.com/mollfpr in version: 9.1.43-5 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

Copy link
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.1.44-8 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 success ✅

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.

7 participants