Skip to content

Search with the page's own search - #734

Merged
andiwand merged 1 commit into
mainfrom
fix/732-page-search
Oct 25, 2026
Merged

andiwand merged 1 commit into
mainfrom
fix/732-page-search

Conversation

@andiwand

@andiwand andiwand commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Fixes #732. Stacked on #733.

Core 7.6 turns on lazy layout. The browser does not lay out a line, a page, a row or a slide far from the viewport, and the find of the WebView does not search them. So find missed hits in a long document, and its count was too low.

Changes

  • FindActionModeCallback calls odr.search, odr.searchNext and odr.searchPrevious through PageView. The page searches every chunk, and folds case and diacritics (cafe finds Café).
  • PageView forwards the searchChange message of the host bridge to a SearchListener. The find bar shows current + 1/count from it.
  • Closing the find bar calls odr.resetSearch.
  • LargeTextTests counts the needles with the page search.

Testing (Pixel_6_Pro emulator, Android 12, WebView Chrome 91)

  • LargeTextTests passes (1 MB of text).
  • A text file of 30k lines: the find bar shows 1/2, and the next step selects Zébrafinch on line 29,991. On Chrome 91, the screen does not move to that hit, because a hidden chunk is 0 px tall. Core #1277 (7.6.1) fixes this. I checked that fix in this WebView: the hit is then on screen.
  • A pdf of 208 pages: karimaki finds 8 hits (1/8), and a step back to 8/8 shows the hit on page 208.
  • A deck of 20 slides and a sheet of 13 chunks: the last hit is on screen.
  • A text file of 200k lines: odr.search runs out of memory in the renderer on this emulator. Core #1277 fixes it (+218 MB and 7 s on the emulator, measured with its search.js).

@andiwand
andiwand force-pushed the fix/732-page-search branch from a0a4241 to f7f789d Compare October 25, 2026 13:05
Base automatically changed from core-7.6.0 to main October 25, 2026 13:19
Core 7.6 turns on lazy layout. The browser does not lay out a line, a
page, a row or a slide far from the viewport, and the find of the
WebView does not search them. So find missed hits in a long document,
and its count was too low.

- FindActionModeCallback calls odr.search, odr.searchNext and
  odr.searchPrevious through PageView. The page searches every chunk.
- PageView forwards the searchChange message of the host bridge to a
  SearchListener. The find bar shows its count and its current hit.
- LargeTextTests counts the needles with the page search too.

Fixes #732

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JuNa2W75khbpynkiG9iDqF
@andiwand
andiwand force-pushed the fix/732-page-search branch from f7f789d to 1ab6bb0 Compare October 25, 2026 13:22
@andiwand
andiwand merged commit 5c2d852 into main Oct 25, 2026
2 of 3 checks passed
@andiwand
andiwand deleted the fix/732-page-search branch October 25, 2026 13:24
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.

Find misses text far from the viewport with the next core release

1 participant