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
[HOLD for payment 2024-03-04] [$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes #35835
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
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:
Log in to New Expensify
Navigate to a chat with a few messages
Hold last message
Tap Edit message
Clear compose box
Tap apply changes
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?
changed the title [-]iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/-][+][$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/+]on Feb 5, 2024
Please 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 reportScrollManager.scrollToIndex(index, false);
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?
I looked closely at the conditions for the existing reportScrollManager.scrollToIndex(index, false); here
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)#
Focus the composer and show keyboard after edit on IOS as well.
Or specific logic to call reportScrollManager.scrollToIndex(index, false); when deleting the message in the edit flow
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! 📣
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:
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.
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.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
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.
You don't want want to scroll down if you are editing something in history.
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.
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
const getSavedScrollPosition = () => {
return savedScrollPosition;
};
//and then use this savedScrollPosition in your logic
if (index === 0) {
const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
const scrollPos = getSavedScrollPosition();
//use this to scroll.
keyboardDidHideListener.remove();
});
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.
I will be in office, but at the end of my day in approx 12 hrs I can go through the checklist thoroughly and test.
changed the title [-][$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/-][+][HOLD for payment 2024-03-04] [$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/+]on Mar 5, 2024
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Activity
[-]iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/-][+][$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/+]melvin-bot commentedon Feb 5, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01a3b81b8f8d63b5f3
melvin-bot commentedon Feb 5, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (
External)melvin-bot commentedon Feb 5, 2024
Triggered auto assignment to @stephanieelliott (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.jeremy-croff commentedon Feb 6, 2024
Proposal
Please 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
reportScrollManager.scrollToIndex(index, false);Using this utility after the delete draft here:
App/src/pages/home/report/ReportActionItemMessageEdit.tsx
Line 298 in 500dd09
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?
I looked closely at the conditions for the existing reportScrollManager.scrollToIndex(index, false); here
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)#
HarshMohanSason commentedon Feb 6, 2024
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.
melvin-bot commentedon Feb 6, 2024
📣 @HarshMohanSason! 📣
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:
Format:
jeremy-croff commentedon Feb 6, 2024
You don't want want to scroll down if you are editing something in history.
HarshMohanSason commentedon Feb 7, 2024
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
16 remaining items
jeremy-croff commentedon Feb 13, 2024
@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.
jeremy-croff commentedon Feb 14, 2024
@allroundexperts bumping this.
allroundexperts commentedon Feb 14, 2024
That's fine @jeremy-croff. Please open the PR so I can test it.
jeremy-croff commentedon Feb 14, 2024
I have opened the draft for review so you can test it.
I will be in office, but at the end of my day in approx 12 hrs I can go through the checklist thoroughly and test.
jeremy-croff commentedon Feb 15, 2024
Expecting to continue work on this in 12 hours
jeremy-croff commentedon Feb 16, 2024
Ready for review!
stephanieelliott commentedon Feb 19, 2024
Hey @allroundexperts looks like this is waiting on your review!
stephanieelliott commentedon Feb 27, 2024
PR was deployed to staging
stephanieelliott commentedon Mar 5, 2024
This was deployed to prod on 2/28, seems the automation didn't work so am updating manually
[-][$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/-][+][HOLD for payment 2024-03-04] [$500] iOS-Chat not scrolled to bottom if delete last message by edit > clear comment > apply changes[/+]stephanieelliott commentedon Mar 6, 2024
Summarizing payment on this issue:
Upwork job is here: https://www.upwork.com/jobs/~1737876297360310272"
JmillsExpensify commentedon Mar 12, 2024
$500 approved for @allroundexperts based on summary.