-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2024-03-04] [$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes #35835
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01a3b81b8f8d63b5f3 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts ( |
Triggered auto assignment to @stephanieelliott ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.We don't presreve the scroll position after deleting a message through the edit flow. What is the root cause of that problem?Only in IOS, we are maintaing focus on the composer. So the keyboard shows up during edit, shifts the scroll. After delete, we don't have the keyboard, and the scroll position is lost. On other platforms we focus the composer and the keyboard gets shown again, preserving the scroll. What changes do you think we should make in order to solve the problem?We have a nice utility to preserve the scroll Using this utility after the delete draft here: will preserve the correct scroll position and address this issue. But how do we reconcile the logic with the existing scroll listeners on keyboard hide? App/src/pages/home/report/ReportActionItemMessageEdit.tsx Lines 293 to 297 in 500dd09
And confirmed that this will run when scrolled all the way to the bottom, and when edited a message to a new message. By removing the boundaries when that runs, and always running that, it will ensure the messages are always visible. In both that use case, and this use case. What alternative solutions did you explore? (Optional)#
|
Did you try using the scrollToEnd() method provided by the ScrollView component? That should solve this case if all you need to do is to just scroll at the bottom each time a message edit was successful. |
📣 @HarshMohanSason! 📣
|
You don't want want to scroll down if you are editing something in history. |
I meant call the function after the delete is completed by setting a flag to know if it has been finished or not. The solutions you have provided where "Or specific logic to call reportScrollManager.scrollToIndex(index, false); when deleting the message in the edit flow". You can try using a trigger function which is called whenever the keyboard is opened so it saves that position. Then you can have something like
|
I'm trying to understand, but the root cause of the current IOS bug is that the existing scroll is not working because keyboardDidHide actually never occurs. Since the composer doesn't get refocused. That's why I proposed to either call a scroll to current position after delete, or focus on the composer. |
Hey @allroundexperts would you mind weighing in on the proposals here? |
I think we should focus the composer and show the keyboard again on iOS as well like we do on other platforms to maintain consistency. As such, @jeremy-croff's alternate proposal looks good to me. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @NikkiWines, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Yep, agreed - let's go with consistency 👍 |
📣 @jeremy-croff 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
I'm reviewing the composer consistency idea and have the following considerations: I was wrong saying not re-focusing is IOS specific, there are actually conditions seperate for touch screen devices like is my report empty then show the keyboard so when testing on android I was missing these conditions when comparing. Showing the keyboard after edit actually did not fix this bug after implementing this locally and the root cause is specified in the comment below. Sorry for the complication. See below comment for the root cause and why this is only reproducible on IOS. |
While developing I identified a one liner that caused this issue: updating
Fixes this issue, and is the root cause. Only IOS does it on willHideKeyboard. It was done specifically for #29211 (comment) This impacts the timing between the scroll and the insertion of the composer element which is pushing the text off. In a branch I have made the change back to didHideKeyboard to fix the scroll on IOS This seems to work the best. |
@allroundexperts I'm looking for approval on the information above. I have a draft PR open and can finalize the checklist if this looks good. |
@allroundexperts bumping this. |
That's fine @jeremy-croff. Please open the PR so I can test it. |
I have opened the draft for review so you can test it. |
Expecting to continue work on this in 12 hours |
Ready for review! |
Hey @allroundexperts looks like this is waiting on your review! |
PR was deployed to staging |
This was deployed to prod on 2/28, seems the automation didn't work so am updating manually |
Summarizing payment on this issue:
Upwork job is here: https://www.upwork.com/jobs/~1737876297360310272" |
$500 approved for @allroundexperts based on summary. |
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.36-1
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:
Expected Result:
The edited message should be deleted, and chat history should be scrolled to the very bottom
Actual Result:
The edited message is deleted, but chat history is not scrolled to the bottom. There is one or two messages below
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6367929_1707148265687.OVKO5302.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: