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 2024-07-10] [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Chat - Compose box is hidden when editing multiple line break message #40767

Closed
1 of 6 tasks
izarutskaya opened this issue Apr 23, 2024 · 64 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Apr 23, 2024

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


Version Number: v1.4.64-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4503695
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Pre-requisite: user must be logged in.

  1. Go to any chat.
  2. Send a message with 10 line breaks.
  3. Tap and hold on the recently sent message.
  4. Tap on "Edit comment".
  5. Verify the compose box is partially hidden, the chat does not auto-scroll to the bottom.

Expected Result:

The page should auto-scroll to the bottom and the compose box should be fully visible without manual scroll.

Actual Result:

The page is not auto-scrolled to the bottom, the compose box is partially hidden, manual scroll is required.

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

Bug6457792_1713810082838.Vbjf1205_1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0179a22c17165154c1
  • Upwork Job ID: 1782955414960959488
  • Last Price Increase: 2024-05-29
  • Automatic offers:
    • rojiphil | Reviewer | 102547928
    • suneox | Contributor | 102547931
Issue OwnerCurrent Issue Owner: @trjExpensify
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

Triggered auto assignment to @trjExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb.

@trjExpensify
Copy link
Contributor

I can reproduce it. Couldn't find a recent issue, looks like @kosmydel fixed it once before here in Oct 2023: #24502

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Apr 24, 2024
@melvin-bot melvin-bot bot changed the title Chat - Compose box is hidden when editing multiple line break message [$250] Chat - Compose box is hidden when editing multiple line break message Apr 24, 2024
Copy link

melvin-bot bot commented Apr 24, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0179a22c17165154c1

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 24, 2024
Copy link

melvin-bot bot commented Apr 24, 2024

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

@suneox
Copy link
Contributor

suneox commented Apr 24, 2024

Proposal

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

Chat - Compose box is hidden when editing multiple line break message

What is the root cause of that problem?

When editing a message item on report item list will be focus and scrollToIndex immediate, but the keyboard shown 100% after the list item scrollToIndex and the height of report item will resize to smaller so the keyboard will overlap the edit composer

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

We will be waiting the keyboard open 100% before scrollToIndex. We can use InteractionManager.runAfterInteractions and requestAnimationFrame to wait the keyboard opened then scroll to index
Update onFocus function to

    onFocus={() => {
        setIsFocused(true);
+       InteractionManager.runAfterInteractions(() => {
+           requestAnimationFrame(() => {
                reportScrollManager.scrollToIndex(index, true);
+           });
+       });
        setShouldShowComposeInputKeyboardAware(false);
        ...

Same solution with this and this

Before fix
Screen.Recording.2024-04-24.at.12.39.49.mov
After fix
Screen.Recording.2024-04-24.at.12.40.57.mov

What alternative solutions did you explore? (Optional)

@suneox
Copy link
Contributor

suneox commented Apr 24, 2024

I can reproduce it. Couldn't find a recent issue, looks like @kosmydel fixed it once before here in Oct 2023: #24502

@trjExpensify This issue still happens when you edit the last item has multiple lines

Screen.Recording.2024-04-24.at.12.39.49.mov

@tienifr
Copy link
Contributor

tienifr commented Apr 24, 2024

Proposal

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

The page is not auto-scrolled to the bottom, the compose box is partially hidden, manual scroll is required.

What is the root cause of that problem?

We're running scrollToIndex right after the edit composer is focused. At that time, the keyboard is still showing and when it 's shown totally, the keyboard will be overlap with the composer

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

We need to wait for keyboard is shown totally. To do that we shouldn't lean on runAfterInteractions or requestAnimationFrame because they're not enough to make sure the keyboard is shown 100%. Instead of that we should use keyboardDidShow event

const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', (e) => {
                                    reportScrollManager.scrollToIndex(index, true);
                                    keyboardDidShowListener.remove()
                                });

What alternative solutions did you explore? (Optional)

NA

Result

Screen.Recording.2024-04-24.at.16.18.12.mov

@kosmydel
Copy link
Contributor

I can reproduce it. Couldn't find a recent issue, looks like @kosmydel fixed it once before here in Oct 2023: #24502

The mentioned issue was related to mWeb only, not native. At first glance, the root cause of this issue is different.

@suneox
Copy link
Contributor

suneox commented Apr 24, 2024

I think the RCA and solution on this proposal is inherited and duplicated with my proposal is we have to wait keyboard show

however, my chosen option for solution wait keyboard show based on a lot of code base also use runAfterInteractions to allows JavaScript animations to run smoothly avoid many transitions run the same time, and the event keyboardDidShow doesn't support for mWeb

@tienifr
Copy link
Contributor

tienifr commented Apr 25, 2024

Screen.Recording.2024-04-25.at.11.49.38.mov

It works well on mweb. As I said in my proposal, runAfterInteractions can not make sure the keyboard is shown totally

@suneox
Copy link
Contributor

suneox commented Apr 25, 2024

react-native-web doesn't implement Keyboard event

Screenshot 2024-04-25 at 22 35 36

I have tried keyboard event before using runAfterInteractions and it doesn't work for mWeb

Screen.Recording.2024-04-25.at.23.33.06.mov

My solution using runAfterInteractions for scroll to item the same with this one, this one ... and flatlist also apply requestAnimationFrame for scroll to item that all the reason i using runAfterInteractions and requestAnimationFrame to make sure no frame update that also mean the keyboard opened it also avoid multiple transition run same time

@sword1202
Copy link

If there is multi lines text, it's impossible to edit on iPhone.

bug_cannotEditMultiLine.mp4

@melvin-bot melvin-bot bot added the Overdue label Apr 26, 2024
@trjExpensify
Copy link
Contributor

@rojiphil are you going to review these proposals?

@melvin-bot melvin-bot bot removed the Overdue label Apr 27, 2024
@rojiphil
Copy link
Contributor

@rojiphil are you going to review these proposals?

@trjExpensify Yes. Will review and share an update today.

@rojiphil
Copy link
Contributor

react-native-web doesn't implement Keyboard event

@tienifr What are your thoughts on this concern?

@rojiphil
Copy link
Contributor

runAfterInteractions can not make sure the keyboard is shown totally

@suneox And what are your thoughts on this concern?

@suneox
Copy link
Contributor

suneox commented Apr 28, 2024

@suneox And what are your thoughts on this concern?

@rojiphil I also explain in my comment the reason I was using runAfterInteractions with requestAnimationFrame to make sure it can work for all platform instead of the keyboard even.

My solution using runAfterInteractions for scroll to item the same with this one, this one ... and flatlist also apply requestAnimationFrame for scroll to item that all the reason i using runAfterInteractions and requestAnimationFrame to make sure no frame update that also mean the keyboard opened it also avoid multiple transition run same time

@rojiphil
Copy link
Contributor

@suneox @tienifr On further investigation, I could reproduce the problem even without the keyboard on my iOS simulator. So how can scrolling early even before the Keyboard shows up completely be the root cause here?

40767-scroll-issue.mp4

@suneox
Copy link
Contributor

suneox commented Apr 29, 2024

@suneox @tienifr On further investigation, I could reproduce the problem even without the keyboard on my iOS simulator. So how can scrolling early even before the Keyboard shows up completely be the root cause here?

40767-scroll-issue.mp4

You must enable keyboard by shortcut CMD+k

@melvin-bot melvin-bot bot added the Weekly KSv2 label Jun 2, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 11, 2024
@melvin-bot melvin-bot bot changed the title [$250] Chat - Compose box is hidden when editing multiple line break message [HOLD for payment 2024-06-18] [$250] Chat - Compose box is hidden when editing multiple line break message Jun 11, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

Copy link

melvin-bot bot commented Jun 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 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 2024-06-18. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 11, 2024

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:

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-18] [$250] Chat - Compose box is hidden when editing multiple line break message [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Chat - Compose box is hidden when editing multiple line break message Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 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 2024-06-20. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 13, 2024

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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 18, 2024
@trjExpensify
Copy link
Contributor

👋 checklist time, please!

@suneox
Copy link
Contributor

suneox commented Jun 24, 2024

@rojiphil you're a reviewer for this issue so could you please complete a check list?

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@rojiphil rojiphil mentioned this issue Jun 24, 2024
1 task
@rojiphil
Copy link
Contributor

  • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR: Offending PR
  • [@rojiphil] 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: Added comment
  • [@rojiphil] 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: Not Required. Existing checklist is good enough to capture such issues.
  • [@rojiphil] Determine if we should create a regression test for this bug. : Given the spooky nature of this issue, it is better to have a regression test case to ensure this does not occur again.
  • [@rojiphil] 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.
  1. Go to any chat.
  2. Send a message with 10 line breaks.
  3. Tap and hold on the recently sent message.
  4. Tap on "Edit comment".
  5. Verify that the page auto-scrolls to the bottom and the compose box is fully visible without manual scroll.

@rojiphil
Copy link
Contributor

👋 checklist time, please!

@trjExpensify Completed BZ checklist and accepted the offer too. Thanks.

@trjExpensify
Copy link
Contributor

Thanks! Regression test issue created for Applause.

Payment summary as follows:

Paid you both, closing!

@melvin-bot melvin-bot bot removed the Overdue label Jun 24, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Chat - Compose box is hidden when editing multiple line break message [HOLD for payment 2024-07-10] [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Chat - Compose box is hidden when editing multiple line break message Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jul 3, 2024

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:

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

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

8 participants