Consolidate the Spotlight open path - #25991
Open
crazytonyli wants to merge 3 commits into
Open
Conversation
…ifier type Identifiers arrive from the system through Spotlight activities, so the composite format cannot be assumed. Decomposition now returns nil for a malformed identifier or an unknown item type instead of indexing past the end of the components. A post identifier type parses a post's composite identifier into its site domain and post ID, and resolves the site by WP.com ID or xmlrpc URL and the cached post from it.
Route every Spotlight tap through one async open method that resolves the identifier, fetches the post from the cache first and the network second, refuses trashed posts, and reports whether anything was put on screen. The activity handler validates the identifier up front and dispatches the open, so a malformed identifier is rejected instead of misrouted. Post and page navigation share one method, and the Reader helpers return a result instead of taking failure closures.
Collaborator
Generated by 🚫 Danger |
crazytonyli
marked this pull request as ready for review
September 4, 2026 01:29
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 34374 | |
| Version | PR #25991 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 4d8ee7c | |
| Installation URL | 7taeb88e14s7g |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 34374 | |
| Version | PR #25991 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 4d8ee7c | |
| Installation URL | 26pum17qb0tkg |
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
Opening a Spotlight result currently uses separate callback-based paths for WP.com and self-hosted posts, with duplicate navigation logic for posts and pages.
This PR:
SearchIdentifierGenerator.decomposeFromUniqueIdentifier(_:)reject malformed and unknown identifiers.AbstractPost.SearchIdentifierto resolve the exact site and post for WP.com and self-hosted sites.openItem(withUniqueIdentifier:), with shared post and page navigation. It opens cached posts immediately, fetches missing posts, and rejects trashed posts.Testing instructions