Optimize transcript rendering performance#5784
Merged
Merged
Conversation
Reduce transcript word rerenders during playback/search and speed up transcript search matching.
Move row revision tracking into TinyBase hooks and avoid whole transcript table subscriptions in session transcript state.
✅ Deploy Preview for old-char canceled.
|
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.
Summary
Note
Medium Risk
Touches transcript visibility, search highlighting, and store subscription patterns; behavior is covered by new tests but incorrect memo or listener wiring could cause stale UI or missed updates.
Overview
Reduces transcript UI churn during audio playback and in-transcript search, and narrows TinyBase reactivity so components don’t resubscribe to whole tables.
Transcript search match resolution in
getTranscriptMatchesnow advances a single span cursor instead of scanning every span per hit. New unit tests cover match order, multi-word phrases, and whole-word mode.useMainStoreRowsRevision/useStoreRowsRevisionlive in~/store/tinybase/hooksand replaceuseTable("transcripts")in transcript state,useHasTranscript, and render-request hooks—updates depend on per-row listeners for the relevant transcript (and related) row IDs.Search highlighting moves up the tree:
SegmentsListbuildsTranscriptSearchRenderStatefrom search context and passes highlights and active match into memoizedWordSpanchildren (no per-worduseSearch).SegmentRenderer’s custommemocompare usesgetActiveLineIndexso playback ticks only rerender when the highlighted line changes, and skips rerenders when the active search match moves between segments that don’t contain either match id.Reviewed by Cursor Bugbot for commit 41debd6. Bugbot is set up for automated code reviews on this repo. Configure here.