Skip to content

SE UI: select first row after OCR completes - fix #11036#11041

Merged
niksedk merged 1 commit into
mainfrom
ocr-select-first-row
May 18, 2026
Merged

SE UI: select first row after OCR completes - fix #11036#11041
niksedk merged 1 commit into
mainfrom
ocr-select-first-row

Conversation

@niksedk
Copy link
Copy Markdown
Member

@niksedk niksedk commented May 18, 2026

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 MainViewModel already called SelectAndScrollToRow(0) after Subtitles.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 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

The 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

  • OCR a .sup file → on OK, the first row is selected; Ctrl+F focuses search; Replace's buttons act on the first line.
  • OCR a VobSub .idx/.sub pair → same.
  • OCR a PGS track inside an .mkv → same.
  • OCR a VobSub track inside an .mkv → same.
  • OCR a DVB track inside a .ts → same.
  • OCR images selected via "Import images for OCR" → same.
  • dotnet test tests/UI/UITests.csproj — 188/188 passing.

🤖 Generated with Claude Code

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>
@niksedk niksedk merged commit b8c8e73 into main May 18, 2026
1 of 3 checks passed
@niksedk niksedk deleted the ocr-select-first-row branch May 18, 2026 20:01
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