Skip to content

Fixes and protocol#649

Merged
TheJoeFin merged 18 commits into
devfrom
fixes-and-protocol
Jun 20, 2026
Merged

Fixes and protocol#649
TheJoeFin merged 18 commits into
devfrom
fixes-and-protocol

Conversation

@TheJoeFin

Copy link
Copy Markdown
Owner
  • Improve memory usage of the Grab Frame
  • Auto detect when content below Grab Frame changes (fixes Grab Frame doesn't auto update #648)
  • Add Protocol handler for compatability with the Text Grab Browser Extension

Remove static ContextMenu from XAML and create it on demand in code-behind. This reduces memory usage by avoiding duplicate menu trees for each WordBorder and centralizes menu logic. ContextMenu items are now initialized only when first opened.
- Add tests for "X ft Y in" formatting and decimal edge cases
- Format length conversions to feet as "X ft Y in" in CalculationService
- Fix ParseNumericString to distinguish decimals from thousands separators
- Use source-generated regex for numeric token extraction
- Minor code style and clarity improvements
Added UndoRedoTests to verify stack capacity and transaction grouping. Made AddOperationToUndoStack and UndoOperationCount internal for testing. Refactored transaction counting and trimming logic to handle new transactions and stack limits more accurately. Improved comments and adjusted Undo/EndTransaction behavior for correctness.
Introduce ImageChangeDetector using Magick.NET to detect stable changes between screen captures by comparing downscaled thumbnails. Add comprehensive unit tests to verify baseline establishment, stable change detection, transient change filtering, and reset behavior.
Implements ProtocolUtilities to parse, recognize, register, and unregister text-grab:// protocol URIs for integration with companion apps and browser extensions. Adds tests for URI recognition, command/parameter parsing, normalization, and error handling to ensure robust protocol support.
Added EditTextWindow.ShouldEnableSpellCheck to control spell check based on text length and long token count, with tests for edge cases. Spell check now updates dynamically as text changes. Optimized ReplaceReservedChars and ToggleCase CanExecute handlers to avoid full text scans. Improved spreadsheet undo/redo state invalidation and table parsing performance. Introduced cached clipboard OCR state to speed up CanExecute checks, with cache updates on clipboard changes and window load. Added PasteClipboardIntoSpreadsheet for protocol-based pasting.
Introduce automatic screen content change detection in GrabFrame using a timer and image differencing to trigger OCR refreshes on live changes. Prevent unnecessary OCR by rebasing the change detector after overlay repaints. Improve undo/redo logic to avoid memory leaks from timer-driven redraws. Add explicit disposal of image sources and automation peers to ensure proper cleanup. Update image manipulation actions to release previous resources. Add helpers for automation peer cache resets and popup detection to enhance accessibility and stability.
Enables text-grab:// protocol activation for direct feature launches (e.g., paste-spreadsheet, edit-text, grab-frame, grab-text, fullscreen, quick-lookup, settings) from browser extension or links. Registers protocol in manifest and at runtime. Adds test for browser extension table HTML parsing to ensure compatibility. Prioritizes protocol handling at startup and supports protocol-based OCR to clipboard.
@TheJoeFin TheJoeFin added enhancement New feature or request Grab Frame Relating to the Grab Frame experience General Processing Relating to the processing of images to some type of text output labels Jun 14, 2026
TheJoeFin added 10 commits June 15, 2026 21:09
Introduces a new user-scoped setting, EtwSpellCheckMode, with a default value of "Auto" in App.config, Settings.settings, and Settings.Designer.cs. This enables configurable spell check mode for the application.
Introduce SpellCheckMode (Auto, AlwaysOn, Off) for Edit Text Window, with new settings UI and menu options. Refactor spell check logic to respect selected mode and update dynamically. Sync mode changes across settings and open windows. Extend diagnostics and add unit tests for all spell check scenarios.
Do not show the loading indicator window when UI Automation is the selected language, as it would interfere with screen reading. Updated grabIndicator handling to be nullable and use null-conditional calls for ShowSuccess and Close.
Introduce IsTextOnly property to GrabTemplate for detecting templates without capture regions. Add ApplyTextOnlyTemplate method to GrabTemplateExecutor for applying such templates to existing text without OCR. Include comprehensive unit tests for these behaviors.
Edit menu now includes "Apply Grab Template" and "Apply Grab Template Per Line" submenus, which are populated at runtime with valid text-only templates. Selecting a template applies it to the selected or all text, or to each non-blank line, respectively. Template usage is tracked via GrabTemplateManager.
Added "Apply Template" to Find and Replace for batch applying text-only templates to matches. Enhanced Regex Editor with a collapsible quick reference of regex tokens, allowing one-click insertion. Made Regex Editor scrollable for better usability. Added "New Regex..." button to TextOnlyTemplateDialog to launch Regex Manager, with auto-refresh of pattern picker on dialog activation.
Add ProtocolUtilities.TryGetSafeProtocolFilePath to validate protocol file paths, restricting access to local, non-network, allowed-root image/PDF files. Update protocol handlers to use this method, preventing unsafe file access. Add unit tests for path validation logic. Remove unused RemoveProtocolRegistration method.
Updated NCalcAsync to 6.2.0 in both main and test projects. Updated Markdig to 1.3.2 in Text-Grab.csproj for improved compatibility and features.
@TheJoeFin TheJoeFin merged commit 3f80f00 into dev Jun 20, 2026
1 check passed
@TheJoeFin TheJoeFin deleted the fixes-and-protocol branch June 20, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request General Processing Relating to the processing of images to some type of text output Grab Frame Relating to the Grab Frame experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant