feat(reader): add current chapter search - #45
Merged
Conversation
Better than PR 1877 (upstream)
There was a problem hiding this comment.
Pull request overview
Adds a native “Find in Chapter” search experience to the reader by wiring a search UI into ReaderScreen/ReaderAppbar, and enabling native WebView find APIs via a pnpm patch to react-native-webview@13.16.1 (Chromium-like behavior and avoiding JS/DOM-based search).
Changes:
- Introduce
useNativeChapterSearch+ReaderSearchbarand integrate them into the reader header/footer flow. - Extend
WebViewReadermessaging to surface native find results back to React Native. - Add a pnpm patch for
react-native-webview@13.16.1to expose Android-native find commands and emitfind-resultevents.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| strings/types/index.ts | Adds the new readerScreen.findInChapter string key to the type map. |
| strings/languages/en/strings.json | Adds English translation for the search placeholder/menu item. |
| strings/languages/vi_VN/strings.json | Adds Vietnamese translation for the search placeholder/menu item. |
| src/screens/reader/ReaderScreen.tsx | Integrates native chapter search state, back handling, and WebView find result plumbing. |
| src/screens/reader/hooks/useNativeChapterSearch.ts | New hook that manages search visibility/query/results and calls native WebView find APIs. |
| src/screens/reader/components/WebViewReader.tsx | Adds onFindResult prop and handles find-result messages. |
| src/screens/reader/components/ReaderSearchbar.tsx | New UI component for in-chapter search input and result navigation controls. |
| src/screens/reader/components/ReaderAppbar.tsx | Adds menu entry to open search and swaps appbar content to ReaderSearchbar when active. |
| pnpm-workspace.yaml | Registers react-native-webview@13.16.1 as a patched dependency. |
| pnpm-lock.yaml | Records the patch hash + patched dependency resolution details. |
| patches/react-native-webview@13.16.1.patch | Implements Android-native WebView find commands + TS typings and emits find-result messages. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…v/lnreader-extended into current-chapter-search
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.
Overview:
react-native-webview@13.16.1)Known issues:
Co-authored-by: OpenAI Codex codex@openai.com