Skip to content

Preferences follow up#14851

Merged
Beamanator merged 6 commits into
mainfrom
cristi_preferences-follow-up
Feb 8, 2023
Merged

Preferences follow up#14851
Beamanator merged 6 commits into
mainfrom
cristi_preferences-follow-up

Conversation

@cristipaval

@cristipaval cristipaval commented Feb 6, 2023

Copy link
Copy Markdown
Contributor

cc @Beamanator

Details

This is a follow-up PR with 2 tiny little changes asked for this PR

Fixed Issues

#14591 (comment)

Tests and QA Steps

  1. Go to Settings -> Preferences -> Language
  2. Change the language
  3. Verify it works as expected
  4. Log out
  5. On the sign in page, change the language from the small language picker
  6. Verify that it works 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 10:54
@cristipaval cristipaval self-assigned this Feb 6, 2023
@melvin-bot melvin-bot Bot requested review from neil-marcellini and removed request for a team February 6, 2023 10:54
@melvin-bot

melvin-bot Bot commented Feb 6, 2023

Copy link
Copy Markdown

@neil-marcellini Please 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]

@neil-marcellini neil-marcellini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is looking pretty good, thanks. There's a couple small changes that would clean this up more.

Also, I discovered a bug related to this which is present on main. If you follow you testing steps and then sign back in, the language chose while signed out is not used after you sign in. I would expect the language choice to be persisted. If you agree it's a bug I can report it and create an issue.

language-change.mov

Comment thread src/libs/actions/App.js
Comment thread src/pages/settings/Preferences/LanguagePage.js Outdated
@neil-marcellini

Copy link
Copy Markdown
Contributor

Hmm why wasn't a C+ reviewer automatically requested?

@Beamanator

Copy link
Copy Markdown
Contributor

Yeah I wonder why no C+ was added - maybe because the "Fixed issue" is just a PR comment?

@Beamanator Beamanator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with @neil-marcellini 's comments

Also, are you thinking about refactoring the options list menu items (in pronouns, timezone select, language, and priority mode) in a different PR?

@cristipaval

Copy link
Copy Markdown
Contributor Author

Hmm why wasn't a C+ reviewer automatically requested?

yeah, because there is no fixed issue. Do you guys think it makes sense to add the same C+ that reviewed the original PR? Is it worth adding a C+ for these tiny changes?

@cristipaval

Copy link
Copy Markdown
Contributor Author

Also, are you thinking about refactoring the options list menu items (in pronouns, timezone select, language, and priority mode) in a different PR?

This is the issue for refactoring the option list. I thought that the changes in the current PR would be out of scope if I added in the PR with the option list refactor.

@cristipaval

Copy link
Copy Markdown
Contributor Author

Also, I discovered a bug related to this which is present on main. If you follow you testing steps and then sign back in, the language chose while signed out is not used after you sign in. I would expect the language choice to be persisted. If you agree it's a bug I can report it and create an issue.

This is because there is no authToken to persist the change on the server and when the user signs in, the language is overridden with whatever the server returns. Here are the statements which skip the persistence on the server. I don't know if we should fix this or not. Maybe ask the team?

@cristipaval

Copy link
Copy Markdown
Contributor Author

Thanks for the review! 🙏
All Feedback is addressed. Please have another round of review.

Comment thread src/pages/settings/Preferences/PreferencesPage.js Outdated
Co-authored-by: Alex Beaman <alexbeaman@expensify.com>
@neil-marcellini

Copy link
Copy Markdown
Contributor

Do you guys think it makes sense to add the same C+ that reviewed the original PR? Is it worth adding a C+ for these tiny changes?

Yeah I guess the changes are pretty small so it's probably not worthing paying $1000 for. One of us will have to run through the checklist however. @Beamanator would you be willing to do that? I'm working on fixing my iOS dev environment at the moment.

This is because there is no authToken to persist the change on the server and when the user signs in, the language is overridden with whatever the server returns. Here are the statements which skip the persistence on the server.

Ah I see. I doubt many people will follow this exact flow so it's probably not worth fixing.

@neil-marcellini neil-marcellini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good 😃

@Beamanator

Beamanator commented Feb 8, 2023

Copy link
Copy Markdown
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
Screen.Recording.2023-02-08.at.11.24.26.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-02-08.at.11.33.25.AM.mov
Mobile Web - Safari
Screen.Recording.2023-02-08.at.11.36.40.AM.mov
Desktop
Screen.Recording.2023-02-08.at.11.26.58.AM.mov
iOS
Screen.Recording.2023-02-08.at.11.35.54.AM.mov
Android
Screen.Recording.2023-02-08.at.11.32.02.AM.mov

@Beamanator Beamanator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@Beamanator Beamanator merged commit b82ef1e into main Feb 8, 2023
@Beamanator Beamanator deleted the cristi_preferences-follow-up branch February 8, 2023 09:38
@OSBotify

OSBotify commented Feb 8, 2023

Copy link
Copy Markdown
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

github-actions Bot commented Feb 8, 2023

