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/14314: Timezone changes to some 1st option in the list while pressing the enter key #14938

Conversation

tienifr
Copy link
Contributor

@tienifr tienifr commented Feb 8, 2023

Details

  • Fix the missing focus style (it should have background color)
  • When going to the options list, initially focus on the item that was selected before, and make it visible in the list

Fixed Issues

$ #14314
$ #14314 (comment)

Tests

  1. Login with any account
  2. Go to Settings -> Profile and click on timezone
  3. Change timezone to some other regions and go back
  4. Again click on timezone
  5. Verify that the timezone selected before is visible in the list, and have the focus style (background color)
  6. Hit the enter key
  7. Verify that the timezone remains the same as was selected before and does not change to any arbitrary region
  • Verify that no errors appear in the JS console

Offline tests

  1. Turn the network off
  2. Repeat the steps in Tests

QA Steps

  1. Login with any account
  2. Go to Settings -> Profile and click on timezone
  3. Change timezone to some other regions and go back
  4. Again click on timezone
  5. Verify that the timezone selected before is visible in the list, and have the focus style (background color)
  6. Hit the enter key
  7. Verify that the timezone remains the same as was selected before and does not change to any arbitrary region
  • 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.
  • 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
Mweb.Chrome.mov
Mobile Web - Safari
Mweb.Safari.mov
Desktop
Desktop.mov
iOS
iOS.mov
Android
Android.mp4

@tienifr tienifr requested a review from a team as a code owner February 8, 2023 02:52
@melvin-bot melvin-bot bot requested review from rushatgabhane and sketchydroide and removed request for a team February 8, 2023 02:52
@MelvinBot
Copy link

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

@rushatgabhane
Copy link
Member

@tienifr can you please add regression steps for the two deploy blockers that this PR was previously linked to?

@tienifr
Copy link
Contributor Author

tienifr commented Feb 9, 2023

@rushatgabhane You mean that we need to add a regression test for this issue

@tienifr
Copy link
Contributor Author

tienifr commented Feb 13, 2023

Regression Test Proposal

Bug: Invite new members - Users is highlighted after selecting

Proposed Test Steps:

  • Open the app
  • Open Workspace and go to the invite member page
  • Select some members
  • Verify that selected members aren't highlighted

Do we 👍 or 👎

Video (Regression Test):

217418140-3cb8ccba-cdf6-4c41-b674-cd51628590af.mp4

@tienifr
Copy link
Contributor Author

tienifr commented Feb 13, 2023

@thienlnam @rushatgabhane

Regression Test Proposal

Bug: Timezone changes to some 1st option in the list while pressing the enter key

Proposed Test Steps:

  1. Go to Profile and click on timezone
  2. Change timezone to some other regions and go back
  3. Again click on timezone and now hit the enter key
  4. Notice that timezone changes to some other region on pressing the enter key

Do we 👍 or 👎

Video (Regression Test):

Screen.Recording.2023-02-13.at.15.48.56.mp4

@tienifr
Copy link
Contributor Author

tienifr commented Feb 13, 2023

@thienlnam @rushatgabhane I added regression tests for both issues #14314 and #14781. Please help to check again

@rushatgabhane
Copy link
Member

@tienifr can you please resolve the merge conflicts

@tienifr
Copy link
Contributor Author

tienifr commented Feb 17, 2023

@rushatgabhane Please help to check again

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

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

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
web.mp4
Mobile Web - Chrome
mweb-android.mp4
Mobile Web - Safari
mweba.mp4
Desktop
desk.mp4
iOS
ios938.mp4
Android
WhatsApp.Video.2023-02-22.at.22.59.48.mp4

@thienlnam
Copy link
Contributor

Taking over review from Andre - @rushatgabhane please let me know when you complete reviewer steps!

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

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

@thienlnam LGTM!

Copy link
Contributor

@thienlnam thienlnam left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@thienlnam
Copy link
Contributor

Merging since this was already approved before

@thienlnam thienlnam merged commit a077bad into Expensify:main Feb 22, 2023
@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 736.745 ms → 747.862 ms (+11.117 ms, +1.5%)
App start nativeLaunch 19.719 ms → 20.125 ms (+0.406 ms, +2.1%)
App start regularAppStart 0.015 ms → 0.015 ms (+0.000 ms, +2.0%)
App start runJsBundle 208.906 ms → 208.719 ms (-0.188 ms, ±0.0%)
Open Search Page TTI 623.247 ms → 614.329 ms (-8.918 ms, -1.4%)
Show details
Name Duration
App start TTI Baseline
Mean: 736.745 ms
Stdev: 34.010 ms (4.6%)
Runs: 684.069229000248 687.1858580000699 692.2313400004059 699.0806569997221 699.47907499969 706.0388620002195 707.3151489999145 708.6922380002216 710.7222539996728 713.1808639997616 714.6395209999755 718.7428630003706 721.043508999981 724.8381260000169 726.5295069999993 727.8193429997191 728.5822109999135 729.6296359999105 739.2397739998996 741.1488239997998 742.3353909999132 751.9348290003836 757.2448720000684 759.3912030002102 760.4148979997262 776.8714309995994 779.6013280004263 785.1976450001821 788.5939610004425 788.6773690003902 800.8456549998373 804.5303269997239

Current
Mean: 747.862 ms
Stdev: 25.222 ms (3.4%)
Runs: 703.6903590001166 706.2027249997482 707.8235919997096 708.9605689998716 718.2307759998366 725.3841270003468 727.7177060004324 728.4685389995575 729.4196800002828 731.2157039996237 736.5727700004354 743.1268999995664 743.4358050003648 744.8491420000792 747.3999589998275 748.0429189996794 749.0423349998891 751.8394309999421 752.0664360001683 752.7159789996222 756.7306169997901 758.9333260003477 763.911105000414 766.6199529999867 772.2922200001776 775.0413419995457 776.8581360001117 786.0855400003493 786.3678430002183 789.985696000047 794.6869109999388
App start nativeLaunch Baseline
Mean: 19.719 ms
Stdev: 1.663 ms (8.4%)
Runs: 17 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 22 22 23 23 24

Current
Mean: 20.125 ms
Stdev: 2.027 ms (10.1%)
Runs: 17 17 18 18 18 18 18 19 19 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 22 22 22 22 23 23 25 25
App start regularAppStart Baseline
Mean: 0.015 ms
Stdev: 0.001 ms (4.0%)
Runs: 0.013631000183522701 0.013875000178813934 0.014039000496268272 0.014078999869525433 0.014241000637412071 0.014282000251114368 0.014403999783098698 0.01444500032812357 0.01444500032812357 0.014485999941825867 0.014607000164687634 0.014689000323414803 0.014770000241696835 0.014770999550819397 0.0148930000141263 0.014932999387383461 0.014933000318706036 0.014973999932408333 0.015176999382674694 0.015177000313997269 0.015217999927699566 0.015217999927699566 0.015298999845981598 0.015420999377965927 0.015463000163435936 0.015542999841272831 0.015544000081717968 0.01582799945026636 0.016234999522566795

Current
Mean: 0.015 ms
Stdev: 0.001 ms (5.7%)
Runs: 0.01314299926161766 0.013794000260531902 0.014119000174105167 0.014282000251114368 0.014282000251114368 0.014527000486850739 0.014566999860107899 0.014566999860107899 0.014566999860107899 0.01464799977838993 0.014649000018835068 0.014851999469101429 0.014892000705003738 0.014973999932408333 0.015054999850690365 0.015137000009417534 0.015137000009417534 0.015137000009417534 0.015258999541401863 0.015259000472724438 0.015381000004708767 0.015381000004708767 0.015544000081717968 0.015625 0.015705999918282032 0.015910000540316105 0.016193999908864498 0.016195000149309635 0.016439000144600868 0.01696799974888563 0.017130999825894833
App start runJsBundle Baseline
Mean: 208.906 ms
Stdev: 23.968 ms (11.5%)
Runs: 165 172 183 184 188 188 189 191 194 195 196 198 199 200 201 202 206 207 207 209 211 221 222 222 229 231 234 235 239 241 244 282

Current
Mean: 208.719 ms
Stdev: 17.258 ms (8.3%)
Runs: 182 186 186 188 190 192 192 193 197 199 201 203 203 205 205 206 206 206 207 209 212 212 213 214 218 226 229 234 237 240 241 247
Open Search Page TTI Baseline
Mean: 623.247 ms
Stdev: 14.940 ms (2.4%)
Runs: 594.2315670000389 594.9858400002122 602.4624019991606 603.6647950001061 607.4540609996766 607.9737550001591 610.4670000001788 611.5484210001305 612.1003020005301 612.8883050000295 616.1640219995752 619.6921799993142 621.3930259998888 622.5313309999183 623.0104580000043 624.7407630002126 624.9344480000436 627.7546389997005 630.6097419997677 630.6697599999607 631.5888669993728 635.3325199997053 635.7962649995461 637.4420569995418 637.9234629999846 639.2550869993865 641.681762999855 642.1415609996766 646.4719650000334 650.4868580000475

Current
Mean: 614.329 ms
Stdev: 18.943 ms (3.1%)
Runs: 578.3056229995564 584.7876789998263 584.8935150001198 590.1087239999324 595.1218670001253 595.3392340000719 595.5384120000526 597.8628340000287 598.1025799997151 599.0459399996325 605.7671720003709 607.062052000314 611.6377770006657 612.9704989995807 616.4691160004586 616.6862800000235 619.7716479999945 622.3238120004535 622.665974999778 623.5548910005018 624.6385099999607 624.7480060001835 625.0208749994636 625.6448569996282 626.5148520004004 627.1538089998066 628.2460529999807 639.480508999899 642.14709499944 642.5077320002019 660.0667730001733

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/thienlnam in version: 1.2.76-0 🚀

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

@priyeshshah11
Copy link
Contributor

Regression Test Proposal

Bug: Invite new members - Users is highlighted after selecting

Proposed Test Steps:

  • Open the app
  • Open Workspace and go to the invite member page
  • Select some members
  • Verify that selected members aren't highlighted

Do we 👍 or 👎

Video (Regression Test):

Hi @tienifr just checking, was this tested on iOS as well? Context here

@tienifr
Copy link
Contributor Author

tienifr commented Feb 27, 2023

@priyeshshah11 yes, my PR works well on iOS

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.76-7 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.76-7 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.2.76-7 🚀

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

@@ -277,7 +300,13 @@ class BaseOptionsSelector extends Component {
showTitleTooltip={this.props.showTitleTooltip}
isDisabled={this.props.isDisabled}
shouldHaveOptionSeparator={this.props.shouldHaveOptionSeparator}
onLayout={this.props.onLayout}
onLayout={() => {
this.scrollToIndex(this.state.focusedIndex, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

@tienifr I noticed this line while reviewing this issue #17774. Could you please explain why this code was added here? I have reviewed your proposal but I couldn't find any explanation for the addition of this code.

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