Skip to content

Refactor CustomPostEditorService.State.newPost to carry PostSettings#25543

Open
crazytonyli wants to merge 4 commits intotask/sync-discussion-defaults-from-restfrom
task/refactor-new-post-post-settings-store
Open

Refactor CustomPostEditorService.State.newPost to carry PostSettings#25543
crazytonyli wants to merge 4 commits intotask/sync-discussion-defaults-from-restfrom
task/refactor-new-post-post-settings-store

Conversation

@crazytonyli
Copy link
Copy Markdown
Contributor

Description

Note

This PR will be merged after #25542.

The first commit format Swift files and can be ignored.

There is an unnecessary round trip between PostCreateParams (used for API requests) and PostSettings (used for UI layer), when saving a local in-memory draft.

The main change is changing .newPost(PostCreateParams) case to .newPost(PostSettings). The rest of the changes are for adopting this API change.

No behavior changes. Pre-formatting before refactoring `CustomPostEditorService.State.newPost` to carry `PostSettings`.
Replace the API DTO `PostCreateParams` with the domain `PostSettings` value type as the new-post state, removing two type-conversion sites on every settings edit and confining `PostCreateParams` to the API boundary in `create(params:)`. Includes resolving unresolved tags and custom terms before the editor save path, so a user-added term in Post Settings is no longer dropped at create time, and clearing the blog's default post format on duplicate when the source post itself has none.
…(from:)

Read `commentsAllowed` and `pingbackInboundEnabled` from the blog's settings into the new-post defaults so a draft saved without visiting Post Settings reflects the admin's configured discussion behavior, instead of always sending `comment_status = open`.
@crazytonyli crazytonyli added this to the 26.9 milestone May 8, 2026
@crazytonyli crazytonyli requested a review from jkmassel May 8, 2026 01:11
@dangermattic
Copy link
Copy Markdown
Collaborator

2 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented May 8, 2026

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 Number32172
VersionPR #25543
Bundle IDorg.wordpress.alpha
Commit643889b
Installation URL21bn7s48jd0eg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented May 8, 2026

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 Number32172
VersionPR #25543
Bundle IDcom.jetpack.alpha
Commit643889b
Installation URL4c9ucogjng7go
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

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