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-10-16] [$500] New chat - The scrollbar automatically scrolls to the top in user contact list. #25947

Closed
1 of 6 tasks
izarutskaya opened this issue Aug 25, 2023 · 44 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 25, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

Prepare: You need to have a lot of contact list.

  1. Log in with User A and User B.
  2. [User A] Open New chat.
  3. [User A] Scroll down in user contact list.
  4. [User B] Change user profile such as user name or user photo, etc.
  5. [User A] Observe the scrollbar in user contact list.

Expected Result:

The scrollbar should not automatically scroll to the top.

Actual Result:

The scrollbar automatically scrolls to the top.

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.57-3

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

Notes/Photos/Videos: Any additional supporting documentation

2023-08-14_23-46-44.mp4
Recording.1334.mp4

Expensify/Expensify Issue URL:

Issue reported by: @oleksandr-pantsyr

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692047251421889

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01586a2845180d88cc
  • Upwork Job ID: 1697357273065869312
  • Last Price Increase: 2023-09-14
  • Automatic offers:
    • aimane-chnaif | Reviewer | 26747658
    • dukenv0307 | Contributor | 26747659
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 25, 2023
@dukenv0307
Copy link
Contributor

Proposal

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

The scrollbar automatically scrolls to the top in user contact list.

What is the root cause of that problem?

When we change the display name in another tab, sections props is changed and componentDidUpdate is triggered. In this function, we always scrollToIndex to the first option if the search value is empty or the focusedIndex in the range

() => {
// If we just toggled an option on a multi-selection page or cleared the search input, scroll to top
if (this.props.selectedOptions.length !== prevProps.selectedOptions.length || this.props.value === '') {
this.scrollToIndex(0);
return;
}
// Otherwise, scroll to the focused index (as long as it's in range)
if (this.state.allOptions.length <= this.state.focusedIndex) {
return;
}
this.scrollToIndex(this.state.focusedIndex);
},
);

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

We should scroll when the searchValue is just cleared or focusedIndex is changed.

const isNewFocusedIndex = newFocusedIndex !== this.state.focusedIndex;
const isNewFocusedIndex = newFocusedIndex !== this.state.focusedIndex;

// eslint-disable-next-line react/no-did-update-set-state
this.setState(
    {
        allOptions: newOptions,
        focusedIndex: newFocusedIndex,
    },
    () => {
        // If we just toggled an option on a multi-selection page or cleared the search input, scroll to top
        if ((this.props.selectedOptions.length !== prevProps.selectedOptions.length) || (!!prevProps.value && !this.props.value)) {
            this.scrollToIndex(0);
            return;
        }

        // Otherwise, scroll to the focused index (as long as it's in range)
        if (this.state.allOptions.length <= this.state.focusedIndex || !isNewFocusedIndex) {
            return;
        }
        this.scrollToIndex(this.state.focusedIndex);
    },
);

What alternative solutions did you explore? (Optional)

NA

Result

Screencast.from.21-08-2023.15.01.16.webm

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 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

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@sakluger
Copy link
Contributor

Haven't gotten to this yet, will review soon.

@melvin-bot melvin-bot bot removed the Overdue label Aug 29, 2023
@sakluger
Copy link
Contributor

This is a small edge case, but I agree it's an annoying bug that we should fix.

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Aug 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01586a2845180d88cc

@melvin-bot melvin-bot bot changed the title New chat - The scrollbar automatically scrolls to the top in user contact list. [$500] New chat - The scrollbar automatically scrolls to the top in user contact list. Aug 31, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

Current assignee @sakluger is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

@sakluger, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@binary3oul
Copy link

binary3oul commented Sep 4, 2023

Proposal

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

The scrollbar automatically scrolls to the top in user contact list.

What is the root cause of that problem?

After receiving the socket event, the state is updated, followed by a scrolling action.

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

We can remove the callback function in this line if uncecessary like this:

this.setState(
            {
                allOptions: newOptions,
                focusedIndex: newFocusedIndex,
            }
)

and add one-line css code: overflowAnchor: none to prevent list from scrolling on this line.
like this: style = {{ overflowAnchor: 'none' }}

@sakluger
Copy link
Contributor

sakluger commented Sep 5, 2023

Just got the first proposal today, not overdue.

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@aimane-chnaif
Copy link
Contributor

@binary3oul thanks for your proposal. The root cause is not correct. And the solution is also 👎

@dukenv0307
Copy link
Contributor

dukenv0307 commented Sep 7, 2023

@aimane-chnaif Any thought in my proposal.

@binary3oul
Copy link

@aimane-chnaif Can you see that file?
You can see componentDidUpdate method inside that file and also

this.setState(
            {
                allOptions: newOptions,
                focusedIndex: newFocusedIndex,
            }, () => {...}
)

in that method.

I mean that we need to delete that callback so that we can prevent to scroll automatically.

Could you please why I am wrong?
Although I will not get an offer, I would be happy to learn more in this platform.
Thank you in advance.

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@sakluger, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@sakluger, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@sakluger
Copy link
Contributor

@aimane-chnaif did you see @dukenv0307's proposal higher up?

@melvin-bot melvin-bot bot removed the Overdue label Sep 19, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 19, 2023
@dukenv0307
Copy link
Contributor

@aimane-chnaif The PR is ready to review.

@oleksandrpantsyr
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~0123ed76caa67b29ea

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

⚠️ Unable to store contributor details cc @thienlnam

@oleksandrpantsyr
Copy link

Hi @izarutskaya
Could you please change the reporter from @oleksandrpantsyr to @oleksandr-pantsyr?
Both are my emails. I have already the contributor detail with @oleksandr-pantsyr.

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

📣 @oleksandrpantsyr! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @dukenv0307 got assigned: 2023-09-19 06:00:08 Z
  • when the PR got merged: 2023-10-05 04:29:34 UTC
  • days elapsed: 11

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 9, 2023
@melvin-bot melvin-bot bot changed the title [$500] New chat - The scrollbar automatically scrolls to the top in user contact list. [HOLD for payment 2023-10-16] [$500] New chat - The scrollbar automatically scrolls to the top in user contact list. Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-5 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-10-16. 🎊

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 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:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] 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.
  • [@sakluger] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@dukenv0307
Copy link
Contributor

Just added a note: This issue would be eligible for speed bonus, since it was approved by C+ within 3 days, and there were no changes after that.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Oct 16, 2023
@sakluger
Copy link
Contributor

Hi @oleksandr-pantsyr I send you an offer via Upwork, let me know once you've accepted. Thanks!

@dukenv0307 thanks, I confirmed that the PR was C+ approved on Sep 21 which was within 3 days.

I completed payment for @dukenv0307. @aimane-chnaif could you please complete the BZ checklist so I can complete your payment as well?

@aimane-chnaif
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Fix for: Chat - New Group - The search box overlays the selected user #14175
  • 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: https://github.com/Expensify/App/pull/14175/files#r1361021150
  • 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: N/A
  • Determine if we should create a regression test for this bug.
  • 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.

As this is minor visual bug which doesn't affect logic, not worth adding regression test.

@oleksandrpantsyr
Copy link

@sakluger
I've accepted an offer in Upwork. thank you.

@sakluger
Copy link
Contributor

All payments have been completed, thanks! 🚀

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants