Skip to content

Social: Settings tab on the modernization chassis (#48824 PR 3)#48860

Merged
dhasilva merged 5 commits into
trunkfrom
update/social-modernization-settings
May 25, 2026
Merged

Social: Settings tab on the modernization chassis (#48824 PR 3)#48860
dhasilva merged 5 commits into
trunkfrom
update/social-modernization-settings

Conversation

@keoshi
Copy link
Copy Markdown
Contributor

@keoshi keoshi commented May 15, 2026

Summary

Phase 3 of the Social modernization umbrella. Fills the empty Tabs.Panel value="settings" placeholder PR 1 left behind with four WPDS Card.Root groups, behind the same rsm_jetpack_ui_modernization_social filter. Stacks on PR 2.5 — depends on it merging first.

Highlights

  • Default share message — wraps the shared MessageTemplateEditor with the same debounced autosave the legacy MessageTemplateSection uses. Self-gates on the social-message-templates blog sticker + manage_options; stickerless sites simply don't see the card.
  • Content creation — Social Notes toggle, a compact outlined "Create a note" action (renders an <a> via Base UI's render slot since WPDS Button ignores href), the "Append post link" sub-toggle, and the "Link format" select. Mounted only when the Social plugin is active — the CPT registration still lives in projects/plugins/social/ (pedxs5-r7-p2 is Notes-as-Social-plugin-driver; keeping the placement is intentional).
  • Customize media — Social Image Generator toggle plus a compact outlined "Change defaults" action that opens the existing TemplatePickerModal. Gated by the paid social-image-generator feature.
  • Customize links — UTM parameters toggle.
  • Empty state for admins on Publicize-inactive sites — WPDS EmptyState pointing back at the wp-admin module-toggles surface. The legacy master SocialModuleToggle is intentionally not ported (umbrella decision: product visibility lives outside the product itself).
  • Layout — Settings column caps at 660px via .jetpack-social-settings so the form rows stay scannable; the page chrome and the Overview tab keep their existing widths. Inline action rows (__card-actions) and nested form controls (__card-nested) share the --wpds-dimension-gap-3xl token (40px in the default theme, 32px in the compact one) so the indent under each toggle's label column tracks the toggle's size scale.

Side-fix — the chassis bundler couldn't compile the SIG template picker before: the picker's templates.js shipped .jpg imports the wp-build esbuild pipeline can't parse, and the picker tree was .js JSX that esbuild rejected by default. The four template thumbnails move to _inc/assets/sig-templates-*.jpg (the same runtime-assets_url pattern services/utils.tsx uses), and the picker / modal / media-picker / video-preview entries rename to .tsx / .ts so esbuild parses the JSX. The legacy webpack bundle keeps working unchanged.

Screenshots

Settings tab — all four Card groups on a paid-plan + Social-plugin site

Settings tab — Default share message, Content creation, Customize media, Customize links

Testing instructions:

  1. Pull this branch and rebuild: jetpack build packages/publicize --deps (or rsync the Jetpack plugin to a Jurassic Ninja site).
  2. Activate the Publicize module on a Jetpack-connected site: wp jetpack module activate publicize.
  3. Without paid Social features, dismiss the pricing-page nudge: wp option update jetpack-social_show_pricing_page 0 (otherwise should_preempt_to_legacy() routes the request back to the legacy SocialAdminPage).
  4. Enable the chassis filter via a mu-plugin or Code Snippets: add_filter( 'rsm_jetpack_ui_modernization_social', '__return_true' );.
  5. Go to wp-admin → Jetpack → SocialSettings tab (or ?p=/?tab=settings).
  6. Customize links is always visible. Expected: a single Card with "Append UTM parameters to shared URLs" toggle and the UTM explainer help text. Toggling the switch hits updateUtmSettings (network roundtrip via /wpcom/v2/publicize/jetpack-social-settings).
  7. Customize media renders only on sites that have the paid social-image-generator plan feature. Expected: toggle + helper text, plus a compact outlined "Change defaults" trigger that opens the existing TemplatePickerModal (template grid, default image picker, font select).
  8. Content creation renders only when the Social plugin is active (i.e. JetpackScriptData.social.plugin_info.social.version is truthy). Expected: "Enable Social Notes" toggle + compact outlined "Create a note" action that navigates to the Social Notes CPT new-post screen. When the toggle is on, the "Append post link" sub-toggle and a 40px-indented "Link format" select appear.
  9. Default share message renders only on sites with the social-message-templates blog sticker AND the current user has manage_options. Expected: the shared MessageTemplateEditor textarea + the "Available placeholders" dropdown; edits autosave via /wp/v2/settings (1s debounce). To enable on a site, ask a sandboxed Automattician to run wpsh > add_blog_sticker( 'jetpack-social-message-templates', null, null, $blog_id );.
  10. Empty state. Deactivate the Publicize module from the wp-admin module-toggles surface (wp option update jetpack_active_modules 'a:0:{}' or via the Jetpack module manager). Reload the Settings tab. Expected: the four cards collapse to a single WPDS EmptyState ("Auto-sharing is turned off" + "Manage modules" link back to Jetpack settings). The empty state shows only for admins on self-hosted sites; WPCOM Simple sites never hit it (Publicize is always on there).
  11. Filter off behavior. Remove the chassis filter and reload. Expected: the legacy SocialAdminPage renders unchanged — same header, same AdminSection layout, same three toggles.
  12. Layout. With the chassis filter on, verify the Settings cards are constrained to a 660px column (centered) while the Overview tab keeps its existing 720px width and the page chrome (tabs nav, header) stays full-width.

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

No. PR 3 wires existing store actions and existing REST endpoints (updateSocialNotes, updateSocialNotesConfig, updateUtmSettings, updateSocialImageGeneratorConfig, setMessageTemplate) into a new chassis surface, gated by the same modernization filter as PR 1–2.5. No new Tracks events, no new REST endpoints, no new options. The bundler-compatibility renames + asset moves preserve every existing import path through the consumer-facing barrel files.

🤖 Generated with Claude Code

@keoshi keoshi self-assigned this May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

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 update/social-modernization-settings branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/social-modernization-settings

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

@keoshi keoshi added [Status] Needs Review This PR is ready for review. [Plugin] Social Issues about the Jetpack Social plugin labels May 15, 2026
@github-actions github-actions Bot added [Feature] Publicize Now Jetpack Social, auto-sharing [Package] Publicize [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: June 2, 2026
    • Code freeze: June 1, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 15, 2026

Code Coverage Summary

11 files are newly checked for coverage. Only the first 5 are listed here.

File Coverage
projects/packages/publicize/_inc/components/settings-tab/content-creation-card.tsx 0/13 (0.00%) 💔
projects/packages/publicize/_inc/components/settings-tab/customize-links-card.tsx 0/7 (0.00%) 💔
projects/packages/publicize/_inc/components/settings-tab/customize-media-card.tsx 0/12 (0.00%) 💔
projects/packages/publicize/_inc/components/settings-tab/default-share-message-card.tsx 0/17 (0.00%) 💔
projects/packages/publicize/_inc/components/settings-tab/publicize-inactive-empty-state.tsx 0/1 (0.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.

@keoshi keoshi force-pushed the update/social-modernization-modal-wpds branch from 3e6290e to fe74066 Compare May 18, 2026 09:36
@keoshi keoshi requested a review from a team as a code owner May 18, 2026 09:36
@keoshi keoshi force-pushed the update/social-modernization-settings branch 2 times, most recently from 98d47c5 to 1e0ca69 Compare May 18, 2026 12:48
@anomiex anomiex removed the request for review from a team May 18, 2026 14:41
@dhasilva dhasilva force-pushed the update/social-modernization-modal-wpds branch from 1101761 to 5ecbf8a Compare May 23, 2026 00:34
Base automatically changed from update/social-modernization-modal-wpds to trunk May 25, 2026 19:52
keoshi and others added 2 commits May 25, 2026 18:47
…48824)

Fills the empty `Tabs.Panel value="settings"` placeholder PR 1 left
behind with four WPDS `Card.Root` groups that mirror the umbrella's
Settings design:

- **Default share message** — wraps the shared `MessageTemplateEditor`
  with the same debounced autosave the legacy `MessageTemplateSection`
  uses. Self-gates on the `social-message-templates` blog sticker and
  `manage_options`, so stickerless sites simply don't see the card.
- **Content creation** — Social Notes toggle, a compact "Create a
  note" action, the "Append post link" sub-toggle, and the "Link
  format" select. Mounted only when the Social plugin is active (the
  CPT registration still lives in `projects/plugins/social/`).
- **Customize media** — Social Image Generator toggle and a compact
  "Change defaults" action that opens the existing
  `TemplatePickerModal`. Gated by the paid `social-image-generator`
  feature.
- **Customize links** — UTM parameters toggle.

When Publicize is inactive on a self-hosted site (and the current user
can toggle modules), the cards collapse to a thin WPDS `EmptyState`
that points back at the wp-admin module-toggles surface. The legacy
master `SocialModuleToggle` is intentionally not ported (umbrella
decision: product visibility lives outside the product itself). The
column caps at 660px via `.jetpack-social-settings` so the form rows
stay scannable; the chassis page chrome and the Overview tab keep
their existing widths.

Inline action rows (`__card-actions`) and nested form controls
(`__card-nested`) share the `--wpds-dimension-gap-3xl` token (40px in
the default theme, 32px in the compact one) so the indent under each
toggle's label column tracks the toggle's size scale.

Side-fix the chassis bundler couldn't compile the SIG template picker
before: the picker's `templates.js` shipped `.jpg` imports that the
wp-build esbuild pipeline can't parse, and the picker tree was `.js`
JSX that esbuild rejects by default. The four template thumbnails
move to `_inc/assets/sig-templates-*.jpg` (the same runtime-`assets_url`
pattern `services/utils.tsx` uses), and the picker / modal /
media-picker / video-preview entries rename to `.tsx` / `.ts` so
esbuild parses the JSX. The legacy webpack bundle keeps working
unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- WPDS Button doesn't accept `href`; use Base UI's `render` slot
  (`render={ <a href={...} /> }`) so the "Create a note" and "Manage
  modules" buttons actually navigate.
- Drop `variant="secondary"` on the "Change defaults" trigger — WPDS
  Button variants are `solid | outline | minimal | unstyled`, so
  `secondary` silently fell back to the default solid/brand fill.
  Switch both action triggers to `variant="outline"` so they read as
  the secondary affordances they're meant to be.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dhasilva dhasilva force-pushed the update/social-modernization-settings branch from 1e0ca69 to b39e150 Compare May 25, 2026 22:45
dhasilva and others added 2 commits May 25, 2026 19:50
The PR-3 rename of media-picker/index.js → .tsx exposed type errors the
.js file masked: mediaDetails inferred as {} (so the mediaData/metaData/
previewData destructure failed) and every prop became required (so the
template-picker modal's MediaPicker call errored on the omitted
wrapperClassName). Add an explicit MediaPickerProps type, and complete
the MediaDetails type with the previewData field the hook already
returns.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers SettingsTab's visibility logic — the admin empty state vs. cards,
and the per-card gating (message-templates feature + manage_options,
Social-plugin presence, image-generator feature). Stubs the card
children so the test isolates the gating decisions rather than each
card's store wiring.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the hand-rolled flex/gap SCSS with the @wordpress/ui Stack
component (matching the WPDS audit feedback on PR 48833). Stack owns the
flex direction + gap tokens; the stylesheet keeps only what Stack
doesn't — the 660px column cap and the toggle-aligned indents (now a
single shared rule for the action rows and nested controls). Verified
in-browser: desktop column stays capped/centred at 660px and mobile
goes full-width, both with the same 16px gaps and 40px indents as before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dhasilva dhasilva merged commit 669c158 into trunk May 25, 2026
73 of 74 checks passed
@dhasilva dhasilva deleted the update/social-modernization-settings branch May 25, 2026 23:43
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Review This PR is ready for review. labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Connection [JS Package] Social Logos [Package] Publicize [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin RNA [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants