Skip to content

My Jetpack: add flagged products-only interface for Simple and Atomic sites#49982

Draft
enejb wants to merge 6 commits into
trunkfrom
add/my-jetpack-products-simple-atomic
Draft

My Jetpack: add flagged products-only interface for Simple and Atomic sites#49982
enejb wants to merge 6 commits into
trunkfrom
add/my-jetpack-products-simple-atomic

Conversation

@enejb

@enejb enejb commented Jun 25, 2026

Copy link
Copy Markdown
Member

Proposed changes

Trial/prototype PR exploring a new products-only My Jetpack interface for WordPress.com Simple and Atomic sites, behind a feature flag. The goal is to prototype the new interface — the page URL (admin.php?page=my-jetpack) stays the same, but the UI shows only products with no tabs.

When the JETPACK_MY_JETPACK_PRODUCTS_ONLY constant is set and the site is Simple or Atomic:

  • Reuses the existing products UI. The tab strip (Overview / Products / Help) is hidden while keeping the same layout chrome — content width, background, and the separator below the header — by locking the existing tab panel to the Products tab rather than re-implementing it.
  • The wp-admin sidebar menu label stays My Jetpack (unchanged).
  • Module activate/deactivate toggles are hidden on Simple sites and on Atomic sites without a business plan; they remain on Atomic sites that have a business plan (covers both the product cards and the module rows in the list view).
  • Site type (Simple/Atomic) and business-plan detection use Status\Host and the WordPress.com "site has feature" API (Product::does_site_have_feature()). All three signals are overridable via filters so a mu-plugin can force states for testing:
    • my_jetpack_products_page_site_typesimple / atomic / other
    • my_jetpack_products_page_enabled — force the whole mode on/off
    • my_jetpack_products_page_can_manage_modules — force the toggle capability
  • Self-hosted / Jetpack sites are unaffected — the flag is a no-op there.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

This is behind a feature flag, so it's easiest to test on a Jurassic Ninja site (or local) with a small mu-plugin that turns the flag on and forces each state via the filters above:

Tester mu-plugin
<?php
/** Plugin Name: My Jetpack Products-Only Tester */
if ( ! defined( 'JETPACK_MY_JETPACK_PRODUCTS_ONLY' ) ) {
	define( 'JETPACK_MY_JETPACK_PRODUCTS_ONLY', true );
}
function mj_tester_state() {
	if ( isset( $_GET['mj_state'] ) ) {
		return sanitize_key( wp_unslash( $_GET['mj_state'] ) );
	}
	return defined( 'MJ_FORCE_STATE' ) ? MJ_FORCE_STATE : 'off';
}
add_filter( 'my_jetpack_products_page_enabled', fn( $e ) => 'off' === mj_tester_state() ? false : true );
add_filter( 'my_jetpack_products_page_site_type', function ( $t ) {
	$s = mj_tester_state();
	if ( 'simple' === $s ) { return 'simple'; }
	if ( in_array( $s, array( 'atomic_business', 'atomic_nobiz' ), true ) ) { return 'atomic'; }
	return $t;
} );
add_filter( 'my_jetpack_products_page_can_manage_modules', function ( $c ) {
	return 'atomic_business' === mj_tester_state() ? true
		: ( in_array( mj_tester_state(), array( 'simple', 'atomic_nobiz' ), true ) ? false : $c );
} );
  1. Add the mu-plugin above to the test site.
  2. Visit /wp-admin/admin.php?page=my-jetpack&mj_state=simple → only the products grid renders (no tabs), and no module toggles appear.
  3. …&mj_state=atomic_business → same products-only layout, module toggles are shown.
  4. …&mj_state=atomic_nobiz → products-only layout, no toggles.
  5. …&mj_state=off → normal tabbed My Jetpack.

Screenshots

Captured on a live Jurassic Ninja site at 1440×900.

Before (current tabbed My Jetpack) After — Simple (mj_state=simple)
before simple
After — Atomic + business (atomic_business) After — Atomic, no business (atomic_nobiz)
business nobiz

Control — flag off renders the normal tabbed My Jetpack:

off

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/my-jetpack-products-simple-atomic branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/my-jetpack-products-simple-atomic

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 25, 2026
@jp-launch-control

jp-launch-control Bot commented Jun 25, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 6 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/my-jetpack/_inc/components/my-jetpack-tab-panel/index.tsx 0/33 (0.00%) 0.00% 5 💔
projects/packages/my-jetpack/_inc/components/my-jetpack-tab-panel/products/use-all-jetpack-modules.ts 0/5 (0.00%) 0.00% 3 ❤️‍🩹
projects/packages/my-jetpack/_inc/components/module-toggle/index.tsx 0/20 (0.00%) 0.00% 2 ❤️‍🩹
projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx 0/46 (0.00%) 0.00% 1 ❤️‍🩹
projects/packages/my-jetpack/_inc/components/my-jetpack-tab-panel/products/product-card-action.tsx 17/31 (54.84%) -0.33% 1 ❤️‍🩹

2 files are newly checked for coverage.

File Coverage
projects/packages/my-jetpack/src/class-products-page.php 0/4 (0.00%) 💔
projects/packages/my-jetpack/_inc/utils/is-products-only-mode.ts 2/2 (100.00%) 💚

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] My Jetpack [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant