Skip to content

Search: a result lights and goes to its own written word - #284

Merged
Joost-8 merged 2 commits into
mainfrom
claude/search-transcript-marks-ad4f23
Nov 21, 2026
Merged

Joost-8 merged 2 commits into
mainfrom
claude/search-transcript-marks-ad4f23

Conversation

@Joost-8

@Joost-8 Joost-8 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Joost's feedback page (21 Nov): "Make sure transcription also marks and puts location of words in search."

What changes

  • Tapping a transcript match in Search this notebook (the modal or the sidebar list, Search results you can step through: a sidebar, or the original list (discussion #112) #235) now marks that match's own ink as current and glides to it. Before, the list could only point at a word when the device reading and the transcript found the same number of words; otherwise every hit on the page lit alike and the view landed on the first one.
  • transcriptMatchInk (pure, src/search/hit-strokes.ts) lines each transcript match up with the reading on its own, in the order search-results.ts counts nth.
  • Each of a page's transcripts (the note's own entry, the AI's sidecar) is aligned separately. Joined, a word at the start of the second took the first one's end as context and lit nothing ("CRT", Algebra p14, the 2026-10-22 ledger case).
  • LaTeX command names (\cdot, \frac) and the AI's bracketed notes are left out of the alignment; \gcd, \log, \bmod keep the letters that were written.

Measured on the vault (read-only), tests/bench/search-marks.ts

171 pages with a transcript in 14 notebooks, Grape's learned model with page words:

before after
results that go to their own word (13,316 matches) 6.6% 93.0%
transcript words that light nothing (4,665) 6.5% 6.2%

Algebra 94.4% / 3.9%, Network 97.3% / 1.1%. Most words still dark are the AI's descriptions of the page ("Division of … by …: quotient"), not ink.

Where Grape and the transcript disagree (2de22f3, Joost: "apply tweak")

When Grape's reading holds the word exactly and the transcript's alignment points at other ink altogether, only Grape's word lights (preferReading); a result whose ink is not lit is never made current. 11 of 4,989 words change: the kept Grape ink was right 11/11 (judged on crops), the dropped transcript ink wrong in 5, a second correct place in 4, unclear in 2. Dark words stay 6.2%; steering 93.0% → 92.9%. Test from Network lecture notes p20 ("flags").

Not covered

  • Without Grape or with on-device reading off, a transcript match lights no ink (text boxes and PDF words still do). The reading already runs on demand when a result opens, but only with the model.
  • Pages with both a device entry and an AI transcript list each word twice; both now go to the same ink.
  • Recording transcripts are not a search source. Not yet tried on the iPad.

Review page: https://claude.ai/artifact/3B9qVRmMbNpvTe78uvnhEc

Gates run locally: lint, lint:review, lint:css, typecheck, test, build.

🤖 Generated with Claude Code

Joost-8 and others added 2 commits November 21, 2026 15:34
Opening a transcript match from Search this notebook (or its sidebar list)
now marks that match's own ink as current and glides there, instead of
lighting the page's hits alike and landing on the first one. Each match of
the transcript is lined up with this device's reading on its own
(transcriptMatchInk), so the list's nth result is its own place even when
the reading found more or fewer words than the transcript.

Also:
- each of a page's transcripts (the note's own entry, the AI's sidecar) is
  lined up separately: joined, a word at the start of the second took the
  end of the first as context and lit nothing ("CRT", Algebra p14);
- LaTeX command names (\cdot, \frac) and the AI's own bracketed notes are
  left out of the alignment; \gcd, \log and \bmod keep what was written.

Measured on the vault's 14 notebooks (tests/bench/search-marks.ts, Grape's
learned model): results that steer to their own spot 6.6% -> 93.0% of
13,316 matches; transcript words lighting nothing 6.5% -> 6.2%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the device reading holds the searched word exactly and the
transcript's alignment points at other ink altogether (no stroke in
common), only the reading's word lights (`preferReading`). A results-list
match whose ink is not lit no longer becomes the current mark
(`withFocusInk` picks the lit word sharing most strokes, or none).

Measured on the vault's 14 notebooks: 11 of 4,989 words change. The kept
Grape ink was right in 11 of 11 (judged by eye on crops); the dropped
transcript ink was wrong in 5, a second correct place in 4, unclear in 2.
Words lighting nothing stay at 6.2%; results that steer to their own
word 93.0% -> 92.9%. Test built from Network lecture notes p20 ("flags").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Joost-8
Joost-8 merged commit 95bc53c into main Nov 21, 2026
1 check passed
@Joost-8
Joost-8 deleted the claude/search-transcript-marks-ad4f23 branch November 21, 2026 15:00
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.

1 participant