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

[HOLD for payment 2023-08-03] [HOLD for payment 2023-08-02] [$500] DEV: Web - Unable to paste copied text into emoji search box #23502

Closed
1 of 6 tasks
kbecciv opened this issue Jul 24, 2023 · 34 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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

@kbecciv
Copy link

kbecciv commented Jul 24, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to any chat
  2. Right click any text > Copy
  3. Open Emoji picker
  4. Click on emoji search text box
  5. Attempt to paste copied text into the emoji search text input

Expected Result:

Text pasted into emoji search text input successfully

Actual Result:

Emoji search text remains empty after text paste attempt

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: Dev v1.3.44-0
Reproducible in staging?: no
Reproducible in production?: no
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-24.at.3.11.51.PM.mov

Expensify/Expensify Issue URL:
Issue reported by: @honnamkuan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690183117515199

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014a88b8b12d4216db
  • Upwork Job ID: 1683594984549310464
  • 2023-07-24
  • Automatic offers:
    • | | 0
    • honnamkuan | Reporter | 25727250
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 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

@StevenKKC
Copy link
Contributor

StevenKKC commented Jul 24, 2023

Proposal

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

Unable to paste copied text into emoji search box.

What is the root cause of that problem?

In EmojiPickerMenu, there is no paste handler, only have keydown handler and mousemove handler.

this.keyDownHandler = (keyBoardEvent) => {
if (keyBoardEvent.key.startsWith('Arrow')) {
if (!this.state.isFocused || keyBoardEvent.key === 'ArrowUp' || keyBoardEvent.key === 'ArrowDown') {
keyBoardEvent.preventDefault();
}
// Move the highlight when arrow keys are pressed
this.highlightAdjacentEmoji(keyBoardEvent.key);
return;
}
// Select the currently highlighted emoji if enter is pressed
if (!isEnterWhileComposition(keyBoardEvent) && keyBoardEvent.key === CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey && this.state.highlightedIndex !== -1) {
const item = this.state.filteredEmojis[this.state.highlightedIndex];
if (!item) {
return;
}
const emoji = lodashGet(item, ['types', this.props.preferredSkinTone], item.code);
this.addToFrequentAndSelectEmoji(emoji, item);
return;
}
// Enable keyboard movement if tab or enter is pressed or if shift is pressed while the input
// is not focused, so that the navigation and tab cycling can be done using the keyboard without
// interfering with the input behaviour.
if (keyBoardEvent.key === 'Tab' || keyBoardEvent.key === 'Enter' || (keyBoardEvent.key === 'Shift' && this.searchInput && !this.searchInput.isFocused())) {
this.setState({isUsingKeyboardMovement: true});
return;
}
// We allow typing in the search box if any key is pressed apart from Arrow keys.
if (this.searchInput && !this.searchInput.isFocused()) {
this.setState({selectTextOnFocus: false});
this.searchInput.focus();
// Re-enable selection on the searchInput
this.setState({selectTextOnFocus: true});
}
};
// Keyboard events are not bubbling on TextInput in RN-Web, Bubbling was needed for this event to trigger
// event handler attached to document root. To fix this, trigger event handler in Capture phase.
document.addEventListener('keydown', this.keyDownHandler, true);
// Re-enable pointer events and hovering over EmojiPickerItems when the mouse moves
this.mouseMoveHandler = () => {
if (!this.state.arePointerEventsDisabled) {
return;
}
this.setState({arePointerEventsDisabled: false});
};
document.addEventListener('mousemove', this.mouseMoveHandler);

So user is unable to paste text into emoji search box.

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

We can add paste handler in EmojiPickerMenu.

    this.pasteHandler = (event) => {
        if (!this.searchInput) {
            return;
        }
        const text = (event.clipboardData || window.clipboardData).getData('text');
        this.searchInput.value += text;
        this.filterEmojis(this.searchInput.value);
    }

And remove handler in cleanupEventHandlers.

    document.removeEventListener('keydown', this.pasteHandler);

What alternative solutions did you explore? (Optional)

None.

@daordonez11
Copy link
Contributor

daordonez11 commented Jul 24, 2023

Proposal

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

Copy paste does not work in the EmojiPickerMenu component

What is the root cause of that problem?

Due to recent changes in the Composer component handlePaste method now begins with the event.preventDefault method:

handlePaste(event) {
event.preventDefault();
const isVisible = this.props.checkComposerVisibility();
const isFocused = this.textInput.isFocused();
if (!(isVisible || isFocused)) {
return;
}
if (this.textInput.id !== event.target.id) {
return;
}
const {files, types} = event.clipboardData;

This makes it work for the parent/first mounted component but preventing default behavior ends up in preventing other handlers/inputs to work as expected. Hence the expected native handler of the input does nothing.

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

As it was before move event.preventDefault() after the validations so it is indeed prevented only if the logic does apply to the current composer, something like this:

 handlePaste(event) {
        const isVisible = this.props.checkComposerVisibility();
        const isFocused = this.textInput.isFocused();

        if (!(isVisible || isFocused)) {
            return;
        }

        if (this.textInput.id !== event.target.id) {
            return;
        }
        event.preventDefault();

Video of solution working:

23470.solution.working.webm

What alternative solutions did you explore? (Optional)

Create a new handler in the component but is just not tackling it in the root.
Also, not sure if it makes sense but using Composer in this TextInput? Still less disruptive just to tackle it in the root and avoid unnecessary handlers.
PS: I think this might be a regression of 23135 @Santhosh-Sellavel

@mountiny mountiny self-assigned this Jul 24, 2023
@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jul 24, 2023
@melvin-bot melvin-bot bot changed the title DEV: Web - Unable to paste copied text into emoji search box [$1000] DEV: Web - Unable to paste copied text into emoji search box Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

Job added to Upwork: https://www.upwork.com/jobs/~014a88b8b12d4216db

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

melvin-bot bot commented Jul 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

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

melvin-bot bot commented Jul 24, 2023

📣 @Santhosh-Sellavel Please request via NewDot manual requests for the Contributor role ($1000)

@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

📣 @honnamkuan 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@Santhosh-Sellavel
Copy link
Collaborator

@robertKozik check this out #23502 (comment)!

@mountiny
Copy link
Contributor

Stepping in here as this would be unfortunate regression in staging. Assigning Santosh as the C+ here as they came from the PR with Robert who is now C+ as well.

@StevenKKC thank you for your quick proposal, I must admit I think that @daordonez11 proposal which implements the fix in Composer itself. I will make the reward half here with no urgency bonus given this is a regression but Robert most likely is not online to work on this at this time. Also let's do no reward for C+ given this was a regression from the previous PR. I hope thats understandable.

@daordonez11 would you be able to create the PR and ensure that pasting works correctly with multiple composers open? ie with edit mode you can have multiple composers.

@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

📣 @Santhosh-Sellavel Please request via NewDot manual requests for the Reviewer role ($1000)

@mountiny mountiny removed the Needs Reproduction Reproducible steps needed label Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

📣 @daordonez11 🎉 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 📖

@mountiny mountiny changed the title [$1000] DEV: Web - Unable to paste copied text into emoji search box [$500] DEV: Web - Unable to paste copied text into emoji search box Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

Upwork job price has been updated to $500

@Santhosh-Sellavel
Copy link
Collaborator

Okay, @mountiny that makes sense!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 25, 2023
@mountiny
Copy link
Contributor

mountiny commented Jul 25, 2023

🚀 Thanks for the hustle

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@mountiny
Copy link
Contributor

PR is being CPed

@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 26, 2023
@melvin-bot melvin-bot bot changed the title [$500] DEV: Web - Unable to paste copied text into emoji search box [HOLD for payment 2023-08-02] [$500] DEV: Web - Unable to paste copied text into emoji search box Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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:

  • [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
  • [@Santhosh-Sellavel] 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.
  • [@adelekennedy] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 27, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-08-02] [$500] DEV: Web - Unable to paste copied text into emoji search box [HOLD for payment 2023-08-03] [HOLD for payment 2023-08-02] [$500] DEV: Web - Unable to paste copied text into emoji search box Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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:

  • [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] 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:
  • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
  • [@Santhosh-Sellavel] 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.
  • [@adelekennedy] 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 Overdue and removed Weekly KSv2 labels Aug 1, 2023
@adelekennedy
Copy link

@mountiny & company it looks like you just need the payment summary and upwork payment from me here?

@mountiny
Copy link
Contributor

mountiny commented Aug 6, 2023

@adelekennedy correct, thank you!

@Santhosh-Sellavel
Copy link
Collaborator

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:

cc: @mountiny if differ on any let me know, thanks!

@adelekennedy
Copy link

adelekennedy commented Aug 6, 2023

Payment Summary
@honnamkuan - $250 for reporting bonus (paid via Upwork)
@daordonez11 - $500 for fix (paid via Upwork)
@Santhosh-Sellavel - $500 for fix (paid via NewDot)

@Santhosh-Sellavel
Copy link
Collaborator

Stepping in here as this would be unfortunate regression in staging. Assigning Santosh as the C+ here as they came from the PR with Robert who is now C+ as well.
Also, let's do no reward for C+ given this was a regression from the previous PR. I hope thats understandable.

As agreed with this here.

No due in payment for here, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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
None yet
Development

No branches or pull requests

7 participants