App Intents: publish and schedule post intents#25756
Draft
crazytonyli wants to merge 5 commits into
Draft
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33034 | |
| Version | PR #25756 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 75cf8f1 | |
| Installation URL | 3sb5r17qaucko |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33034 | |
| Version | PR #25756 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 75cf8f1 | |
| Installation URL | 7pdmjpbj7tosg |
Adds eligibility, blocker, and update-parameter helpers that let App Intents publish or schedule server-synced posts. Posts with unsaved local edits, pages, local-only posts, and posts the user's role cannot publish are refused up front, using the same capability check and nil-capabilities allowance as the in-app publish affordances, rather than surfacing a raw server rejection after confirmation. Publishing a previously scheduled post moves its date to now through a RemotePostUpdateParameters helper shared with PostCoordinator.save, covering the private-publish case the earlier inline copies missed. The publishable status list is shared between the eligibility check and the fetch predicate.
A save that skips the UIKit flow used to skip the coordinator's non-UI side effects too: the dashboard notifications that refresh the posts cards, the app-rating significant event, and the post-save error analytics. The dormant didPublish helper now owns the success block so non-UI callers can emit them, leaving only the alert and notice UI in the UIKit path. The not-found cleanup from the in-app alert flow is shared so a post permanently deleted on the server no longer survives as a local ghost, and it now also removes the post's Spotlight entry, which was previously leaked. The scheduled-post publish date coercion moves to the shared RemotePostUpdateParameters helper.
Two side-effecting intents that ask for confirmation before acting and appear as App Shortcuts with Siri phrases; the post picker offers only server-synced posts in a publishable status, and a failed save surfaces the server's own error message instead of a generic failure. Eligibility and the schedule intent's future-date guard run again after requestConfirmation returns, so state that changed while the dialog was pending, most notably an editor revision created in the app, is not silently published. The result dialog reflects the post's status after the save, because the server publishes immediately when the chosen date is no longer far enough in the future. The save path emits the PostCoordinator side effects and cleans up server-deleted posts, and the strings use the ios-appintents. GlotPress keys.
447a9ee to
6008842
Compare
34833bc to
75cf8f1
Compare
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.


Note
This PR will be merged after #25755