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-10-23][$500] Chat - App refocuses on composer even when RHN is open #28926

Closed
2 of 6 tasks
kbecciv opened this issue Oct 5, 2023 · 31 comments
Closed
2 of 6 tasks
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

@kbecciv
Copy link

kbecciv commented Oct 5, 2023

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 the app
  2. Open any report and focus on composer
  3. Open settings->about->app download links
  4. Right click on any download link and click copy
  5. Start typing anything and observe that app writes everything in composer even though RHN is open

Expected Result:

App should not focus back on composer if RHN is open

Actual Result:

App focuses back on composer even if RHN is open on copy link from app download link in about settings

Workaround:

Unknown

Platforms:

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

  • Android / native - not testable
  • Android / Chrome - not testable
  • iOS / native - not testable
  • iOS / Safari - not testable
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.78.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

mac.chrome.desktop.composer.refocus.on.open.RHN.mov
windows.chrome.composer.focus.copy.link.about.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a7a9e4d7988e32e2
  • Upwork Job ID: 1709947117056393216
  • Last Price Increase: 2023-10-05
  • Automatic offers:
    • dukenv0307 | Contributor | 27123533
    • dhanashree-sawant | Reporter | 27123535
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 5, 2023
@melvin-bot melvin-bot bot changed the title Chat - App refocuses on composer even when RHN is open [$500] Chat - App refocuses on composer even when RHN is open Oct 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01a7a9e4d7988e32e2

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

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

melvin-bot bot commented Oct 5, 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

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

@martin12345678900
Copy link

Can't reproduce :/

@dukenv0307
Copy link
Contributor

dukenv0307 commented Oct 5, 2023

Proposal

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

App focuses back on composer even if RHN is open on copy link from app download link in about settings

What is the root cause of that problem?

In here, after copying the link, we're always refocusing on the composer, even in the case where another route is open.

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

In there, we should check that the active route is the report route, if yes we trigger the refocusing. For example, we can do something like this

if (!Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(Navigation.getTopmostReportId()))) {
    return;
}

(This can be checked here or inside ReportActionComposeFocusManager.focus, where it will take effect for all attempts to focus the composers)

What alternative solutions did you explore? (Optional)

This might happen for other opened context menu as well, we should double check and fix the same for those places.
If we decide to add the check in ReportActionComposeFocusManager.focus then it will work for all places.

@chahedmoetaz
Copy link

Any updates?

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

📣 @chahedmoetaz! 📣
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. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. 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>

@suneox
Copy link
Contributor

suneox commented Oct 5, 2023

Proposal

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

Chat - App refocuses on composer even when RHN is open

What is the root cause of that problem?

After press copy a link from context menu item the current implement alway focus to composer at

onPress: (closePopover, {selection}) => {
Clipboard.setString(selection);
hideContextMenu(true, ReportActionComposeFocusManager.focus);
},

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

The focus behavior should be handle base on a use case.
For example, at the report page we have 2 links that can be copied. The first link after copy should be focus and the second link after copy shouldn't focus on the composer so we should handle a focus behavior when executing the function showContextMenu

  1. at BaseReportActionContextMenu.js we have to add variable isFocusComposeAfterSelect into payload after user action on ContextMenuItem

onPress={() => interceptAnonymousUser(() => contextAction.onPress(closePopup, payload), contextAction.isAnonymousAction)}

    const payload = {
        reportAction,
        reportID: props.reportID,
        draftMessage: props.draftMessage,
        selection: props.selection,
+       isFocusComposeAfterSelect: props.isFocusComposeAfterSelect,
        close: () => setShouldKeepOpen(false),
        openContextMenu: () => setShouldKeepOpen(true),
        interceptAnonymousUser,
    };
  1. The we have to add config isFocusCompose into PopoverReportActionContextMenu.js the same with isUnreadChat with default value is true to avoid affect current implement
        .....
        const [isChatPinned, setIsChatPinned] = useState(false);
+       const [isFocusComposeAfterSelect, setIsFocusComposeAfterSelect] = useState(false);
        .....
        * @param {Boolean} isUnreadChat - Flag to check if the chat is unread in the LHN. Used for the Mark as Read/Unread action
+       * @param {Boolean} isFocusCompose - Flag to check auto focus compose after action press

        isUnreadChat = false,
+       isFocusCompose = true,
        .....
        setHasUnreadMessages(isUnreadChat);
+       setIsFocusComposeAfterSelect(isFocusCompose);
        .....
        isUnreadChat={hasUnreadMessages}
+       isFocusComposeAfterSelect={isFocusComposeAfterSelect}
  1. After that we config isFocusCompose for ReportActionContextMenu.js also the same with isUnreadChat with default value is true to avoid affect current implement

  2. Then we can use the config for ContextMenuActions on press

      onPress: (closePopover, {selection, isFocusComposeAfterSelect}) => {
          console.log(`___________ isFocusComposeAfterSelect ___________`,isFocusComposeAfterSelect)
          Clipboard.setString(selection);
          hideContextMenu(true, isFocusComposeAfterSelect ? ReportActionComposeFocusManager.focus : undefined);
      },
  1. Finally at page AppDownloadLinks.js we can handle composer focus behavior at

onSecondaryInteraction={(e) => ReportActionContextMenu.showContextMenu(CONTEXT_MENU_TYPES.LINK, e, item.link, popoverAnchor)}

    onSecondaryInteraction={(e) =>
        ReportActionContextMenu.showContextMenu(
            CONTEXT_MENU_TYPES.LINK,
            e,
            item.link,
            popoverAnchor,
            undefined,
            undefined,
            undefined,
            undefined,
            undefined,
            undefined,
            undefined,
            undefined,
            undefined,
            undefined,
            false
        )
    }

Nice to have we can cleanup function ReportActionContextMenu.showContextMenu using an object params instead of argument params and call func look like this

  ReportActionContextMenu.showContextMenu({
    type: CONTEXT_MENU_TYPES.LINK,
    event: e,
    selection: item.link,
    contextMenuAnchor: popoverAnchor,
    isFocusCompose: false
  })

Demonstrate my change

28926.mp4

What alternative solutions did you explore? (Optional)

@peterdbarkerUK
Copy link
Contributor

I wonder if the intention here is that the RHN should close upon copy-to-clipboard, and focus correctly returns to the composer. That makes more sense for me, as a user has already retrieved the link and would now want to navigate elsewhere. Asked in slack!

@melvin-bot melvin-bot bot added the Overdue label Oct 9, 2023
@peterdbarkerUK
Copy link
Contributor

I was wrong, bug is correct as written - @mananjadhav could you take a look at the proposals here? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2023
@mananjadhav
Copy link
Collaborator

Based on the expected behavior @dukenv0307's proposal looks good.

🎀 👀 🎀 C+ review.

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@luacmartins
Copy link
Contributor

I agree that @dukenv0307's proposal is good. Assigning to the issue.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

📣 @mananjadhav Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

Offer link
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 Oct 10, 2023

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot changed the title [$500] Chat - App refocuses on composer even when RHN is open [HOLD for payment 2023-10-23] [$500] Chat - App refocuses on composer even when RHN is open Oct 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

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

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

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 Oct 16, 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:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav] 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:
  • [@mananjadhav] 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:
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] 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.
  • [@peterdbarkerUK] 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 Oct 16, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-23] [$500] Chat - App refocuses on composer even when RHN is open [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-23] [$500] Chat - App refocuses on composer even when RHN is open Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

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

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

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

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 Oct 16, 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:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav] 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:
  • [@mananjadhav] 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:
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] 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.
  • [@peterdbarkerUK] 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 Daily KSv2 labels Oct 23, 2023
@peterdbarkerUK
Copy link
Contributor

Summarizing payouts for this issue:

Issue reporter: @dhanashree-sawant $50

Contributor: @dukenv0307 $750 (inc urgency bonus)

Contributor+: @mananjadhav $750 (inc urgency bonus) - @mananjadhav please complete the above checklist, notify me here, and then request payment via NewDot.

Upwork Job

@mananjadhav
Copy link
Collaborator

I think this change exists since a long time. I couldn't pinpoint it to a specific PR.

Neither do I think we need a regression test for this one. We've anyway fixed this at the Composer level, so less likely to occur again. cc - @peterdbarkerUK

@JmillsExpensify
Copy link

$750 payment approved for @mananjadhav based on summary above.

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@luacmartins luacmartins changed the title [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-23] [$500] Chat - App refocuses on composer even when RHN is open [HOLD for payment 2023-10-23][$500] Chat - App refocuses on composer even when RHN is open Oct 27, 2023
@luacmartins
Copy link
Contributor

Just pending payment.

@melvin-bot melvin-bot bot removed the Overdue label Oct 27, 2023
@mananjadhav
Copy link
Collaborator

@peterdbarkerUK Is the payout done for @dukenv0307 @dhanashree-sawant ? If yes then we're good to close here.

@melvin-bot melvin-bot bot added the Overdue label Oct 30, 2023
@luacmartins
Copy link
Contributor

Just pending confirmation for the above

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@peterdbarkerUK
Copy link
Contributor

Yep, they were both paid last week! Job removed and closing :)

I'm sorry for the slow followup while I was OoO last week.

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

9 participants