You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] Chat - The chat shakes when you swipe down #31586
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsNeeds ReproductionReproducible steps needed
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:
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
I suggest removing this part of the code and setting the paddingTop: CONST.CHAT_HEADER_LOADER_HEIGHT always
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 ).
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.
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 ?
@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!
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsNeeds ReproductionReproducible steps needed
Activity
melvin-bot commentedon Nov 20, 2023
Triggered auto assignment to @sophiepintoraetz (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-]Chat - The chat shakes when you swipe down[/-][+][$500] Chat - The chat shakes when you swipe down[/+]melvin-bot commentedon Nov 20, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01a404d0c8e8de3687
melvin-bot commentedon Nov 20, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Nov 20, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (
External)shahinyan11 commentedon Nov 21, 2023
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.getNewerActionsis called which switches loader by changing the propisLoadingNewerReportActions. And inReportActionsListcomponent comes a change in container style associated with changing of theisLoadingNewerReportActionsprop in this part of code. ( It adds or removepaddingTop: CONST.CHAT_HEADER_LOADER_HEIGHTto the container so that the content moves up and the loader becomes visible ) . It Is the main cause of shaking of the contentWhat 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_HEIGHTin 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
paddingTop: CONST.CHAT_HEADER_LOADER_HEIGHTalwaysReportActionsViewcomponent and increase throttle time.What is wrong and need to be fixed :
Now the code is written incorrectly and the
loadNewerChatsfunction is called without throttling. It is wrapped inuseMemowhich has deeps which changes after every call ofReport.getNewerActionsand theloadNewerChatsfunction re-defines again ( Which makes using the_.throttlethis way pointless ).brunovjk commentedon Nov 21, 2023
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
loadNewerChatsis invoked prematurely, before the user scrolls to the very end, leading to unnecessary adjustments in the container style within theReportActionsListcomponent, rendering theloading circle(paddingTop: CONST.CHAT_HEADER_LOADER_HEIGHT) unnecessarily.App/src/pages/home/report/ReportActionsList.js
Line 466 in d40c017
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
onStartReachedThresholdto zero, so thatloadNewerChatswill only be called when the user gets to the end of the scroll (chat).What alternative solutions did you explore? (Optional)
melvin-bot commentedon Nov 24, 2023
@sobitneupane, @sophiepintoraetz Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
22 remaining items
sobitneupane commentedon Dec 8, 2023
@shahinyan11 I was reviewing the proposals. But looks like the issue is no longer reproducible.
shahinyan11 commentedon Dec 8, 2023
@sobitneupane and what steps did you take ? Or should we do something ?
shahinyan11 commentedon Dec 8, 2023
@sobitneupane The behavior changed due to adding following code
|| hasNewestReportActionin condition in this condition .sobitneupane commentedon Dec 8, 2023
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.
shahinyan11 commentedon Dec 8, 2023
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 ?
sobitneupane commentedon Dec 8, 2023
@shahinyan11 I think we should close the issue for now. We can always reopen the issue if the problem resurfaces.
cc: @sophiepintoraetz
melvin-bot commentedon Dec 11, 2023
@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!
melvin-bot commentedon Dec 11, 2023
@sobitneupane, @sophiepintoraetz Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Dec 11, 2023
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
sophiepintoraetz commentedon Dec 12, 2023
Ah, I missed this comment from being OOO, agreed.