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

Make Site Settings available to duplicate views experiment users #98875

Merged
merged 30 commits into from
Feb 5, 2025

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Jan 24, 2025

Fixes #98185

Related to #98185, pfYzsZ-1uU-p2

Not strictly blocking but should be merged with Automattic/jetpack#40913 at a similar time.

Proposed Changes

This PR makes "Site Settings" available to duplicate views experiment users.

URL Simple Atomic
/sites/settings/site/:site Screenshot 2025-01-30 at 11 19 21 Screenshot 2025-01-30 at 11 19 02
/hosting-config/:site Redirect to /hosting-features: Screenshot 2025-01-29 at 14 21 58 Screenshot 2025-01-29 at 14 21 10
/sites/settings/site/:site/transfer-site Screenshot 2025-01-29 at 14 25 52 Screenshot 2025-01-29 at 14 23 09
/sites/settings/site/:site/reset-site Screenshot 2025-01-29 at 14 26 17 Screenshot 2025-01-29 at 14 23 24
/sites/settings/site/:site/delete-site Screenshot 2025-01-29 at 14 26 08 Screenshot 2025-01-29 at 14 23 31
/settings/general/:site Redirect to /sites/settings/site/:site on Classic, Redirect to options-general.php on Default with #98664 Redirect to /sites/settings/site/:site on Classic, Redirect to options-general.php on Default with #98664
/settings/start-over/:site Redirect to /sites/settings/site/:site/reset-site Redirect to /sites/settings/site/:site/reset-site
/settings/start-site-transfer/:site Redirect to /sites/settings/site/:site/transfer-site Redirect to /sites/settings/site/:site/transfer-site
/settings/delete-site/:site Redirect to /sites/settings/site/:site/delete-site Redirect to /sites/settings/site/:site/delete-site

This PR removes the Admin Interface setting from Server Settings, and we won't have the Admin Interface setting anywhere in SMP. i.e., the Admin Interface setting can only be found in /wp-admin/options-general.php.

  • While it might make sense to move this WordPress.com-specific setting in SMP, the original intent of adding it under Settings → General was to provide HEs and users with a single, consistent location to modify the setting—regardless of the admin interface style or page-specific view.
  • Once the hold-out phase is over, adding the Admin Interface setting to SMP would align with this goal, as users will always have access to SMP.

Redirection logic:

  • Classic view + hold out
    • /settings/general (Hosting > Site Settings) redirects to SMP since they are compatible feature-wise.
    • Users can access options-general.php via Settings > General as before.
  • Default view + hold out
    • /settings/general (Settings > General) redirects to options-general.php
    • /settings/reading (Settings > General) redirects to options-reading.php
    • /settings/writing (Settings > General) redirects to options-writing.php
    • /settings/discussion (Settings > General) redirects to options-discussion.php

p1738292995924339/1738285330.573259-slack-CRWCHQGUB

Why are these changes being made?

See #98185 and pfYzsZ-1uU-p2.

This PR focuses on adopting the new design's structure. We will address styling details in later iterations soon:
pfYzsZ-1uU-p2#comment-1452.

Testing Instructions

  • Add yourself to the treatment group via 22167-explat-experiment
  • Go to /sites
  • Select any site
  • Click the "Settings" tab
  • Test if functions work propery as much as possible
  • Test links are correct as much as possible
  • Test all the redirections work as expected

Regression testing:

  • Add yourself to the control group via 22167-explat-experiment
  • Go to /sites
    • Select any site
    • Click the "Server Settings" tab
    • Ensure the page works properly
  • Go to /settings/general/:site (Settings > General in Default site, Hosting > Site Settings in Classic sites)
    • Ensure the page works properly

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

@matticbot
Copy link
Contributor

matticbot commented Jan 24, 2025

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

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

name                   parsed_size           gzip_size
entry-subscriptions         -350 B  (-0.0%)     -165 B  (-0.0%)
entry-stepper               -350 B  (-0.0%)     -166 B  (-0.0%)
entry-domains-landing       -350 B  (-0.1%)     -165 B  (-0.1%)
entry-browsehappy           -350 B  (-0.2%)     -165 B  (-0.3%)
entry-login                  +96 B  (+0.0%)       -4 B  (-0.0%)
entry-main                   -12 B  (-0.0%)     -128 B  (-0.0%)

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

Sections (~8179 bytes added 📈 [gzipped])

name                  parsed_size           gzip_size
hosting                 +185595 B  (+6.7%)   +49161 B  (+6.6%)
staging-site              -7004 B  (-0.4%)    -2811 B  (-0.6%)
settings                  -2088 B  (-0.2%)     -562 B  (-0.2%)
site-settings             +1185 B  (+0.1%)     -310 B  (-0.1%)
settings-newsletter        +599 B  (+0.1%)     +916 B  (+0.6%)
settings-discussion        +599 B  (+0.1%)     +811 B  (+0.7%)
settings-writing           +461 B  (+0.1%)     +110 B  (+0.1%)
settings-security          +461 B  (+0.1%)     +113 B  (+0.1%)
settings-reading           +461 B  (+0.1%)     +105 B  (+0.1%)
settings-podcast           +461 B  (+0.1%)     +110 B  (+0.1%)
settings-performance       +461 B  (+0.1%)     +145 B  (+0.1%)
settings-jetpack           +461 B  (+0.1%)     +156 B  (+0.1%)
site-marketing             +341 B  (+0.0%)     +105 B  (+0.0%)
marketing                  +332 B  (+0.0%)      +50 B  (+0.0%)
email                      +103 B  (+0.0%)      -48 B  (-0.0%)
site-tools                  -69 B  (-0.0%)     -318 B  (-0.1%)
github-deployments          -69 B  (-0.0%)     +140 B  (+0.0%)
people                      -58 B  (-0.0%)     -476 B  (-0.2%)
site-purchases              +13 B  (+0.0%)      +11 B  (+0.0%)
purchases                   +13 B  (+0.0%)      +11 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.

@okmttdhr okmttdhr self-assigned this Jan 28, 2025
@okmttdhr okmttdhr force-pushed the add/hosting-menu-site-setting branch from 4641a1b to 8cbf951 Compare January 28, 2025 06:04
@okmttdhr okmttdhr force-pushed the add/hosting-menu-site-setting branch from 9eed548 to 45ecba9 Compare January 29, 2025 02:47
@okmttdhr okmttdhr marked this pull request as ready for review January 29, 2025 05:41
@okmttdhr okmttdhr requested a review from a team January 29, 2025 05:48
@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 Jan 29, 2025
@okmttdhr okmttdhr requested a review from matt-west January 29, 2025 05:52
client/hosting/overview/controller.tsx Show resolved Hide resolved
@@ -86,11 +86,12 @@ class SiteSettingsFormJetpackMonitor extends Component {

/* eslint-disable wpcalypso/jsx-classname-namespace */
return (
<PanelCard className="jetpack-monitor-settings">
<HostingCard
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why we changed many PanelCard back to HostingCard in this PR?

The idea was to deprecate HostingCard and start using PanelCard in the new design.

I tried reverting the changes in this file (and the defensive mode card) and I didn't notice any broken visual.

Copy link
Member Author

@okmttdhr okmttdhr Jan 30, 2025

Choose a reason for hiding this comment

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

If we use PanelCard, there will be inconsistent spacing because the other HostingCard has an extra margin-bottom.

Screenshot 2025-01-30 at 12 22 46

In production, this isn't an issue since we're using Masonry, but this PR removes it to align them vertically. https://github.com/Automattic/wp-calypso/pull/98875/files#diff-907edd6df95246780ac004e4382376a1337c383d5623336379d74a2e44707ab8R195

I reverted the change in 011e592, and I believe we can keep using PanelCard for now, as we're exploring the layout design (card, one-column, two-column) TvapEJxLZ98RGWobNN1Xd1-fi-487_10437 and addressing it soon. CC: @matt-west

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.

Added a minor comment about making the width of the settings cards consistent across tabs.

Why do we display the Admin interface style card here now?

Copy link
Contributor

@lsl lsl left a comment

Choose a reason for hiding this comment

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

Mostly works great, I came across a couple of issues:

  1. This might be ok but I would expect the admin interface switcher not to redirect to wp-admin when modifying this option in SMP.
  2. Switching to a staging site while on settings results in errors,
    2a. Clicking server settings subtab results in a broken back button
  3. Switching to a simple site while on server settings takes you to hosting features instead of General settings (One could argue this is correct but I expected to stay in the settings tab)
Peek.2025-01-30.11-15.mp4

Revert "Add "Admin interface style" to General Settings"

This reverts commit b0caa4b.
@okmttdhr
Copy link
Member Author

okmttdhr commented Jan 30, 2025

Thanks for the feedback!

Why do we display the Admin interface style card here now?

This might be ok but I would expect the admin interface switcher not to redirect to wp-admin when modifying this option in SMP.

After discussion, I removed the Admin Interface setting from SMP.

Added the following context in the description: 👇

This PR removes the Admin Interface setting from Server Settings, and we won't have the Admin Interface setting anywhere in SMP. i.e., the Admin Interface setting can only be found in /wp-admin/options-general.php.

  • While it might make sense to move this WordPress.com-specific setting in SMP, the original intent of adding it under Settings → General was to provide HEs and users with a single, consistent location to modify the setting—regardless of the admin interface style or page-specific view.
  • Once the hold-out phase is over, adding the Admin Interface setting to SMP would align with this goal, as users will always have access to SMP.

Slack convo: p1738198428731869/1738195548.078849-slack-CRWCHQGUB

@okmttdhr
Copy link
Member Author

okmttdhr commented Jan 30, 2025

Switching to a simple site while on server settings takes you to hosting features instead of General settings (One could argue this is correct but I expected to stay in the settings tab)

I checked our latest design, and the Hosting Features tab is separate from the Settings tab:
Screenshot 2025-01-30 at 11 31 21
I believe this itself makes sense since it will keep this upsell prominent.

So, I think I suggest keeping users within the Settings tab when switching to a simple site while on Settings > Server. That feels more intuitive. Thoughts? @matt-west @lsl

@okmttdhr okmttdhr requested a review from a team January 30, 2025 08:12
Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Tested both control and treatment behaviors. It works nicely 👍

@matt-west
Copy link
Contributor

I'd prefer to redirect Server Settings to the general settings instead of the hosting features page

Agreed. 👍

@@ -58,7 +61,7 @@ export function siteSettings( context, next ) {
}
recordPageView( basePath + '/:site', analyticsPageTitle );

next();
redirectIfDuplicatedView( 'options-general.php' )( context, next );
Copy link
Contributor

Choose a reason for hiding this comment

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

Needed to happen after the above redirect checks so running the extra middleware here instead of in the controller like all the others.

@matticbot
Copy link
Contributor

matticbot commented Feb 3, 2025

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 add/hosting-menu-site-setting on your sandbox.

Copy link
Contributor

@lsl lsl left a comment

Choose a reason for hiding this comment

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

Tested without the wp-admin redirects:

Treatment:

  • Simple site Classic view
  • Simple site Default view
  • Atomic site Classic view
  • Atomic site Default view

Control:

  • Simple site Classic view
  • Simple site Default view
  • Atomic site Classic view
  • Atomic site Default view

Everything looks good / makes sense.

@okmttdhr okmttdhr merged commit ad30aad into trunk Feb 5, 2025
13 checks passed
@okmttdhr okmttdhr deleted the add/hosting-menu-site-setting branch February 5, 2025 06:41
@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 Feb 5, 2025
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.

Settings: Make Site Settings available to duplicate views experiment users
5 participants