Skip to content
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

Fix menu item padding #14855

Merged
merged 10 commits into from
Feb 27, 2023
Merged

Fix menu item padding #14855

merged 10 commits into from
Feb 27, 2023

Conversation

cristipaval
Copy link
Contributor

Details

Removes the extra inner padding when MenuItem has no left icon.

Fixed Issues

$ #14745

Tests and QA Steps

  1. Go to Settings -> Profile and verify that the left margin is 20px
  2. Go to Settings -> Preferences and verify that the left margin is 20px
  3. Go to Settings -> Profile -> Timezone and verify that the left margin is 20px
  4. Test that all other pages with menu items look as expected
  • Verify that no errors appear in the JS console

Offline tests

N/A

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 / Chrome
    • iOS / native
    • iOS / 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 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 verified the translation was requested/reviewed 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 correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • 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.js 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 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(themeColors.componentBG)
  • 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 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 have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
web.mov
Mobile Web - Chrome
android.chrome.mov
Mobile Web - Safari
ios.safari.mov
Desktop
desktop.mov
iOS
ios.native.mov
Android
android.native.mov

@cristipaval cristipaval requested a review from a team as a code owner February 6, 2023 13:28
@cristipaval cristipaval self-assigned this Feb 6, 2023
@melvin-bot melvin-bot bot requested review from aimane-chnaif and neil-marcellini and removed request for a team February 6, 2023 13:29
@melvin-bot
Copy link

melvin-bot bot commented Feb 6, 2023

@aimane-chnaif @neil-marcellini One of you needs to 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]

@aimane-chnaif
Copy link
Contributor

@cristipaval should we wait for design confirmation here?

@cristipaval
Copy link
Contributor Author

yeah, I think we better wait for @shawnborton to confirm it looks as expected. He is ooo today, so I think he will review it tomorrow the earliest.

Copy link
Contributor

@neil-marcellini neil-marcellini left a comment

Choose a reason for hiding this comment

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

I feel like the alignment with the back button in the header was better on the profile page before. The timezone page does look like an improvement.

Profile this branch
image

Profile staging.
image

@shawnborton
Copy link
Contributor

This looks good to me. I agree that the top back arrow feels a bit strange, but let's solve that in a different PR as that's been that way for a long time. The goal of this PR is to undo the left padding regression that was added, and I think it solves that.

shawnborton
shawnborton previously approved these changes Feb 7, 2023
@aimane-chnaif
Copy link
Contributor

@shawnborton which one is correct?

Before:
timezone1 copy

After:
timezone2 copy

Here's full diff video: (former is production, latter is this PR)

diff.mov

@cristipaval Also, please pull from latest main which now has Personal details in Profile page from #14290

@cristipaval
Copy link
Contributor Author

Thank you @shawnborton !

All on you @aimane-chnaif and @neil-marcellini

@shawnborton
Copy link
Contributor

This is what we'd like to see ideally:
image

Basically 20px padding from left and right edges of the frame.

So maybe we can follow up and have the left arrow use a smaller bounding box. I think we can adjust the hitbox area around it to make sure it's still easily tappable though.

@neil-marcellini
Copy link
Contributor

This is what we'd like to see ideally:

Why don't we fix it now? It doesn't seem that hard.

@shawnborton
Copy link
Contributor

That works for me.

@cristipaval
Copy link
Contributor Author

Feedback addressed.

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Feb 10, 2023

diff2.mov

I feel page title is too close to back button. It looks like previous page's title, similar to iOS default system navigation.
Is this only me?

@shawnborton
Copy link
Contributor

I quite like it actually!

@shawnborton
Copy link
Contributor

shawnborton commented Feb 10, 2023

But I am curious if the "X" button is wrapped in any kind of bigger box, and how close that is to the right side.

Same with the ">" carets on the rows - how close are they to the right edge?

Just want to make sure we get perfect spacing like this:
image

image

@aimane-chnaif
Copy link
Contributor

@cristipaval are you gonna fix @shawnborton's last feedback or already ready for final review?

@aimane-chnaif
Copy link
Contributor

@aimane-chnaif when will you be able to review this?

yes sorry, reviewing now

@aimane-chnaif
Copy link
Contributor

@cristipaval could you please pull from main for safety?

@neil-marcellini
Copy link
Contributor

@aimane-chnaif I think you can review without pulling from main since there are no merge conflicts. You could also pull main into the branch yourself if you want.

@aimane-chnaif
Copy link
Contributor

@aimane-chnaif I think you can review without pulling from main since there are no merge conflicts. You could also pull main into the branch yourself if you want.

Sure!

@aimane-chnaif
Copy link
Contributor

This should be fixed here?
personal details

@cristipaval
Copy link
Contributor Author

This should be fixed here? personal details

Yes it might be related as I changed the padding in MenuItem
Did you merge the main branch?

@aimane-chnaif
Copy link
Contributor

Did you merge the main branch?

yes locally, it's always safe to sync with main. I saw a few examples of regression caused after merging main but not happened on branch itself.

@aimane-chnaif
Copy link
Contributor

@cristipaval I fully tested all the pages where MenuItem is used. Only Personal details page has the issue above.
I think just removing this custom style will make consistent with others.

-                       wrapperStyle={[styles.ph2]}

@cristipaval
Copy link
Contributor Author

Hey @aimane-chnaif ! Thanks a lot for the rigorous testing! Of course in this case it makes sense to merge main and fix the regressions. I'll do it asap.

@cristipaval
Copy link
Contributor Author

@aimane-chnaif Could you please review again?

@aimane-chnaif
Copy link
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 tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / 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 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 correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • 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.js 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(themeColors.componentBG)
  • 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 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 have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web web
Mobile Web - Chrome

mchrome

Mobile Web - Safari

msafari

Desktop desktop
iOS

personal details
preferences
profile
timezone

Android

android

Copy link
Contributor

@neil-marcellini neil-marcellini left a comment

Choose a reason for hiding this comment

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

Looks great, time to merge!

@neil-marcellini neil-marcellini merged commit 7b906c7 into main Feb 27, 2023
@neil-marcellini neil-marcellini deleted the cristi_fix-menu-item-padding branch February 27, 2023 19:01
@github-actions
Copy link
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

Name Duration
Open Search Page TTI 614.621 ms → 684.101 ms (+69.481 ms, +11.3%) 🔴
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 614.621 ms
Stdev: 19.367 ms (3.2%)
Runs: 578.4970300002024 586.3745120000094 590.5492349998094 591.1116949999705 594.566284999717 595.7068690001033 597.0924879997037 598.7937830002047 598.9933270001784 599.8887119996361 600.2673749998212 601.9461669996381 605.7168379998766 609.5514320000075 610.0644539999776 611.5467129996978 613.7866219999269 617.4370530000888 620.7194019998424 621.1773269996047 621.8864750000648 622.3404139997438 623.266480000224 623.5943200001493 626.6362300002947 628.1034340001643 628.118978000246 632.3243820001371 633.6051440001465 636.0138759999536 644.2972820000723 659.0617279997095 659.4486489999108

Current
Mean: 684.101 ms
Stdev: 30.800 ms (4.5%)
Runs: 622.6841640002094 628.8419599998742 637.1457119998522 637.3024089997634 638.5823570000939 642.3842779998668 663.798014999833 666.7261959998868 667.0801599998958 667.0906169996597 674.988159999717 680.0457770000212 680.0926109999418 681.873576999642 681.8979500001296 683.1611330001615 683.2258709999733 687.318847999908 687.4530850001611 690.5655519999564 691.5059410003014 695.2193610002287 695.6475430000573 697.715657999739 706.963175999932 708.8898930000141 709.6192219997756 716.3987630000338 716.8908689999953 717.791016000323 726.2203369997442 741.1593019999564 749.0694180000573

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 727.858 ms → 749.244 ms (+21.386 ms, +2.9%)
App start runJsBundle 201.656 ms → 205.375 ms (+3.719 ms, +1.8%)
App start regularAppStart 0.014 ms → 0.018 ms (+0.004 ms, +25.8%) 🟡
App start nativeLaunch 19.724 ms → 19.517 ms (-0.207 ms, -1.0%)
Show details
Name Duration
App start TTI Baseline
Mean: 727.858 ms
Stdev: 25.131 ms (3.5%)
Runs: 682.4473179997876 686.2888190001249 687.1609109998681 696.6095309997909 701.2580419997685 702.0754959997721 704.178170000203 708.9691030001268 711.2054360001348 711.2232699999586 713.6142970002256 714.3849659999833 722.0923350001685 722.2033999999985 725.0755969998427 726.9892600001767 727.0938829998486 731.4194849999622 731.6143450001255 742.8303020000458 744.4577640001662 745.4458469999954 747.6216009999625 748.4537080000155 749.1215889998712 752.5218930002302 758.5818520002067 763.6872999998741 767.6770999999717 768.24508399982 769.0642180000432

Current
Mean: 749.244 ms
Stdev: 25.002 ms (3.3%)
Runs: 701.545361999888 709.5510379998013 718.8464640001766 719.9722879999317 722.8914499999955 725.8856139997952 727.0605230000801 731.1595820002258 735.1464610002004 736.1493739997968 738.5424080002122 741.5522079998627 741.9007210000418 743.6199130001478 746.7937130001374 747.5324860000983 749.5230939998291 750.689600000158 751.1183070000261 752.3302670000121 754.6745679997839 756.4771079998463 762.7050959998742 764.9452610001899 768.3681700001471 772.0218009999953 776.0003860001452 779.6136150001548 788.0599059998058 800.258808999788 811.6282270001248
App start runJsBundle Baseline
Mean: 201.656 ms
Stdev: 18.455 ms (9.2%)
Runs: 162 171 172 180 182 184 187 188 189 191 195 195 195 200 200 203 203 205 206 206 206 207 207 209 214 222 222 223 224 228 238 239

Current
Mean: 205.375 ms
Stdev: 14.912 ms (7.3%)
Runs: 185 187 187 187 188 189 193 193 194 195 197 198 198 198 199 203 204 205 206 209 210 212 212 212 216 220 222 223 223 228 234 245
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (5.8%)
Runs: 0.012898999731987715 0.013061000034213066 0.01318400027230382 0.01318400027230382 0.013224000111222267 0.013427999801933765 0.013549000024795532 0.013631999958306551 0.013712999876588583 0.013712999876588583 0.013875000178813934 0.013875999953597784 0.013916000258177519 0.013956999871879816 0.014119000174105167 0.014119000174105167 0.014119999948889017 0.014200999867171049 0.014201000332832336 0.014405000023543835 0.014689000323414803 0.014771000016480684 0.014771000016480684 0.014852000400424004 0.014933000318706036 0.014973999932408333 0.015137000009417534 0.015176999848335981 0.015177999623119831 0.015339999925345182 0.015625 0.016478999983519316

Current
Mean: 0.018 ms
Stdev: 0.001 ms (5.1%)
Runs: 0.015583999920636415 0.015910000074654818 0.016764000058174133 0.017090000212192535 0.01717099966481328 0.017211999744176865 0.0174150001257658 0.017455999739468098 0.017456000205129385 0.017537000123411417 0.017537000123411417 0.017741000279784203 0.017821999732404947 0.017822000198066235 0.017822999972850084 0.018066000193357468 0.018066999968141317 0.01814799988642335 0.018269999884068966 0.018350999802350998 0.01847400004044175 0.018757999874651432 0.01875800034031272 0.018798000179231167 0.018798999954015017 0.018798999954015017 0.0188400000333786 0.019001999869942665 0.01904299994930625 0.01981700025498867
App start nativeLaunch Baseline
Mean: 19.724 ms
Stdev: 2.032 ms (10.3%)
Runs: 17 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 21 21 21 22 22 24 24 25

Current
Mean: 19.517 ms
Stdev: 1.500 ms (7.7%)
Runs: 17 17 17 18 18 18 18 18 19 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 21 21 21 22 23

@github-actions github-actions bot added the DeployBlockerCash This issue or pull request should block deployment label Feb 27, 2023
@github-actions
Copy link
Contributor

@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.2.77-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.2.77-0 🚀

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

@esh-g
Copy link
Contributor

esh-g commented Feb 28, 2023

I think I found a regression. The phone number is not inline with e-mail in contact methods
https://expensify.slack.com/archives/C049HHMV9SM/p1677573548049769

Screenshot 2023-02-28 at 2 32 41 PM

Could someone please confirm whether this is intended or not?

@neil-marcellini
Copy link
Contributor

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.77-4 🚀

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DeployBlockerCash This issue or pull request should block deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants