YPE-1219 - feat(ui): add language search to BibleVersionPicker#270
Conversation
🦋 Changeset detectedLatest commit: 75ae60c The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa70deed3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
New language search is a feature addition, not a bug fix. Co-authored-by: Cursor <cursoragent@cursor.com>
…aring language search
3ae1d23 to
12b91f6
Compare
|
Sorry for this. please fix storybook tests. Copilot told me:
|
Add a distinct aria-label for the Bible version search input so tests can target it separately from the language search field when both are mounted. Co-authored-by: Cursor <cursoragent@cursor.com>
…m Spanish and French locales
|
@greptile review |
Summary
BibleVersionPickerlanguage panel that globally filters available languages by id, language name, and display namesScreen.Recording.2026-06-24.at.9.24.38.AM.mov
Test plan
pnpm --filter @youversion/platform-react-ui test -- bible-version-picker.test.tsxLanguageSearchstory — filter matches, empty state, tab hidingMade with Cursor
Greptile Summary
This PR adds a bottom-anchored search input to the
BibleVersionPickerlanguage panel that globally filters languages by id, name, and display names, with a loading spinner, a no-results empty state, and automatic clearing on back-navigation, popover close, or language selection.BibleLanguagePickerContentgains a controlledTabscomponent (preserving the selected tab across searches), aLanguageRowsub-component, and auseEffectthat resets search when theopenprop goesfalsefor RN/Expo standalone consumers.Rootcontext is extended withlanguageSearchQuery,filteredLanguages,isLoadingLanguages,closeLanguagePanel, andresetLanguageSearch;isLoadingLanguagesgates the empty state so it doesn't flash while language data is fetching.getByPlaceholderTextto role-based queries.Confidence Score: 4/5
Safe to merge after resolving the duplicate i18n keys in en.json and adding the missing translations to es.json and fr.json.
The language search logic, state management, and reset lifecycle are correctly implemented and well-tested. The locale files have two issues: en.json now has two copies of
noLanguageSearchResultsandlanguageSearchAriaLabel(the base branch had them at lines 4–5 and this PR re-adds them at lines 46–47), and es.json/fr.json are missing all three new keys despite the PR description stating those translations were included.packages/ui/src/i18n/locales/en.json (duplicate keys), packages/ui/src/i18n/locales/es.json and fr.json (missing new translation keys)
Important Files Changed
noLanguageSearchResultsandlanguageSearchAriaLabelalready existed in the base branch at lines 4–5 and are re-added at lines 46–47 by this PRnoLanguageSearchResults,languageSearchAriaLabel,versionSearchAriaLabel); PR description claims es/fr translations were addedLanguageSearchintegration story added; existing stories updated to use aria-label selectors instead of placeholder textSequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant User participant LanguagePanel as BibleLanguagePickerContent participant Root as Root (Context) participant Filter as filterLanguagesBySearch User->>LanguagePanel: Types in search input LanguagePanel->>Root: setLanguageSearchQuery(query) Root->>Filter: filterLanguagesBySearch(uniqueLanguages, query) Filter-->>Root: filteredLanguages[] Root-->>LanguagePanel: filteredLanguages via context alt isSearching alt isLoadingLanguages LanguagePanel-->>User: Show spinner else "filteredLanguages.length > 0" LanguagePanel-->>User: Show filtered list else LanguagePanel-->>User: Show empty state end else not searching LanguagePanel-->>User: Show Suggested / All tabs end User->>LanguagePanel: Selects a language LanguagePanel->>Root: setSelectedLanguageId + resetLanguageSearch LanguagePanel->>Root: "onRequestClose -> closeLanguagePanel" Root-->>User: Returns to version list, search cleared User->>LanguagePanel: Presses Back button LanguagePanel->>Root: closeLanguagePanel Note over Root: setLanguageSearchQuery + setIsLanguagesOpen(false)%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant User participant LanguagePanel as BibleLanguagePickerContent participant Root as Root (Context) participant Filter as filterLanguagesBySearch User->>LanguagePanel: Types in search input LanguagePanel->>Root: setLanguageSearchQuery(query) Root->>Filter: filterLanguagesBySearch(uniqueLanguages, query) Filter-->>Root: filteredLanguages[] Root-->>LanguagePanel: filteredLanguages via context alt isSearching alt isLoadingLanguages LanguagePanel-->>User: Show spinner else "filteredLanguages.length > 0" LanguagePanel-->>User: Show filtered list else LanguagePanel-->>User: Show empty state end else not searching LanguagePanel-->>User: Show Suggested / All tabs end User->>LanguagePanel: Selects a language LanguagePanel->>Root: setSelectedLanguageId + resetLanguageSearch LanguagePanel->>Root: "onRequestClose -> closeLanguagePanel" Root-->>User: Returns to version list, search cleared User->>LanguagePanel: Presses Back button LanguagePanel->>Root: closeLanguagePanel Note over Root: setLanguageSearchQuery + setIsLanguagesOpen(false)Comments Outside Diff (1)
packages/ui/src/components/bible-version-picker.tsx, line 824-848 (link)BibleLanguagePickerContentaccepts anopenprop, but this component never observesopen === false. Standalone SDK integrations that render this exported content directly can close and reopen the language panel with the previouslanguageSearchQuerystill applied, so the panel reopens filtered or in the empty state instead of clearing on close.Prompt To Fix With AI
Reviews (6): Last reviewed commit: "fix(ui): reset language search on BibleL..." | Re-trigger Greptile