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

Send SELECT_SEARCH_RESULT event only on left-mouse clicks #3472

Merged
merged 6 commits into from
Dec 19, 2023

Conversation

aneevel
Copy link
Contributor

@aneevel aneevel commented Dec 6, 2023

Fixes

Fixes #2551 by @obulat

Description

When sending a SELECT_SEARCH_RESULT event, there is now a check that the event was performed with the primary mouse button (typically left-mouse click) before propagating the event

Testing Instructions

Run the app, and search for anything. Click on any search result with the primary mouse button and check the console; you will see a SELECT_SEARCH_RESULT logged in the console. Click on any search result with a button other than primary and check the console; you will not see an event logged to the console.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@aneevel aneevel requested a review from a team as a code owner December 6, 2023 02:58
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for great work, @aneevel! Could you revert the changes to pnpm-lock.yaml? Are you using a different version of pnpm than what is used in this repository? We are still on v.7, and the current version is 8. This might have caused the unnecessary changes.

@aneevel
Copy link
Contributor Author

aneevel commented Dec 6, 2023

Thanks for the help @obulat - I've reverted pnpm-lock.yaml as requested.

Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@obulat obulat added 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend labels Dec 6, 2023
Signed-off-by: Olga Bulat <obulat@gmail.com>
Copy link
Collaborator

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM! @aneevel, are you able to add a Playwright test for this case? @obulat let me know if you don't think that's necessary for this change and I'll approve it instead.

@openverse-bot
Copy link
Collaborator

Based on the medium urgency of this PR, the following reviewers are being gently reminded to review this PR:

@dhruvkb
This reminder is being automatically generated due to the urgency configuration.

Excluding weekend1 days, this PR was ready for review 8 day(s) ago. PRs labelled with medium urgency are expected to be reviewed within 4 weekday(s)2.

@aneevel, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings.

Footnotes

  1. Specifically, Saturday and Sunday.

  2. For the purpose of these reminders we treat Monday - Friday as weekdays. Please note that the operation that generates these reminders runs at midnight UTC on Monday - Friday. This means that depending on your timezone, you may be pinged outside of the expected range.

Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to get this merged, even without the Playwright test, before the frontend code freeze. @aneevel if you've been working on it (and can still add the test), let us know.

@sarayourfriend
Copy link
Collaborator

Good point, Dhruv. Let's merge this now, then. If there's work on a playright test it can be in a separate PR anyway, right?

@sarayourfriend sarayourfriend merged commit 6d6b123 into WordPress:main Dec 19, 2023
43 checks passed
@sarayourfriend
Copy link
Collaborator

Here's an issue to follow up on the unit test: #3555

@stacimc stacimc mentioned this pull request Dec 19, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Any mouse click on a search results sends SELECT_SEARCH_RESULT analytics event
5 participants