feat: search every view that renders text, not only a document - #692
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3c83f589f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
andiwand
force-pushed
the
feature/search-every-view
branch
from
August 16, 2026 07:19
e3c83f5 to
d7397cf
Compare
`odr.search()` and its siblings shipped with the document script, so a pdf, a plain text file, an xml source view and an archive listing had no search at all. The search code moves into its own `search.js` (plus the `mark` rules as `search.css`) that every one of those views writes. - a pdf's glyph layer is `aria-hidden` and rejected by the walker, so a hit lands in the text layer only; `color:inherit` keeps that layer invisible under the highlight and `mix-blend-mode` keeps the glyphs readable through it - the text view's line numbers are `aria-hidden` for the same reason, and its editor reads a position through a `<mark>` instead of past it - a hit inside a folded xml section opens it Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0192ViykqXESAC9VM8Pv2R3u
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0192ViykqXESAC9VM8Pv2R3u
andiwand
force-pushed
the
feature/search-every-view
branch
from
August 16, 2026 07:41
d7397cf to
0f1b1ee
Compare
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.
🤖 Generated with Claude Code
odr.search(),searchNext(),searchPrevious()andresetSearch()shippedinside
document.js, so only a document view had them — a pdf, a plain textfile, an xml source view and an archive listing had no search at all, and a
host's search bar did nothing on any of them.
The search code moves into its own
search.js, with themarkrules assearch.css, and every view that renders text writes the pair. It isformat-agnostic: it walks the page's text nodes and knows nothing about how
they got there. The font specimen, image and media views get nothing — a glyph
grid and a
<video>have no text to find.Per view
aria-hidden, which the walker now rejects bythe subtree, so a hit lands in the text layer only rather than in both. There
marktakescolor:inherit, or the browser's own mark colour would paintthe layer that is meant to stay invisible, and
mix-blend-mode:multiply, oran opaque highlight would cover the glyphs it marks. The service also serves
the two shipped resources now, which it never had to before.
aria-hiddenfor the same reason: thenumbers are ours, not the file's, and a search for
1should not find them.The editor reads a caret position through a
<mark>instead of past it, soediting an editable view still lands the change where the caret is while a
search is active.
<details>opens it.xml/AGENTS.mdsaidthe view carries no script; it now says its only one is the shared search.
Testing
html.linked_resources_are_servedcovers the pdf service too, which is theone that had to learn to answer for a shipped resource.
step, reset, the pdf highlight over both text modes, the gutter staying out
of the results, and an insert through a mark in the text editor.
document.css/document.jslose what moved out.