Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
eaa3128
feat: add Text-to-Speech post-grab action
kmcnaught May 21, 2026
f1a8a69
feat: speak captured text instead of showing notification
kmcnaught May 22, 2026
4ee634b
feat: add Voice Output settings page with voice selection
kmcnaught May 22, 2026
1d68394
Add WindowsAiDescriptionEnabled user setting
TheJoeFin May 23, 2026
6aefcbf
Add Windows AI Description language and OCR line generators
TheJoeFin May 23, 2026
924268b
Add Windows AI image description as OCR pseudo-language
TheJoeFin May 23, 2026
4b6bf06
Add unit tests for Windows AI Description language
TheJoeFin May 23, 2026
25a49cb
Add Windows AI Description language option and toggle
TheJoeFin May 23, 2026
76b125a
Add Recognizers engine (Microsoft Recognizers-Text)
TheJoeFin Jun 30, 2026
367fa9d
Add unified PatternItem/PatternExecutor backbone
TheJoeFin Jun 30, 2026
9de3bc8
Unify patterns and recognizers in the UI as one "Patterns" concept
TheJoeFin Jun 30, 2026
eb323fa
Add shared SearchBar control with regex split-button and pattern picker
TheJoeFin Jul 1, 2026
4b0d7f3
Use shared SearchBar in Quick Simple Lookup, Find & Replace, and Grab…
TheJoeFin Jul 1, 2026
5654036
Add Ctrl+Shift+F shortcut to open Find & Replace from the editor
TheJoeFin Jul 1, 2026
8e27cc6
Refine default regex list to avoid recognizer overlap
TheJoeFin Jul 1, 2026
935c798
Merge pull request #651 from TheJoeFin/Recognizers
TheJoeFin Jul 1, 2026
b106034
Add WindowsAiDescriptionEnabled user setting
TheJoeFin May 23, 2026
712745d
Add Windows AI Description language and OCR line generators
TheJoeFin May 23, 2026
bda213e
Add Windows AI image description as OCR pseudo-language
TheJoeFin May 23, 2026
93f11ec
Add unit tests for Windows AI Description language
TheJoeFin May 23, 2026
e1d1735
Add Windows AI Description language option and toggle
TheJoeFin May 23, 2026
836e92a
Merge branch 'WinAI-description' of https://github.com/TheJoeFin/Text…
TheJoeFin Jul 1, 2026
672d302
Add cancellation and Bitmap support to WinAI description
TheJoeFin Jul 1, 2026
6148d55
Add interactive overlay for AI description grabs
TheJoeFin Jul 1, 2026
d94f30e
Style post-grab choice bar to match app theme and animate it in
TheJoeFin Jul 1, 2026
f82cee7
Improve AI description UX and null handling
TheJoeFin Jul 1, 2026
1f9211d
Await overlay close before post-grab insert actions
TheJoeFin Jul 1, 2026
888781a
Add Edit Text Window toggle to grab overlay UI
TheJoeFin Jul 1, 2026
5a2aa8a
Merge pull request #653 from TheJoeFin/WinAI-description
TheJoeFin Jul 1, 2026
b4307ab
Merge branch 'main' into tts
TheJoeFin Jul 1, 2026
15d33f3
Merge pull request #647 from kmcnaught/tts
TheJoeFin Jul 1, 2026
a1c3ff6
Update TTS settings and remove SpeakInsteadOfToast
TheJoeFin Jul 2, 2026
65a925c
Add speaking rate control to Voice Output Settings
TheJoeFin Jul 2, 2026
5f02282
Remove TTS and SpeakInsteadOfToast features
TheJoeFin Jul 2, 2026
0021aac
Add GrabFrameSpeakEnabled user setting (default: False)
TheJoeFin Jul 2, 2026
a39c6b3
Thread-safe TTS queue, BusyChanged event, resource fixes
TheJoeFin Jul 2, 2026
4e91467
Add GrabFrame TTS toggle and speaking progress overlay
TheJoeFin Jul 2, 2026
be55a64
Add setting to announce slow processing via TTS
TheJoeFin Jul 4, 2026
f65e60f
Merge pull request #654 from TheJoeFin/text-to-speech
TheJoeFin Jul 4, 2026
75dced6
Add Bash(gh issue view *) to allowed commands list
TheJoeFin Jul 4, 2026
b91fc26
Copy spreadsheet selection as Markdown table
TheJoeFin Jul 4, 2026
7f2845c
Add customizable bottom bar tool visibility to Grab Frame
TheJoeFin Jul 4, 2026
3d3af04
Freeze frame on word edit; diff-based unfreeze logic
TheJoeFin Jul 4, 2026
fd7b8a7
Add Grab Frame file (.tggf) save/load support
TheJoeFin Jul 4, 2026
d0f1dc9
Add configurable Grab Frame border style and color
TheJoeFin Jul 4, 2026
7751960
Filter furigana from Japanese OCR output
TheJoeFin Jul 5, 2026
6f015fa
Add thorough tests for CJK furigana filtering
TheJoeFin Jul 5, 2026
d1e0aa9
Add RemoveFurigana setting and UI for CJK OCR cleanup
TheJoeFin Jul 5, 2026
eb4bae7
Add Japanese OCR tests, furigana removal, and line order
TheJoeFin Jul 5, 2026
865556e
Merge pull request #570 from TheJoeFin/better-cjk
TheJoeFin Jul 5, 2026
c1f88ec
Add HDR capture correction and borderless settings
TheJoeFin Jul 6, 2026
bc4908e
Add HDR-aware screen capture and tone-mapping utilities
TheJoeFin Jul 6, 2026
dfcbf95
Add HDR-aware screen capture and tone mapping tests
TheJoeFin Jul 6, 2026
7e4b9a1
Add HDR capture correction toggle and permission check
TheJoeFin Jul 6, 2026
dc367d5
Allow Bash(git log *) in allowed commands list
TheJoeFin Jul 6, 2026
342660a
Allow gh pr view and gh pr diff in Bash allowlist
TheJoeFin Jul 6, 2026
6a67612
Refactor HDR capture: shared D3D11 device, faster timeout
TheJoeFin Jul 6, 2026
da93dd6
Merge pull request #660 from TheJoeFin/hdr-capture-wgc
TheJoeFin Jul 7, 2026
91b50e6
Add SettingsCard/Expander controls and refactor ShortcutControl
TheJoeFin Jul 7, 2026
d8455be
Add SettingsStyles.xaml for settings page text styles
TheJoeFin Jul 7, 2026
9303756
Modernize settings UI with SettingsCard/Expander controls
TheJoeFin Jul 7, 2026
8b07148
Prevent overlay from appearing in OCR screenshots
TheJoeFin Jul 9, 2026
b76eaed
Add git fetch to allowed Bash commands in settings
TheJoeFin Jul 9, 2026
86c3548
Track spreadsheet cell selection for Find/Replace
TheJoeFin Jul 9, 2026
c128b0b
Add flexible column split utility and comprehensive tests
TheJoeFin Jul 9, 2026
00458f3
Add SplitColumnWindow for advanced cell splitting
TheJoeFin Jul 9, 2026
7c7a5ea
Add spreadsheet cell split-to-columns feature
TheJoeFin Jul 9, 2026
f8d521f
Update NuGet packages and add NuGet.CommandLine refs
TheJoeFin Jul 9, 2026
eb9bb08
Bump app version to 4.15.0
TheJoeFin Jul 10, 2026
58c3c0a
Contain NuGet.CommandLine transitive dependency
TheJoeFin Jul 10, 2026
318946c
Stop SaveGrabFrameFileAsync from mutating the caller's HistoryInfo
TheJoeFin Jul 10, 2026
d6f086e
Decouple FormatResolvedValue from the recognizer library's collection…
TheJoeFin Jul 10, 2026
2036e03
Drop version column from BUILT-WITH, defer to the project files
TheJoeFin Jul 10, 2026
4b1bc0d
Add HiddenSmartPatternIds user setting
TheJoeFin Jul 12, 2026
0643fb0
Expand permissions for ProDuckMap data and CLI access
TheJoeFin Jul 12, 2026
50b77bc
Add test for file-backed hidden smart pattern IDs
TheJoeFin Jul 12, 2026
f4a763c
Rename Regex Manager to Patterns Manager; add pattern hiding
TheJoeFin Jul 12, 2026
c21b64e
Add HiddenSmartPatternIds managed setting support
TheJoeFin Jul 12, 2026
1ff3e4d
Rename Regex Manager to Patterns Manager, unify pattern list
TheJoeFin Jul 12, 2026
687182e
Add SymbolDropDownButton style and XAML formatting tweaks
TheJoeFin Jul 13, 2026
1defbb2
Refactor regex icon theming and chevron animation
TheJoeFin Jul 13, 2026
c532e96
Enhance Post Grab Actions button feedback and Freeze tool logic
TheJoeFin Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,21 @@
"PowerShell(dotnet build *)",
"PowerShell(dotnet test *)",
"PowerShell(Get-ChildItem *)",
"WebFetch(domain:raw.githubusercontent.com)"
"WebFetch(domain:raw.githubusercontent.com)",
"Bash(gh issue view *)",
"Bash(git log *)",
"Bash(gh pr view *)",
"Bash(gh pr diff *)",
"Bash(git fetch *)",
"WebFetch(domain:app.produckmap.com)",
"Read(//c/Users/josep/.claude/skills/pdm/**)",
"Read(//c/Users/josep/.claude/skills/pdm/bin/**)",
"PowerShell(& \"C:\\\\Users\\\\josep\\\\.claude\\\\skills\\\\pdm\\\\bin\\\\pdm.ps1\" *)",
"PowerShell(& \"C:\\\\Users\\\\josep\\\\.claude\\\\skills\\\\pdm\\\\bin\\\\pdm.ps1\" auth)",
"Bash(\"/c/Users/josep/.claude/skills/pdm/bin/pdm\" story-map *)",
"Bash(\"/c/Users/josep/.claude/skills/pdm/bin/pdm\" type *)",
"Bash(\"/c/Users/josep/.claude/skills/pdm/bin/pdm\" ui-element *)",
"Bash(\"/c/Users/josep/.claude/skills/pdm/bin/pdm\" api *)"
],
"deny": []
}
Expand Down
66 changes: 38 additions & 28 deletions BUILT-WITH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,48 @@

Text Grab depends on the direct NuGet packages listed below.

- **Versions** are intentionally omitted here. The project files are the single source of truth — see [`Text-Grab/Text-Grab.csproj`](Text-Grab/Text-Grab.csproj) and [`Tests/Tests.csproj`](Tests/Tests.csproj) for the exact version of each package.
- **Scope** identifies whether a package is used by the app, the tests, or both.
- **Notice** links to a bundled local notice file when one ships with Text Grab, or to the upstream project license file otherwise.
- **Project** links to the upstream project home or repository.
- Test-only packages are documented for completeness, but they are not part of normal end-user app builds.

The same package inventory is also available from the app's **About → Licenses** flow.

| Package | Version | Scope | License | Notice | Project | Notes |
| --- | --- | --- | --- | --- | --- | --- |
| CliWrap | 3.10.1 | App | MIT | [Open](https://github.com/Tyrrrz/CliWrap/blob/master/License.txt) | [Project](https://github.com/Tyrrrz/CliWrap) | — |
| Dapplo.Windows.User32 | 2.0.89 | App | MIT | [Open](https://github.com/dapplo/Dapplo.Windows/blob/master/LICENSE) | [Project](https://github.com/dapplo/Dapplo.Windows) | — |
| Humanizer.Core | 3.0.10 | App | MIT | [Open](https://github.com/Humanizr/Humanizer/blob/main/license.txt) | [Project](https://github.com/Humanizr/Humanizer) | — |
| Magick.NET-Q16-AnyCPU | 14.12.0 | App | Apache-2.0 | [Open](https://github.com/dlemstra/Magick.NET/blob/main/License.txt) | [Project](https://github.com/dlemstra/Magick.NET) | — |
| Magick.NET.SystemDrawing | 8.0.20 | App | Apache-2.0 | [Open](https://github.com/dlemstra/Magick.NET/blob/main/License.txt) | [Project](https://github.com/dlemstra/Magick.NET) | — |
| Magick.NET.SystemWindowsMedia | 8.0.20 | App | Apache-2.0 | [Open](https://github.com/dlemstra/Magick.NET/blob/main/License.txt) | [Project](https://github.com/dlemstra/Magick.NET) | — |
| Markdig | 1.1.3 | App | BSD-2-Clause | [Open](ThirdPartyNotices/licenses/Markdig-license.txt) | [Project](https://github.com/xoofx/markdig) | Bundled to satisfy BSD-2-Clause binary redistribution notice requirements. |
| Microsoft.Toolkit.Uwp.Notifications | 7.1.3 | App | MIT | [Open](https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/main/License.md) | [Project](https://github.com/CommunityToolkit/WindowsCommunityToolkit) | — |
| Microsoft.WindowsAppSDK.AI | 1.8.70 | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| Microsoft.WindowsAppSDK.Foundation | 1.8.260415000 | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| Microsoft.WindowsAppSDK.Runtime | 1.8.260416003 | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| Microsoft.WindowsAppSDK.WinUI | 1.8.260415005 | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| NCalcAsync | 5.12.0 | App, Tests | MIT | [Open](https://github.com/ncalc/ncalc/blob/master/LICENSE) | [Project](https://github.com/ncalc/ncalc) | Shared by the application and the test project. |
| PdfPig | 0.1.14 | App | Apache-2.0 | [Open](https://github.com/UglyToad/PdfPig/blob/master/LICENSE) | [Project](https://github.com/UglyToad/PdfPig) | — |
| UnitsNet | 5.75.0 | App | MIT-0 | [Open](https://github.com/angularsen/UnitsNet/blob/master/LICENSE) | [Project](https://github.com/angularsen/UnitsNet) | — |
| WPF-UI | 4.2.1 | App | MIT | [Open](https://github.com/lepoco/wpfui/blob/main/LICENSE) | [Project](https://github.com/lepoco/wpfui) | — |
| WPF-UI.Tray | 4.2.1 | App | MIT | [Open](https://github.com/lepoco/wpfui/blob/main/LICENSE) | [Project](https://github.com/lepoco/wpfui) | — |
| ZXing.Net | 0.16.11 | App | Apache-2.0 | [Open](https://github.com/micjahn/ZXing.Net/blob/master/COPYING) | [Project](https://github.com/micjahn/ZXing.Net) | — |
| ZXing.Net.Bindings.Windows.Compatibility | 0.16.14 | App | Apache-2.0 | [Open](https://github.com/micjahn/ZXing.Net/blob/master/COPYING) | [Project](https://github.com/micjahn/ZXing.Net) | — |
| BenchmarkDotNet | 0.15.8 | Tests | MIT | [Open](https://github.com/dotnet/BenchmarkDotNet/blob/master/LICENSE.md) | [Project](https://github.com/dotnet/BenchmarkDotNet) | Test-only dependency. |
| coverlet.collector | 10.0.0 | Tests | MIT | [Open](https://github.com/coverlet-coverage/coverlet/blob/master/LICENSE) | [Project](https://github.com/coverlet-coverage/coverlet) | Test-only dependency. |
| Microsoft.NET.Test.Sdk | 18.4.0 | Tests | MIT | [Open](https://github.com/microsoft/vstest/blob/main/LICENSE) | [Project](https://github.com/microsoft/vstest) | Test-only dependency. |
| Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers | 18.7.37220.1 | Tests | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers-LICENSE.md) | [Project](https://learn.microsoft.com/visualstudio/profiling/) | Visual Studio benchmarking tooling; test-only dependency. |
| xunit.runner.visualstudio | 3.1.5 | Tests | Apache-2.0 | [Open](https://github.com/xunit/visualstudio.xunit/blob/main/License.txt) | [Project](https://github.com/xunit/visualstudio.xunit) | Test-only dependency. |
| Xunit.StaFact | 3.0.13 | Tests | MS-PL | [Open](https://github.com/AArnott/Xunit.StaFact/blob/main/LICENSE) | [Project](https://github.com/AArnott/Xunit.StaFact) | Test-only dependency. |
| xunit.v3 | 3.2.2 | Tests | Apache-2.0 | [Open](https://github.com/xunit/xunit/blob/main/LICENSE) | [Project](https://github.com/xunit/xunit) | Test-only dependency. |
| Package | Scope | License | Notice | Project | Notes |
| --- | --- | --- | --- | --- | --- |
| CliWrap | App | MIT | [Open](https://github.com/Tyrrrz/CliWrap/blob/master/License.txt) | [Project](https://github.com/Tyrrrz/CliWrap) | — |
| Dapplo.Windows.User32 | App | MIT | [Open](https://github.com/dapplo/Dapplo.Windows/blob/master/LICENSE) | [Project](https://github.com/dapplo/Dapplo.Windows) | — |
| Humanizer.Core | App | MIT | [Open](https://github.com/Humanizr/Humanizer/blob/main/license.txt) | [Project](https://github.com/Humanizr/Humanizer) | — |
| Magick.NET-Q16-AnyCPU | App | Apache-2.0 | [Open](https://github.com/dlemstra/Magick.NET/blob/main/License.txt) | [Project](https://github.com/dlemstra/Magick.NET) | — |
| Magick.NET.SystemDrawing | App | Apache-2.0 | [Open](https://github.com/dlemstra/Magick.NET/blob/main/License.txt) | [Project](https://github.com/dlemstra/Magick.NET) | — |
| Magick.NET.SystemWindowsMedia | App | Apache-2.0 | [Open](https://github.com/dlemstra/Magick.NET/blob/main/License.txt) | [Project](https://github.com/dlemstra/Magick.NET) | — |
| Markdig | App | BSD-2-Clause | [Open](ThirdPartyNotices/licenses/Markdig-license.txt) | [Project](https://github.com/xoofx/markdig) | Bundled to satisfy BSD-2-Clause binary redistribution notice requirements. |
| Microsoft.Recognizers.Text.Choice | App | MIT | [Open](https://github.com/microsoft/Recognizers-Text/blob/master/LICENSE.md) | [Project](https://github.com/microsoft/Recognizers-Text) | Culture-aware entity recognizers. |
| Microsoft.Recognizers.Text.DateTime | App | MIT | [Open](https://github.com/microsoft/Recognizers-Text/blob/master/LICENSE.md) | [Project](https://github.com/microsoft/Recognizers-Text) | Culture-aware entity recognizers. |
| Microsoft.Recognizers.Text.Number | App | MIT | [Open](https://github.com/microsoft/Recognizers-Text/blob/master/LICENSE.md) | [Project](https://github.com/microsoft/Recognizers-Text) | Culture-aware entity recognizers. |
| Microsoft.Recognizers.Text.NumberWithUnit | App | MIT | [Open](https://github.com/microsoft/Recognizers-Text/blob/master/LICENSE.md) | [Project](https://github.com/microsoft/Recognizers-Text) | Culture-aware entity recognizers. |
| Microsoft.Recognizers.Text.Sequence | App | MIT | [Open](https://github.com/microsoft/Recognizers-Text/blob/master/LICENSE.md) | [Project](https://github.com/microsoft/Recognizers-Text) | Culture-aware entity recognizers. |
| Microsoft.Toolkit.Uwp.Notifications | App | MIT | [Open](https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/main/License.md) | [Project](https://github.com/CommunityToolkit/WindowsCommunityToolkit) | — |
| Microsoft.WindowsAppSDK.AI | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| Microsoft.WindowsAppSDK.Foundation | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| Microsoft.WindowsAppSDK.Runtime | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| Microsoft.WindowsAppSDK.WinUI | App | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.WindowsAppSDK-license.txt) | [Project](https://github.com/microsoft/windowsappsdk) | Package ships Microsoft Windows App SDK license terms. |
| NCalcAsync | App, Tests | MIT | [Open](https://github.com/ncalc/ncalc/blob/master/LICENSE) | [Project](https://github.com/ncalc/ncalc) | Shared by the application and the test project. |
| PdfPig | App | Apache-2.0 | [Open](https://github.com/UglyToad/PdfPig/blob/master/LICENSE) | [Project](https://github.com/UglyToad/PdfPig) | — |
| UnitsNet | App | MIT-0 | [Open](https://github.com/angularsen/UnitsNet/blob/master/LICENSE) | [Project](https://github.com/angularsen/UnitsNet) | — |
| Vortice.Direct3D11 | App | MIT | [Open](https://github.com/amerkoleci/Vortice.Windows/blob/main/LICENSE) | [Project](https://github.com/amerkoleci/Vortice.Windows) | Direct3D 11 interop for HDR-aware screen capture. |
| Vortice.DXGI | App | MIT | [Open](https://github.com/amerkoleci/Vortice.Windows/blob/main/LICENSE) | [Project](https://github.com/amerkoleci/Vortice.Windows) | DXGI interop for HDR-aware screen capture. |
| WPF-UI | App | MIT | [Open](https://github.com/lepoco/wpfui/blob/main/LICENSE) | [Project](https://github.com/lepoco/wpfui) | — |
| WPF-UI.Tray | App | MIT | [Open](https://github.com/lepoco/wpfui/blob/main/LICENSE) | [Project](https://github.com/lepoco/wpfui) | — |
| ZXing.Net | App | Apache-2.0 | [Open](https://github.com/micjahn/ZXing.Net/blob/master/COPYING) | [Project](https://github.com/micjahn/ZXing.Net) | — |
| ZXing.Net.Bindings.Windows.Compatibility | App | Apache-2.0 | [Open](https://github.com/micjahn/ZXing.Net/blob/master/COPYING) | [Project](https://github.com/micjahn/ZXing.Net) | — |
| BenchmarkDotNet | Tests | MIT | [Open](https://github.com/dotnet/BenchmarkDotNet/blob/master/LICENSE.md) | [Project](https://github.com/dotnet/BenchmarkDotNet) | Test-only dependency. |
| coverlet.collector | Tests | MIT | [Open](https://github.com/coverlet-coverage/coverlet/blob/master/LICENSE) | [Project](https://github.com/coverlet-coverage/coverlet) | Test-only dependency. |
| Microsoft.NET.Test.Sdk | Tests | MIT | [Open](https://github.com/microsoft/vstest/blob/main/LICENSE) | [Project](https://github.com/microsoft/vstest) | Test-only dependency. |
| Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers | Tests | Microsoft license terms | [Open](ThirdPartyNotices/licenses/Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers-LICENSE.md) | [Project](https://learn.microsoft.com/visualstudio/profiling/) | Visual Studio benchmarking tooling; test-only dependency. |
| xunit.runner.visualstudio | Tests | Apache-2.0 | [Open](https://github.com/xunit/visualstudio.xunit/blob/main/License.txt) | [Project](https://github.com/xunit/visualstudio.xunit) | Test-only dependency. |
| Xunit.StaFact | Tests | MS-PL | [Open](https://github.com/AArnott/Xunit.StaFact/blob/main/LICENSE) | [Project](https://github.com/AArnott/Xunit.StaFact) | Test-only dependency. |
| xunit.v3 | Tests | Apache-2.0 | [Open](https://github.com/xunit/xunit/blob/main/LICENSE) | [Project](https://github.com/xunit/xunit) | Test-only dependency. |
</content>
</invoke>
46 changes: 46 additions & 0 deletions Tests/CaptureLanguageUtilitiesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ namespace Tests;
public class CaptureLanguageUtilitiesTests : IDisposable
{
private readonly bool _originalUiAutomationEnabled;
private readonly bool _originalWindowsAiDescriptionEnabled;

public CaptureLanguageUtilitiesTests()
{
_originalUiAutomationEnabled = Settings.Default.UiAutomationEnabled;
_originalWindowsAiDescriptionEnabled = Settings.Default.WindowsAiDescriptionEnabled;
}

public void Dispose()
{
Settings.Default.UiAutomationEnabled = _originalUiAutomationEnabled;
Settings.Default.WindowsAiDescriptionEnabled = _originalWindowsAiDescriptionEnabled;
Settings.Default.Save();
LanguageUtilities.InvalidateAllCaches();
}
Expand All @@ -42,6 +45,16 @@ public void MatchesPersistedLanguage_MatchesLegacyTesseractDisplayName()
Assert.True(matches);
}

[Fact]
public void MatchesPersistedLanguage_MatchesWindowsAiDescriptionTag()
{
WindowsAiDescriptionLang language = new();

bool matches = CaptureLanguageUtilities.MatchesPersistedLanguage(language, WindowsAiDescriptionLang.Tag);

Assert.True(matches);
}

[Fact]
public void FindPreferredLanguageIndex_PrefersPersistedMatchBeforeFallbackLanguage()
{
Expand Down Expand Up @@ -84,12 +97,45 @@ public async Task GetCaptureLanguagesAsync_IncludesUiAutomationWhenEnabled()
Assert.Contains(languages, language => language is UiAutomationLang);
}

[WpfFact]
public async Task GetCaptureLanguagesAsync_ExcludesWindowsAiDescriptionByDefault()
{
Settings.Default.WindowsAiDescriptionEnabled = false;
Settings.Default.Save();
LanguageUtilities.InvalidateAllCaches();

List<ILanguage> languages = await CaptureLanguageUtilities.GetCaptureLanguagesAsync(includeTesseract: false);

Assert.DoesNotContain(languages, language => language is WindowsAiDescriptionLang);
}

[WpfFact]
public async Task GetCaptureLanguagesAsync_IncludesWindowsAiDescriptionOnlyWhenSupported()
{
Settings.Default.WindowsAiDescriptionEnabled = true;
Settings.Default.Save();
LanguageUtilities.InvalidateAllCaches();

List<ILanguage> languages = await CaptureLanguageUtilities.GetCaptureLanguagesAsync(includeTesseract: false);

if (WindowsAiUtilities.CanDeviceDescribeImagesWithWinAI())
Assert.Contains(languages, language => language is WindowsAiDescriptionLang);
else
Assert.DoesNotContain(languages, language => language is WindowsAiDescriptionLang);
}

[Fact]
public void SupportsTableOutput_ReturnsFalseForUiAutomation()
{
Assert.False(CaptureLanguageUtilities.SupportsTableOutput(new UiAutomationLang()));
}

[Fact]
public void SupportsTableOutput_ReturnsFalseForWindowsAiDescription()
{
Assert.False(CaptureLanguageUtilities.SupportsTableOutput(new WindowsAiDescriptionLang()));
}

[Fact]
public void RequiresLiveUiAutomationSource_ReturnsTrueForStaticUiAutomationWithoutSnapshot()
{
Expand Down
Loading