Skip to content

[$500] Chat - The chat shakes when you swipe down #31586

Closed

Description

@lanitochka17

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.1.4
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. Navigate to https://staging.new.expensify.com/
  2. Log in
  3. Open a conversation with a lot of one word messages and some emojis in a chat
  4. Swipe up and down

Expected Result:

The swiping should be smooth

Actual Result:

The chat shakes when you swipe down

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

Bug6284556_1700515578151.Shake.1.mp4
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a404d0c8e8de3687
  • Upwork Job ID: 1726717224301903872
  • Last Price Increase: 2023-12-11

Activity

  1. added
    External
    Daily
    Bug
    on Nov 20, 2023
  2. melvin-bot commented on Nov 20, 2023

    @melvin-bot

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

  3. changed the title [-]Chat - The chat shakes when you swipe down[/-] [+][$500] Chat - The chat shakes when you swipe down[/+] on Nov 20, 2023
  4. melvin-bot commented on Nov 20, 2023

    @melvin-bot
  5. melvin-bot commented on Nov 20, 2023

    @melvin-bot

    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
  6. added
    Help Wanted
    on Nov 20, 2023
  7. melvin-bot commented on Nov 20, 2023

    @melvin-bot

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

  8. shahinyan11 commented on Nov 21, 2023

    @shahinyan11
    Contributor

    Proposal

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

    Chat - The chat shakes when you swipe down

    What is the root cause of that problem?

    While scrolling, every time the scroll indicator gets close to the bottom, the Report.getNewerActions is called which switches loader by changing the prop isLoadingNewerReportActions. And in ReportActionsList component comes a change in container style associated with changing of the isLoadingNewerReportActions prop in this part of code. ( It adds or remove paddingTop: CONST.CHAT_HEADER_LOADER_HEIGHT to the container so that the content moves up and the loader becomes visible ) . It Is the main cause of shaking of the content

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

    We can change this part of code like this - isLoadingNewerReportActions && scrollingVerticalOffset.current <= CONST.CHAT_HEADER_LOADER_HEIGHT ? styles.chatContentScrollViewWithHeaderLoader : {} .

    Adding scrollingVerticalOffset.current <= CONST.CHAT_HEADER_LOADER_HEIGHT in check helps us avoid adding a loader if the scroll position is such that the loader won't be visible anyway.

    What alternative solutions did you explore? (Optional)

    Alternatively we can

    1. I suggest removing this part of the code and setting the paddingTop: CONST.CHAT_HEADER_LOADER_HEIGHT always
    2. fix _.throttle function in ReportActionsView component and increase throttle time.
      What is wrong and need to be fixed :
      Now the code is written incorrectly and the loadNewerChats function is called without throttling. It is wrapped in useMemo which has deeps which changes after every call of Report.getNewerActions and the loadNewerChats function re-defines again ( Which makes using the _.throttle this way pointless ).
  9. brunovjk commented on Nov 21, 2023

    @brunovjk
    Contributor

    Proposal

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

    The problem involves noticeable shaking in the chat view when engaging in specific actions, like opening multiline text in edit mode and scrolling up.

    What is the root cause of that problem?

    The issue arises because loadNewerChats is invoked prematurely, before the user scrolls to the very end, leading to unnecessary adjustments in the container style within the ReportActionsList component, rendering the loading circle (paddingTop: CONST.CHAT_HEADER_LOADER_HEIGHT) unnecessarily.

    onStartReachedThreshold={0.75}

    If the user doesn't reach the end of the scroll, the loading circle is not visible anyway, making the adjustments redundant.

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

    Set onStartReachedThreshold to zero, so that loadNewerChats will only be called when the user gets to the end of the scroll (chat).

        onStartReached={loadNewerChats}
        onStartReachedThreshold={0}
    

    What alternative solutions did you explore? (Optional)

  10. melvin-bot commented on Nov 24, 2023

    @melvin-bot

    @sobitneupane, @sophiepintoraetz Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. 22 remaining items

  12. sobitneupane commented on Dec 8, 2023

    @sobitneupane
    Contributor

    @shahinyan11 I was reviewing the proposals. But looks like the issue is no longer reproducible.

  13. shahinyan11 commented on Dec 8, 2023

    @shahinyan11
    Contributor

    @sobitneupane and what steps did you take ? Or should we do something ?

  14. shahinyan11 commented on Dec 8, 2023

    @shahinyan11
    Contributor

    @sobitneupane The behavior changed due to adding following code || hasNewestReportAction in condition in this condition .

  15. sobitneupane commented on Dec 8, 2023

    @sobitneupane
    Contributor

    The change was introduced by this PR. And the issue is no longer reproducible. I don't think any action is required in the issue.

  16. shahinyan11 commented on Dec 8, 2023

    @shahinyan11
    Contributor

    The issue is no longer reproducible but the question arises. When this loader may appear ? If there still exists some cases when the loader may appear, the issue still actual and if not, then why not remove the loader component from there ?

  17. sobitneupane commented on Dec 8, 2023

    @sobitneupane
    Contributor

    @shahinyan11 I think we should close the issue for now. We can always reopen the issue if the problem resurfaces.

    cc: @sophiepintoraetz

  18. melvin-bot commented on Dec 11, 2023

    @melvin-bot

    @sobitneupane @sophiepintoraetz this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

  19. melvin-bot commented on Dec 11, 2023

    @melvin-bot

    @sobitneupane, @sophiepintoraetz Whoops! This issue is 2 days overdue. Let's get this updated quick!

  20. melvin-bot commented on Dec 11, 2023

    @melvin-bot

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

  21. sophiepintoraetz commented on Dec 12, 2023

    @sophiepintoraetz
    Contributor

    Ah, I missed this comment from being OOO, agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineeringExternalHelp WantedNeeds Reproduction

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions