Skip to content

Conversation

@tyxla
Copy link
Member

@tyxla tyxla commented Apr 4, 2025

Proposed Changes

This PR suggests cleaning up a few more unused props and related code from the SiteSelector component, specifically:

  • showManageSitesButton: was not in use after Sites: Remove legacy site picker #102364 landed.
  • showAddNewSite: was used, but the related UI was never visible (see below screenshots).
  • groups: was not used at all.

Could be more straightforward to review on a per-commit basis.

Why are these changes being made?

Just cleaning up unused code.

A follow-up to #102364 that did some more cleanup.

Lands part of a larger cleanup in #101844.

Testing Instructions

  • Go through these testing instructions on production and this branch and verify there are observable changes:
    • Log in as a user with at least two Jetpack sites connected. Feel free to spin them up from jurassic.ninja if you need.
    • Go to Jetpack Cloud.
    • Verify that site selection in the sidebar doesn't reveal any "add site" buttons at the bottom of the sidebar.
    • Log in with a partner account.
    • Go to Jetpack Cloud.
    • Verify that site selection in the sidebar doesn't reveal any "add site" buttons at the bottom of the sidebar.

Screenshots

Jetpack Cloud, single user account, site selection:
Screenshot 2025-04-04 at 13 25 19

Jetpack Cloud, partner account, site selection:
Screenshot 2025-04-04 at 13 25 50

@tyxla tyxla added Sites [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Components [Type] Janitorial labels Apr 4, 2025
@tyxla tyxla requested a review from a team April 4, 2025 10:32
@tyxla tyxla self-assigned this Apr 4, 2025
@github-actions
Copy link

github-actions bot commented Apr 4, 2025

@matticbot
Copy link
Contributor

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

App Entrypoints (~2398 bytes added 📈 [gzipped])

Details
name                   parsed_size           gzip_size
entry-main                 +8358 B  (+0.4%)    +1310 B  (+0.2%)
entry-stepper              +7781 B  (+0.6%)     +903 B  (+0.2%)
entry-subscriptions        +3514 B  (+0.2%)    +1897 B  (+0.4%)
entry-login                +3084 B  (+0.1%)     +748 B  (+0.1%)
entry-domains-landing      +3005 B  (+0.4%)     +818 B  (+0.4%)
entry-browsehappy          +3005 B  (+1.5%)     +818 B  (+1.4%)

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

Sections (~35744 bytes added 📈 [gzipped])

Details
name                                parsed_size           gzip_size
customize                              -21524 B  (-7.3%)    -6430 B  (-7.1%)
woocommerce                            -21413 B  (-7.5%)    -6418 B  (-7.3%)
preview                                -21354 B  (-8.3%)    -6409 B  (-8.0%)
gutenberg-editor                       -21353 B  (-4.0%)    -6386 B  (-3.9%)
signup                                 +12539 B  (+4.7%)     +158 B  (+0.3%)
jetpack-cloud-features-comparison      -12480 B  (-1.8%)    -4803 B  (-2.4%)
async-step-unified-plans               +12461 B  (+1.3%)     +207 B  (+0.1%)
async-step-unified-domains             +12446 B  (+1.1%)     -251 B  (-0.1%)
site-purchases                         -12346 B  (-0.6%)    -4682 B  (-0.8%)
stats                                  -12255 B  (-1.1%)    -4166 B  (-1.2%)
promote-post-i2                        -12204 B  (-1.6%)    -3361 B  (-1.4%)
settings-performance                   -12167 B  (-2.5%)    -3891 B  (-2.6%)
settings-jetpack                       -12101 B  (-2.2%)    -3342 B  (-2.1%)
concierge                              -12101 B  (-2.5%)    -3355 B  (-2.5%)
woocommerce-installation               -12088 B  (-3.9%)    -3356 B  (-3.5%)
migrate                                -12088 B  (-3.3%)    -3358 B  (-3.0%)
marketing                              -12088 B  (-1.5%)    -3028 B  (-1.2%)
jetpack-social                         -12088 B  (-1.8%)    -3341 B  (-1.8%)
jetpack-search                         -12088 B  (-2.1%)    -3344 B  (-2.0%)
jetpack-cloud-pricing                  -12088 B  (-1.6%)    -3346 B  (-1.5%)
google-my-business                     -12088 B  (-2.3%)    -3354 B  (-2.1%)
export                                 -12088 B  (-4.0%)    -3356 B  (-3.6%)
add-ons                                -12088 B  (-3.4%)    -3355 B  (-3.0%)
jetpack-cloud-overview                 -12079 B  (-2.9%)    -3340 B  (-2.5%)
settings-security                      -12064 B  (-2.6%)    -3946 B  (-2.7%)
settings-reading                       -12064 B  (-2.9%)    -3952 B  (-3.3%)
settings-discussion                    -12064 B  (-3.1%)    -3919 B  (-3.3%)
jetpack-cloud-settings                 -12009 B  (-1.7%)    -3238 B  (-1.6%)
jetpack-cloud                          -11995 B  (-3.2%)    -3301 B  (-2.8%)
comments                               -11993 B  (-1.6%)    -3323 B  (-1.6%)
settings-podcast                       -11983 B  (-2.5%)    -3393 B  (-2.3%)
scan                                   -11970 B  (-1.4%)    -2915 B  (-1.2%)
marketplace                            -11944 B  (-2.2%)    -3314 B  (-2.0%)
theme                                  -11836 B  (-1.6%)    -3972 B  (-1.8%)
settings-newsletter                    -11814 B  (-2.2%)    -2721 B  (-1.8%)
jetpack-connect                        -11093 B  (-1.0%)    -2909 B  (-0.9%)
import                                 -10587 B  (-1.5%)    -2082 B  (-1.0%)
settings                                -9749 B  (-1.0%)    -3795 B  (-1.3%)
home                                    -8795 B  (-0.5%)    -3270 B  (-0.6%)
posts                                   -8703 B  (-1.3%)    -2263 B  (-1.1%)
jetpack-cloud-partner-portal            -8695 B  (-0.9%)    -3217 B  (-1.1%)
jetpack-cloud-plugin-management         -8685 B  (-0.4%)    -3255 B  (-0.5%)
settings-writing                        -8641 B  (-1.5%)    -2889 B  (-1.8%)
a8c-for-agencies-plugins                -8639 B  (-0.4%)    -3296 B  (-0.6%)
email                                   -8624 B  (-0.9%)    -2370 B  (-0.9%)
people                                  -8612 B  (-1.0%)    -2974 B  (-1.2%)
earn                                    -8552 B  (-1.1%)    -2883 B  (-1.2%)
themes                                  -8521 B  (-0.9%)    -3120 B  (-1.1%)
reader                                  -8412 B  (-0.2%)     -772 B  (-0.1%)
pages                                   -8406 B  (-1.8%)    -2914 B  (-2.1%)
posts-custom                            -8405 B  (-1.3%)    -2492 B  (-1.2%)
subscribers                             -8302 B  (-0.7%)    -2222 B  (-0.7%)
backup                                  -7426 B  (-0.6%)    -2705 B  (-0.8%)
checkout                                -6943 B  (-0.4%)     +759 B  (+0.1%)
account                                 -6598 B  (-0.9%)    -2844 B  (-1.3%)
purchases                               -6495 B  (-0.3%)    -3226 B  (-0.5%)
media                                   -6413 B  (-0.4%)    -2806 B  (-0.7%)
plugins                                 -6328 B  (-0.2%)    -2755 B  (-0.3%)
activity                                -6080 B  (-0.8%)    -1347 B  (-0.6%)
a8c-for-agencies-sites                  -5443 B  (-0.2%)     -499 B  (-0.1%)
site-performance                        -4701 B  (-0.3%)    -2589 B  (-0.6%)
hosting                                 -4657 B  (-0.3%)    -2499 B  (-0.6%)
site-settings                           -4564 B  (-0.3%)    -2494 B  (-0.6%)
github-deployments                      -4481 B  (-0.4%)    -1781 B  (-0.5%)
staging-site                            -4389 B  (-0.3%)    -1987 B  (-0.5%)
sites-dashboard                         -4297 B  (-0.4%)    -1960 B  (-0.6%)
site-monitoring                         -4297 B  (-0.4%)    -2240 B  (-0.6%)
site-logs                               -4297 B  (-0.4%)    -1929 B  (-0.6%)
domains                                 -4231 B  (-0.2%)    -1460 B  (-0.2%)
plans                                   -3695 B  (-0.2%)    -1959 B  (-0.3%)
overview                                -3622 B  (-0.1%)    -1726 B  (-0.3%)
jetpack-cloud-agency-dashboard          -3608 B  (-0.3%)     -858 B  (-0.3%)
a8c-for-agencies-client                  -244 B  (-0.0%)     -541 B  (-0.2%)
devdocs                                  +230 B  (+0.1%)     +110 B  (+0.2%)
patterns                                 +211 B  (+0.0%)     +424 B  (+0.1%)
security                                 -206 B  (-0.0%)      -77 B  (-0.0%)
entrepreneur-flow                        -196 B  (-0.1%)     -463 B  (-0.8%)
a8c-for-agencies-partner-directory       +148 B  (+0.0%)     +808 B  (+0.5%)
notification-settings                    -107 B  (-0.0%)     +312 B  (+0.1%)
new-hosted-site-flow                     -103 B  (-0.1%)      -35 B  (-0.1%)
site-profiler                             +54 B  (+0.0%)       +7 B  (+0.0%)
performance-profiler                      +54 B  (+0.0%)       +7 B  (+0.0%)
jetpack-cloud-agency-signup               +54 B  (+0.1%)      -15 B  (-0.1%)
a8c-for-agencies-landing                  +54 B  (+0.0%)       -7 B  (-0.0%)
a8c-for-agencies                          +54 B  (+0.0%)      -14 B  (-0.0%)
me                                        -52 B  (-0.0%)     -146 B  (-0.1%)
account-close                             -52 B  (-0.0%)      -82 B  (-0.0%)
a8c-for-agencies-woopayments              -48 B  (-0.0%)     +399 B  (+0.2%)
a8c-for-agencies-team                     -48 B  (-0.0%)      +61 B  (+0.0%)
a8c-for-agencies-settings                 -48 B  (-0.0%)       -2 B  (-0.0%)
a8c-for-agencies-purchases                -48 B  (-0.0%)    -1758 B  (-0.8%)
a8c-for-agencies-overview                 -48 B  (-0.0%)      +76 B  (+0.0%)
a8c-for-agencies-migrations               -48 B  (-0.0%)      -31 B  (-0.0%)
a8c-for-agencies-marketplace              -48 B  (-0.0%)     +535 B  (+0.2%)
a8c-for-agencies-agency-tier              -48 B  (-0.0%)      +65 B  (+0.1%)
site-blocks                               -37 B  (-0.0%)      -35 B  (-0.0%)
a8c-for-agencies-referrals                -15 B  (-0.0%)     +390 B  (+0.1%)

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 (~32525 bytes added 📈 [gzipped])

Details
name                                                                              parsed_size           gzip_size
async-load-signup-steps-site-picker                                                  -20243 B  (-8.8%)    -7507 B  (-10.2%)
async-load-signup-steps-difm-site-picker                                             -20243 B  (-8.8%)    -7590 B  (-10.2%)
async-load-calypso-post-editor-editor-media-modal                                    +15201 B  (+1.1%)    +3979 B   (+1.1%)
async-load-calypso-blocks-editor-checkout-modal                                      +14153 B  (+1.2%)    +5418 B   (+1.6%)
async-load-calypso-components-web-preview-component                                  +12998 B  (+2.8%)    +3979 B   (+2.9%)
async-load-store-app-store-stats-listview                                             +9477 B  (+7.5%)    +3096 B   (+9.4%)
async-load-calypso-jetpack-cloud-sections-sidebar-navigation-manage-selected-...      +9432 B  (+8.1%)    +3081 B   (+7.8%)
async-load-store-app-store-stats                                                      +9423 B  (+3.6%)    +3076 B   (+4.2%)
async-load-calypso-post-editor-media-modal                                            +5871 B  (+0.5%)    +1508 B   (+0.4%)
async-load-design-blocks                                                              -4689 B  (-0.2%)     -223 B   (-0.0%)
async-load-calypso-my-sites-sidebar                                                    +763 B  (+2.8%)     +238 B   (+2.6%)
async-load-comment-block-editor                                                        +157 B  (+0.0%)     +407 B   (+0.1%)
async-load-calypso-my-sites-stats-stats-post-detail                                    +157 B  (+0.5%)      +25 B   (+0.2%)
async-load-calypso-my-sites-site-settings-seo-settings-form                            +157 B  (+0.1%)      +21 B   (+0.0%)
async-load-automattic-global-styles-src-components-global-styles-variations            +157 B  (+0.0%)     +407 B   (+0.1%)
async-load-design-playground                                                           -130 B  (-0.0%)     -450 B   (-0.1%)
async-load-design                                                                       -91 B  (-0.0%)     -449 B   (-0.1%)
async-load-signup-steps-website-content                                                 -66 B  (-0.0%)      -55 B   (-0.1%)
async-load-design-wordpress-components-gallery                                          +64 B  (+0.0%)     -360 B   (-0.2%)
async-load-purchase-modal-wrapper                                                       +54 B  (+0.0%)      +16 B   (+0.0%)
async-load-my-sites-checkout-purchase-modal-is-eligible-for-one-click-checkou...        +54 B  (+0.0%)     -114 B   (-0.1%)
async-load-masterbar-cart-masterbar-cart-wrapper                                        +54 B  (+0.0%)      +69 B   (+0.2%)
async-load-calypso-notifications                                                        +54 B  (+0.0%)      +37 B   (+0.1%)
async-load-calypso-blocks-jitm-templates-home-task                                      +54 B  (+0.1%)      -31 B   (-0.2%)
async-load-automattic-help-center-stepper                                               +54 B  (+0.0%)     +475 B   (+0.2%)
async-load-automattic-help-center                                                       +54 B  (+0.0%)     +475 B   (+0.2%)
async-load-signup-steps-website-content-section-types                                   +44 B  (+0.0%)       +1 B   (+0.0%)
async-load-signup-steps-domains                                                         -26 B  (-0.0%)     -137 B   (-0.1%)

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

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

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

  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug cleanup/site-selector-unused-props on your sandbox.

@jsnajdr
Copy link
Member

jsnajdr commented Apr 4, 2025

showAddNewSite: was used, but the related UI was never visible (see below screenshots).

Isn't this an unintentional bug in CSS styles of the site picker? The "Add new site" button is part of a vertically laid-out flexbox container, and due to the styles (flex-grow, flex-shrink, etc) it's never displayed. After fixing the styles I see this:

Screenshot 2025-04-04 at 14 18 00

Clicking the button leads to wordpress.com/jetpack/connect. So I guess the question is: when I'm in Jetpack Cloud UI and want to connect a new site, how do I do it? Is there an alternative to the invisible button?

Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

No regressions spotted 👍

Two unrelated issues found in testing: #102390, #101831

The "Add new site" button is part of a vertically laid-out flexbox container, and due to the styles (flex-grow, flex-shrink, etc) it's never displayed.

Good catch. I cannot detect any intentionality in this being hidden, nor could I pinpoint where exactly this regressed. For example #67459 and #67295 are where the flex: 1 and magin-top: auto rules were added, but based on the screenshots it was still working as expected.

Do you know who to ping? Bugomattic is not helping me here and in any case who knows right now 😅 Otherwise we can post an issue.

selected: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] ),
hideSelected: PropTypes.bool,
filter: PropTypes.func,
groups: PropTypes.bool,
Copy link
Member

Choose a reason for hiding this comment

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

I guess we can also remove these if the prop was noop-ing?

diff --git a/client/blocks/reader-share/reblog.jsx b/client/blocks/reader-share/reblog.jsx
index f0fa3820c87..811c345a841 100644
--- a/client/blocks/reader-share/reblog.jsx
+++ b/client/blocks/reader-share/reblog.jsx
@@ -49,11 +49,7 @@ const ReaderReblogSelection = ( props ) => {
 			popoverTitle={ translate( 'Repost on' ) }
 			onClose={ props.closeMenu }
 		>
-			<SiteSelector
-				className="reader-share__site-selector"
-				onSiteSelect={ pickSiteToShareTo }
-				groups
-			/>
+			<SiteSelector className="reader-share__site-selector" onSiteSelect={ pickSiteToShareTo } />
 		</ReaderPopoverMenu>
 	);
 };
diff --git a/client/my-sites/sites/index.jsx b/client/my-sites/sites/index.jsx
index 9c5a2d08e4c..2a6031cd3c1 100644
--- a/client/my-sites/sites/index.jsx
+++ b/client/my-sites/sites/index.jsx
@@ -254,7 +254,7 @@ class Sites extends Component {
 								{ fromSite && <VisitSite siteSlug={ fromSite } /> }
 							</div>
 							<Card className="sites__select-wrapper">
-								<SiteSelector filter={ this.filterSites } siteBasePath={ siteBasePath } groups />
+								<SiteSelector filter={ this.filterSites } siteBasePath={ siteBasePath } />
 							</Card>
 						</>
 					) }

@ciampo
Copy link
Contributor

ciampo commented Apr 7, 2025

The "Add new site" button is part of a vertically laid-out flexbox container, and due to the styles (flex-grow, flex-shrink, etc) it's never displayed.

Good catch. I cannot detect any intentionality in this being hidden, nor could I pinpoint where exactly this regressed. For example #67459 and #67295 are where the flex: 1 and magin-top: auto rules were added, but based on the screenshots it was still working as expected.

Do you know who to ping? Bugomattic is not helping me here and in any case who knows right now 😅 Otherwise we can post an issue.

My gut tells me it's not intentional, and should be restored — should we check with product/designers? (@keoshi )

@tyxla
Copy link
Member Author

tyxla commented Apr 7, 2025

The "Add new site" button is part of a vertically laid-out flexbox container, and due to the styles (flex-grow, flex-shrink, etc) it's never displayed.

Good catch. I cannot detect any intentionality in this being hidden, nor could I pinpoint where exactly this regressed. For example #67459 and #67295 are where the flex: 1 and magin-top: auto rules were added, but based on the screenshots it was still working as expected.
Do you know who to ping? Bugomattic is not helping me here and in any case who knows right now 😅 Otherwise we can post an issue.

My gut tells me it's not intentional, and should be restored — should we check with product/designers? (@keoshi )

Yep, I agree, it might be the case that it's unintentional, so let's double-check. Also cc the rest of @Automattic/jetpack-design for feedback

@ciampo
Copy link
Contributor

ciampo commented May 20, 2025

The "Add new site" button is part of a vertically laid-out flexbox container, and due to the styles (flex-grow, flex-shrink, etc) it's never displayed.

Good catch. I cannot detect any intentionality in this being hidden, nor could I pinpoint where exactly this regressed. For example #67459 and #67295 are where the flex: 1 and magin-top: auto rules were added, but based on the screenshots it was still working as expected.
Do you know who to ping? Bugomattic is not helping me here and in any case who knows right now 😅 Otherwise we can post an issue.

My gut tells me it's not intentional, and should be restored — should we check with product/designers? (@keoshi )

Yep, I agree, it might be the case that it's unintentional, so let's double-check. Also cc the rest of @Automattic/jetpack-design for feedback

Re-sending the ping in case the earlier one went unnoticed — @Automattic/jetpack-design @keoshi

@tyxla
Copy link
Member Author

tyxla commented May 22, 2025

@ciampo I think this should evenutally be closed/revisited, which is why I added the "blocked" / "do not merge" labels. I think we should consider using the "add new button" that we use everywhere, and this will obsolete this old one in the sidebar.

Keeping this PR open in the meantime, and I'd like to get back to it, but I haven't been able to work on it in due to other commitments.

@keoshi
Copy link
Contributor

keoshi commented Jun 12, 2025

Sorry, folks. Completely missed this in my inbox.

I can't remember the button ever being there, but it should totally be visible. Not sure if a complete oversight or a bug introduced long ago.

Unrelated but the flow after that also has some bugs. Notably, the < Back link in wordpress.com/jetpack/connect redirects users to wordpress.com and not cloud.jetpack.com.

@github-actions
Copy link

This PR has been marked as stale. This happened because:

  • It has been inactive for the past 3 months.
  • It hasn't been labeled `[Pri] BLOCKER`, `[Pri] High`, `[Status] Keep Open`, etc.

If this PR is still useful, please do a trunk merge or rebase and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation.

If the PR is not updated (or at least commented on) in another month, it will be automatically closed.

@tyxla
Copy link
Member Author

tyxla commented Aug 14, 2025

Going to close for now, all this work has to be revisited at some point as Calypso is being untangled and consolidated with the hosting dashboard project.

@tyxla tyxla closed this Aug 14, 2025
@tyxla tyxla deleted the cleanup/site-selector-unused-props branch August 14, 2025 09:28
@github-actions github-actions bot removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Stale labels Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants