Social: drop attachment toggle in per-network mode, promote Default media option#48573
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 5 files.
|
|
I haven't tested it yet just watched the video, since SIG and Featured image options from the dropdown will now behave as attachment, should they be categorized under the attachment tab in the dropdown? |
Good point. |
e115938 to
ca3ea5f
Compare
In per-network customization, the "Share as attachment" toggle is forced ON and non-interactable, so it currently has no functional purpose. Remove it and add a "Default" option to the media dropdown that maps to the existing media_source: 'none' value. Picking Default leaves the share without a per-connection attachment, so the destination network falls back to the post-level OG image. Picking any other source attaches that image as today. The Default option is only surfaced when the attachment toggle is hidden (per-network mode); global mode is unchanged. No backend changes — Extractor::is_social_post() already returns false for media_source: 'none' in the per-connection branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Default is now the rendered state for any per-network connection that has no explicit override (Featured image was previously auto-selected via detect-media-source even though attached_media was empty, which made "Featured image" appear selected without actually being attached). - Drop the globalMediaSource / synthesized attached_media fallback in PerNetworkCustomizationForm. Connections inherit nothing from global media; uncustomized connections leave media_source undefined. - MediaSectionV2 skips detectMediaSource when the attachment toggle is hidden (per-network mode), so undefined media_source maps to Default. - MediaSectionV2 preview mirrors the OG resolver in Default mode: SIG (if globally enabled) → featured image → nothing. - handleSourceSelect unsets both media_source and attached_media when Default is picked, so the saved connection override is cleared (REST update() drops fields whose value is undefined). No backend changes — Extractor::is_social_post() already returns false when media_source is missing or 'none'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Render selected media-source items with role="menuitemradio" and a check icon suffix so the active option is visually identifiable. The previous approach (disabled + greyed out) read as "unclickable" rather than "selected". - Switch the option icon to iconPosition="left" so the option icon and the selected check don't fight for the same slot. - Re-clicking the active terminal source (Default / Featured image / SIG) is a no-op; re-clicking media-library / ai-image still re-opens their picker so users can swap to a different image. - In per-network mode, surface SIG and Featured image under "Attachment" rather than "Link preview". With the toggle hidden, those sources always attach — the old grouping was misleading. Default is the only link-preview option in per-network. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c76b6ac to
5969f15
Compare
I initially wanted to add that OG text, but I think it’s more technical for most of the users. |
That makes sense |
gmjuhasz
left a comment
There was a problem hiding this comment.
Okay this works as intended to me. The "default" wording is still something I like less because its not clear what that means, but it's also pretty hard to explain better, and the preview show it on the right. Let's show it to design and see what they think


Fixes #
Completes SOCIAL-473.
Proposed changes
media_source: 'none'to a first-class Default option in the media dropdown, surfaced only when the toggle is hidden (per-network mode). Picking Default produces no per-connection attachment; the destination network falls back to the post-level OG image.forceMediaAsAttachment: booleanprop onSharePostForm/MediaSectionV2withattachmentToggleMode: 'visible' | 'hidden'. Per-network passes'hidden'.media_sourceundefined.MediaSectionV2skipsdetectMediaSourcewhen the toggle is hidden, so undefined / missing media maps to Default.media_sourceandattached_mediaon the connection, clearing the per-connection override entirely (RESTupdate()already drops fields whose value isundefined).Extractor::is_social_post()already returnsfalseformedia_source: 'none'or missing, andget_attached_media()returns empty.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
SOCIAL_ENHANCED_PUBLISHING), open a post in the editor.media_source: 'featured-image'and the actual featured image is attached on publish.media_sourceandattached_mediaare unset; on publish the share goes through as a regular link with the post-level OG preview.media_source: 'sig'and the SIG image is attached on publish.media_source: 'media-library'with the chosen image, attached on publish.requiresMedianetwork) selected: pick Default and confirm aNO_MEDIA_ERRORvalidation surfaces (Instagram requires a real attachment).og:image) is unchanged for any of these per-connection states.Screen.Recording.2026-05-06.at.7.46.50.PM.mov