Skip to content

feat(reader): add current chapter search - #45

Merged
aiko-chan-ai merged 7 commits into
masterfrom
current-chapter-search
Jul 12, 2026
Merged

feat(reader): add current chapter search#45
aiko-chan-ai merged 7 commits into
masterfrom
current-chapter-search

Conversation

@aiko-chan-ai

Copy link
Copy Markdown

Overview:

  • Added a "Find in Chapter" menu to search within the current chapter
  • Search logic is equivalent to Chromium's implementation (patched react-native-webview@13.16.1)
  • Better performance compared to implementing search using JavaScript
  • Does not affect the DOM tree compared to JavaScript-based search implementations
  • Can it be considered better than upstream PR 1877?

Known issues:

  • Result navigation does not work in paginated reading mode
  • The reader UI is rendered incorrectly when searching (with the virtual keyboard open)

Co-authored-by: OpenAI Codex codex@openai.com

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 + ReaderSearchbar and integrate them into the reader header/footer flow.
  • Extend WebViewReader messaging to surface native find results back to React Native.
  • Add a pnpm patch for react-native-webview@13.16.1 to expose Android-native find commands and emit find-result events.

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.

Comment thread src/screens/reader/components/ReaderAppbar.tsx
aiko-chan-ai and others added 3 commits July 12, 2026 22:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@aiko-chan-ai
aiko-chan-ai merged commit f6fe485 into master Jul 12, 2026
2 checks passed
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