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

[Awaiting checklist] [$250] mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box #45471

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 16, 2024 · 23 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 16, 2024

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.7-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4724379
Email or phone of affected tester (no customers): vdargentotest+mweb071524@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

Pre-requisite: copy an image from the phone gallery

  1. Go to any chat
  2. Tap on the compose box for the keyboard to be displayed
  3. Paste the image you copied before

Expected Result:

The image preview page should be completely displayed

Actual Result:

The image preview page is partially displayed and the keyboard is not dismissed

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6543394_1721092979736.Smge1802_1_.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015f768185460c027a
  • Upwork Job ID: 1813533658277249254
  • Last Price Increase: 2024-07-17
  • Automatic offers:
    • Krishna2323 | Contributor | 103215448
Issue OwnerCurrent Issue Owner: @sobitneupane
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 16, 2024
Copy link

melvin-bot bot commented Jul 16, 2024

Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@twisterdotcom FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 16, 2024

Proposal

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

mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box

What is the root cause of that problem?

We do not blur the input before we call displayFileInModal.

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

                    onPasteFile={(file) => {
                        if (isKeyboardShown) {
                            textInputRef.current?.blur();
                        }
                        displayFileInModal(file);
                    }}

We should also check if the keyboard is already shown or not.

What alternative solutions did you explore? (Optional)

We can blur the input in ReportActionCompose.

displayFileInModal={displayFileInModal}

@abzokhattab
Copy link
Contributor

abzokhattab commented Jul 16, 2024

Proposal

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

Keyboard is not dismissed when pasting an image on compose box

What is the root cause of that problem?

chat composer is still focused and not blured when pasting the file content

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

in the handlePaste function inside the composer we should blur the composer focus if the content is an attachment:

// If paste contains files, then trigger file management
if (event.clipboardData?.files.length && event.clipboardData.files.length > 0) {
// Prevent the default so we do not post the file name into the text box
onPasteFile(event.clipboardData.files[0]);
return true;
}
// If paste contains base64 image
if (clipboardDataHtml?.includes(CONST.IMAGE_BASE64_MATCH)) {
const domparser = new DOMParser();
const pastedHTML = clipboardDataHtml;
const embeddedImages = domparser.parseFromString(pastedHTML, TEXT_HTML)?.images;
if (embeddedImages.length > 0 && embeddedImages[0].src) {
const src = embeddedImages[0].src;
const file = FileUtils.base64ToFile(src, 'image.png');
onPasteFile(file);
return true;
}
}
// If paste contains image from Google Workspaces ex: Sheets, Docs, Slide, etc

to do that we should add:

                textInput.current?.blur();

here and also here

OR

we can declare a helper function inside the Composer file that would call onPaste and blurs the input at the same time .. this way we will apply the separation of concerns principal since it's not the best practice for other components to modify the textinput

@Krishna2323
Copy link
Contributor

Proposal Updated

  • Minor updated in main solution and added alternative

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

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

@twisterdotcom twisterdotcom added External Added to denote the issue can be worked on by a contributor and removed External Added to denote the issue can be worked on by a contributor labels Jul 17, 2024
@melvin-bot melvin-bot bot changed the title mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box [$250] mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

Job added to Upwork: https://www.upwork.com/jobs/~015f768185460c027a

Copy link

melvin-bot bot commented Jul 17, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Jul 19, 2024
@sobitneupane
Copy link
Contributor

Thanks for the proposal everyone.

Proposal from @Krishna2323 looks good to me.

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

📣 @Krishna2323 🎉 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 melvin-bot bot added the Weekly KSv2 label Jul 23, 2024
@Krishna2323
Copy link
Contributor

@sobitneupane, PR ready for review ^

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box [HOLD for payment 2024-08-05] [$250] mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.13-4 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-08-05. 🎊

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

Copy link

melvin-bot bot commented Jul 29, 2024

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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
  • [@sobitneupane] 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:
  • [@sobitneupane] 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:
  • [@sobitneupane] Determine if we should create a regression test for this bug.
  • [@sobitneupane] 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.
  • [@twisterdotcom] 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 labels Aug 5, 2024
@twisterdotcom
Copy link
Contributor

Payment Summary:

@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 6, 2024
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-08-05] [$250] mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box [Awaiting checklist] [$250] mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box Aug 6, 2024
Copy link

melvin-bot bot commented Aug 9, 2024

@arosiclair, @twisterdotcom, @sobitneupane, @Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Aug 9, 2024
@twisterdotcom
Copy link
Contributor

Bump on this @sobitneupane.

@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Go to any chat
  2. Tap on the compose box.
  3. Paste an image in the compose box.
  4. Verify that the keyboard is closed (if open) and image is previewed in the Attachment Modal.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot removed the Overdue label Aug 13, 2024
@sobitneupane
Copy link
Contributor

I could not identify the exact PR which might have caused this issue. The feature was added by this PR.

@garrettmknight
Copy link
Contributor

$250 approved for @sobitneupane based on this summary.

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
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants