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

Replace Subscriptions section available on Reader sidebar with Popular sites section #96954

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

mehmoodak
Copy link
Member

Related to #https://github.com/Automattic/loop/issues/233

Proposed Changes

  • In Reader recent screen replaced ReaderListFollowedSites component with ReaderPopularSitesSidebar
  • Added title prop in ReaderPopularSitesSidebar component to make title implementation consistent.
  • Removed the unused ReaderListFollowedSites component.

Note: The current implementation displays 10 popular sites without pagination. Let me know if it need any changes.

Before After
image image

Why are these changes being made?

  • New design requirements.

Testing Instructions

  • Navigate to /read.
  • Make sure "Popular sites" on sidebar are working as expected.

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 UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • 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)?

@mehmoodak mehmoodak self-assigned this Dec 2, 2024
@matticbot
Copy link
Contributor

matticbot commented Dec 2, 2024

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

App Entrypoints (~121 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-stepper              -1825 B  (-0.1%)     -121 B  (-0.0%)
entry-main                 -1825 B  (-0.1%)     -121 B  (-0.0%)
entry-subscriptions         -313 B  (-0.0%)      -98 B  (-0.0%)
entry-login                 -313 B  (-0.0%)      -98 B  (-0.0%)
entry-domains-landing       -313 B  (-0.0%)      -98 B  (-0.0%)
entry-browsehappy           -313 B  (-0.1%)      -98 B  (-0.2%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~1991 bytes removed 📉 [gzipped])

name                             parsed_size           gzip_size
reader                               -7398 B  (-0.5%)    -2010 B  (-0.4%)
home                                  +150 B  (+0.0%)      +62 B  (+0.0%)
write-flow                            +112 B  (+0.0%)      +41 B  (+0.0%)
link-in-bio-tld-flow                  +112 B  (+0.0%)      +41 B  (+0.0%)
build-flow                            +112 B  (+0.0%)      +41 B  (+0.0%)
plugins                               +111 B  (+0.0%)      +43 B  (+0.0%)
jetpack-cloud-plugin-management       +111 B  (+0.0%)      +43 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.

Async-loaded Components (~2139 bytes added 📈 [gzipped])

name                                                 parsed_size            gzip_size
async-load-calypso-reader-tag-stream-main                +3039 B  (+17.0%)     +881 B  (+16.7%)
async-load-calypso-reader-discover-discover-stream       +2070 B  (+15.4%)     +621 B  (+14.1%)
async-load-calypso-reader-sidebar                        +1601 B   (+1.6%)     +367 B   (+1.3%)
async-load-calypso-reader-search-stream                   -875 B   (-1.3%)     -238 B   (-1.3%)
async-load-calypso-reader-p-2-main                        +760 B  (+23.6%)     +170 B  (+14.3%)
async-load-calypso-reader-a-8-c-main                      +760 B  (+23.5%)     +170 B  (+14.2%)
async-load-calypso-reader-list-manage                     +307 B   (+1.1%)     +127 B   (+1.7%)
async-load-design-blocks                                  +112 B   (+0.0%)      +41 B   (+0.0%)
async-load-calypso-components-web-preview-component       +112 B   (+0.0%)      +41 B   (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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.

@matticbot
Copy link
Contributor

matticbot commented Dec 2, 2024

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

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

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug loop-233/replace-subscription-section-with-popular-sites on your sandbox.

@mehmoodak mehmoodak added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 3, 2024
Base automatically changed from loop-223/refactor-recommended-sites-store-to-TS to trunk December 3, 2024 04:23
@davemart-in
Copy link
Contributor

@mehmoodak just clarifying, is this ready for review?

@davemart-in
Copy link
Contributor

I just added it to our team board.

@mehmoodak
Copy link
Member Author

Yes it's ready for review. I will resolve the conflicts soon.

@mehmoodak mehmoodak marked this pull request as ready for review December 3, 2024 11:10
@mehmoodak mehmoodak requested a review from a team as a code owner December 3, 2024 11:10
@davemart-in davemart-in self-requested a review December 3, 2024 11:16
Copy link
Contributor

@davemart-in davemart-in left a comment

Choose a reason for hiding this comment

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

Works as expected on my end. No JS errors. Nicely done!

return <div className="reader-tag-sidebar-recommended-sites">{ popularSitesLinks }</div>;
return (
<>
{ title ? <h2 className="reader-tag-sidebar-title">{ title }</h2> : null }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{ title ? <h2 className="reader-tag-sidebar-title">{ title }</h2> : null }
{ title && <h2 className="reader-tag-sidebar-title">{ title }</h2> }

I think this would simplify it a little.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 9397732.

@@ -47,4 +58,42 @@ function FollowingStream( { ...props } ) {
);
}

function ReaderStreamSidebar(): JSX.Element | null {
Copy link
Contributor

@arcangelini arcangelini Dec 3, 2024

Choose a reason for hiding this comment

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

It looks like there is a /reader/stream directory where these appear to go. Did you have specific reason for not putting this in that directory? If not, I might suggest sticking to that pattern because it makes it easier to read and find 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in ea5e892.

Copy link
Contributor

@arcangelini arcangelini left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants