Conversation
Introduced a new ParagraphDetection user setting (default: True) to control paragraph wrapping detection. Updated App.config, Settings.settings, and Settings.Designer.cs to support this setting. Added a ToggleSwitch to GeneralSettings.xaml for user control, with event handlers in GeneralSettings.xaml.cs to persist changes. Also updated the code generation version in Settings.Designer.cs.
- Add paragraph-test-image.png and include in test output - Assert "paragraphDetection" in DiagnosticsTests bug report - Add ParagraphWrapDetection and IsWrappedParagraph_ReturnsExpected tests - Add BuildTextFromOcrLines_UsesParagraphDetectionForWinAi test - Introduce FakeOcrLinesWords and FakeOcrLine for test mocking
Added the ParagraphDetection property to SettingsInfoModel and included it in DiagnosticsUtilities. This enables diagnostics to report the state of paragraph detection in application settings.
Implemented paragraph detection in OcrUtilities for space-joining languages using Windows AI OCR. Lines are now grouped into paragraphs based on bounding box geometry, joining wrapped lines with spaces and separating paragraphs with newlines. Added GetTextFromOcrResult, IsWrappedLine, and IsWrappedParagraph helpers. Refactored BuildTextFromOcrLines to use the new paragraph-aware logic.
Replaced the previous word-joining logic with a new method, AppendWordBordersWithParagraphDetection, which sorts word borders and inserts spaces or newlines based on paragraph detection. This enhances the accuracy of reconstructed text, especially for line and paragraph breaks, using OcrUtilities.IsWrappedParagraph and related settings.
Introduce EditTextTableDocument for structured text editing, with parsing, serialization, and manipulation of tabular data (plain, CSV, TSV, XML). Add EtwEditorMode and EditTextTableDocumentJson to HistoryInfo for editor state tracking. Implement SpreadsheetUndoHistory for undo/redo of spreadsheet/table edits.
- Add IoUtilities methods for markdown/spreadsheet detection and editor mode selection - Use ReadToEndAsync in FileUtilities for async file reading - Add MarkdownDocumentUtilities for Markdown↔FlowDocument conversion, theming, and detection using Markdig
Switched from FileUtilities.SaveTextFile to SaveHistoryTextFileBlocking for saving history JSON files, delegating file writing to the new method.
Introduce new test classes for EditTextTableDocument, EditTextWindow, MarkdownDocumentUtilities, SpreadsheetUndoHistory, and file I/O/history services. Tests cover table parsing/serialization, row/column/view metric operations, markdown round-tripping, undo/redo logic, file extension mode detection, and edit window state handling. Includes WPF and theory tests for markdown and history features. Minor import changes to support new tests.
Added "Bash(pdm *)" and "Bash(pdm api *)" to the allow list in settings.local.json, broadening permitted Bash command patterns for the pdm CLI alongside the existing "Bash(bin/pdm *)". No permissions were removed.
Major refactor to support Raw Text, Spreadsheet, and Markdown modes in EditTextWindow. Added DataGrid-based spreadsheet editor with context menus, undo/redo, and row/column operations. Introduced Markdown editor with live preview and theming. Updated UI for mode switching, file open/save for new formats, and improved styles. Enhanced bottom bar, selection UI, and window lifecycle handling for all modes.
- Upgrade NuGet packages in Tests.csproj and Text-Grab.csproj, including Magick.NET, WindowsAppSDK, WPF-UI, and coverlet.collector - Add Markdig for Markdown support - Enhance app manifest to associate .csv, .tsv, .tab, .md, .markdown, and .txt files with "Open with Text Grab" verb - No functional code changes; updates focus on dependencies and file type integration
…fety, indentation, file open, save sync Agent-Logs-Url: https://github.com/TheJoeFin/Text-Grab/sessions/63f3f784-4485-4547-a38c-4d37de922366 Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
- Add new spreadsheet, translation, AI, and utility buttons to ButtonInfo.cs with appropriate handlers and icons - Update translation prompt to use local alphabet/characters - Add event handlers for new actions and editor mode toggles in EditTextWindow.xaml.cs - Refactor list initializations with C# collection expressions; add ToggleMenuItem helper - Add EditTextWindowActionCatalogTests to verify all ButtonInfo actions are valid and expected - Minor code cleanups and naming consistency improvements
Refactored EditTextWindow to unify text and spreadsheet cell transformation logic, enabling all text operations (replace, case toggle, trim, AI transforms, etc.) to work on selected spreadsheet cells. Added helper methods for cell selection and value updates. Improved word selection for spreadsheet cells. Updated command handlers and context menus for spreadsheet awareness. Enhanced CursorWordBoundaries for edge cases and added related unit tests. Minor UI tweaks to spreadsheet context menu.
Add spreadsheet and markdown editing modes
- Introduce OpenContentKind.PdfDocument and PDF extension helpers - Support PDFs in context menu and "Open With" registration - Add FileUtilities.GetVisualDocumentFilter for images/PDFs - Route PDF files to new PdfDocumentRenderer for native text and OCR - Refactor to treat images and PDFs as visual documents - No breaking changes to existing image workflows
- Introduce PdfTextLineOverlay and PdfTextCanvas for PDF text selection - Add PDF page navigation controls to GrabFrame UI - Support loading, rendering, and extracting text from PDFs - Enable selection, search, and copy of PDF text lines - Update pan/zoom logic for PDF overlays and spacebar-panning - Refactor event handlers and utilities for PDF support - Update dialogs, menus, and help text to include PDFs - Improve XAML formatting and documentation consistency
Updated GrabFrame logic to accept both image and PDF files by using IoUtilities.IsVisualDocumentFile. Added PdfPig NuGet package for PDF handling. Improved debug message to reflect support for PDFs.
Expanded FilesIoTests to cover file type and filter logic. Added PdfDocumentRendererTests for rendering, coordinate mapping, line grouping, and OCR overlap handling.
Added a new "Open File..." menu item with a document icon to the NotifyIconWindow context menu. Implemented its click handler to asynchronously open the file picker using App.OpenFileWithPickerAsync().
Introduce FileUtilities.GetOpenDocumentFilter() for unified open file dialog filters, replacing hardcoded strings and supporting images, PDFs, spreadsheets, markdown, and text files. Refactor GrabFrame to generalize and enhance spacebar-based pan/zoom logic, including new state tracking, improved event handling, and better user experience for both images and PDFs.
Refactored ZoomBorder to use PreviewMouseDown/Up/Move for panning, improving modifier key support and event robustness. Added isPanning state, IsSpacePanModifierPressed, and RequireSpaceToPan for flexible pan activation. Middle mouse now resets zoom/pan. Improved mouse capture/release and removed obsolete handlers.
Added static helpers for file picker and drag-and-drop file handling in App.xaml.cs. Renamed TryToOpenFile to TryToOpenFilePathAsync and updated usages. Ensured EditTextWindow is activated after opening a file.
Expanded FilesIoTests to cover GetOpenDocumentFilter and drag-and-drop file handling. Added tests for document type filters, dropped file path extraction, and drag-drop effects. Included necessary using directives for System.IO and System.Windows.
Added a 300ms grace period after releasing Space before disabling pan mode, making panning with Space+mouse smoother. Ensured pan/zoom is always enabled for PDFs and moved focus away from buttons to prevent accidental activation during panning. Refactored event handling and focus logic for more robust and user-friendly pan/zoom interactions. Also improved mouse capture logic and code clarity in ZoomBorder.
…replace, colspan/rowspan Agent-Logs-Url: https://github.com/TheJoeFin/Text-Grab/sessions/c5acdc4a-84dd-4662-b5d3-335886f0b193 Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TheJoeFin/Text-Grab/sessions/c5acdc4a-84dd-4662-b5d3-335886f0b193 Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Expanded file filtering to include PDFs for OCR, updated UI messages to reference "files" instead of just "images," clarified variable typing in spreadsheet undo logic, and set StaysOpenOnClick for relevant menu items to enhance user experience.
Replaced custom Copy with standard Cut/Copy/Paste commands in the spreadsheet context menu. Added command bindings and keyboard shortcut handling for these actions. Implemented TryCutSpreadsheetCellValues for cut logic with clipboard failure detection. Updated clipboard helper to return success status. Added unit tests for cut scenarios.
Enable copying selected spreadsheet cells with Ctrl+C in EditTextWindow when the cell editor is not focused. Set ClipboardCopyMode to None in the DataGrid XAML to manage copy behavior programmatically.
Added RequiresCopilotPlus property to ButtonInfo to flag actions requiring a Copilot+ PC. Marked AI-powered and translation buttons as Copilot+ dependent. Updated "Enter Markdown Mode" icon to SymbolRegular.Markdown20.
Add SymbolIcon-based icons to history menu items reflecting editor mode (Spreadsheet, Markdown, or Text). Update menu item headers to show trimmed, single-line, 40-character text snippets for better readability.
Recent history menu items in EditTextWindow now show a 40-character text snippet and a SymbolIcon representing the editor mode (table, markdown, or text). Also trims the humanized date for cleaner display. Adds references to Wpf.Ui.Controls.SymbolIcon and SymbolRegular.
Added a filter TextBox above the left ListView to enable command filtering by text. Replaced the previous layout with a Grid to accommodate the new filter. Implemented filtering logic using a CollectionView and event handler. Removed redundant "Is Icon" labels and improved XAML formatting.
Add support for detecting Windows Explorer restarts by handling the "TaskbarCreated" message. When detected, unregister and re-register the tray icon to restore it. Also, add proper cleanup of the window message hook on window close. Add P/Invoke for RegisterWindowMessage in NativeMethods.
Added "Bash(bin/pdm *)" to the allow list in settings.local.json, enabling all Bash commands that start with "bin/pdm" for broader pdm CLI support. This complements the existing "Bash(pdm api *)" entry.
Implement Settings.json sidecar for user settings persistence. Import/export a subset of settings, merge with classic settings, and ensure only allowed properties are handled. Update property change logic to persist changes. Add unit tests for sidecar import, export, and merging behaviors.
Centralize regex/search logic in new TextSearchUtilities class, updating all usages in FindAndReplaceWindow, EditTextWindow, and GrabFrame for consistency. Improve whitespace and match display handling. Update FindResult to store match length directly. Enhance StringMethods.MakeStringSingleLine for edge cases. Add comprehensive unit tests for new utilities and whitespace scenarios.
- Track wrapped cells in EditTextTableDocument; add IsCellWrapped/SetCellWrap methods - Update row/column operations to maintain wrapped cell indices - Persist wrapped cell state in serialization and view metrics - Add "Wrap Text" toggle to spreadsheet cell context menu - Bind cell TextWrapping to per-cell wrap state in UI - Add helpers and tests for wrap state and row height persistence - Refactor selection and style logic for new wrapping feature
Refactored window activation logic to use OpenOrActivateEditTextWindow, which opens EditTextWindow in spreadsheet mode when table mode is selected and no existing window is present. Added ShouldOpenNewEtwInSpreadsheetMode for decision logic and EnterSpreadsheetMode to EditTextWindow. Updated usages in FullscreenGrab and GrabFrame. Added unit tests for spreadsheet mode logic.
Introduce GrabFrameTableEditState for managing table editing state, separator placement, and normalization in the grab frame. Add GrabFrameViewScaleUtilities for handling scale coercion, window sizing, and scale stepping logic. These utilities support advanced table editing and view scaling features.
Support user-defined row/column separators in table analysis. Switch separator types to double for higher accuracy. Update word-to-cell assignment logic and add helper methods for merging/sanitizing separators. Extend WordBorderInfo with display and formatting properties.
- Enable manual table row/column separator placement in GrabFrame with new UI, overlay, and state persistence - Improve OCR paragraph detection and rendering with grouped lines and enhanced WordBorder support - Add image scaling and zoom controls for frozen images, including overlay scaling and minimum window sizing - Expand test coverage for table editing, paragraph grouping, and view scaling - Fix table line removal, state management, and overlay scaling bugs; refine UI state updates for table editing
- Pass CancellationToken to AsyncExpression.EvaluateAsync in tests for proper cancellation support - Use char overload in Assert.True for StartsWith in CalculatorTests - Add null check for QrBitmap before clipboard copy in QrCodeWindow - Suppress WFO0003 warning in Text-Grab.csproj and document DPI setting - Make GetDataObject nullable and add null check in ClipboardUtilities - Improve OcrUtilities to handle null RecognizedText by falling back to input language or "en-US" - Use await Dispatcher.InvokeAsync for scroll sync in EditTextWindow for better async UI handling
- Use Assert.IsType for AllPatterns test for explicit type checking - Allow null input for DetermineStartingLevel and update docs - Minor formatting in ExtractedPattern.cs; reformat IsSimpleWord - Use Assert.Single in Regex test for clarity - Remove unused GUID string and related tests from StringMethodTests.cs - Update copyright year in project file to 2026
Added ReconcileManagedJsonSettings to SettingsService to invalidate and reload all managed JSON settings from disk. Updated import workflow to call this method after importing settings from a ZIP file, ensuring in-memory cache is consistent with imported files.
Bump version from 4.13.2 to 4.14.0 in Package.appxmanifest and Text-Grab.csproj to reflect the new release. No other changes included.
- Migrate project, docs, and configs from .NET 9.0 to .NET 10.0 - Require Visual Studio 2022 and .NET 10.0 SDK in build instructions - Refactor App.xaml.cs startup argument parsing for clarity and robustness, add StartupArguments record, improve flag handling, and add unit tests - Update GitHub Actions to use global.json for SDK versioning - Revise README and copilot-instructions.md for accuracy, grammar, and new features - Update launch.json for .NET 10.0 output - Correct .csproj metadata and links - Minor content and formatting improvements throughout documentation
The Moq package reference was removed from Tests.csproj. No other changes were made to the project file or dependencies.
Added BUILT-WITH.md with full NuGet dependency inventory and license info. Updated README to reference it. Added Markdig BSD-2-Clause, Microsoft Visual Studio BenchmarkDotNetDiagnosers, and WindowsAppSDK license texts to satisfy redistribution and notice requirements.
Introduces a Licenses window listing all direct NuGet dependencies, their licenses, and links to license notices and project URLs. Adds ThirdPartyNoticeUtilities and ThirdPartyPackageInfo for centralized package metadata and notice handling. Updates project file to include BUILT-WITH.md and license files in output/package. Adds unit tests to validate the package catalog. Updates FirstRunWindow UI to provide access to the new Licenses window.
Complete visual and UX overhaul of the FirstRunWindow for a modern, card-based onboarding. Each mode is now presented as an interactive card with previews and live launch, and quick setup options are surfaced as styled toggles. Added new XAML styles and accent resources. Code-behind now uses a settingsInitialized flag to prevent premature event handling, refactors default mode logic, and improves type safety with the TextGrabMode enum. Enhances user guidance, discoverability, and code maintainability.
Upgraded dependencies in Text-Grab.csproj, including Magick.NET, Markdig, Microsoft.WindowsAppSDK, and WPF-UI packages. Also updated Microsoft.NET.Test.Sdk to 18.5.1 in Tests.csproj. These updates ensure compatibility and bring in the latest features and fixes.
Update NotifyIconWindow to use Loaded event, hide from taskbar, and set WindowStyle to None for a more hidden tray icon. Refactor NotifyIconUtilities to reuse existing NotifyIconWindow instances, prevent duplicates, and ensure proper cleanup and recreation. Improves tray icon reliability and non-intrusiveness.
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.
Closes #641
Closes #596
Closes #593
Closes #459
Closes #271