Skip to content

[HOLD #41128] [$500] mWeb - Chat - The keyboard appears for a moment when leaving the thread #35494

Closed

Description

@kbecciv

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: v1.4.34-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:
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:

Issue found when executing PR #35202

Action Performed:

  1. Go to URL https://staging.new.expensify.com/ on Android
  2. Login with any account
  3. Navigate to any conversation
  4. Start a thread and send some messages
  5. Tap and hold on a message and choose Reply in Thread
  6. Click on the three-dot menu and hit "Leave thread"

Expected Result:

The keyboard doesn't appear for a moment when leaving the thread

Actual Result:

The keyboard appears for a moment when leaving the thread

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

Add any screenshot/video evidence

Bug6362602_1706721121608.video_2024-01-31_17-29-22.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01278478c2e7ed2136
  • Upwork Job ID: 1752743923246346240
  • Last Price Increase: 2024-03-15

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 31, 2024
  2. changed the title [-]mWeb - Chat - The keyboard appears for a moment when leaving the thread[/-] [+][$500] mWeb - Chat - The keyboard appears for a moment when leaving the thread[/+] on Jan 31, 2024
  3. melvin-bot commented on Jan 31, 2024

    @melvin-bot
  4. melvin-bot commented on Jan 31, 2024

    @melvin-bot

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

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 31, 2024
  6. melvin-bot commented on Jan 31, 2024

    @melvin-bot

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

  7. kbecciv commented on Jan 31, 2024

    @kbecciv
    Author

    We think that this bug might be related to #vip-vsb
    CC @quinthar

  8. Christinadobrzyn commented on Jan 31, 2024

    @Christinadobrzyn
    Contributor

    I can reproduce this based on the steps in the OP. I think this can be External so waiting for proposals.

  9. samilabud commented on Jan 31, 2024

    @samilabud
    Contributor

    Proposal

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

    The keyboard appears for a moment when leaving the thread

    What is the root cause of that problem?

    When we are in a thread and the composer is focused the keyboard going to be displayed, but when we click on the three dots the keyboard get hide (as part of the behavior of this component), here no matter what option we select the keyboard going to be displayed again after three dots menu get hide, because of this when we leave the thread the keyboard seems to appear (expected behavior) and then disappears when the leave action makes we navigates back to main thread because the composer loose the focus.

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

    We can keep the focus on the composer when navigating backwards and the keyboard is displayed.

    To do this we should modify the ReportScreen Component to add a variable that determine if the user got to the screen using the navigation component with path (this let us know if the user is not getting to the Report from LHN), like:

    const isReportOpenedFromNavigationPath = Boolean(lodashGet(route, 'path') || false);

    And pass this to ReportFooter as a prop:

    <ReportFooter
                                           report={report}
                                           pendingAction={addWorkspaceRoomOrChatPendingAction}
                                           isComposerFullSize={isComposerFullSize}
                                           listHeight={listHeight}
                                           isEmptyChat={isEmptyChat}
                                           lastReportAction={lastReportAction}
                                           isReportOpenedFromNavigationPath={isReportOpenedFromNavigationPath}
                                       />
    

    With the prop isReportOpenedFromNavigationPath we can now determinate when to force the input focus, to do this we can pass as a prop the result of this variable on ReportActionCompose, like:

     const forceFocusComposer = props.isReportOpenedFromNavigationPath;
    .
    .
    .
    <ReportActionCompose
                                onSubmit={onSubmitComment}
                                reportID={props.report.reportID}
                                report={props.report}
                                isEmptyChat={props.isEmptyChat}
                                lastReportAction={props.lastReportAction}
                                pendingAction={props.pendingAction}
                                isComposerFullSize={props.isComposerFullSize}
                                listHeight={props.listHeight}
                                isReportReadyForDisplay={props.isReportReadyForDisplay}
                                shouldForceComposerFocus={forceFocusComposer}
                            />
    

    Finally we should receive the new prop and use it to focus the composer when is true inside of ReportActionCompose component, like:

    useEffect(() => {
            if (!shouldForceComposerFocus) {
                return;
            }
            focus();
        }, [shouldForceComposerFocus]);
    

    Result:

    Leaving.thread.keyboard.issue.mp4
  10. Christinadobrzyn commented on Feb 1, 2024

    @Christinadobrzyn
    Contributor

    collecting proposals!

  11. 108 remaining items

  12. Christinadobrzyn commented on May 3, 2024

    @Christinadobrzyn
    Contributor

    watching - #41128

  13. Julesssss commented on May 3, 2024

    @Julesssss
    Contributor

    Hey @Christinadobrzyn, I'm going to try and move that linked issue forward.

  14. Christinadobrzyn commented on May 8, 2024

    @Christinadobrzyn
    Contributor

    thanks @Julesssss! I'll keep an eye on #41128

  15. Christinadobrzyn commented on May 14, 2024

    @Christinadobrzyn
    Contributor

    monitoring - #41128

  16. Christinadobrzyn commented on May 21, 2024

    @Christinadobrzyn
    Contributor

    monitoring - #41128

  17. Christinadobrzyn commented on May 28, 2024

    @Christinadobrzyn
    Contributor

    PR - #41128 is done and I think this is resolved.

    Testing again and the keyboard shows after leaving a thread.

    screenRecording-28-5-2024-16-8.mp4

    Gonna ask QA to test again. https://expensify.slack.com/archives/C9YU7BX5M/p1716883797729199

  18. isagoico commented on May 28, 2024

    @isagoico

    Issue is still reproducible on Android mWeb

    1953885561340247456az_recorder_20240528_103525.mp4
  19. Christinadobrzyn commented on Jun 5, 2024

    @Christinadobrzyn
    Contributor

    hum @sobitneupane can you restest? I'm not able to reproduce as is above #35494 (comment)

  20. sobitneupane commented on Jun 6, 2024

    @sobitneupane
    Contributor

    @Christinadobrzyn I could not reproduce the issue in Android/Chrome.

  21. Christinadobrzyn commented on Jun 7, 2024

    @Christinadobrzyn
    Contributor

    Awesome - let's close! thanks for checking @sobitneupane!

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions