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

Android/IOS app does not focus on date of birth field when 'fix the errors' link is clicked #15473

Merged

Conversation

narefyev91
Copy link
Contributor

Details

Native apps does not fire focus on field with editable={false} prop.
To make it working we need to use custom ref with showPicker function fired on focus, function will be executed - and default picker will be shown.
Also there are some improvements:

  1. We don't really need e.preventDefault() for native apps - it's doing nothing in particular case
  2. We need to close calendar picker before firing onInputChange (when date selected) - it will fix issue with shacked calendar (which looks a bit weird).

Fixed Issues

$ #15290
$ #15290 (comment)

Tests

  1. Open the app in android
  2. Open settings
  3. Open Profile
  4. Open Personal details
  5. Open date of birth
  6. Write or select any wrong date eg: 02/02/2024
  7. Click on save
  8. Click on fix the errors
  • Verify that no errors appear in the JS console

Offline tests

This feature doesn't change or is impacted by offline mode.

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 / 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.
  • 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 author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2023-02-24.at.15.03.43.mov
Mobile Web - Chrome
Screen.Recording.2023-02-24.at.15.14.59.mov
Mobile Web - Safari
Screen.Recording.2023-02-24.at.15.05.57.mov
Desktop
Screen.Recording.2023-02-24.at.15.28.06.mov
iOS
Screen.Recording.2023-02-24.at.15.00.48.mov
Android
8mb.video-5mZ-12OWYqnp.mp4

@narefyev91 narefyev91 requested a review from a team as a code owner February 24, 2023 13:42
@MelvinBot
Copy link

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

@melvin-bot melvin-bot bot requested review from alex-mechler and Santhosh-Sellavel and removed request for a team February 24, 2023 13:42
@MelvinBot
Copy link

@alex-mechler @Santhosh-Sellavel 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]

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Feb 24, 2023

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

Web & Desktop
Screen.Recording.2023-02-25.at.12.48.46.AM.mov
Mobile Web - Chrome
Screen_Recording_20230225_004724_Chrome.mp4
Mobile Web - Safari
Simulator.Screen.Recording.-.iPhone.14.-.2023-02-25.at.00.45.57.mp4
iOS
Simulator.Screen.Recording.-.iPhone.14.-.2023-02-25.at.00.25.24.mp4
Android
Screen_Recording_20230225_002213_New.Expensify.mp4

Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Choose a reason for hiding this comment

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

LGTM, Tests well!

Copy link
Contributor

@alex-mechler alex-mechler left a comment

Choose a reason for hiding this comment

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

LGTM and tested great! Thanks for the quick fix!

@alex-mechler
Copy link
Contributor

Just waiting for job3 to pass, it had errored out so I restarted it

@alex-mechler
Copy link
Contributor

Job3 didn't time out this time 🎉

Merging

@alex-mechler alex-mechler merged commit 835a9f1 into Expensify:main Feb 27, 2023
@MelvinBot
Copy link

Congrats, that’s your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks!

@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

Name Duration
Open Search Page TTI 606.317 ms → 657.164 ms (+50.847 ms, +8.4%) 🔴
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 606.317 ms
Stdev: 15.040 ms (2.5%)
Runs: 572.7230629995465 578.062989000231 587.7862149998546 588.2912599984556 593.28133200109 593.4131269995123 594.6507169995457 595.1668710000813 596.8116870000958 597.5379230007529 599.1908369995654 601.8295089993626 603.2123620007187 603.7097169999033 604.4388429988176 604.5172129999846 605.7872319985181 606.1811520010233 608.4807539992034 611.0007330011576 612.0966800004244 612.1400560010225 612.7320959996432 615.2313640005887 616.7247720006853 616.9509279988706 618.0692960005254 620.0546880010515 625.2093509994447 629.0613209996372 635.3970950003713 642.3994550015777

Current
Mean: 657.164 ms
Stdev: 19.678 ms (3.0%)
Runs: 618.7742919996381 620.9527190010995 623.1885580010712 624.0072429999709 630.356282999739 632.531617000699 640.2041430007666 640.3738199993968 647.9154870007187 649.6955159995705 650.5936279986054 651.7389330007136 651.9927570000291 653.2344569992274 656.0716549996287 664.1300050001591 664.3044839985669 665.7783209998161 666.1617440003902 666.9121909998357 667.1481940001249 668.0051269996911 668.4499110002071 671.6199550013989 672.156493999064 672.631877001375 675.9071460012347 676.2014570012689 676.672038000077 682.3380539994687 689.090779999271 690.1171880010515

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 731.529 ms → 743.172 ms (+11.643 ms, +1.6%)
App start runJsBundle 194.531 ms → 204.125 ms (+9.594 ms, +4.9%)
App start nativeLaunch 20.552 ms → 21.100 ms (+0.548 ms, +2.7%)
App start regularAppStart 0.014 ms → 0.017 ms (+0.003 ms, +22.7%) 🟡
Show details
Name Duration
App start TTI Baseline
Mean: 731.529 ms
Stdev: 23.118 ms (3.2%)
Runs: 680.6276549994946 699.8163220006973 703.5421319995075 704.6824830006808 706.0131180007011 706.3148490004241 706.6291109994054 708.0196649990976 717.7195810005069 720.128877999261 720.2688710000366 720.7831009998918 721.0318599995226 725.2659140005708 727.4249290004373 735.2436689995229 735.3328680004925 738.0979740004987 738.2052270006388 739.2586369998753 739.2851519994438 740.5476610008627 745.0890769995749 745.639428999275 752.1334169991314 752.7914370000362 753.5147849991918 755.7172940000892 756.5805719997734 758.8840820007026 759.4973360002041 794.8531570006162

Current
Mean: 743.172 ms
Stdev: 22.649 ms (3.0%)
Runs: 704.5760340001434 711.1194320004433 711.4916089996696 713.6893189996481 714.9866649992764 719.4830339998007 721.7825160007924 723.6075410004705 725.7433860003948 727.4674609992653 730.6040550004691 730.8667890001088 740.1805399991572 743.1225450001657 744.2592990007252 744.6211680006236 745.4385410007089 747.2189690005034 748.927222000435 750.5649640001357 753.4175349995494 756.1319580003619 756.731998000294 757.0807489994913 757.2171069998294 759.1976469997317 763.2465770002455 777.4341129995883 780.6917930003256 781.7202589996159 795.7100610006601
App start runJsBundle Baseline
Mean: 194.531 ms
Stdev: 13.899 ms (7.1%)
Runs: 174 177 178 178 179 181 181 183 186 186 187 187 188 188 188 190 192 192 195 197 198 198 203 204 205 206 208 212 217 221 223 223

Current
Mean: 204.125 ms
Stdev: 15.943 ms (7.8%)
Runs: 176 184 186 187 190 190 192 192 192 194 197 197 197 198 200 200 201 201 202 205 205 207 208 214 216 216 221 223 227 230 239 245
App start nativeLaunch Baseline
Mean: 20.552 ms
Stdev: 1.452 ms (7.1%)
Runs: 18 19 19 19 19 19 19 20 20 20 20 20 20 20 20 20 20 21 21 21 21 21 22 22 22 23 23 23 24

Current
Mean: 21.100 ms
Stdev: 1.814 ms (8.6%)
Runs: 19 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 21 21 21 21 22 22 22 22 22 23 24 24 25 26
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (4.8%)
Runs: 0.012492001056671143 0.012897999957203865 0.013019999489188194 0.01314299926161766 0.013305999338626862 0.01342800073325634 0.013632001355290413 0.013671999797224998 0.013671999797224998 0.013671999797224998 0.013712998479604721 0.013875000178813934 0.013915998861193657 0.013915998861193657 0.013916000723838806 0.0139979999512434 0.014038000255823135 0.014078998938202858 0.014120001345872879 0.014159999787807465 0.014159999787807465 0.014363998547196388 0.01440500095486641 0.014527000486850739 0.014607001096010208 0.014608001336455345 0.014689000323414803 0.014770999550819397 0.014810999855399132 0.014933999627828598 0.0157880000770092

Current
Mean: 0.017 ms
Stdev: 0.001 ms (7.4%)
Runs: 0.014567000791430473 0.014893000945448875 0.015381000936031342 0.01590999960899353 0.01615399867296219 0.01619499921798706 0.016235999763011932 0.016276000067591667 0.01647999882698059 0.016600999981164932 0.01660199835896492 0.016724001616239548 0.016927000135183334 0.017171001061797142 0.01717200130224228 0.017333999276161194 0.017333999276161194 0.017455998808145523 0.017578000202775 0.017578000202775 0.01769999973475933 0.017782000824809074 0.01827000081539154 0.01827000081539154 0.01879899948835373 0.019001999869942665 0.019001999869942665 0.019042998552322388 0.020101001486182213

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

@Santhosh-Sellavel
Copy link
Collaborator

I believe this PR fixes the performance issue.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/alex-mechler 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/alex-mechler in version: 1.2.77-0 🚀

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

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

5 participants