Skip to content

Custom Posts: Show "Post updated" notice#25576

Open
crazytonyli wants to merge 2 commits into
trunkfrom
task/custom-posts-show-notice
Open

Custom Posts: Show "Post updated" notice#25576
crazytonyli wants to merge 2 commits into
trunkfrom
task/custom-posts-show-notice

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Description

Mirror the existing UX: show notice after post is saved/published.

The first commit is code-format changes and can be ignored.

@crazytonyli crazytonyli added this to the 27.0 milestone May 21, 2026
@crazytonyli crazytonyli requested a review from jkmassel May 21, 2026 21:16
@wpmobilebot

wpmobilebot commented May 21, 2026

Copy link
Copy Markdown
Contributor
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 Number32328
VersionPR #25576
Bundle IDcom.jetpack.alpha
Commitcaae1e1
Installation URL53fqj57lk68to
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented May 21, 2026

Copy link
Copy Markdown
Contributor
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 Number32328
VersionPR #25576
Bundle IDorg.wordpress.alpha
Commitcaae1e1
Installation URL7docmtoa5gbo0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Post a Notice toast on every HTTP write to the site from the Custom Post editor (save draft, update, publish) and from the standalone settings sheet reached from the Custom Posts list. The notice's title reflects the action: "Draft saved" only on the first save of a brand-new post, "Post updated" for any save of an existing post, and "Post published" via the publishing sheet. The post title is the notice's subtitle (omitted when empty). Localized strings live in a shared CustomPostNotice enum.
@crazytonyli crazytonyli force-pushed the task/custom-posts-show-notice branch from 6c9a5a3 to caae1e1 Compare May 25, 2026 10:12

@jkmassel jkmassel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a comment, but also publishPost notifies now but what about moveToDraft, trashPost, and deletePost?

editorService: editorService,
blog: blog,
from: vc,
completion: { _ in }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this need a similar body to the one in showPublishingSheet?

}
}

private enum Strings {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a duplicate of the ViewModel strings?

WDYT about extracting them into a higher-level shared CustomPostNotice string set?

@@ -251,6 +255,12 @@ private extension CustomPostEditorViewController {
func save(publish: Bool) async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we only ever pass false here, so do we need this param? (this will cause a breaking change in callers)

Suggested change
func save(publish: Bool) async {
func save() async {

Comment on lines +234 to +237
let postTitle = editorService.post?.title?.raw
let subtitle = (postTitle?.isEmpty == false) ? postTitle : nil
Notice(title: Strings.CustomPostNotice.postPublished, message: subtitle, feedbackType: .success)
.post()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We repeat this pattern a bunch – I wonder if we could extract it to a helper? Could be the enum you use to consolidate the strings?

@crazytonyli

Copy link
Copy Markdown
Contributor Author

what about moveToDraft, trashPost, and deletePost

I didn't touch those because the existing Posts list does not show a notice on these actions.

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.

3 participants