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

Logged in Profiler: Allow searching pages in dropdown and show empty states #95415

Merged
merged 9 commits into from
Oct 17, 2024

Conversation

vykes-mac
Copy link
Contributor

@vykes-mac vykes-mac commented Oct 15, 2024

Relates to https://github.com/Automattic/dotcom-forge/issues/9372

Proposed Changes

  • Add disclaimer to the end of the pages list Searching your top 20 most popular pages.
  • Remove call to backend when user searches the dropdown list
  • Forces a No pages found item when no pages are found

image

image

Why are these changes being made?

  • To make the experience more predictable and provide clear indications when pages are not available

Testing Instructions

  • Go to /sites/performance/site
  • Verify Searching your top 20 most popular pages. copy is show at the bottom of the list
  • Search for a page that doesn't exist and verify No pages found is shown

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-aUh-p2)?

@vykes-mac vykes-mac self-assigned this Oct 15, 2024
@matticbot
Copy link
Contributor

matticbot commented Oct 15, 2024

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

Sections (~127 bytes added 📈 [gzipped])

name              parsed_size           gzip_size
site-performance       +366 B  (+0.0%)     +127 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.

@vykes-mac vykes-mac added Logged-in Performance Profiler i1 [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Reviewer Can Merge PR author indicates the reviewer is free to merge/deploy if they want to own the change. labels Oct 16, 2024
@vykes-mac vykes-mac changed the title Update/empty state Logged in Profiler: Allow searching pages in dropdown and show empty states Oct 16, 2024
Copy link
Contributor

@candy02058912 candy02058912 left a comment

Choose a reason for hiding this comment

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

Functionality-wise, this PR works 👍

Added a comment where the copy might cause confusion.
I didn't realize it when reading the copy from the original issue description, but it felt a bit weird when testing.

if ( item.value === '-1' ) {
return (
<div className="message">
{ translate( 'Searching your top 20 most popular pages.' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

"Searching your top 20 most popular pages" may give a feeling that it's still retrieving the pages since only ten are shown in the dropdown.
image

Wondering if these would be a clearer copy:

  • Search is limited to the top 20 pages.
  • Top 20 pages available for search.

Copy link
Contributor

Choose a reason for hiding this comment

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

@matt-west curious what you think of the copy from a UX point of view 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for highlighting @candy02058912. I agree that we can improve on the current copy.

We're really talking about a limitation of the performance feature here rather than just the search.

Something like this could work, but it's a bit long.

Performance testing is available for the 20 most popular pages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc: @autumnfjeld what's your take on the copy suggestions here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@candy02058912

Performance testing is available for the 20 most popular pages.

If this fits on two lines, this is good.

Slightly shorter option if needed and if @matt-west approved

Performance tests limited to the 20 most popular pages.

Performance tests limited to the top 20 pages.

Copy link
Contributor

@matt-west matt-west left a comment

Choose a reason for hiding this comment

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

Looks good @vykes-mac. Let's address the copy suggestion, but otherwise ship it!

Copy link
Contributor

@paulopmt1 paulopmt1 left a comment

Choose a reason for hiding this comment

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

Working as expected, good job @vykes-mac!

One optional comment.

);
}
if ( item.value === '-2' ) {
return <div className="message">{ translate( 'No pages found' ) }</div>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're looking for a specific page when using the searching, should it be Page not found instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think because a search query can return a list of pages matching and not only a specific one No pages found works. I think the copy works as is. but we can change later if others have a strong opinion.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/empty-state on your sandbox.

@candy02058912 candy02058912 merged commit 8bffce1 into trunk Oct 17, 2024
11 checks passed
@candy02058912 candy02058912 deleted the update/empty-state branch October 17, 2024 07:18
@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 Oct 17, 2024
@a8ci18n
Copy link

a8ci18n commented Oct 17, 2024

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/16921039

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @vykes-mac for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Oct 20, 2024

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Logged-in Performance Profiler i1 Reviewer Can Merge PR author indicates the reviewer is free to merge/deploy if they want to own the change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants