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

Plugins: Reset category selection when searching #78916

Merged
merged 8 commits into from
Jul 6, 2023

Conversation

WBerredo
Copy link
Contributor

@WBerredo WBerredo commented Jul 3, 2023

Fixes #66938

Proposed Changes

When searching on the plugins browser input:

  • Assure it's on the main Plugins page before constructing the URL with the search param. If not, first redirect to the main Plugins page.
  • When on a category page, reset breadcrumbs to allow them to be reconstructed only with the search

Testing Instructions

Before After
CleanShot 2023-07-03 at 15 38 06 CleanShot 2023-07-03 at 15 49 55

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

@matticbot
Copy link
Contributor

matticbot commented Jul 3, 2023

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~22 bytes added 📈 [gzipped])

name                             parsed_size           gzip_size
plugins                               +134 B  (+0.0%)      +22 B  (+0.0%)
jetpack-cloud-plugin-management       +134 B  (+0.0%)      +22 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@WBerredo WBerredo force-pushed the update/plugins-search-category-selected branch from e7943a1 to 39c2968 Compare July 3, 2023 20:13
@WBerredo WBerredo requested review from a team and worldomonation as code owners July 3, 2023 20:45
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 3, 2023
@WBerredo WBerredo force-pushed the update/plugins-search-category-selected branch 2 times, most recently from 4d4d57e to 49b561b Compare July 4, 2023 02:10
@WBerredo WBerredo force-pushed the update/plugins-search-category-selected branch from 49b561b to 0aa8769 Compare July 4, 2023 02:18
@WBerredo WBerredo requested a review from worldomonation July 4, 2023 02:28
Copy link
Contributor

@worldomonation worldomonation left a comment

Choose a reason for hiding this comment

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

Approving, but with a semi-strong suggestion to revise the E2E changes to use a safer method. If you feel strongly that it's not necessary, it's fine to merge and deploy - but please do keep an eye on TeamCity failure statistics for the step.

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

This works as described! The url and the breadcrumb do not contain the category when doing a search which is great.

Additionally, I have found that when you have a site selected, doing a search term removes the site selection and changes to All sites.

Is that expected?

Add a search term Result
CleanShot 2023-07-05 at 15 05 35@2x CleanShot 2023-07-05 at 15 11 29@2x

@WBerredo
Copy link
Contributor Author

WBerredo commented Jul 5, 2023

Additionally, I have found that when you have a site selected, doing a search term removes the site selection and changes to All sites.

Is that expected?

thanks for noticing this behavior, its not expected and it should be fixed here 2345522

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the previous comment so promptly! 🙌

While testing again, I found a new scenario I would like to discuss with you. When searching and selecting a category after the search, the breadcrumb remains with the Search Results value that can be clicked. When clicking it, it performs the search again but does not include the searched term in the text box.

What do you think about that scenario?

CleanShot.2023-07-05.at.15.41.30.mp4

@WBerredo WBerredo force-pushed the update/plugins-search-category-selected branch from 1ad25c0 to 2e8db5c Compare July 5, 2023 14:17
@epeicher
Copy link
Contributor

epeicher commented Jul 5, 2023

My previous comment is existing behavior and it has been reported as a different issue here:

@WBerredo WBerredo force-pushed the update/plugins-search-category-selected branch from 2e8db5c to e1f6113 Compare July 5, 2023 16:48
@WBerredo WBerredo requested a review from epeicher July 5, 2023 17:00
Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks for adding E2E tests 💯
I have tested it, and it works as advertised. LGTM! 🚢

@WBerredo WBerredo merged commit 451451c into trunk Jul 6, 2023
@WBerredo WBerredo deleted the update/plugins-search-category-selected branch July 6, 2023 15:53
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin Search behavior seems unintuitive when under a category
4 participants