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

Fixes extra space for scrollbar issue in image preview #14170

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

priyeshshah11
Copy link
Contributor

@priyeshshah11 priyeshshah11 commented Jan 10, 2023

Details

Fixed Issues

$ #13881
PROPOSAL: #13881 (comment)

Tests

  1. Go to any chat.
  2. Upload a tall or a wide image. (try with other kinds of images too)
  3. Verify that the scrollbar appears only when the content overflows.
  4. If no scrollbar is shown above, verify it shows when you zoom in & if the content overflows.
  5. On MacOS go to system settings and change scroll behaviour to "always show scrollbar", verify that the scrollbar is always shown (not just when scrolling) if the content overflows.
  • Verify that no errors appear in the JS console

Offline tests

  1. Go to any chat.
  2. Upload a tall or a wide image. (try with other kinds of images too)
  3. Verify that the scrollbar appears only when the content overflows.
  4. If no scrollbar is shown above, verify it shows when you zoom in & if the content overflows.
  5. On MacOS go to system settings and change scroll behaviour to "always show scrollbar", verify that the scrollbar is always shown (not just when scrolling) if the content overflows.

QA Steps

  1. Go to any chat.
  2. Upload a tall or a wide image. (try with other kinds of images too)
  3. Verify that the scrollbar appears only when the content overflows.
  4. If no scrollbar is shown above, verify it shows when you zoom in & if the content overflows.
  5. On MacOS go to system settings and change scroll behaviour to "always show scrollbar", verify that the scrollbar is always shown (not just when scrolling) if the content overflows.
  • 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
    • 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 Screen Shot 2023-01-11 at 10 32 50 AM
Mobile Web - Safari

Simulator Screen Shot - iPhone 12 Pro Max - 2023-01-10 at 11 34 53

Desktop
desk.mov
iOS

Simulator Screen Shot - iPhone 12 Pro Max - 2023-01-10 at 11 24 17

Android Screen Shot 2023-01-10 at 10 43 09 PM

@priyeshshah11 priyeshshah11 requested a review from a team as a code owner January 10, 2023 00:53
@melvin-bot melvin-bot bot requested review from puneetlath and rushatgabhane and removed request for a team January 10, 2023 00:53
@melvin-bot
Copy link

melvin-bot bot commented Jan 10, 2023

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

@@ -2231,10 +2231,6 @@ const styles = {
paddingEnd: 20,
},

noScrollbars: {
scrollbarWidth: 'none',
Copy link
Member

@rushatgabhane rushatgabhane Jan 10, 2023

Choose a reason for hiding this comment

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

Leaving a note that scrollbarWidth is a firefox only property

https://caniuse.com/?search=scrollbar-width

Good to remove!

@priyeshshah11
Copy link
Contributor Author

@rushatgabhane I have completed all tasks, tests & attached screenshots & videos except for mweb-chrome & desktop as I can't login due to the 429 error. Can you or someone else help with that?

@rushatgabhane
Copy link
Member

@priyeshshah11 that's alright i guess. Can you please add a new test which mentions the expected behavior after enabling "always show scrollbar" from system settings.

@priyeshshah11
Copy link
Contributor Author

@priyeshshah11 that's alright i guess. Can you please add a new test which mentions the expected behavior after enabling "always show scrollbar" from system settings.

@rushatgabhane Added that step.

@rushatgabhane
Copy link
Member

rushatgabhane commented Jan 10, 2023

verify that the scrollbar is shown continuously

can you please change it to 'verify that the scrollbar is always show'

Also, are you still getting the 429 error? Please try again, and raise it on slack if no luck

@priyeshshah11
Copy link
Contributor Author

can you please change it to 'verify that the scrollbar is always show'

Also, are you still getting the 429 error? Please try again, and raise it on slack if no luck

done & yes still facing that issue, have raised it in this thread https://expensify.slack.com/archives/C01GTK53T8Q/p1673234742624769

@priyeshshah11
Copy link
Contributor Author

@puneetlath @rushatgabhane Screenshots/videos for all platforms have now been uploaded.

@puneetlath
Copy link
Contributor

@rushatgabhane do you have an ETA on when you'll be able to review/tests?

@rushatgabhane
Copy link
Member

rushatgabhane commented Jan 11, 2023

@priyeshshah11 it'd be great if you can add the exact images you want QA to test with

Here's mine (you can add this as well ig)

DSCF2242-min

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.

@puneetlath LGTM! 🎉

Can't zoom in mWeb btw

Thanks for the quick PR @priyeshshah11

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-01-12.at.2.24.16.AM.mov
Mobile Web - Chrome
WhatsApp.Video.2023-01-12.at.02.28.28.mp4
Mobile Web - Safari
Screen.Recording.2023-01-12.at.2.34.58.AM.mov
Desktop
Screen.Recording.2023-01-12.at.2.29.59.AM.mov
iOS
Screen.Recording.2023-01-12.at.2.33.02.AM.mov
Android

WhatsApp Image 2023-01-12 at 02 15 25

@puneetlath puneetlath merged commit 81ba1ab into Expensify:main Jan 11, 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 664.522 ms → 682.190 ms (+17.667 ms, +2.7%)
App start nativeLaunch 9.214 ms → 19.800 ms (+10.586 ms, +114.9%) 🟡
App start runJsBundle 183.781 ms → 191.750 ms (+7.969 ms, +4.3%)
Open Search Page TTI 600.078 ms → 605.335 ms (+5.257 ms, +0.9%)
App start regularAppStart 0.014 ms → 0.014 ms (+0.000 ms, +3.4%)
Show details
Name Duration
App start TTI Baseline
Mean: 664.522 ms
Stdev: 31.007 ms (4.7%)
Runs: 620.7590020000935 621.1306989998557 623.4740539998747 626.7353579998016 628.4741830001585 632.4832469997928 641.3276260001585 641.8120430000126 643.0832310002297 644.0983330002055 648.4095680001192 648.7641030000523 651.5672360002063 652.71320200013 656.0735550001264 657.8063610000536 659.0592240002006 661.3624849999323 665.7524190000258 673.201659000013 673.8708819998428 677.3977430001833 680.6660690000281 683.8366109998897 685.1403439999558 688.3624950000085 690.4963320000097 695.8557950002141 696.8541339999065 714.0653030001558 732.668479999993 747.4103439999744

Current
Mean: 682.190 ms
Stdev: 33.780 ms (5.0%)
Runs: 628.8456850000657 628.8964149998501 634.8066320000216 636.8287430000491 637.880073999986 639.8279160000384 643.6198220001534 659.5257370001636 663.7678669998422 666.6233569998294 671.2330530001782 671.6077350000851 673.4172600000165 676.6460770000704 680.6413810001686 683.5342129999772 684.813821000047 692.604514000006 692.6136260000058 693.9012950002216 694.6551490002312 695.5861269999295 697.2799240001477 700.7461859998293 703.747357999906 706.6840829998255 708.6362459999509 741.0973970000632 743.6335920002311 746.9181450000033 747.2571069998667
App start nativeLaunch Baseline
Mean: 9.214 ms
Stdev: 1.176 ms (12.8%)
Runs: 7 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 12 12

Current
Mean: 19.800 ms
Stdev: 1.720 ms (8.7%)
Runs: 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 22 22 22 24 24
App start runJsBundle Baseline
Mean: 183.781 ms
Stdev: 25.334 ms (13.8%)
Runs: 146 155 155 156 158 158 159 163 163 166 171 172 173 174 176 178 178 179 186 187 190 191 195 198 199 203 204 211 222 224 243 248

Current
Mean: 191.750 ms
Stdev: 23.255 ms (12.1%)
Runs: 160 161 165 167 170 172 173 173 174 174 174 178 181 183 184 185 187 191 191 196 198 201 201 203 204 210 213 214 226 228 244 255
Open Search Page TTI Baseline
Mean: 600.078 ms
Stdev: 19.141 ms (3.2%)
Runs: 566.7435720004141 567.1976319998503 568.5154220000841 569.4534909999929 577.277710000053 581.0421549999155 584.2882890002802 585.7301440001465 587.2547609996982 588.2873129998334 589.1896159998141 591.1190189998597 592.6998299998231 593.3108720001765 594.5541179999709 598.601116000209 602.3273120000958 604.037271999754 605.3298340002075 606.3659669999033 607.6808269997127 607.6918949997053 609.1361490003765 610.6775309997611 611.2821039999835 617.0710049998015 617.3939209999517 623.3318680003285 624.1686200001277 624.2262780000456 625.3290209998377 633.4287110003643 637.8322760001756

Current
Mean: 605.335 ms
Stdev: 19.845 ms (3.3%)
Runs: 569.731853000354 571.7642830000259 573.0318200001493 577.6617030003108 578.9959720000625 584.4059649999253 586.1562099996954 586.6305749998428 588.7697349996306 594.9416510001756 599.0647379998118 599.456991000101 599.9798590000719 602.7102049998939 602.9640709999949 605.5181070002727 605.750326000154 608.0640869997442 608.8727219998837 609.6938070002943 610.4884039997123 612.3991300002672 612.776368000079 615.4997969996184 617.462565000169 619.2863770001568 624.3500159997493 627.5228269998915 632.0193690001033 632.2826740001328 632.3922530002892 640.1453450000845 645.2510589999147
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (7.9%)
Runs: 0.012206999585032463 0.01220700005069375 0.012287999968975782 0.012451000045984983 0.012492000125348568 0.012655000202357769 0.012735999654978514 0.012735999654978514 0.012858000118285418 0.012858000118285418 0.012899000197649002 0.012980000115931034 0.013061999808996916 0.01310200011357665 0.013304999563843012 0.013345999643206596 0.013346000108867884 0.013753000181168318 0.0138349998742342 0.01399700017645955 0.01399700017645955 0.014119000174105167 0.014282000251114368 0.0143630001693964 0.014444999862462282 0.014851000159978867 0.015056000091135502 0.015136000234633684 0.015705999918282032 0.016479000449180603

Current
Mean: 0.014 ms
Stdev: 0.001 ms (5.1%)
Runs: 0.012858000118285418 0.012979999650269747 0.013021000195294619 0.013061000034213066 0.013345999643206596 0.013346999883651733 0.013346999883651733 0.013346999883651733 0.013630999717861414 0.013712999876588583 0.01375299971550703 0.013753000181168318 0.013874999713152647 0.013956000097095966 0.01399700017645955 0.0139979999512434 0.014037999790161848 0.014078000094741583 0.014160000253468752 0.014160000253468752 0.014201000332832336 0.014241999946534634 0.014282000251114368 0.01436399994418025 0.01444500032812357 0.014770000241696835 0.014770000241696835 0.014771000016480684 0.014852000400424004 0.0148930000141263 0.015503000002354383 0.015949999913573265

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @puneetlath in version: 1.2.53-0 🚀

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

@mvtglobally
Copy link

@rushatgabhane @puneetlath When you select "always show scrollbar" on Mac Desktop, You end up seeing 2 scroll bars when zoom in. Expected?
Screen Shot 2023-01-12 at 10 03 10 PM

@priyeshshah11
Copy link
Contributor Author

@rushatgabhane @puneetlath When you select "always show scrollbar" on Mac Desktop, You end up seeing 2 scroll bars when zoom in. Expected?

Screen Shot 2023-01-12 at 10 03 10 PM

Yes, expected but will wait for others' comments.

@rushatgabhane
Copy link
Member

@mvtglobally yes that's expected

@Julesssss
Copy link
Contributor

Do we have an open bug for the double scrollbar issue?

@rushatgabhane
Copy link
Member

rushatgabhane commented Jan 13, 2023

@Julesssss nope.
I don't think it's a bug because it only happens when "always show scrollbar" is enabled on system settings.

Let me know if you disagree

@Julesssss
Copy link
Contributor

Ah yeah that makes sense, thanks

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @Julesssss in version: 1.2.53-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.

6 participants