-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2024-12-07] [$250] The up-to-edit feature doesn't work when the message contains an embedded image. #52319
Comments
Triggered auto assignment to @jliexpensify ( |
Edited by proposal-police: This proposal was edited at 2024-11-14 08:30:02 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.When the last message sent in a chat includes an attachment, pressing the ArrowUp key does not open the edit box, preventing the user from editing that message What is the root cause of that problem?When a message with an attachment is sent, the selection.start value is set to the length of the text in that message. Because of this, the condition in the code that triggers the edit box doesn’t pass, which is why the edit box isn’t activated. App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 482 in 9d8571b
What changes do you think we should make in order to solve the problem?when we send the comment without or without attachment, this onClear, is called. App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 700 in be4d7f5
we can set the selection.start to 0 as : App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 514 to 519 in be4d7f5
the and just to not re-rerun this
The
clear function in Composer component is triggered for all messages, regardless of whether they include attachments or are text-only.
In clear, App/src/components/Composer/implementation/index.tsx Lines 63 to 68 in 04402e9
In ComposerWithSuggestions, we maintain a separate local selection state using which we decide to open the comment edit box if the selection.start <=0,
This means the selection reset on clear in Composer doesn’t propagate to ComposerWithSuggestions , which is why we need to explicitly update the selection state of ComposerWithSuggestions in the onClear :App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 700 in be4d7f5
|
Edited by proposal-police: This proposal was edited at 2024-11-12 04:40:00 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Up to edit feature doesn't work What is the root cause of that problem?When users send the message along with image, the selection should be reset to 0 (same as what we send the message only). But we prevent to update selection if the text input is not focused, in case users send message + image, the image modal preview will show that makes the composer is blurred App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 512 to 522 in 64cb4ee
=> the selection is not reset to 0, then the logic up-to-edit is not triggered App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 482 in 9d8571b
What changes do you think we should make in order to solve the problem?We should prevent
What alternative solutions did you explore? (Optional)We can force update the selection in clear function. Pass clear flag param in
Then use this flag to force update selection in App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 512 in 64cb4ee
|
I think it makes sense to fix this, yes. Basically whether a message has an image or not shouldn't change your ability to hit the up arrow to quickly edit it. |
Job added to Upwork: https://www.upwork.com/jobs/~021856262688043659757 |
Ty Shawn, lets do it! |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani ( |
Thanks for the proposal, @Shahidullah-Muffakir. Removing Steps to reproduce the issue after applying your change:
|
@jayeshmangwani , Oh, got it, thanks for explaining that! I could reproduce it now. Given that, what do you think of the alternative approach I mentioned in my proposal: setting selection.start to 0 whenever a message is sent with an attachment? Or when we send the comment without or without attachment, this onClear, is called. App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 700 in be4d7f5
we can set the selection.start to 0 here as well as: Untitled.mp4 |
@daledah I tried adding
suggestion-reapears.mov |
@Shahidullah-Muffakir I have a question for this comment: if we add the |
@jayeshmangwani , in this part: App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 514 to 519 in be4d7f5
the and just to not re-rerun this
Also, I noticed that
|
Thanks! Let me test this change. |
Just to confirm, is onClear triggered only for text only message? |
No, clear is triggered for all messages, regardless of whether they include attachments or are text-only.
In clear, App/src/components/Composer/implementation/index.tsx Lines 63 to 68 in 04402e9
In ComposerWithSuggestions, we maintain a separate local selection state using which we decide to open the comment edit box if the selection.start <=0,
This means the selection reset on clear in Composer doesn’t propagate to ComposerWithSuggestions , which is why we need to explicitly update the selection state of ComposerWithSuggestions in the onClear :App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 700 in be4d7f5
|
@Shahidullah-Muffakir While testing your changes, I discovered another bug related to the up-to-edit feature (reproducing on staging as well), which I believe we should address within this issue. Could you confirm if the root cause is the same for message with attachment as well as the bug described below, and whether your proposal will fix it? Steps to reproduce:
Let me know if your solution will cover this case as well. edit-focus-bug.mov |
@jayeshmangwani , Yes it has the same root cause as the issue in the OP, and the proposed solution will work for this as well. Screen.Recording.2024-11-14.at.1.25.53.PM.mov |
@Shahidullah-Muffakir Cool, please add your comments #52319 (comment) #52319 (comment) #52319 (comment) to the main proposal in one place and update the proposal so I can review it again. |
@jayeshmangwani, Proposal updated, Thank you. |
Hey @Shahidullah-Muffakir, thanks for updating the proposal, and sorry for the back-and-forth. Since this is the main component of the app, I need to test some parts thoroughly, which is why it's taking a bit longer to approve the proposal. Also, from your proposal, it seems to work fine in testing, but I don't entirely agree with setting
|
No problem, @jayeshmangwani.
What do you think about this? I’ll also keep looking . |
Yes, but in the |
Yes @daledah, I'm also able to reproduce this on staging, so it doesn't appear to be caused by your changes. |
Thanks to everyone for the proposals above! I've tested a few cases, and calling 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @daledah 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@jayeshmangwani PR is ready. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.68-7 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 2024-12-07. 🎊 For reference, here are some details about the assignees on this issue:
|
@jayeshmangwani @jliexpensify @jayeshmangwani The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Payment Summary
|
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test Proposal
Do we agree 👍 or 👎 |
Paid and job closed. |
$250 approved for @jayeshmangwani |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.59-3
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @quinthar
Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs
Action Performed:
Expected Result:
User able to edit the sent message
Actual Result:
Up to edit feature doesn't work
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.737.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jliexpensifyThe text was updated successfully, but these errors were encountered: