-
Notifications
You must be signed in to change notification settings - Fork 3k
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-09-04] [$1000] App changes focus from edit message composer to send message composer when mark as unread #23898
Comments
Triggered auto assignment to @maddylewis ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The application changes focus from the edit message composer to the send message composer when an action ("Mark as Read", "Mark as Unread", "Pin", or "Unpin") is triggered in the Left Hand Navigation (LHN) report context menu. What is the root cause of that problem?In the file App/src/pages/home/report/ContextMenu/ContextMenuActions.js, the App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 253 to 266 in eb02006
App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 237 to 251 in eb02006
App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 311 to 324 in eb02006
App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 325 to 338 in eb02006
This is the key line responsible for the focus shift: hideContextMenu(true, ReportActionComposeFocusManager.focus); What changes do you think we should make in order to solve the problem?To resolve this issue, we should modify the onPress: (closePopover, {reportID}) => {
// ... action code
if (closePopover) {
hideContextMenu(true, undefined);
}
}, My proposal targets this specific undesired behavior of unintended focus shift. By passing 'undefined' to the 'hideContextMenu' function, we ensure that the current focus state is retained and does not automatically shift to the message composer when the user performs one of the specified actions. If the user is editing a message, it keeps the focus on the edit field; if a user is composing a new message, it keeps the focus on the message composer; and if the user is not focused on any input, it does not impose a forced focus. This approach respects the user's current context and maintains their interaction flow, which results in an improved user experience. Result: 2023-07-30.23-02-16.mp4What alternative solutions did you explore? (Optional)None. |
ProposalPlease re-state the problem that we are trying to solve in this issue.App changes focus from edit message composer to main composer when mark as unread in LHN What is the root cause of that problem?When pressing
We set this callback function when we open any chat App/src/pages/home/report/ReportActionCompose.js Lines 248 to 253 in eb02006
But we setup focus callback only on main composer. So the The root cause of this issue is that we only setup focus callback only for the main composer. What changes do you think we should make in order to solve the problem?The focus manager should be setup for any composer with focus. This is reasonable and consistent to manager's purpose Logic:
This works as expected ResultWhat alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~012c0c567372dabdf6 |
Current assignee @maddylewis is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
added external label so that C+ can review existing proposals |
Thank you both for your proposals. @rayane-djouah, While it does seem that returning focus does indeed work correctly after selecting from the LHN context menu without using the focus callback, this isn't the case for report screen right-click context menu, removing the callback breaks this as it also uses ContextMenuActions. @s-alves10, I agree with your analysis, it does make sense that the focus callback should be set for the last used textInput rather than always targeting the main composer. |
@Ollyws I believe that the observed behavior is expected, given the current state of our application. For instance, when actions such as 'Mark as Read/Unread' are triggered from the MiniContextMenu, when the EmojiPicker is opened and subsequently closed, or even when we react to a message, the focus is not explicitly set. focus.mp4In my view, this behavior is consistent and logical: interactions with other ReportActionItems or interactions with reports in the Left Hand Navigation (LHN) should not force a focus state. This approach maintains the focus state in the context that is most relevant to the user's current interaction. Furthermore, we have the option to disable the automatic focus shift for actions such as 'Copy to Clipboard' and 'Delete Comment' from the report context menu. By doing so, we ensure the focus remains where the user anticipates it to be. |
ProposalPlease re-state the problem that we are trying to solve in this issue.App loses focus on edit composer and switches to focus send message composer What is the root cause of that problem?We're only focusing on the main composer when closing the context menu here, while if we're editing the message, we want to focus on the message edit input instead. What changes do you think we should make in order to solve the problem?We need to make sure the
What alternative solutions did you explore? (Optional)NA |
@tienifr, Thanks for your proposal. Having a general composer callback set with the It generally seems to work well, however I noticed one small issue: Contrary to production, If you blur the composer by clicking a report-action then select an item from the LHN context-menu the composer will not be re-focused (although the callback will be called). This seems to be caused by PressableWithSecondaryInteraction. |
Triggered auto assignment to @alexpensify ( |
This comment was marked as duplicate.
This comment was marked as duplicate.
hiya @alexpensify - i am OOO until ~Aug 20.
|
📣 @namhihi237 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
PR ready for review #24481. |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.57-6 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-09-04. 🎊 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.
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:
|
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:
|
@Ollyws - can you confirm what needs to be done in this checklist? thanks! #23898 (comment) |
@namhihi237 / @tienifr are paid. offer sent to @Ollyws. |
No PR is responsible for this bug as it was more of a feature that wasn't previously considered and as focusing the edit composer is not really important for any user user flow or very impactful I don't think a regression test is particularly useful here. |
everyone is paid - closing! |
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:
Expected Result:
App still keeps focus on the message being edited
Actual Result:
App loses focus on edit composer and switches to focus send message composer
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?
Version Number: 1.3.47-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
Screen.Recording.2023-07-30.at.13.49.59.mov
Recording.1407.mp4
Expensify/Expensify Issue URL:
Issue reported by: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690700101909109
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: