App Intents: post and reader post entities and open intents#25755
Draft
crazytonyli wants to merge 5 commits into
Draft
App Intents: post and reader post entities and open intents#25755crazytonyli wants to merge 5 commits into
crazytonyli wants to merge 5 commits into
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33035 | |
| Version | PR #25755 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 6008842 | |
| Installation URL | 60qb7ndnigb3g |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33035 | |
| Version | PR #25755 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 6008842 | |
| Installation URL | 3iag86f4f9qdg |
…reader posts Entity identifiers reuse the Spotlight composite identifier format so a Spotlight item and its associated app entity always name the same post, including the xmlrpc branch for self-hosted sites; parsing lives in shared AppIntentIdentifier types so callers can validate identifiers without a Core Data lookup. Unresolvable or trashed posts resolve to nothing instead of falling back to another post, and reader post IDs survive values beyond Int32. The title search helpers back the entity queries: an empty query returns the most recent items, deduplicated for reader posts, and only posts that round-trip through the identifier resolvers are returned.
Extract the Spotlight item routing into an internal async openItem method that App Intents can call with an entity identifier, using the failable decompose so a malformed identifier no longer crashes. openItem awaits the fetch (local cache first, network fallback) and reports the real outcome instead of returning true once the identifier parsed, and it refuses to open trashed posts; the Spotlight activity path keeps its synchronous contract by validating the identifier up front and dispatching the open. The open source is threaded through the path so Spotlight analytics fire only for genuine Spotlight opens, with intent opens untracked for now. Indexing gains an entity association hook via a protocol the Jetpack app conforms to in a Jetpack-only file; the WordPress app has no conformance and indexes unchanged.
PostEntity covers posts and pages; both entities use the Spotlight composite identifier as their entity ID, the string queries search the local Core Data store, and OpenPostIntent/OpenReaderPostIntent require a signed-in account and navigate through the same routing as a Spotlight tap, reporting its real outcome. A well-formed identifier missing from the local store (Reader purges, reinstalls) resolves to a placeholder entity instead of dropping the saved shortcut, since the open path can still handle it remotely. On iOS 18 and later, newly indexed Spotlight items get the matching entity associated. Strings use the ios-appintents. GlotPress keys.
447a9ee to
6008842
Compare
12eafed to
3677cbe
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 #25754