Copy link
Copy Markdown
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 700.434 ms → 722.193 ms (+21.758 ms, +3.1%)
App start runJsBundle 192.871 ms → 202.906 ms (+10.035 ms, +5.2%)
App start regularAppStart 0.014 ms → 0.015 ms (+0.001 ms, +6.7%)
App start nativeLaunch 20.469 ms → 19.933 ms (-0.535 ms, -2.6%)
Open Search Page TTI 611.010 ms → 608.269 ms (-2.741 ms, ±0.0%)
Show details
Name Duration
App start TTI Baseline
Mean: 700.434 ms
Stdev: 28.548 ms (4.1%)
Runs: 633.4411369999871 651.0892719998956 669.1555000001099 670.5801319999155 674.5397389999125 679.0746989999898 680.2794500000309 681.3264919999056 681.4949829999823 685.4081820000429 687.3176710000262 688.6135720000602 693.5447400000412 695.4228350000922 696.1065090000629 696.6355969998986 697.946750999894 702.0441860000137 702.625737000024 707.1459079999477 712.0436029999983 714.4894789999817 715.9893080000766 720.8411600000691 725.8235069999937 726.2904860000126 727.7848469999153 730.3436769999098 740.8090830000583 752.6319369999692 772.6273709998932

Current
Mean: 722.193 ms
Stdev: 23.013 ms (3.2%)
Runs: 674.8181539999787 680.2820119999815 695.030705000041 698.3345419999678 699.4527499999385 700.7813919999171 700.8675210000947 705.7097279999871 706.2294409999158 709.220250000013 709.4271269999444 713.4312529999297 715.1227750000544 715.5316379999276 718.668209000025 719.4720640000887 720.0011259999592 721.3201089999638 725.1250229999423 725.9973190000746 726.891203999985 731.0754660000093 735.4223370000254 736.557310000062 740.8211880000308 741.6413499999326 745.5329430000857 746.7492019999772 750.3897530001123 763.4154519999865 766.7013360001147 770.1530220001005
App start runJsBundle Baseline
Mean: 192.871 ms
Stdev: 22.252 ms (11.5%)
Runs: 155 167 168 168 172 175 176 177 177 179 180 180 180 181 182 188 190 191 193 197 198 206 208 210 210 210 225 227 227 232 250

Current
Mean: 202.906 ms
Stdev: 22.720 ms (11.2%)
Runs: 170 172 172 173 179 180 181 182 186 189 189 195 195 196 197 201 203 204 205 205 206 209 214 214 219 219 221 230 238 246 247 256
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.000 ms (3.2%)
Runs: 0.0134680001065135 0.013508999953046441 0.013590999878942966 0.013794000027701259 0.01383400009945035 0.0139979999512434 0.0139979999512434 0.014038000022992492 0.01407799986191094 0.014079000102356076 0.014079000102356076 0.014160000020638108 0.014161000028252602 0.01424099993892014 0.014282000018283725 0.014322999864816666 0.014362999936565757 0.01436399994418025 0.014404000015929341 0.014484999934211373 0.014484999934211373 0.014607999939471483 0.0147299999371171 0.014730000169947743 0.014851999934762716 0.014933000085875392 0.014973999932408333 0.015056000091135502 0.015339999925345182

Current
Mean: 0.015 ms
Stdev: 0.001 ms (7.3%)
Runs: 0.013142999960109591 0.0134680001065135 0.013752999948337674 0.013794000027701259 0.014160000020638108 0.014201000100001693 0.014362999936565757 0.014362999936565757 0.014526000013574958 0.014527000021189451 0.014607000164687634 0.014728999929502606 0.014771000016480684 0.014811000088229775 0.0148930000141263 0.015217999927699566 0.01525900000706315 0.015339999925345182 0.015420999843627214 0.015503000002354383 0.015503000002354383 0.015949999913573265 0.01595099992118776 0.016112999990582466 0.016234999988228083 0.016276000067591667 0.01647999999113381 0.016600999981164932 0.01672299997881055 0.016804999904707074 0.0174150001257658 0.017619000049307942
App start nativeLaunch Baseline
Mean: 20.469 ms
Stdev: 3.041 ms (14.9%)
Runs: 17 17 17 18 18 18 18 18 18 18 18 19 19 19 19 19 19 20 20 21 21 21 22 22 22 24 24 24 25 25 25 30

Current
Mean: 19.933 ms
Stdev: 1.504 ms (7.5%)
Runs: 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 22 22 23
Open Search Page TTI Baseline
Mean: 611.010 ms
Stdev: 12.776 ms (2.1%)
Runs: 586.3038339999039 586.7462170000654 587.2515459998976 594.0779220000841 596.990722999908 597.5778000000864 600.9238289999776 605.357258999953 605.5569249999244 605.7379560000263 607.4567869999446 608.1104739999864 608.5673420000821 608.958415000001 611.0096430000849 611.5467939998489 611.5661619999446 611.6609699998517 613.2455649999902 617.3518069998827 617.6882329999935 617.7926029998343 617.8545739999972 618.5521239999216 621.8649089999963 621.8708089999855 623.9684249998536 625.9608970000409 629.6540530000348 630.682902000146 639.4378259999212

Current
Mean: 608.269 ms
Stdev: 18.321 ms (3.0%)
Runs: 568.9108079997823 581.4082849998958 586.7400720000733 588.4674480003305 588.9725750000216 591.0176600003615 591.4283050000668 598.9083660002798 600.5019939998165 601.4379479999188 601.8240970000625 602.5347909999546 602.9239920000546 604.1942959998269 604.2788090000395 604.7964679999277 605.8009439997841 605.8221040000208 607.1611329999287 609.579590999987 609.5992029998451 611.4204920004122 614.4449060000479 614.8039549998939 620.2114260001108 622.2654210003093 623.7505299998447 627.1822510000784 633.4610589998774 640.7954099997878 642.8328860001639 657.1439209999517

@OSBotify

OSBotify commented Feb 9, 2023

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Beamanator in version: 1.2.68-0 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 1.2.68-0 🚀

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.

4 participants