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

Add safe area padding to error page #14295

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Jan 13, 2023

Details

Adds safe area padding to the generic error page

Fixed Issues

$ #14283

Tests

  1. Force an error by adding a throw new Error() anywhere in a React component that is rendered
  2. Verify the Generic Error Page as correct bottom padding.
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

No QA as there is no way to simulate an error in staging (or should not be at least) 😄

  • 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 / 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
    • 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

2023-01-17_14-35-09

Mobile Web - Chrome 2023-01-17_14-48-06
Mobile Web - Safari 2023-01-17_14-33-31
Desktop

2023-01-17_14-49-59

iOS 2023-01-17_14-33-31
Android 2023-01-17_14-47-17

@marcaaron marcaaron self-assigned this Jan 13, 2023
@marcaaron marcaaron marked this pull request as ready for review January 18, 2023 00:51
@marcaaron marcaaron requested a review from a team as a code owner January 18, 2023 00:51
@melvin-bot melvin-bot bot requested review from mananjadhav and sketchydroide and removed request for a team January 18, 2023 00:52
@melvin-bot
Copy link

melvin-bot bot commented Jan 18, 2023

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

@sketchydroide
Copy link
Contributor

looks good, but I'll wait for @mananjadhav

@mananjadhav
Copy link
Collaborator

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-error-page
Mobile Web - Chrome mweb-chrome-error-page
Mobile Web - Safari mweb-safari-error-page
Desktop desktop-error-page
iOS ios-error-page
Android android-error-page

Thanks for waiting @sketchydroide. I reviewed and tested the changes. Seems to be working fine, not sure if we can QA this. Good to merge here.

@sketchydroide
Copy link
Contributor

sorry @mananjadhav but maybe we need to update the checklist?

@sketchydroide
Copy link
Contributor

reran and it was fine 🤷🏼

@sketchydroide sketchydroide merged commit b197f26 into main Jan 19, 2023
@sketchydroide sketchydroide deleted the marcaaron-addSafeAreaPaddingToErrorPage branch January 19, 2023 15:31
@OSBotify
Copy link
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
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 676.189 ms → 707.546 ms (+31.357 ms, +4.6%)
App start runJsBundle 183.125 ms → 200.219 ms (+17.094 ms, +9.3%)
App start nativeLaunch 20.219 ms → 21.355 ms (+1.136 ms, +5.6%)
App start regularAppStart 0.016 ms → 0.015 ms (-0.001 ms, -7.0%)
Open Search Page TTI 612.564 ms → 606.254 ms (-6.311 ms, -1.0%)
Show details
Name Duration
App start TTI Baseline
Mean: 676.189 ms
Stdev: 27.668 ms (4.1%)
Runs: 619.9907770007849 626.6918020006269 639.3439719993621 644.2542090006173 645.1532439999282 653.2201339993626 653.7678319998085 653.8721389994025 655.8705759998411 655.9203760009259 655.9712000004947 657.7325589992106 665.5685469992459 676.5160080008209 676.6839150004089 677.9386630002409 680.3615739997476 682.0370540004224 683.7521080002189 684.5807830002159 684.8518219999969 687.2071839999408 689.026004999876 689.3598570004106 692.1773080006242 698.9225869998336 703.1953699998558 715.3560760002583 717.1988759990782 717.421651000157 723.5525519996881 730.5505359992385

Current
Mean: 707.546 ms
Stdev: 30.600 ms (4.3%)
Runs: 646.4729800000787 651.4596480000764 655.02594400011 664.8614520002156 669.2782749999315 678.384103000164 684.9988880008459 687.1239449996501 689.0649750009179 693.1213080007583 694.0163070000708 694.2820859998465 702.6849969998002 703.7786640003324 704.150667000562 705.5757749993354 707.5376449991018 714.8939369991422 718.2797040008008 718.8268909994513 730.1478070002049 731.3549199998379 731.8465659990907 733.4900359995663 737.377722999081 739.5252880007029 742.6733640003949 747.2229180000722 748.4879410006106 750.9287340007722 757.0596660003066
App start runJsBundle Baseline
Mean: 183.125 ms
Stdev: 22.617 ms (12.4%)
Runs: 156 157 158 159 161 163 164 165 166 167 168 170 170 171 171 175 176 180 180 182 184 185 191 206 206 211 212 212 215 218 218 243

Current
Mean: 200.219 ms
Stdev: 24.613 ms (12.3%)
Runs: 159 169 171 176 177 177 177 178 181 185 186 187 191 193 193 194 197 202 203 204 205 205 206 210 216 217 222 227 244 245 248 262
App start nativeLaunch Baseline
Mean: 20.219 ms
Stdev: 2.288 ms (11.3%)
Runs: 17 17 18 18 18 18 18 18 18 19 19 19 19 19 19 20 20 20 20 20 21 21 21 22 22 22 23 23 24 24 24 26

Current
Mean: 21.355 ms
Stdev: 2.585 ms (12.1%)
Runs: 18 18 18 19 19 19 19 19 19 19 20 20 20 20 20 20 21 22 22 22 23 23 23 24 24 24 24 24 25 26 28
App start regularAppStart Baseline
Mean: 0.016 ms
Stdev: 0.001 ms (5.7%)
Runs: 0.015178000554442406 0.015178000554442406 0.015178000554442406 0.01521800085902214 0.015461999922990799 0.01550300046801567 0.015542998909950256 0.015625 0.015705998986959457 0.01574699953198433 0.015828000381588936 0.015828000381588936 0.01590999960899353 0.01603199914097786 0.01607300154864788 0.016276000067591667 0.01648000068962574 0.01672299951314926 0.01672300137579441 0.016845999285578728 0.016927000135183334 0.017048999667167664 0.017048999667167664 0.0170889999717474 0.017130998894572258 0.017659999430179596 0.017740000039339066 0.019164999946951866

Current
Mean: 0.015 ms
Stdev: 0.001 ms (6.3%)
Runs: 0.013956999406218529 0.013997001573443413 0.0139979999512434 0.014079000800848007 0.01411999948322773 0.014364000409841537 0.014444999396800995 0.014485999941825867 0.014526000246405602 0.014608001336455345 0.01464799977838993 0.01476999931037426 0.014810999855399132 0.014892999082803726 0.014893000945448875 0.014973999932408333 0.015014000236988068 0.015014000236988068 0.015015000477433205 0.015137000009417534 0.015298999845981598 0.015421999618411064 0.01574699953198433 0.01574699953198433 0.015828000381588936 0.015992000699043274 0.016112999990582466 0.016397999599575996 0.01660200022161007 0.01765899918973446 0.01769999973475933
Open Search Page TTI Baseline
Mean: 612.564 ms
Stdev: 24.701 ms (4.0%)
Runs: 556.3075370006263 567.9675700012594 590.4613450001925 590.5490320008248 591.9125169999897 593.0410970002413 595.0264489986002 597.2266849987209 599.0677899997681 600.699869999662 600.7513429988176 601.3881839998066 603.4334720000625 605.6272790003568 607.1772869993001 607.3146569989622 608.8550209999084 610.9583740010858 612.0292569994926 612.3582770004869 615.1579589992762 615.3823240008205 619.1188970003277 625.0113120004535 625.4321699999273 633.4260660000145 638.2424320001155 645.9417320005596 646.0907390005887 651.6772869993001 662.6638179998845 671.7646079994738

Current
Mean: 606.254 ms
Stdev: 20.028 ms (3.3%)
Runs: 570.8224289994687 577.4243579991162 578.5096030011773 580.5231940001249 581.2208249997348 581.4655360002071 582.9108479991555 586.3380539994687 588.4024249985814 590.2683109994978 593.0702309999615 593.5336509998888 604.4724119994789 604.7793790008873 605.5109459999949 607.8774009998888 607.9661049991846 608.1528329998255 609.297607999295 611.6256920006126 613.0656749997288 613.1335859987885 615.78540099971 620.2283939998597 620.4017340000719 624.1995040010661 624.6487230006605 629.0917560011148 631.3412270005792 632.0002440009266 632.7746999990195 634.1269939988852 651.4082440007478

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/sketchydroide in version: 1.2.57-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 1.2.57-3 🚀

platform result
🤖 android 🤖 failure ❌
🖥 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants