Skip to content

feat(core): add useSearch().unified - #245

Draft
Dustin-Kelley wants to merge 6 commits into
mainfrom
cursor/unified-search-images-3e61
Draft

Dustin-Kelley wants to merge 6 commits into
mainfrom
cursor/unified-search-images-3e61

Conversation

@Dustin-Kelley

@Dustin-Kelley Dustin-Kelley commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Why

useSearch().unified should call the same unified search as the React SDK. @youversion/platform-core 2.13.0 does not export searchUnified. This package calls GET /v1/search-unified through a local copy until that function ships.

No example app changes being shipped but just proves the hook/api works
Screenshot iPhone 17 Pro 10-22-2026 at 11 58 58 AM

What changed

  • The copied function matches searchUnified from platform-sdk-react #446, including its types.
  • The request sends query, bible_id, language_ranges[], and optional user_intent and fields[]. Fields are verses or topics.
  • The result has verse and topic lists, didYouMean, and searchInsteadFor. userIntent is set when the API sends one. images is present only when the response includes a non-empty image array, and those values are passed through unchanged.

Scope

  • Covers the copied function, the result type, and tests for the URL, the query params, and the mapping.
  • Leaves out a screen that shows the results and a dependency bump.

Tradeoffs

When core publishes searchUnified, change the import in packages/core/src/search/api.ts from ./search-unified to @youversion/platform-core and delete search-unified.ts, search-unified-schema.ts, and bible-version-id.ts. The useSearch().unified method stays.

Blast Radius

useSearch() keeps the unified method. Verse search and topic search stay as they are. No screen calls unified yet. The result shape now matches the React type, so stubs include didYouMean and searchInsteadFor.

Verification

  • Core search tests passed. The full core suite passed, 43 suites, 660 tests, and coverage thresholds held.
  • The search sheet and reader-search hook tests passed, 44 tests.
  • Core and UI typecheck passed.
  • pnpm lint passed.
  • No app key was available, so this was not checked against the live API.
Open in Web Open in Cursor 

cursoragent and others added 2 commits October 19, 2026 14:42
buildUnifiedSearchCall keeps bibleId and language ranges, and it puts fields and userIntent on options only when the caller sets them. mapUnifiedSearchImages maps passage_id to passageId, turns a missing list into an empty list, and drops a hit that lacks a string id or passage_id.

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
The method takes a query, a bible id, language ranges, and optional fields and user intent. requestUnifiedSearch throws until @youversion/platform-core publishes SearchClient.searchUnified, and the wrapper reports that as a transient error. Live image results wait on that client (YPE-6190).

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

BrowserStack App Live

Item Value
Build rn-unified-se-pr245-1
Uploaded commit dfc5243
Automation run Open run
Android App Live id bs://55bcc1164d1cab90a46343e6efa7d795179ec046
iOS App Live id bs://0c56886225cec51ec2ab7536820999052fe45cec

Review-fix commits are not uploaded automatically. To upload the current PR head again, comment one of:

/app-live <sha> (both platforms), /app-live-ios <sha>, /app-live-android <sha>

Replace <sha> with the full 40-character sha of the head commit you are approving — abbreviations are refused, because a short prefix can be deliberately collided. Naming it binds the approval to that exact revision: if the head moves before the build starts, the build is refused rather than silently retargeted, and the log names the sha to re-issue. The bare form of each command is accepted when the PR author is themselves an approved collaborator on platform-sdk-reactnative-expo_automation.

Only approved collaborators on platform-sdk-reactnative-expo_automation can trigger a build.

cursoragent and others added 4 commits October 22, 2026 14:02
@youversion/platform-core 2.13.0 does not export searchUnified.
useSearch().unified calls GET /v1/search-unified and returns verses, topics, and images.
Replace requestUnifiedSearch with SearchClient.searchUnified when it ships.

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
The sample label was the word beta. It is now bravo.

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
The stand-in matches platform-sdk-react #446, including its result type.

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
The package build rejects an unused type. Export the check so the copy still compiles.

Co-authored-by: Dustin Kelley <Dustin-Kelley@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants