Repository navigation
fix(web): PDF find matches curly quotes when you type straight ones - #29802
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — PDF search now treats straight and curly quotes equivalently for page results and highlights. The change is limited to local search matching and does not modify documents or stored data. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by Merged main without rebasing at d926154. The diff against that base remains two files, 22 additions and 5 deletions. This brings main's existing file-save browser timeout fix into the branch; no PDF code changes were needed. Blacksmith Verified in the real client's PDF.js fallback with a typeset PDF: straight apostrophes and double quotes find curly text and highlight it; missing and cleared searches remove highlights. Chrome's native viewer was also exercised, then native PDF support was disabled for the fallback check. CI is blocked by an unrelated failure also present on main: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceProven in the real web client, Chromium, 1280×800, light theme, with fresh synthetic data on each commit. Opened quotes.pdf through Files; searched Straight quotes produce
Not shown:
|
…ingdotgg#29802) Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> (cherry picked from commit 8b633d9)












Problem
Typing
don'tinto PDF find does not match the typesetdon’t, so the viewer lists no matching page and highlights nothing. The PDF.js fallback's matching helpers only lowercase text, even though PDF.js also normalizes quote characters.Change
Fold curly apostrophes and double quotes in both page text and the query before page filtering and highlight matching. The fold covers the same U+2018–U+201B and U+201C–U+201F ranges as PDF.js. Each replacement has the same UTF-16 length, keeping highlight positions aligned. Other PDF.js normalizations remain outside this fix.
Scope
A focused fix for an obvious mismatch between keyboard input and typeset PDF text; no prior issue. It changes the existing matching helpers and one test case. Related #25702 added wrapped-line matching, #29759 folds quotes for in-thread find, and #27267 concerns server message search. Those do not implement this PDF quote fold.
Verification
Current revision: 0f29fef. The maintenance merge preserves the original two-file fix and main's scroll-restoration changes from #31104.
[false, false]instead of[true, false]. This was not repeated for the maintenance merge.pdfLayout.test.tspasses 19/19, including main's scroll-restoration case.CI=true vp run check:changedpasses format, lint, knip, two package typechecks, tests and React Compiler. Local and sandbox trees, changed files and normalized diff hashes match.Test/Checkfailures. That targeted test passes on the merge (one passed, 15 skipped). All eight required checks pass on this head; all 36 check runs completed with success or skipped. Macroscope approved this head, CodeRabbit reports no actionable findings, and no review threads remain unresolved.be5e4a014b430f068dc39850886d3c0e43d03100(task56137eee-ab85-492e-baf2-d7dbd6935848).The following real-client proof was captured by Maria at d926154, before this merge. It exercises the PDF.js fallback: straight apostrophes and double quotes match typeset curly text, while missing and cleared queries remove highlights. The quote-matching code is unchanged by this merge; main's adjacent scroll-restoration work does not change find. The retained screenshots and recording were fetched successfully again. No fresh client session or native-mobile verification is claimed.
Historical recording at the same revision: quote search and clearing.
Created and maintained with Claude Opus 5.5 in Claude Code through T3 Code. Maria's earlier takeover used GPT-6.1 Sol. Latest independent review and publication by GPT-6.1 Sol (high) in Codex through T3 Code.