Extract PostSettingsDataProvider protocol#25363
Conversation
Generated by 🚫 Danger |
|
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 31407 | |
| Version | PR #25363 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | dfacacd | |
| Installation URL | 5n1thac0vo850 |
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 31407 | |
| Version | PR #25363 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | dfacacd | |
| Installation URL | 1mr3rsgj9sfsg |
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
|
Thanks for the work on this! I wanted to share some thoughts on how this approach compares to the original suggestion of branching at the ViewModel level. The idea behind that approach was to:
Branching at the swift var navigationTitle: String {
isPost ? Strings.postSettingsTitle : Strings.pageSettingsTitle
}
func suggestedTags() async throws -> [String] {
try await TagSuggestionsService().getSuggestedTags(for: post)
}
func save(settings: PostSettings) async throws {
let coordinator = PostCoordinator.shared
if coordinator.isSyncAllowed(for: post) && post.status == settings.status {
let revision = post.createRevision()
settings.apply(to: revision)
coordinator.setNeedsSync(for: revision)
} else {
let changes = settings.makeUpdateParameters(from: post)
try await coordinator.save(post, changes: changes)
}
}I guess my main question is whether this direction still gets us the benefits we were after - specifically, keeping |
|
@kean Sorry, I misunderstood the original discussion. I can explore that direction. |





Description
As discussed in a previous PR, extracting a protocol to unify the updating Post Settings code on both data types: AbstractPost and AnyPostWithEditContext.
I have organized the diff into smaller commits. It'd be easier to review commit by commit.
Testing instructions
Mainly regression tests in the regular Posts and Pages.