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

[HOLD for payment 2023-12-04] [$500] iOS - Task - Scroll bar in the task confirmation page is on the left #31441

Closed
1 of 6 tasks
kbecciv opened this issue Nov 16, 2023 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Nov 16, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch New Expensify app.
  2. Tap + > Assign task.
  3. Enter a title.
  4. Enter a long description consisting of 4 long paragraphs.
  5. After entering the description. scroll up and place the cursor anywhere (as long as it is not at the end of the final paragraph).
  6. Proceed to task confirmation page.
  7. Scroll down the page.

Expected Result:

Scroll bar in the task confirmation page is on the right.

Actual Result:

Scroll bar in the task confirmation page is on the left.
It reappears on the right when backgrounding and relaunching the app.
The scroll bar will be on the right if Step 5 is not executed.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6279115_1700141603341.RPReplay_Final1700130682.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ab581eacfb336866
  • Upwork Job ID: 1725146640127684608
  • Last Price Increase: 2023-11-16
  • Automatic offers:
    • alitoshmatov | Reviewer | 27761199
    • ikevin127 | Contributor | 27761200
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 16, 2023
@melvin-bot melvin-bot bot changed the title iOS - Task - Scroll bar in the task confirmation page is on the left [$500] iOS - Task - Scroll bar in the task confirmation page is on the left Nov 16, 2023
Copy link

melvin-bot bot commented Nov 16, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01ab581eacfb336866

Copy link

melvin-bot bot commented Nov 16, 2023

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 16, 2023
Copy link

melvin-bot bot commented Nov 16, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Nov 16, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (External)

@ikevin127
Copy link
Contributor

ikevin127 commented Nov 16, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue

Scroll bar in the task confirmation page is on the left side.

What is the root cause of that problem?

This was discussed here as well, the root cause seems to be the transition switch between navigation stacks when the screen stack that we navigate to uses ScrollView.

<ScrollView contentContainerStyle={styles.flexGrow1}>

What changes do you think we should make in order to solve the problem?

Issue can be solved by adding scrollIndicatorInsets={{ right: 1 }} to our ScrollView.

Videos

iOS: Native
36fb3396-1d25-4584-b3cb-dcf2dae5a503.mp4

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Nov 16, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Task - Scroll bar in the task confirmation page is on the left

What is the root cause of that problem?

Very interesting bug
I found an interesting reason
Which generally fits our case (Because if we do a hot reload this bug disappears )

facebook/react-native#26610 (comment)

It looks like this issue happens when the ScrollView (and probably other scrollable components too) is mounted in a screen while the navigation animation is running. For example when rendering the ScrollView only after receiving data from an API. The position of the scroll bar seems to be set depending on where the ScrollView is on the screen when it's mounted / rendered.

What changes do you think we should make in order to solve the problem?

To fix this bug we can disable automatically adjust the scroll indicator insets for IOS using automaticallyAdjustsScrollIndicatorInsets={false}
https://reactnative.dev/docs/scrollview#automaticallyadjustsscrollindicatorinsets-ios

<ScrollView contentContainerStyle={styles.flexGrow1}>

As a result

<ScrollView contentContainerStyle={styles.flexGrow1} automaticallyAdjustsScrollIndicatorInsets={false}>

Or we can write a patch or create separate component for ScrollView and make this value false by default because apparently, this problem is quite common

What alternative solutions did you explore? (Optional)

We can use scrollIndicatorInsets={{ top: Number.MIN_VALUE, bottom: Number.MIN_VALUE }} (contentInsetAdjustmentBehavior="always") - optional instead { right: 1 } to preserve the pixel proportions

@tienifr
Copy link
Contributor

tienifr commented Nov 17, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Scroll bar in the task confirmation page is on the left.
It reappears on the right when backgrounding and relaunching the app.

What is the root cause of that problem?

When the ScrollView is mounted when screen animation is in progress, since iOS will adjust scroll indicator insets by default, sometimes it will stuck in the middle/left of the screen. This issue is explained quite well in this thread facebook/react-native#26610. The automaticallyAdjustsScrollIndicatorInsets by default will be true for ScrollView in iOS, and it's like that for a purpose. If it's false, this issue will occur.

Having automaticallyAdjustsScrollIndicatorInsets set to true is Apple's intended behavior. With this set to false, the user will not be able to tell whether or not there is more to scroll on devices with rounded corners, or with ScrollViews underneath native navigation bars or tab bars. See screenshots.

What changes do you think we should make in order to solve the problem?

So our challenge here is:

  • We cannot have the automaticallyAdjustsScrollIndicatorInsets true while screen transition is going on, since it will cause the scrollbar to be stuck
  • But we also need the automaticallyAdjustsScrollIndicatorInsets to be true in other cases.

We can fix it the same way we fix the autofocus input behavior:

  • Create a ScrollView component folder
  • In index.js, just return the ScrollView from react-native
  • For iOS (the automaticallyAdjustsScrollIndicatorInsets is only available and relevant for iOS), create a automaticallyAdjustsScrollIndicatorInsets state with false as initial value
  • Pass that automaticallyAdjustsScrollIndicatorInsets to the scroll view
  • After screen transition ends, set the automaticallyAdjustsScrollIndicatorInsets state to true (The condition to determine screen transition ends can be the same as in the useAutoFocusInput)
  • Use this ScrollView whenever we need the scrollbar to be stable (likely everywhere we're currently using ScrollView)

With this, we have the best of both worlds here

  • automaticallyAdjustsScrollIndicatorInsets is still true so we don't have UI issues
  • When screen is transitioning automaticallyAdjustsScrollIndicatorInsets will be false to avoid scrollbar position glitches
  • Only impacts iOS where this issue is concerned

What alternative solutions did you explore? (Optional)

Use the scrollIndicatorInsets to set a static insets scrollIndicatorInsets={{ right: Number.MIN_VALUE }}, but we need to make it dynamic based on the device right-to-left or left-to-right preference to make sure the scrollbar is in the right place for all users. For the reverse preference, it should be scrollIndicatorInsets={{ left: Number.MIN_VALUE }}

@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
@stephanieelliott
Copy link
Contributor

Hey @alitoshmatov looks like we have a few proposals ready for review!

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2023
@alitoshmatov
Copy link
Contributor

Reviewing

@alitoshmatov
Copy link
Contributor

All proposals show correct RCA some with in depth explanation. I think best solution is applying scrollIndicatorInsets which all proposals suggest. I think we should go with @ikevin127 's proposal, since he was the first one to suggest the correct solution, although right should be set to 0 since setting it to 1 is causing small padding in scroll.

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Nov 20, 2023

Triggered auto assignment to @Li357, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Li357
Copy link
Contributor

Li357 commented Nov 21, 2023

Agree, all yours @ikevin127!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 21, 2023
Copy link

melvin-bot bot commented Nov 21, 2023

📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 21, 2023

📣 @ikevin127 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@tienifr
Copy link
Contributor

tienifr commented Nov 21, 2023

I think best solution is applying scrollIndicatorInsets which all proposals suggest

@alitoshmatov just curious why do you think it's the best solution? It will cause issues for users with left-to-right screen preference, as also explained here.

Also setting right to 0 will not work since RN will omit the prop, if anything, it needs to be handled like mentioned in my alternate solution.

cc @Li357

@melvin-bot melvin-bot bot added the Weekly KSv2 label Nov 21, 2023
@ikevin127
Copy link
Contributor

#31608 PR ready for review.

(property) scrollIndicatorInsets?: Insets | undefined
The amount by which the scroll view indicators are inset from the edges of the scroll view. This should normally be set to the same value as the contentInset. Defaults to {0, 0, 0, 0}.

Considering the prop's default value, I went with scrollIndicatorInsets={{right: Number.MIN_VALUE}} which fixes this issue by making sure the scrollbar is always at the closest to 0 on the right side, as requested by reviewer.

The reason we're using Number.MIN_VALUE and not 0 is because the prop's default is already 0 and setting it to 0 won't change anything with regards to fixing the issue.

cc @alitoshmatov @Li357

As for @tienifr's concerns regarding right-to-left, I set the iPhone's language to Arabic and re-opened the app and no changes / issues can be observed in our app when it comes to iPhone's right-to-left system settings.

@alitoshmatov
Copy link
Contributor

@alitoshmatov just curious why do you think it's the best solution? It will cause issues for users with left-to-right screen preference, as also explained facebook/react-native#26610 (comment).

@tienifr Regarding your concern I had checked our app and didn't find any support for RTL, that's why I didn't considered this an issue.

Also setting right to 0 will not work since RN will omit the prop, if anything, it needs to be handled like mentioned in #31441 (comment).

I apologize for my ignorance in this case, you are right by suggesting Number.MIN_VALUE. But still It was not a big change for me and I think we would have figured it out in the PR.

I hope my judgement here is correct and fair for everyone.

@ikevin127
Copy link
Contributor

ikevin127 commented Nov 22, 2023

#31608 PR ready for review.

In case this got lost in notifications, PR ready since yesterday.

cc @alitoshmatov

@alitoshmatov
Copy link
Contributor

@ikevin127 I am going to review the pr shortly today

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 27, 2023
@melvin-bot melvin-bot bot changed the title [$500] iOS - Task - Scroll bar in the task confirmation page is on the left [HOLD for payment 2023-12-04] [$500] iOS - Task - Scroll bar in the task confirmation page is on the left Nov 27, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 27, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Nov 27, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.3-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-12-04. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 27, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR:
  • [@alitoshmatov] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@alitoshmatov] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@alitoshmatov] Determine if we should create a regression test for this bug.
  • [@alitoshmatov] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 3, 2023
@stephanieelliott
Copy link
Contributor

stephanieelliott commented Dec 4, 2023

Summarizing payment on this issue:

  • Issue reporter: N/A
  • Contributor: @ikevin127 $500, PAID via Upwork
  • Contributor+: @alitoshmatov $500 PAID via Upwork

Upwork job is here

@melvin-bot melvin-bot bot added the Overdue label Dec 7, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

@Li357, @stephanieelliott, @ikevin127, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@alitoshmatov
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR: This is an edge case and no offending PR
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/a
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: No need for discussion
Determine if we should create a regression test for this bug. No need for regression test

@melvin-bot melvin-bot bot removed the Overdue label Dec 8, 2023
@stephanieelliott
Copy link
Contributor

All paid, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants