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 2023-07-26] [$1000] App loses focus from compose box on clicking same chat in LHN for the 2nd time #20865

Closed
1 of 6 tasks
kavimuru opened this issue Jun 15, 2023 · 50 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Jun 15, 2023

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


Action Performed:

  1. Open the app
  2. Open any chat and start typing to select an emoji (e.g. :hea) and observe that App opens the compose box
  3. Reclick on same chat in LHN and observe that focus is lost from compose box (i.e. you don't see the list of emojis)

Expected Result:

App should keep the focus on compose box whenever we click on chat in LHN

Actual Result:

App loses focus from compose box on reclicking on same chat in LHN

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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: 1.3.29.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
Notes/Photos/Videos: Any additional supporting documentation

app.loses.focus.on.reclick.on.chat.LHN.mp4
Recording.982.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686293905214069

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015fc6dbe666a661d7
  • Upwork Job ID: 1670574342491840512
  • Last Price Increase: 2023-06-18
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

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

@jliexpensify
Copy link
Contributor

I'm on Staging (v1.3.28-5) and I don't think this is anb issue anymore?

2023-06-16_17-01-31.mp4

Please re-test on the newest version and re-open with a video + repro steps if it is an issue, thanks!

@dhanashree-sawant
Copy link

Hi @jliexpensify, you will need to click twice i.e. reclick on same chat in LHN to reproduce it.

2023-06-17.09-07-32.mp4

@jliexpensify
Copy link
Contributor

jliexpensify commented Jun 18, 2023

On v1.3.29-0, can reproduce - thanks @dhanashree-sawant

Updated the issue to make it clearer.

@jliexpensify jliexpensify reopened this Jun 18, 2023
@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Jun 18, 2023
@melvin-bot melvin-bot bot changed the title App loses focus from compose box on clicking same chat in LHN for the 2nd time [$1000] App loses focus from compose box on clicking same chat in LHN for the 2nd time Jun 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 18, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015fc6dbe666a661d7

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 18, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Jun 19, 2023

Proposal

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

App loses focus from compose box on clicking same chat in LHN for the 2nd time

What is the root cause of that problem?

If users click on the different chat, the ReportActionCompose will be unmounted and mounted again so the input is focused, but if they click on the same chat, the ReportActionCompose is not unmounted, that why we can see the text input is blurred.

Additionally, in

// A pressed navigation button will remain focused, keeping its tooltip visible, even if it's supposed to be out of view.
// To prevent that we blur the button manually (especially for Safari, where the mouse leave event is missing).
// More info: https://github.com/Expensify/App/issues/13146
DomUtils.blurActiveElement();

we have the logic to blur the active element when we navigate to the screen (e.x: click on LHN option to open chat). It's used to prevent tooltip visible on mobile web when users open chat from LHN.

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

In OptionRowLHN we should add onMouseDown to PressableWithSecondaryInteraction like

 onMouseDown={(e)=>{
                            if (e) {
                                e.preventDefault();
                            }
                        }}

And in

showReportPage(option) {
if (this.props.isCreateMenuOpen) {
// Prevent opening Report page when click LHN row quickly after clicking FAB icon
return;
}
Navigation.navigate(ROUTES.getReportRoute(option.reportID));
this.props.onLinkClick();
}

we can add the condition to prevent navigate to the same chat

        if(this.props.currentReportId !== option.reportID){
            Navigation.navigate(ROUTES.getReportRoute(option.reportID));
        }

Result

Screen.Recording.2023-06-19.at.11.54.17.mov

@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@melvin-bot melvin-bot bot added the Overdue label Jun 21, 2023
@jliexpensify
Copy link
Contributor

Bump @Santhosh-Sellavel as we have a proposal

@melvin-bot melvin-bot bot removed the Overdue label Jun 21, 2023
@Santhosh-Sellavel
Copy link
Collaborator

@tienifr
Why we need to e.preventDefault() ?

@Santhosh-Sellavel
Copy link
Collaborator

Sorry for the delay somehow I missed this!

@tienifr
Copy link
Contributor

tienifr commented Jun 23, 2023

@Santhosh-Sellavel using e.preventDefault(); in onMouseDown to prevent the input lose focus. By default when we click outside the input, it will lose focus

@Santhosh-Sellavel
Copy link
Collaborator

@tienifr your proposal is not working for me!

@tienifr
Copy link
Contributor

tienifr commented Jun 23, 2023

@Santhosh-Sellavel I think it's because of this line

this.shouldAutoFocus = !props.modal.isVisible && (this.shouldFocusInputOnScreenFocus || this.isEmptyChat()) && props.shouldShowComposeInput;

the props.modal.isVisible is not correct, pls help check the video below. After open setting page props.modal.isVisible is true. After refreshing app, props.modal.isVisible should be false, but it's still true => shouldAutoFocus is false.

Screen.Recording.2023-06-24.at.02.35.35.mov

This issue still happen on staging and will be fixed in #16098

So can you please reset props.modal.isVisible (e.x: open the setting page and close it) and test again?
Here's my result

Screen.Recording.2023-06-24.at.02.39.14.mov

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jun 23, 2023

Thanks for reminding #16098!
If this is dependent on that then we should wait here as this issue is not super urgent. When it comes off hold, if the issue exists(It may get fixed there) your proposal will be prioritized. Thanks @tienifr!

@jliexpensify Please add HOLD to title thanks!
It's working #20865 (comment)

@tienifr
Copy link
Contributor

tienifr commented Jun 23, 2023

@Santhosh-Sellavel It seems weird. Did you add e.preventDefault() in onMouseDown in OptionRowLHN and the condition to prevent navigating to the same page as what I mentioned in the proposal. Thanks

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jun 23, 2023

Yeah, I did add that. I messed up the other condition. 🤦 I used && instead of || earlier Sorry @tienifr!

showReportPage(option) {
        if (this.props.isCreateMenuOpen || this.props.currentReportId === option.reportID) {
            // Prevent opening Report page when click LHN row quickly after clicking FAB icon
            return;
        }
        Navigation.navigate(ROUTES.getReportRoute(option.reportID));
        this.props.onLinkClick();
    }

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

📣 @Santhosh-Sellavel We're missing your Upwork ID to automatically send you an offer for the Reviewer role.
Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

📣 @dhanashree! 📣
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:

  1. 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.
  2. 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.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

The BZ member will need to manually hire dhanashree for the Reporter role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

@tienifr
Copy link
Contributor

tienifr commented Jul 6, 2023

The PR ready for review #21552!

@jliexpensify
Copy link
Contributor

Hired @dhanashree-sawant . @Santhosh-Sellavel are you being paid via New.Dot?

@Santhosh-Sellavel
Copy link
Collaborator

@jliexpensify Yes will be via Newdot, please cancel offer thanks!

@jliexpensify
Copy link
Contributor

Weird, no offer to cancel!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 19, 2023
@melvin-bot melvin-bot bot changed the title [$1000] App loses focus from compose box on clicking same chat in LHN for the 2nd time [HOLD for payment 2023-07-26] [$1000] App loses focus from compose box on clicking same chat in LHN for the 2nd time Jul 19, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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:

  • [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
  • [@Santhosh-Sellavel] 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.
  • [@jliexpensify] 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 Jul 25, 2023
@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jul 26, 2023

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:

As far as I see this is not broken by any PR this was just a case we missed handling, from the initial implementation.

@MonilBhavsar Let me know if you differ on any of the above, thanks!

@Santhosh-Sellavel
Copy link
Collaborator

Regression Steps

Test on Desktop App & Desktop Web only

  1. Login with any account
  2. Open any chat
  3. Verify that the composer is focused
  4. Click on the same chat in LHN
  5. Verify that the composer does not lose focus

👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Jul 28, 2023
@Santhosh-Sellavel
Copy link
Collaborator

@jliexpensify Can you leave a comment confirm amount to be paid for C & C+ So I can proceed with Request on ND, thanks!

@melvin-bot melvin-bot bot removed the Overdue label Jul 28, 2023
@jliexpensify
Copy link
Contributor

Payments:

@MonilBhavsar - are you good with this as the Regression Test before I pay out?

@MonilBhavsar
Copy link
Contributor

Yes, looks good to me

@jliexpensify
Copy link
Contributor

Paid out, job closed. @Santhosh-Sellavel please request payment via New.Dot.

@JmillsExpensify
Copy link

Reviewed details for @Santhosh-Sellavel. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants