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 skeleton view is not left-oriented on Android #13662

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

bernhardoj
Copy link
Contributor

@bernhardoj bernhardoj commented Dec 16, 2022

Details

Load more chat skeleton view in report screen is flipped because we manually invert the FlatList on Android using translate but we forget to apply the translate to the skeleton view.

Fixed Issues

$ #13636
PROPOSAL: #13636 (comment)

Tests

  1. Open a chat with a lot of messages
  2. Scroll up quickly, so that you cause the chat to need to load more chats
  3. Verify the skeleton view is not flipped (left-oriented)
  • Verify that no errors appear in the JS console

Offline tests

  1. Open a chat with a lot of messages
  2. Scroll up quickly, so that you cause the chat to need to load more chats
  3. Verify the skeleton view is not flipped (left-oriented)

QA Steps

  1. Open a chat with a lot of messages
  2. Scroll up quickly, so that you cause the chat to need to load more chats
  3. Verify the skeleton view is not flipped (left-oriented)
  • 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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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
Screen.Recording.2022-12-16.at.08.39.28.mov
Mobile Web - Chrome
328550.t.mp4
Mobile Web - Safari
Desktop
Screen.Recording.2022-12-16.at.08.15.12.mov
iOS
Screen.Recording.2022-12-16.at.06.33.39.mov
Android
328549.t.mp4

@bernhardoj bernhardoj requested a review from a team as a code owner December 16, 2022 16:42
@melvin-bot melvin-bot bot requested review from mananjadhav and sketchydroide and removed request for a team December 16, 2022 16:42
@melvin-bot
Copy link

melvin-bot bot commented Dec 16, 2022

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

@mananjadhav
Copy link
Collaborator

mananjadhav commented Dec 19, 2022

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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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-skeleton-view-1.mov
Mobile Web - Chrome
mweb-chrome-skeleton-view.mov
Mobile Web - Safari
mweb-safari-skeleton-view.mov
Desktop
desktop-skeleton-view.mov
iOS
ios-skeleton-view.mov
Android
android-skeleton-view.mov

@sketchydroide Would you be able to help us with the screencasts of mobile Web - Safari and Chrome. Blocked by the Auth issue on Web/mobile Web. While Web we could cover, mobile web is pending. Pending screencasts updated and checklist completed.

@sketchydroide
Copy link
Contributor

let me see if I can do this today, but I'm already testing a big PR today, if not tomorrow

@mananjadhav
Copy link
Collaborator

Don't worry about it @sketchydroide. My IP finally worked and I am just uploading the pending videos. (They're a bit slow because of my flaky internet connection).

@mananjadhav
Copy link
Collaborator

@bernhardoj Don't worry about the pending screenshots. I've tested those and uploaded as a part of my checklist. Anyway the changes aren't related to those platforms. We should be good to merge here.

@sketchydroide All yours.

@bernhardoj
Copy link
Contributor Author

Great. Thank you! @mananjadhav

@sketchydroide
Copy link
Contributor

looks good, but you need to update the Checklist @mananjadhav

Run Expensify/App/.github/actions/javascript/authorChecklist@main
You completed 47 out of 5[1](https://github.com/Expensify/App/actions/runs/3714897368/jobs/6299404234#step:2:1) checklist items with [4](https://github.com/Expensify/App/actions/runs/3714897368/jobs/6299404234#step:2:5) unfinished items
Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md
Error: PR Author Checklist is not completely filled out. Please check every box to verify you've thought about the item.

@mananjadhav
Copy link
Collaborator

@sketchydroide Reviewer checklist is complete, but author is pending primarily because they couldn't test on mobile web.

@bernhardoj You'll have to update the checklist by marking them off.

@sketchydroide
Copy link
Contributor

but author is pending primarily because they couldn't test on mobile web.

Thanks for letting me know

@bernhardoj please complete your checlist so I can merge this 👍🏼

@bernhardoj
Copy link
Contributor Author

Checked all. @sketchydroide

@bernhardoj
Copy link
Contributor Author

I think we can merge this now? @sketchydroide

@sketchydroide
Copy link
Contributor

I think we can merge this now? @sketchydroide

Yes!

@sketchydroide sketchydroide merged commit 576cc25 into Expensify:main Dec 21, 2022
@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
TTI 797.875 ms → 815.680 ms (+17.805 ms, +2.2%)
runJsBundle 180.323 ms → 184.969 ms (+4.646 ms, +2.6%)
nativeLaunch 9.032 ms → 10.065 ms (+1.032 ms, +11.4%)
regularAppStart 0.014 ms → 0.015 ms (+0.001 ms, +3.8%)
Show details
Name Duration
TTI Baseline
Mean: 797.875 ms
Stdev: 25.520 ms (3.2%)
Runs: 756.3271929998882 765.6070170002058 766.1611709999852 767.9358700001612 769.1932899998501 774.820253000129 778.4325009998865 778.9466769997962 780.0477530001663 782.3697939999402 783.8738549998961 786.0964270001277 786.7723710001446 790.7934869998135 791.1728880000301 791.9905449999496 793.7991390000097 794.4415239999071 797.1460859999061 799.9575539999641 810.5515419999138 811.6569249997847 812.9395349998958 813.9517970001325 814.4272460001521 823.1816980000585 828.7708209999837 829.4069460001774 845.7747089997865 852.423206999898 855.1506949998438

Current
Mean: 815.680 ms
Stdev: 27.048 ms (3.3%)
Runs: 767.7723719999194 771.7372189997695 777.9764609998092 784.1725679999217 785.3985979999416 785.5366460001096 792.0844029998407 798.7250819997862 799.5172149999999 799.7429809998721 806.5820499998517 806.902220999822 811.8418649998493 811.9489440000616 814.7123500001617 817.302285999991 817.8786940001883 818.9829890001565 819.6288569997996 820.851458999794 821.8378960001282 822.7419659998268 837.0560469999909 840.9300770000555 841.4892930001952 847.8956030001864 850.0971610001288 858.7852449999191 867.700143000111 872.5708690001629
runJsBundle Baseline
Mean: 180.323 ms
Stdev: 13.551 ms (7.5%)
Runs: 154 163 165 165 166 166 169 170 173 173 173 174 176 176 177 178 179 181 183 183 185 185 187 188 190 191 195 201 205 208 211

Current
Mean: 184.969 ms
Stdev: 16.541 ms (8.9%)
Runs: 162 163 163 165 167 168 170 171 171 172 175 175 176 177 178 180 187 187 190 190 195 195 196 196 197 197 198 198 206 207 220 227
nativeLaunch Baseline
Mean: 9.032 ms
Stdev: 1.732 ms (19.2%)
Runs: 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 10 10 10 11 11 11 12 13 14

Current
Mean: 10.065 ms
Stdev: 2.368 ms (23.5%)
Runs: 7 7 7 7 7 8 8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11 11 11 12 12 13 14 14 15 15
regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (4.9%)
Runs: 0.012858000118285418 0.013020999729633331 0.013141999952495098 0.013345999643206596 0.013346000108867884 0.01334700034931302 0.013386999722570181 0.013427999801933765 0.013630999717861414 0.013671000022441149 0.013712000101804733 0.01375299971550703 0.013753999955952168 0.0138349998742342 0.013956000097095966 0.014159999787807465 0.014200999867171049 0.014242000412195921 0.014281999785453081 0.014322999864816666 0.014323000330477953 0.014403999783098698 0.014405000023543835 0.014485999941825867 0.014566999860107899 0.01464799977838993 0.0147299999371171 0.01501399977132678 0.015054999850690365 0.015339999925345182 0.015746999997645617

Current
Mean: 0.015 ms
Stdev: 0.001 ms (6.0%)
Runs: 0.013142999727278948 0.013590000104159117 0.013712000101804733 0.01375299971550703 0.013753000181168318 0.013753000181168318 0.013753000181168318 0.013875000178813934 0.013915999792516232 0.0139979999512434 0.0139979999512434 0.014077999629080296 0.014119999948889017 0.014160000253468752 0.014241000171750784 0.014281999785453081 0.014322999864816666 0.014403999783098698 0.014810999855399132 0.014933000318706036 0.015054999850690365 0.01509599993005395 0.01525900000706315 0.015298999845981598 0.015381000004708767 0.015625 0.015666000079363585 0.015868999995291233 0.01615400006994605 0.016234999988228083 0.016398000065237284

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @sketchydroide in version: 1.2.43-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.2.43-1 🚀

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