SE UI: select first row after OCR completes - fix #11036#11041
Merged
Conversation
After an OCR pass finished the subtitle grid had no selection, so Ctrl+F did nothing and Replace's Replace/Replace-all buttons were no-ops until the user manually clicked a row. Several of the OCR result handlers in MainViewModel already called SelectAndScrollToRow(0) after AddRange'ing the OCR'd subtitle — six of them didn't. Added it to the missing six so the post-OCR state matches the rest: - ImportImagesForOcr (image-file picker) - SubtitleOpen -> BluRaySup branch (.sup direct open) - ImportSubtitleFromTransportStream (.ts/.m2ts DVB) - LoadPgsFromMatroska (PGS track inside .mkv) - LoadVobSubFromMatroska (VobSub track inside .mkv) - ImportSubtitleFromVobSubFile (.idx/.sub VobSub pair) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
After an OCR pass finished, the subtitle grid had no row selected. As a result Ctrl+F did nothing and the Replace dialog's Replace / Replace-all buttons were no-ops until the user manually clicked a row (see #11036 repro). Several of the OCR-result handlers in
MainViewModelalready calledSelectAndScrollToRow(0)afterSubtitles.AddRange(result.OcredSubtitle); six of them didn't. Added the call to the missing six so the post-OCR state matches the rest.Sites updated
ImportImagesForOcr— image-file pickerSubtitleOpen→ BluRaySup branch —.supdirect openImportSubtitleFromTransportStream—.ts/.m2tsDVBLoadPgsFromMatroska— PGS track inside.mkvLoadVobSubFromMatroska— VobSub track inside.mkvImportSubtitleFromVobSubFile—.idx/.subVobSub pairThe seven handlers that already called
SelectAndScrollToRow(0)(DivX, Dost, WebVtt images, SpDvdSup, the second BluRaySup helper, the MP4 VobSub track, and the DVB-image Matroska helper) are unchanged.Test plan
.supfile → on OK, the first row is selected; Ctrl+F focuses search; Replace's buttons act on the first line..idx/.subpair → same..mkv→ same..mkv→ same..ts→ same.dotnet test tests/UI/UITests.csproj— 188/188 passing.🤖 Generated with Claude Code