Wire JetpackSocial into Custom Post Settings#25546
Open
crazytonyli wants to merge 7 commits intotrunkfrom
Open
Wire JetpackSocial into Custom Post Settings#25546crazytonyli wants to merge 7 commits intotrunkfrom
crazytonyli wants to merge 7 commits intotrunkfrom
Conversation
Adds a new "Share to social media" section to Post Settings for custom post types when the socialSharingV2 feature flag is enabled. The section shows the site's connected social accounts with per-connection toggles, an optional custom message field, and an "Add a connection" entry point that reuses the OAuth flow from the Social screen. On save, the post payload now includes jetpack_publicize_connections in additional fields and jetpack_publicize_message in post meta, so Jetpack Social can publish the post to the selected accounts.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32189 | |
| Version | PR #25546 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 61dad94 | |
| Installation URL | 3qc874r9ehrn0 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32189 | |
| Version | PR #25546 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 61dad94 | |
| Installation URL | 0kuucerrg133g |
Contributor
There was a problem hiding this comment.
Pull request overview
Wires Jetpack Social “Share to social media” (v2) into Custom Post Type Post Settings behind the socialSharingV2 feature flag, including UI for per-connection toggles + custom message, and encoding the resulting state into REST update/create payloads.
Changes:
- Adds a v2 social sharing entry + detail flow in Post Settings, backed by a
PostSocialSharingDraftbinding andSiteSocialConnectionsService. - Encodes
jetpack_publicize_connectionsintoadditional_fieldsandjetpack_publicize_messageinto post meta for update/create requests. - Extends JetpackSocial with draft/model helpers, a new detail view, and updated add-connection flow to return the created
SocialConnection, plus new/updated tests.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsViewModelProtocol.swift | Adds optional v2 social sharing binding surface for host view models. |
| WordPress/Classes/ViewRelated/Post/PostSettings/PostSettingsView.swift | Dispatches between legacy vs v2 social sharing UI; adds Jetpack-branded section entry. |
| WordPress/Classes/ViewRelated/Post/PostSettings/PostSettings.swift | Persists draft state in PostSettings and encodes publicize connections/message into REST params. |
| WordPress/Classes/ViewRelated/Post/PostSettings/CustomPostSettingsViewModel.swift | Plumbs JetpackSocial service + add-connection coordinator; exposes v2 binding; initializes draft from fetched post. |
| Tests/KeystoneTests/Tests/Features/Posts/PostSettingsTests.swift | Adds coverage for publicize message clearing/preservation and connections encoding in update params. |
| Tests/KeystoneTests/Tests/Features/Posts/CustomPostSettingsViewModelTests.swift | New regression tests around hasChanges behavior with social v2 draft state. |
| Tests/KeystoneTests/Tests/Features/Posts/CustomPostEditorServiceTests.swift | Adds coverage ensuring create/update local application carries social draft into params/pending settings. |
| Modules/Tests/JetpackSocialTests/SiteSocialConnectionsServiceTests.swift | Removes test relying on deleted currentConnectionIDs() API. |
| Modules/Tests/JetpackSocialTests/PostSocialSharingDraftTests.swift | New tests for draft parsing/round-trips and publicize field/meta helpers. |
| Modules/Sources/JetpackSocial/Views/PostSocialSharingDetailView.swift | New SwiftUI detail screen (toggles + custom message) and summary helper. |
| Modules/Sources/JetpackSocial/Views/AddConnectionCoordinator.swift | Adds optional callback for newly created connection and wires it through success path. |
| Modules/Sources/JetpackSocial/Views/AccountConfirmationView.swift | Adjusts completion to return the created SocialConnection instead of the keyring account. |
| Modules/Sources/JetpackSocial/Strings/Strings.swift | Adds localized strings for the Post Settings social-sharing section. |
| Modules/Sources/JetpackSocial/Services/SiteSocialConnectionsService.swift | Removes currentConnectionIDs() API. |
| Modules/Sources/JetpackSocial/Services/PostSocialSharingDraft.swift | Introduces PostSocialSharingDraft model for message + per-connection enablement state. |
| Modules/Sources/JetpackSocial/Models/WpAdditionalFields+Publicize.swift | Adds parsing/encoding helpers for jetpack_publicize_connections. |
| Modules/Sources/JetpackSocial/Models/PostMeta+Publicize.swift | Adds parsing/encoding helpers for jetpack_publicize_message. |
| AGENTS.md | Adds guidance about Core Data concurrency and avoiding cross-thread managed object capture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds a new "Share to social media" section to Post Settings for custom post types when the socialSharingV2 feature flag is enabled. The section shows the site's connected social accounts with per-connection toggles, an optional custom message field, and an "Add a connection" entry point that reuses the OAuth flow from the Social screen.
On save, the post payload now includes jetpack_publicize_connections in additional fields and jetpack_publicize_message in post meta, so Jetpack Social can publish the post to the selected accounts.
Simulator.Screen.Recording.-.iPhone.Air.-.2026-05-08.at.21.47.56.mov