Skip to content

[$500] Request Money - [Scan receipt] Compose box is not focused when visiting requested money details chat after deleting another one #27249

Closed

Description

@izarutskaya

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open website
  2. Click on + icon
  3. Request Money
  4. Choose Scan, file and user
  5. Click on Request btn
  6. Reach "Receipt scan in progress" chat and delete it
  7. Visit another "Receipt scan in progress" chat

Expected Result:

Compose box should be focused when visiting requested money details chat after deleting another one

Actual Result:

Compose box is not focused when visiting requested money details chat after deleting another one

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.68-12

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

Notes/Photos/Videos: Any additional supporting documentation

Screen-Capture.-.2023-08-29T203858.242.1.mp4
Recording.1515.mp4

Expensify/Expensify Issue URL:

Issue reported by: @MahmudjonToraqulov

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693323530864789

View all open jobs on GitHub

Actual Result:

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a4ca96d5c6ee6b8d
  • Upwork Job ID: 1702371901400743936
  • Last Price Increase: 2023-09-21

Activity

  1. DylanDylann commented on Sep 12, 2023

    @DylanDylann
    Contributor

    Proposal

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

    • Compose box is not focused when visiting requested money details chat after deleting another one

    What is the root cause of that problem?

    • This bug occurs with the case manual request as well.
    • Below are the main steps occurs when deleting request money and visit another one:
    1. When opening the TransactionThread and clicking on the "Delete Request" button, it will open the confirm modal and set the modal.isVisible to true. (ONYXKEYS.MODAL)
    2. After clicking the "Delete" button in the confirm modal, it will navigate the user to the previous report screen without setting the modal.isVisible to true because the modal is unmounted before the onModalHide function (which will set the modal.isVisible to false) is called:
      const deleteTransaction = useCallback(() => {
      IOU.deleteMoneyRequest(parentReportAction.originalMessage.IOUTransactionID, parentReportAction, true);
      setIsDeleteModalVisible(false);
      }, [parentReportAction, setIsDeleteModalVisible]);
    3. The modal.isVisible is used to check whether we should run the focus function or not:
      useEffect(() => {
      if (modal.isVisible && !prevIsModalVisible) {
      // eslint-disable-next-line no-param-reassign
      isNextModalWillOpenRef.current = false;
      }
      // We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused.
      // We avoid doing this on native platforms since the software keyboard popping
      // open creates a jarring and broken UX.
      if (!(willBlurTextInputOnTapOutside && !isNextModalWillOpenRef.current && !modal.isVisible && isFocused && (prevIsModalVisible || !prevIsFocused))) {
      return;
      }
      focus();
      }, [focus, prevIsFocused, prevIsModalVisible, isFocused, modal.isVisible, isNextModalWillOpenRef]);
    4. Because the modal.isVisible is still true, visiting another one will not auto focus on the composer

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

    • We should set the Modal.isvisible to false before navigation actions like below:
    function deleteMoneyRequest(transactionID, reportAction, isSingleTransactionView = false) {
    ...
     Modal.setModalVisibility(false);
        if (isSingleTransactionView && shouldDeleteTransactionThread && !shouldDeleteIOUReport) {
            // Pop the deleted report screen before navigating. This prevents navigating to the Concierge chat due to the missing report.
            Navigation.goBack();
            Navigation.navigate(ROUTES.getReportRoute(iouReport.reportID));
            return;
        }
    
        if (shouldDeleteIOUReport) {
            // Pop the deleted report screen before navigating. This prevents navigating to the Concierge chat due to the missing report.
            Navigation.goBack();
            Navigation.navigate(ROUTES.getReportRoute(iouReport.chatReportID));
        }
    }
    

    What alternative solutions did you explore? (Optional)

    • NA

    Result

    Screencast.from.11-09-2023.22.41.13.webm
  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 12, 2023
  3. melvin-bot commented on Sep 12, 2023

    @melvin-bot

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

  4. melvin-bot commented on Sep 12, 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
  5. sakluger commented on Sep 14, 2023

    @sakluger
    Contributor

    I reproduced this and do think it's a bug. Here's what I notice:

    • When I click into the User a owes $X thread from a DM chat, the compose box is focused/highlighted by default
    • When I click into an IOU or manual request (I.e. receipt scan in progress) from the User a owes $X thread, the compose box is unfocused by default (this is expected)
    • When I click back out to the User a owes $X thread via the "From" link at the top of the page, the compose box is focused (expected)
    • When I click back into the User a owes $X thread, then click into an IOU or manual request and delete that IOU/manual request, it brings me back to the User a owes $X thread with the compose box unfocused (not expected behavior).
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 14, 2023
  7. changed the title [-]Request Money - [Scan receipt] Compose box is not focused when visiting requested money details chat after deleting another one[/-] [+][$500] Request Money - [Scan receipt] Compose box is not focused when visiting requested money details chat after deleting another one[/+] on Sep 14, 2023
  8. melvin-bot commented on Sep 14, 2023

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 14, 2023
  10. melvin-bot commented on Sep 14, 2023

    @melvin-bot

    Current assignee @sakluger is eligible for the External assigner, not assigning anyone new.

  11. melvin-bot commented on Sep 14, 2023

    @melvin-bot

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

  12. sakluger commented on Sep 18, 2023

    @sakluger
    Contributor

    @0xmiroslav could you please have a look at the proposal we got last week? Thanks!

  13. 6 remaining items

  14. melvin-bot commented on Sep 21, 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? 💸

  15. 0xmiroslav commented on Sep 21, 2023

    @0xmiroslav
    Contributor

    After clicking on the confirm button and navigating to previous report, this cleanup function is called but the isVisible is always false so the hideModal is not called. So we can fix this by adding the isVisible to the dependences

    @DylanDylann can you please share video to verify your fix?

  16. DylanDylann commented on Sep 21, 2023

    @DylanDylann
    Contributor

    @0xmiroslav Please help check this video

    Screencast.from.21-09-2023.23.54.26.webm
  17. sakluger commented on Sep 22, 2023

    @sakluger
    Contributor

    Chill out Melvin, we're working on this one.

  18. 0xmiroslav commented on Sep 22, 2023

    @0xmiroslav
    Contributor

    @DylanDylann your solution was deprecated in #27639.
    Please update proposal

  19. DylanDylann commented on Sep 22, 2023

    @DylanDylann
    Contributor

    @0xmiroslav Maybe this issue has been fixed. Can not reproduce this now

  20. 0xmiroslav commented on Sep 22, 2023

    @0xmiroslav
    Contributor

    I am also not able to reproduce.
    @sakluger let's close

  21. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    @sakluger, @0xmiroslav Whoops! This issue is 2 days overdue. Let's get this updated quick!

  22. sakluger commented on Sep 25, 2023

    @sakluger
    Contributor

    Okay, thanks you two. Closing.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions