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

Check whether option row changed focus before re-rendering #14856

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

mountiny
Copy link
Contributor

@mountiny mountiny commented Feb 6, 2023

Details

Adding a condition which we forgot to re-add here which will compare if the option rows have been focused or not.

Fixed Issues

$ #14837

Tests

  • Verify that no errors appear in the JS console
  1. Go to https://staging.new.expensify.com/
  2. Click +
  3. Click Request money
  4. Choose amount an click Next
  5. Press Arrow keys to navigate through attendees list

or

  1. Go to https://staging.new.expensify.com/
  2. Go to group chat
  3. Click +
  4. Click Split bill
  5. Choose amount an click Next
  6. Press Arrow keys to navigate through attendees list

Offline tests

Same

QA Steps

  • Verify that no errors appear in the JS console
  1. Go to https://staging.new.expensify.com/
  2. Click +
  3. Click Request money
  4. Choose amount an click Next
  5. Press Arrow keys to navigate through attendees list

or

  1. Go to https://staging.new.expensify.com/
  2. Go to group chat
  3. Click +
  4. Click Split bill
  5. Choose amount an click Next
  6. Press Arrow keys to navigate through attendees list

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
Screen.Recording.2023-02-06.at.14.14.26.mov
Mobile Web - Chrome

No keyboard navigation

Mobile Web - Safari

No keyboard navigation

Desktop
Screen.Recording.2023-02-06.at.14.14.26.mov
iOS

No keyboard navigation

Android

No keyboard navigation

@mountiny mountiny requested a review from a team as a code owner February 6, 2023 14:22
@mountiny mountiny self-assigned this Feb 6, 2023
@melvin-bot melvin-bot bot requested review from eVoloshchak and neil-marcellini and removed request for a team February 6, 2023 14:23
@melvin-bot
Copy link

melvin-bot bot commented Feb 6, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

⚠️ ⚠️ Heads up! This pull request has the CP Staging label ⚠️ ⚠️
If you applied the CP Staging label before the PR was merged, the PR will be be immediately deployed to staging even if the open StagingDeployCash deploy checklist is locked.
However if you applied the CP Staging after the PR was merged it's possible it won't be CP'ed automatically. If you need it to be CP'ed to staging, tag a member of @Expensify/mobile-deployers to CP it manually, otherwise you can wait for it to go out with the next deploy.

@mountiny mountiny changed the title Check for option row icon change to re-render Check whether option row changed focus before re-rendering Feb 6, 2023
@PauloGasparSv PauloGasparSv self-requested a review February 6, 2023 14:32
@PauloGasparSv
Copy link
Contributor

PauloGasparSv commented Feb 6, 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Web.mov
Web.Offline.mov
Mobile Web - Chrome

Does not have keyboard

Mobile Web - Safari

Does not have keyboard

Desktop
Desktop-part-1.mov
Desktop.2.mov
iOS

Does not have keyboard

Android

Does not have keyboard

Copy link
Contributor

@PauloGasparSv PauloGasparSv left a comment

Choose a reason for hiding this comment

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

LGTM!

Hey @eVoloshchak @neil-marcellini, approving and merging this to unblock a deploy blocker

@PauloGasparSv PauloGasparSv merged commit 74400c3 into main Feb 6, 2023
@PauloGasparSv PauloGasparSv deleted the vit-revertOptionListChange branch February 6, 2023 14:43
OSBotify pushed a commit that referenced this pull request Feb 6, 2023
Check whether option row changed focus before re-rendering

(cherry picked from commit 74400c3)
OSBotify added a commit that referenced this pull request Feb 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 714.777 ms → 723.804 ms (+9.027 ms, +1.3%)
App start runJsBundle 194.387 ms → 199.344 ms (+4.957 ms, +2.5%)
App start regularAppStart 0.015 ms → 0.015 ms (+0.001 ms, +4.0%)
App start nativeLaunch 19.968 ms → 19.719 ms (-0.249 ms, -1.2%)
Open Search Page TTI 618.735 ms → 618.433 ms (-0.302 ms, ±0.0%)
Show details
Name Duration
App start TTI Baseline
Mean: 714.777 ms
Stdev: 33.258 ms (4.7%)
Runs: 630.5761250001378 672.0551220001653 672.826417000033 677.487962000072 677.5207159998827 679.7021269998513 686.3325140001252 693.661100000143 694.2717989999801 696.5681920000352 696.6032210001722 700.5342149999924 700.710059999954 707.949229999911 708.9863309999928 709.7123369998299 711.0091820000671 720.0160969998688 722.2069890000857 723.0144949997775 732.0123519999906 733.5908630001359 736.9953609998338 738.6931280000135 742.4577600001357 743.0873630000278 743.9231690000743 745.4051959998906 753.2645879997872 756.989949000068 771.5020320001058 793.2026920001954

Current
Mean: 723.804 ms
Stdev: 25.395 ms (3.5%)
Runs: 681.3847730001435 693.6722789998166 696.6747710001655 698.8674579998478 700.9252280001529 703.1069359998219 705.1366969998926 705.3173670000397 705.8455830002204 706.2942389999516 706.7815519999713 708.3350630002096 712.2036219998263 713.5504890000448 714.2347470000386 714.3366689998657 718.2867829999886 720.0817419998348 720.1109659997746 722.887258999981 723.1902390001342 731.6044399999082 737.2441010000184 739.5819560000673 741.3974549998529 744.2393669998273 753.6115760002285 754.0004619997926 754.7769880001433 763.1286849998869 776.433583999984 794.4979659998789
App start runJsBundle Baseline
Mean: 194.387 ms
Stdev: 18.780 ms (9.7%)
Runs: 160 166 169 169 173 174 177 182 182 183 185 187 190 190 193 195 197 197 200 202 203 203 203 205 206 208 216 218 225 233 235

Current
Mean: 199.344 ms
Stdev: 18.726 ms (9.4%)
Runs: 165 178 179 179 180 183 184 186 186 187 191 191 192 193 193 193 197 198 198 198 199 201 203 205 215 217 220 229 230 231 234 244
App start regularAppStart Baseline
Mean: 0.015 ms
Stdev: 0.001 ms (5.1%)
Runs: 0.01355000026524067 0.013753999955952168 0.013875000178813934 0.013915999792516232 0.013915999792516232 0.013957000337541103 0.0139979999512434 0.014078999869525433 0.01407900033518672 0.014119999948889017 0.014161000028252602 0.014404000248759985 0.014405000023543835 0.014444999862462282 0.01444500032812357 0.014566999860107899 0.014607000164687634 0.014607999939471483 0.014607999939471483 0.014649000018835068 0.014810999855399132 0.014851999934762716 0.014852000400424004 0.014934000093489885 0.015176999848335981 0.015218000393360853 0.015705999918282032 0.015787999611347914 0.015950999688357115 0.016112999990582466 0.016805000137537718

Current
Mean: 0.015 ms
Stdev: 0.001 ms (5.2%)
Runs: 0.013916000258177519 0.014037999790161848 0.014039000030606985 0.014078999869525433 0.014119000174105167 0.014485999941825867 0.014567000325769186 0.014688999857753515 0.014689000323414803 0.014771000016480684 0.014771000016480684 0.01509599993005395 0.01509599993005395 0.015096999704837799 0.015135999768972397 0.015136000234633684 0.015217999927699566 0.01525900000706315 0.015421999618411064 0.015503000002354383 0.015666000079363585 0.015705999918282032 0.01570700015872717 0.015746999997645617 0.015786999836564064 0.01582799991592765 0.015951000154018402 0.01599099999293685 0.015992000233381987 0.016642000060528517 0.016845999751240015 0.01700799958780408
App start nativeLaunch Baseline
Mean: 19.968 ms
Stdev: 1.713 ms (8.6%)
Runs: 18 18 18 18 18 18 18 18 18 19 19 19 19 20 20 20 20 20 20 20 21 21 21 21 21 22 22 22 23 23 24

Current
Mean: 19.719 ms
Stdev: 1.681 ms (8.5%)
Runs: 17 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 20 20 20 21 21 21 21 21 21 22 22 22 23 24
Open Search Page TTI Baseline
Mean: 618.735 ms
Stdev: 22.549 ms (3.6%)
Runs: 585.4399419999681 585.7967530000024 587.4556889999658 592.8546960004605 593.2368979998864 598.0571289998479 598.059815000277 598.39192799991 600.659708999563 601.9912930000573 610.015788000077 610.4511730000377 611.3334559998475 614.0545659996569 614.2513020001352 615.2006839998066 615.5529789999127 616.6683760001324 621.8037109998986 623.9958099997602 624.3051359998062 624.7467040000483 625.6443690001033 625.7574060000479 629.5069989999756 632.1124269999564 637.6435949997976 638.1204839996062 638.4310710001737 645.1372080002911 652.8830969999544 658.9029950001277 689.7947599999607

Current
Mean: 618.433 ms
Stdev: 15.351 ms (2.5%)
Runs: 586.2172039998695 588.1112069999799 593.4391279998235 596.0918780001812 598.2358800000511 604.7408050000668 606.1853849999607 607.3090010001324 610.1378990001976 610.6381839998066 612.6936860000715 613.7146809999831 614.4536129999906 616.9632170000114 617.1987309996039 619.8865149999037 619.9571130000986 621.3051760001108 621.8973799999803 622.8935150001198 622.9108480000868 623.578777000308 624.0948490002193 626.1681729997508 629.0156660000794 630.3109140000306 630.6214199997485 634.1538089998066 635.1106369998306 635.7010090001859 635.9022619999014 649.2124029998668 649.4393309997395

@OSBotify
Copy link
Contributor

OSBotify commented Feb 6, 2023

🚀 Cherry-picked to staging by https://github.com/PauloGasparSv in version: 1.2.65-1 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

OSBotify commented Feb 6, 2023

🚀 Deployed to production by https://github.com/mountiny in version: 1.2.65-2 🚀

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

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants