Skip to content

Conversation

kean
Copy link
Contributor

@kean kean commented Sep 17, 2025

Fixes https://linear.app/a8c/issue/CMM-759/new-publishing-sheet. See the ticket for the rationale.

Screenshot 2025-09-23 at 8 47 11 AM

Changes:

  • Move “Publish” to the nav bar, so it takes less vertical space
  • Use standard “Close” button
  • Add a “Preview” button
  • Add a full list of “Post Settings” options, including “Featured Image” and “Excerpt” – stuff you would expect to be in this sheet.
  • When you close it, it now asks you whether you want to save the settings you fiddles with like added tags – prod will just discard without telling you.

In terms of tech, it now uses the existing PostSettingsView with minimum changes – only adding the header and the “publish” logic. Any change we add to “Post Settings” – like adding “Excerpt“ generator – is automatically reflected here. It even reuses the existing SiteListRowView now.

For simplicity, it’s just a variation of PostSettingsViewModel – it’s nearly identical, and in the future I plan to add the “Status” field to “Post Settings” to be consistent with the web an dot allow publishing from “Post Settings” by changing status.

Recording

Screen.Recording.2025-09-23.at.8.53.05.AM.mov

@kean kean added this to the 26.4 milestone Sep 17, 2025
@kean kean requested a review from crazytonyli September 17, 2025 20:00
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 17, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number29179
VersionPR #24855
Bundle IDcom.jetpack.alpha
Commit9b1648d
Installation URL626ujqrtqttj0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 17, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number29179
VersionPR #24855
Bundle IDorg.wordpress.alpha
Commit9b1648d
Installation URL6qnhqpg5uvslg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

"postSettings.preview.label",
value: "Preview",
comment: "Label for the preview button in Post Settings"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems publishingOptionsHeader and previewLabel are not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@kean kean force-pushed the task/rework-prepublishing-sheet-ios26 branch from 277cde3 to 08d261f Compare September 22, 2025 22:22
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@kean
Copy link
Contributor Author

kean commented Sep 22, 2025

I made some minor tweaks and integrated social sharing. It now works by updating the existing PostSettings structure (PostSocialSharingSettings) and delaying when it applies the actual changes to Core Data – it only happens when you save. I was also able to return the “Social Sharing” option back to the regular “Post Settings” screen. Most of the code was copied from PrepublishingViewController with no changes.

The only missing piece now is “Media Upload” status integration, which I’ll implement in a separate PR. I’ll continue testing and refining it in separate PRs also – it’s currently under the FF.

@kean kean requested a review from crazytonyli September 22, 2025 22:24
}

static func make(for post: Post) -> PostSocialSharingSettings? {
guard let context = post.managedObjectContext else {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied most of the social-sharing code from the existing PrepublishingViewController with minimum changes to the implementation or the architecture. I do not plan to rework it in the scope of this project.

@kean kean force-pushed the task/rework-prepublishing-sheet-ios26 branch from c4eff4d to c694e39 Compare September 23, 2025 15:57
@kean
Copy link
Contributor Author

kean commented Sep 23, 2025

I also integrated the media uploads state view. It's not complete. The feature flag is still off for now – I'll enable it when It's fully tested and UI tests are updated.

Screenshot 2025-09-23 at 11 58 03 AM

}

private var cornerRadius: CGFloat {
if #available(iOS 26, *) { 10 } else { 6 }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A small change to make the corner radius work better with the larger radius on iOS 26.

/// - parameter changes: The set of changes apply to the post together
/// with the publishing options.
@MainActor
func publish_v2(_ post: AbstractPost, parameters: RemotePostUpdateParameters) async throws {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I plan to remove the previous version in the next PR where the legacy screen is removed.

slug = post.wp_slug ?? ""
status = post.status ?? .draft
publishDate = post.dateCreated
publishDate = post.shouldPublishImmediately() ? nil : post.dateCreated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

delegate: self,
coreDataStack: ContextManager.shared
)
viewController?.navigationController?.pushViewController(optionsVC, animated: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not ideal, but it's the existing practice in this screen, and I'm not planning to refactor it in this PR.

@kean kean force-pushed the task/rework-prepublishing-sheet-ios26 branch from 79082ea to 9b1648d Compare September 24, 2025 12:13
@kean kean enabled auto-merge September 24, 2025 12:13
Copy link

@kean kean added this pull request to the merge queue Sep 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 24, 2025
@kean kean merged commit 5fc306f into trunk Sep 24, 2025
30 of 32 checks passed
@kean kean deleted the task/rework-prepublishing-sheet-ios26 branch September 24, 2025 13:04
Copy link

sentry-io bot commented Sep 25, 2025

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

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

Successfully merging this pull request may close these issues.

4 participants