-
Notifications
You must be signed in to change notification settings - Fork 5
feat(ui): add Bible Reader search #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f2fc973
feat(core): parse USFM references in one grammar
camrun91 c360180
feat(hooks): encode Reader search as an exclusive-lane session
camrun91 3b108f8
feat(hooks): add useBibleSearch over the session reducer
camrun91 f21507b
feat(ui): hold search verse focus until the chapter paints
camrun91 6c4ff6f
feat(ui): mount Bible Reader search from the Toolbar
camrun91 03ccaf4
chore: add YPE-5766 search UI changeset
camrun91 896a635
fix(hooks): do not suggest a query that was just submitted
camrun91 445db09
fix(ui): clear search verse focus on the reader scroller
camrun91 a9cec71
fix(ui): hide native search clear next to custom X
camrun91 b29aaf2
fix(ui): keep Search key on mobile after type=text
camrun91 291371b
fix: unblock search UI CI typecheck, story play, and locale ownership
camrun91 5bacf53
fix: restore ui en.json to origin/main for locale ownership
camrun91 4b9f29d
test(core): reproduce USFM verse range expansion hang
camrun91 9d725a5
fix(core): reject unsafe USFM verse range expansion
camrun91 9720ea4
Merge branch 'main' into cl/ype-5766_search_ui
cameronapak 39fffb5
fix: complete Bible search navigation and interaction contracts
ampagent fe1e35a
test(ui): isolate Storybook fonts and passage responses
ampagent 497d9e2
chore: merge main RTL support into Bible search
ampagent d34472a
Merge branch 'main' into cl/ype-5766_search_ui
cameronapak b868d2b
feat(ui): refine Bible search experience and filter disclosure
ampagent 6e4fa5d
Merge branch 'main' into cl/ype-5766_search_ui
cameronapak 77aa9e6
fix(ci): align release tooling manifests and search bundle budgets
ampagent 7d6fe84
fix(search): preserve runtime compatibility and allow resubmission
ampagent c6e5efc
fix(search): honor queued navigation and omit chapter-only hits
ampagent cb1ff01
chore: merge main into Bible search branch
ampagent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| "@youversion/platform-core": minor | ||
| "@youversion/platform-react-hooks": minor | ||
| "@youversion/platform-react-ui": minor | ||
| --- | ||
|
|
||
| Add Bible Reader search: one USFM grammar, an exclusive-lane `useBibleSearch` session, and a Toolbar-mounted `BibleReaderSearch` that navigates with transient verse focus. | ||
|
|
||
| Expose `BibleReaderNavigation` for host requests before reader mount, passage or full-chapter display, and optional in-place focus. Search supports grapheme-safe input, deduplicated results, verse previews, automatic pagination, and accessible dismissal and errors. | ||
|
|
||
| Align search with the reader designs in a toolbar-anchored popover. Show three trending queries and the latest three browser-local recent searches, and preserve query entry and recents when suggestions fail. Load verse previews behind one spinner, keeping earlier results visible during pagination. Result selection moves keyboard focus to the verse; dismissing search with Close or Escape restores the trigger. | ||
|
|
||
| Add an async-compatible `BibleReader.Root.onSearchPress` override for host-owned search. Match toolbar popover motion and native scrollbar themes. Correct verse mapping across poetry lines so focus dims the complete surrounding verses without adding a highlight, and retain focus until user interaction. | ||
|
|
||
| Add Old Testament, New Testament, and Both search filters using the selected Bible's book metadata. Continue through nonmatching result pages before reporting no results. Display sentence-case references above three-line serif previews with inline verse numbers. Back clears the search and filters without closing the popover; show only one X control at a time. | ||
|
|
||
| Give search rows inset hover surfaces without shifting content, align initial search and preview spinners, and reveal loaded previews with a short reduced-motion-aware transition. Reuse existing localized empty-state copy and clear stale failures when changing testament filters. | ||
|
|
||
| Start testament controls collapsed behind an accessible Filters disclosure. Preserve and indicate active filtering while collapsed, and reset to Both and collapsed on Back or clear. Expand and collapse the controls with an interruptible accordion transition, immediate keyboard toggles, and fade-only reduced motion. | ||
|
|
||
| Keep core imports usable without Intl.Segmenter, falling back to Unicode code-point limits for search on those runtimes. Preserve the generic useDebounce delay for null values while suppressing suggestions in submitted searches. Allow Enter to resubmit failed or empty searches without replaying cached pages or duplicating an in-flight request. | ||
|
|
||
| Apply queued reader destinations before fetching passage content, and wait for controlled props to accept pending navigation. Clear activated navigation when the host leaves its destination so returning does not restore stale passage selection or focus. Omit chapter-only search hits while preserving verse ranges and continuation loading. |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { parseUsfmReference } from '../usfm-reference'; | ||
|
|
||
| describe('parseUsfmReference', () => { | ||
| it.each([ | ||
| ['JHN.6', { book: 'JHN', chapter: '6', verses: [] }], | ||
| ['JHN.6.9', { book: 'JHN', chapter: '6', verses: [9] }], | ||
| ['JHN.6.9-11', { book: 'JHN', chapter: '6', verses: [9, 10, 11] }], | ||
| ['JHN.6.9-9', { book: 'JHN', chapter: '6', verses: [9] }], | ||
| ['1JN.1.1', { book: '1JN', chapter: '1', verses: [1] }], | ||
| ['ZZZ.1.1', { book: 'ZZZ', chapter: '1', verses: [1] }], | ||
| ['REV.22.20-21', { book: 'REV', chapter: '22', verses: [20, 21] }], | ||
| ] as const)('parses %s', (usfm, expected) => { | ||
| expect(parseUsfmReference(usfm)).toEqual(expected); | ||
| }); | ||
|
|
||
| it.each([ | ||
| '', | ||
| 'JHN', | ||
| 'jhn.6.9', | ||
| 'JOHN.6.9', | ||
| 'JHN.0.1', | ||
| 'JHN.1.0', | ||
| 'JHN.1.1-0', | ||
| 'JHN.1.5-3', | ||
| 'JHN.6.9-8', | ||
| 'JHN.6.9-', | ||
| 'JHN..9', | ||
| 'MAT.1.1-2-3', | ||
| 'JHN.6.9007199254740992', | ||
| 'JHN.6.1-100000', | ||
| ])('rejects %s', (usfm) => { | ||
| expect(parseUsfmReference(usfm)).toBeNull(); | ||
| }); | ||
|
|
||
| it('rejects unsafe integer verse ranges without hanging', () => { | ||
| expect(parseUsfmReference('JHN.6.9007199254740992-9007199254740993')).toBeNull(); | ||
| expect(parseUsfmReference('JHN.6.9007199254740991-9007199254740992')).toBeNull(); | ||
| }, 1000); | ||
|
|
||
| it('parses a full Psalm 119 range', () => { | ||
| const parsed = parseUsfmReference('PSA.119.1-176'); | ||
| expect(parsed?.book).toBe('PSA'); | ||
| expect(parsed?.chapter).toBe('119'); | ||
| expect(parsed?.verses[0]).toBe(1); | ||
| expect(parsed?.verses[175]).toBe(176); | ||
| expect(parsed?.verses).toHaveLength(176); | ||
| }); | ||
| }); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.