Fix and improve OCR spell check prompt button behavior#11390
Merged
niksedk merged 3 commits intoJun 4, 2026
Conversation
added 3 commits
June 4, 2026 15:25
…extbox content Skip all is meant to tell the engine to never flag this word as unknown again. It was passing result.Word — the current textbox content — which could be empty or edited by the user. The original flagged word is available as unknownWord.Word.FixedWord in scope at all three call sites and is the correct value to pass regardless of textbox state.
The button was a no-op stub. Opens a Google search for the word in the default browser using Avalonia's Launcher API, matching the existing implementation in SpellCheckViewModel.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the OCR “unknown word” prompt dialog by making button states reflect whether an action is valid, reducing UI clutter in whole-text edit mode, and fixing a correctness issue where “Skip all” could skip the wrong word.
Changes:
- Implement command-level
CanExecutelogic for Change/Change all (and other actions) based on whether the word/whole text differs from the original and is non-empty. - Update the prompt window UI to hide irrelevant buttons in “edit whole text” mode and auto-size rows so hidden rows collapse cleanly; toggle label now reflects current mode.
- Fix OCR engine integration so “Skip all” always skips the original flagged word (not the edited textbox content); implement Google search via Avalonia Launcher.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ui/Features/Ocr/PromptUnknownWordWindow.cs | Updates UI bindings: toggle label binding, hides buttons in whole-text mode, and uses auto rows so layout collapses cleanly. |
| src/ui/Features/Ocr/PromptUnknownWordViewModel.cs | Adds original-value tracking + CanExecute gating for commands; fixes SuggestionUseAlways empty-guard; implements Google search launch. |
| src/ui/Features/Ocr/OcrViewModel.cs | Fixes “Skip all” to use the original unknown word value when calling the OCR fix engine. |
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
Several correctness and usability improvements to the OCR spell check prompt (the dialog shown during OCR when an unknown word is encountered).
Button enable/disable logic
Edit whole text mode
Bug fixes
SuggestionUseAlways()was missing the null/empty guard thatSuggestionUse()already had; if triggered with no suggestion selected it would submit an empty Change all.Google it
Spell.check.mov