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

[$500] Chat - Composer not focused after using the Mini context menu #27431

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 14, 2023 · 22 comments
Closed
1 of 6 tasks

[$500] Chat - Composer not focused after using the Mini context menu #27431

izarutskaya opened this issue Sep 14, 2023 · 22 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 14, 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. Go to any chat
  2. Send a message and click anywhere on the page to lose composer focus
  3. Hover over the message and from the Mini context menu click on Copy to the clipboard or Mark as unread
  • If we Copy to the clipboard or Mark as unread from the Context menu(By right-clicking) The composer is refocused

Expected Result:

Composer is focused after using the Mini context menu the same as using the Context menu(By right-clicking)

Actual Result:

Composer not focused after using the Mini context menu

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.70-2

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

T145composerfocus-1.mp4
Recording.1522.mp4

Expensify/Expensify Issue URL:

Issue reported by: @daveSeife

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0112d0966800e14318
  • Upwork Job ID: 1702285337991520256
  • Last Price Increase: 2023-09-28
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 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

@izarutskaya izarutskaya added the External Added to denote the issue can be worked on by a contributor label Sep 14, 2023
@melvin-bot melvin-bot bot changed the title Chat - Composer not focused after using the Mini context menu [$500] Chat - Composer not focused after using the Mini context menu Sep 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0112d0966800e14318

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

melvin-bot bot commented Sep 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

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

@zukilover
Copy link
Contributor

Proposal

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

Chat - Composer not focused after using the Mini context menu

What is the root cause of that problem?

Focusing on composer is only done as callback for popups:

if (closePopover) {
hideContextMenu(true, ReportActionComposeFocusManager.focus);
}

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

We need to implement composer focus on other context menu than popups too (i.e. mini context menu):

             if (closePopover) {
                hideContextMenu(true, ReportActionComposeFocusManager.focus);
            } else {
                ReportActionComposeFocusManager.focus()
            }

What alternative solutions did you explore? (Optional)

N/A

@needpower
Copy link

Proposal

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

Composer is not re-focused after the 'Copy to clipboard' and 'Mark as unread' commands using the Mini context menu.

What is the root cause of that problem?

The ContextMenuActions component defined a behavior for all context menu items, including those mentioned in the bug.

isAnonymousAction: true,
textTranslateKey: 'reportActionContextMenu.copyToClipboard',
icon: Expensicons.Copy,
successTextTranslateKey: 'reportActionContextMenu.copied',
successIcon: Expensicons.Checkmark,
shouldShow: (type, reportAction) =>
type === CONTEXT_MENU_TYPES.REPORT_ACTION &&
!ReportUtils.isReportMessageAttachment(_.last(lodashGet(reportAction, ['message'], [{}]))) &&
!ReportActionsUtils.isMessageDeleted(reportAction),
// If return value is true, we switch the `text` and `icon` on
// `ContextMenuItem` with `successText` and `successIcon` which will fallback to
// the `text` and `icon`
onPress: (closePopover, {reportAction, selection}) => {

isAnonymousAction: false,
textTranslateKey: 'reportActionContextMenu.markAsUnread',
icon: Expensicons.Mail,
successIcon: Expensicons.Checkmark,
shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID, isPinnedChat, isUnreadChat) =>
type === CONTEXT_MENU_TYPES.REPORT_ACTION || (type === CONTEXT_MENU_TYPES.REPORT && !isUnreadChat),
onPress: (closePopover, {reportAction, reportID}) => {

The logic explicitly tells that re-focus should happen only when the context menu is in popover form (right-click):

if (closePopover) {
hideContextMenu(true, ReportActionComposeFocusManager.focus);
}

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

Use existing FocusManager and trigger re-focus regardless of the closePopover boolean flag. This also brings consistency across the platform.

What alternative solutions did you explore? (Optional)

N/A

@hjchoudry
Copy link

Proposal

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

Chat - Composer not focused after using the Mini context menu

What is the root cause of that problem?

Focusing on the composer is only done as a callback for popups, not on the mini context menu:

if (closePopover) {
hideContextMenu(true, ReportActionComposeFocusManager.focus);
}

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

Use existing ReportActionComposeFocusManager.focus and trigger re-focus ReportActionComposeFocusManager.focus regardless of the closePopover boolean flag.

Add this to each menu item in the onPress function at the end
ReportActionComposeFocusManager.focus

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

📣 @hjchoudry! 📣
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>

@hjchoudry
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~0179674adb1f8399c7

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2023
@sophiepintoraetz
Copy link
Contributor

Waiting on reviews from @Ollyws

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Sep 19, 2023

I'm a little skeptical if this is a legit bug worth fixing. I assumed the reason we focus after using the right-click context menu is because using it blurs the composer which should then be re-focused, but in the case of the mini-context-menu the composer is not blurred when it's used.

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Sep 21, 2023
@sophiepintoraetz
Copy link
Contributor

I'm wondering if it's a consistency thing though, right @Ollyws? Though I could be misunderstanding the significance of in the case of the mini-context-menu the composer is not blurred when it's used.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

@Ollyws, @sophiepintoraetz Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@sophiepintoraetz
Copy link
Contributor

Waiting on @Ollyws to come back to me.

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Sep 26, 2023

Asked in slack.

@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

@Ollyws @sophiepintoraetz this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Oct 1, 2023

I think as per the slack convo we're good to close this one.

@melvin-bot melvin-bot bot removed the Overdue label Oct 1, 2023
@sophiepintoraetz
Copy link
Contributor

Agreed - thanks Olly for checking! I also need to wrap up these focus issues and perhaps put a pause on them because we're pretty inconsistent on how we fix them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

6 participants