-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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] Edit message, save/cancel and visiting different report removes focus from composer #29919
Comments
Triggered auto assignment to @peterdbarkerUK ( |
Job added to Upwork: https://www.upwork.com/jobs/~01e2dccea0afb54c13 |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Composer is not focused when user has edited a chat from different report What is the root cause of that problem?Within App/src/pages/home/report/ReportActionItemMessageEdit.js Lines 275 to 276 in 1ed55e0
App/src/pages/home/report/ReportActionItemMessageEdit.js Lines 136 to 138 in 1ed55e0
What changes do you think we should make in order to solve the problem?Remove the offending line that triggers the focus state change: const deleteDraft = useCallback(() => {
// InputFocus.callback(() => setIsFocused(false)); << remove this line
InputFocus.inputFocusChange(false); What alternative solutions did you explore? (Optional)N/A |
is it a regression from #29073 ? |
@narefyev91 please take a look |
@ayazalavi can you confirm that it's a regression from your PR #29073? |
I am not sure, let me take a look. |
@ayazalavi is there any luck so far? If I comment out the line as mentioned in @zukilover's proposal, this issue will no longer be reproducible. |
Is this intended behaviour? From here: On small devices the auto focus will bring up the keyboard which may be annoying. Reports are optimized for reading. Ref: https://expensify.slack.com/archives/C01GTK53T8Q/p1617201995245400 |
@peterdbarkerUK Yes, it's true on small-screen devices. But we still maintain auto-focus on Web/Desktop. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@hoangzinh, @peterdbarkerUK Eep! 4 days overdue now. Issues have feelings too... |
@peterdbarkerUK the Prod regression period is over on issue #26527. Do you agree to accept new proposals to fix this issue here? |
Yes, please. If @zukilover's proposal still works to your liking? Looks like an extremely easy one. |
Let me please write down the proposal as well. Since apparently my PR is connected with this bug. |
@hoangzinh @peterdbarkerUK 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! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@zukilover Thanks for your proposal #29919 (comment). I think you pointed out the correct place that causes this issue. But you haven't explained why we need that line from the beginning and if we remove this line, will it cause any regression bug? |
That specific line was added from #26527 to fix a glitch of the focus states (race condition). It should be fixed with the new inputFocusChange, and thus the focus callback is a redundant line here that should be removed. |
it will cause regression if we remove this line and the bug mentioned in
the #26527 will reappear.
…On Thu, Nov 2, 2023 at 1:55 PM Vinh Hoang ***@***.***> wrote:
@zukilover <https://github.com/zukilover> Thanks for your proposal #29919
(comment)
<#29919 (comment)>.
I think you pointed out the correct place that causes this issue. But you
haven't explained why we need that line from the beginning and if we remove
this line, will it cause any regression bug?
—
Reply to this email directly, view it on GitHub
<#29919 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF3LTZFSHJJMCEQIYGBPGTYCNNW3AVCNFSM6AAAAAA6GGGOZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQGMYTGNBWGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
basically thats why I requested to put proposal but I am still not able to
find fix for it so far.
…On Thu, Nov 2, 2023 at 3:10 PM ayaz alavi ***@***.***> wrote:
it will cause regression if we remove this line and the bug mentioned in
the #26527 will reappear.
On Thu, Nov 2, 2023 at 1:55 PM Vinh Hoang ***@***.***>
wrote:
> @zukilover <https://github.com/zukilover> Thanks for your proposal #29919
> (comment)
> <#29919 (comment)>.
> I think you pointed out the correct place that causes this issue. But you
> haven't explained why we need that line from the beginning and if we remove
> this line, will it cause any regression bug?
>
> —
> Reply to this email directly, view it on GitHub
> <#29919 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAF3LTZFSHJJMCEQIYGBPGTYCNNW3AVCNFSM6AAAAAA6GGGOZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQGMYTGNBWGE>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
@zukilover, because both |
If we take a look at how App/src/libs/actions/InputFocus/index.website.ts Lines 16 to 26 in 17ce0c2
It tries to focus on |
ProposalRestating the ProblemThe problem we are addressing is that when a user edits a message in a chat and then switches to another chat, the main composer does not receive focus. Identifying the Root CauseThe root cause of this issue is that the focus on the compose field is triggered programmatically in ComposerWithSuggestions at this location:
The issue arises when the edit compose box loses focus after closing the edit input field. As a result, the main compose box in the same chat where the message was edited regains focus. When we switch to another chat, this line
evaluates
Consequently, the main compose box loses focus in the new chat. Proposed SolutionTo solve this problem, we suggest calling the focus method at App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js Lines 614 to 620 in bc9cb8f
This will ensure that the main compose box receives focus as soon as it's layout'd, preventing the issue from occurring. Result: 91588771-ee1c-49e9-8e01-db48b37709cd.mp4Alternative SolutionsNo alternative solutions were explored or mentioned in the proposal. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Visiting another report after saving/canceling an edit message composer does not auto-focus the main composer. What is the root cause of that problem?We have a condition here to decide whether we should auto-focus the composer or not. App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js Line 129 in d75acaf
The problem is with the When we start editing a message, the edit composer will be focused, and App/src/pages/home/report/ReportActionItemMessageEdit.js Lines 407 to 410 in d75acaf
When we save/cancel it, it will be unmounted, and it is supposed to reset App/src/pages/home/report/ReportActionItemMessageEdit.js Lines 186 to 204 in d75acaf
The problem is, and that is because we set it to App/src/pages/home/report/ReportActionItemMessageEdit.js Lines 280 to 281 in d75acaf
So, We actually have a logic to always reset App/src/pages/home/ReportScreen.js Lines 276 to 278 in d75acaf
but as you know, it takes time to update the Onyx. What changes do you think we should make in order to solve the problem?IMO, the offending PR (#29073) solution that is trying to solve this issue is a bit hard to read. The behavior that the PR wants to achieve is to refocus back to the last focused composer, in that issue case is the edit composer. We already have a utility for that called
if (!(willBlurTextInputOnTapOutside && !isNextModalWillOpenRef.current && !modal.isVisible && isFocused && (prevIsModalVisible || !prevIsFocused))) {
return;
}
-focus();
+ReportActionComposeFocusManager.focus(); Super simple! |
@hoangzinh, @peterdbarkerUK Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Not overdue, just waiting on proposal review |
@hoangzinh @peterdbarkerUK this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
On my list to review today |
Update: still reading the previous issue #26527 to understand their changes. |
@Vinh hoang
Simply calling focus on main composer layout callback fixes the issue. The issue is due to bug in main composer component as I said in my proposal. Focus doesn’t gets called in a condition when it was already focused without popover getting rendered. If popover gets rendered then to us gets called correctly and this bug doesn’t happen.
…
On Nov 13, 2023 at 12:24 PM, <Vinh Hoang ***@***.***)> wrote:
Update: still reading the previous issue #26527 (#26527) to understand their changes.
—
Reply to this email directly, view it on GitHub (#29919 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAF3LT6XKF372C75I6UB7YLYEHDKFAVCNFSM6AAAAAA6GGGOZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXGU4TCMBYGQ).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Somehow I couldn't reproduce the issue in dev/staging. Is there anyone able to reproduce the issue now? Screen.Recording.2023-11-13.at.14.39.49.mov |
Looks like it's no longer reproducible after the rn-web upgrade. |
+1 I can no longer reproduce. I'm checking how compensation works in this scenario (personal paper trial) |
My ticket was marked with regression. Should I be paid for compensating that?
…
On Nov 13, 2023 at 7:19 PM, <peterdbarkerUK ***@***.***)> wrote:
+1 I can no longer reproduce. I'm checking how compensation works in this scenario (personal paper trial (https://expensify.slack.com/archives/C01SKUP7QR0/p1699885147013969))
—
Reply to this email directly, view it on GitHub (#29919 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAF3LTYAGBIPRNE3XKIR7PLYEIUA5AVCNFSM6AAAAAA6GGGOZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGI2TEOBXGY).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@ayazalavi I'm not sure I understand your question, could you clarify? Thanks! |
Hey folks - first up, I really appreciate all your work making and reviewing proposals for this. As this has been resolved by the rn-web update, I'm going to close it out without paying bounties. The reason being that this issue was solved "in the course of things" unrelated to this issue, without work needing to be done. I understand this can be frustrating, though with the issues that are quick and easy to resolve I hope it is, on balance, not too painful. Please let me know if you have any questions or disagree! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.3.86-1
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: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697650111645879
Action Performed:
Expected Result:
App should focus on composer whenever we visit any report
Actual Result:
App does not focus on composer when we edit any message, save/cancel the mesage and visit any other report
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android.chrome.no.focus.on.composer.mp4
Android: mWeb Chrome
Android.app.no.focus.composer.mp4
iOS: Native
ios.native.no.focus.on.composer.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
mac.chrome.no.focus.on.composer.mov
Recording.124.mp4
MacOS: Desktop
mac.desktop.no.focus.on.composer.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: