Refactor CustomPostEditorService.State.newPost to carry PostSettings#25543
Open
crazytonyli wants to merge 4 commits intotask/sync-discussion-defaults-from-restfrom
Open
Refactor CustomPostEditorService.State.newPost to carry PostSettings#25543crazytonyli wants to merge 4 commits intotask/sync-discussion-defaults-from-restfrom
crazytonyli wants to merge 4 commits intotask/sync-discussion-defaults-from-restfrom
Conversation
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`.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32172 | |
| Version | PR #25543 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 643889b | |
| Installation URL | 21bn7s48jd0eg |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32172 | |
| Version | PR #25543 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 643889b | |
| Installation URL | 4c9ucogjng7go |
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
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.


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) andPostSettings(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.