From a29fdf40fe9ddaed3d3deb56effab7fedc915cd7 Mon Sep 17 00:00:00 2001 From: Patricio <12850986+PAumedes@users.noreply.github.com> Date: Tue, 13 Oct 2026 20:24:05 -0300 Subject: [PATCH 1/5] refactor: show settings lists through compiled bindings DisplayMemberPath looks the property up at run time, which Native AOT can't do. The country and text recognition lists use {x:Bind} templates, and their items read as their names for screen readers. --- Queueify.Core/Services/Countries.cs | 6 +++++- Queueify.Core/Services/OcrLanguages.cs | 6 +++++- Queueify.Tests/ListOptionTests.cs | 19 +++++++++++++++++++ Queueify/MainWindow.xaml | 14 +++++++++++--- 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 Queueify.Tests/ListOptionTests.cs diff --git a/Queueify.Core/Services/Countries.cs b/Queueify.Core/Services/Countries.cs index 1674bb3..3372f13 100644 --- a/Queueify.Core/Services/Countries.cs +++ b/Queueify.Core/Services/Countries.cs @@ -2,7 +2,11 @@ namespace Queueify.Services; -public sealed record CountryOption(string Code, string Name); +public sealed record CountryOption(string Code, string Name) +{ + /// What screen readers say for the item in the Settings list. + public override string ToString() => Name; +} /// /// The countries offered in Settings: where Tidal is available, all of which are Spotify markets diff --git a/Queueify.Core/Services/OcrLanguages.cs b/Queueify.Core/Services/OcrLanguages.cs index 6443e81..4f6c3d1 100644 --- a/Queueify.Core/Services/OcrLanguages.cs +++ b/Queueify.Core/Services/OcrLanguages.cs @@ -2,7 +2,11 @@ namespace Queueify.Services; -public sealed record OcrLanguageOption(string Tag, string Name); +public sealed record OcrLanguageOption(string Tag, string Name) +{ + /// What screen readers say for the item in the Settings lists. + public override string ToString() => Name; +} /// /// The text recognition languages Queueify offers to install (Windows "Features on Demand"), and diff --git a/Queueify.Tests/ListOptionTests.cs b/Queueify.Tests/ListOptionTests.cs new file mode 100644 index 0000000..95192b8 --- /dev/null +++ b/Queueify.Tests/ListOptionTests.cs @@ -0,0 +1,19 @@ +using Queueify.Services; + +namespace Queueify.Tests; + +// Settings lists show these through a template; screen readers read each item by its ToString(). +public class ListOptionTests +{ + [Fact] + public void A_country_reads_as_its_name() + { + Assert.Equal("Argentina", new CountryOption("AR", "Argentina").ToString()); + } + + [Fact] + public void A_text_recognition_language_reads_as_its_name() + { + Assert.Equal("Spanish (Spain)", new OcrLanguageOption("es-ES", "Spanish (Spain)").ToString()); + } +} diff --git a/Queueify/MainWindow.xaml b/Queueify/MainWindow.xaml index f62663c..9bf6686 100644 --- a/Queueify/MainWindow.xaml +++ b/Queueify/MainWindow.xaml @@ -222,6 +222,14 @@ + + + + + + + + @@ -688,7 +696,7 @@ Foreground="{ThemeResource TextFillColorSecondaryBrush}" /> @@ -710,7 +718,7 @@ Foreground="{ThemeResource TextFillColorSecondaryBrush}" /> @@ -745,7 +753,7 @@ Foreground="{ThemeResource TextFillColorSecondaryBrush}" /> - - private void OnLineTapped(object sender, TappedRoutedEventArgs e) + private void OnLineClicked(object sender, RoutedEventArgs e) { - if (sender is not Border { Tag: string raw } box) return; + if (sender is not Button { Tag: string raw } box) return; var (text, year) = OcrService.CleanLine(raw); box.Opacity = 0.45; diff --git a/tests/ui/Queueify.UiTests.ps1 b/tests/ui/Queueify.UiTests.ps1 index 2321cee..679e1ad 100644 --- a/tests/ui/Queueify.UiTests.ps1 +++ b/tests/ui/Queueify.UiTests.ps1 @@ -186,6 +186,26 @@ Select-Item (Find 'Magazine photo*' 'ListItem') Check ((FindId 'PageTitle').Current.Name -eq 'Magazine photo') 'photo page title' Check ($null -ne (Find 'Open photo*' 'Button')) 'photo page offers Open photo' +# Reading a photo goes through Windows' clipboard, imaging and OCR, all calls compiled ahead of time in the +# download. The page's lines are buttons, so they work by keyboard and screen reader too. +# (Replaces the clipboard's content with the test photo.) +Add-Type -AssemblyName System.Drawing +$photo = [System.Drawing.Image]::FromFile((Resolve-Path "$PSScriptRoot\..\..\Queueify.Tests\TestData\magazine-page.png").Path) +[System.Windows.Forms.Clipboard]::SetImage($photo); $photo.Dispose() +# Reading a photo opens the Add albums panel; put it back as it was for the checks after this one. +$paneWasHidden = $null -ne (Find 'Show the Add albums panel*' 'Button') +Invoke (Find 'Paste*' 'Button') +$line = $null +for ($i = 0; $i -lt 20 -and -not $line; $i++) { Start-Sleep -Milliseconds 500; $line = Find 'Clics modernos (Interdisc, 1983)' 'Button' } +Check ($null -ne $line) 'a pasted magazine photo is read: its lines are buttons' +if ($line) { + Invoke $line + Check ((Find 'Find an album' 'Edit').GetCurrentPattern([System.Windows.Automation.ValuePattern]::Pattern).Current.Value -eq 'Clics modernos 1983') ` + 'choosing a line puts it in the search, tidied' + SetText (Find 'Find an album' 'Edit') '' +} +if ($paneWasHidden -and $null -eq (Find 'Show the Add albums panel*' 'Button')) { Keys '^b' } + # ── Help (F1) ── Keys '{F1}' Check ((FindId 'PageTitle').Current.Name -eq 'Help') 'F1 opens Help' From dd9d11f23ad021510d139ca2c87d0df3f705e20c Mon Sep 17 00:00:00 2001 From: Patricio <12850986+PAumedes@users.noreply.github.com> Date: Tue, 13 Oct 2026 22:27:43 -0300 Subject: [PATCH 3/5] feat: download Queueify as a 21 MB exe compiled to native code The app is compiled ahead of time (Native AOT), so no .NET runtime ships with it, and the published folder is appended to a small starter exe, compressed with Brotli: 21 MB, down from 35 MB in 1.2.0 and 93 MB in 1.1.0. The starter unpacks it once per version into %LOCALAPPDATA%\Queueify\app, starts it and removes older versions. - WinUI reads lists only when their WinRT interop code was generated at build time: every ItemsSource gets a List made in the app, and unsafe code is allowed so the generator doesn't skip lists - the app knows the exe the user opened (QUEUEIFY_EXE), so portable Data next to it still works and a taskbar pin starts the download, not the unpacked copy the next version removes - the starter loads its own imports from System32 only - package.ps1 checks the start under another name, where the data goes, the taskbar pin and the starter's dll loading; the UI tests run the download itself with a scratch LOCALAPPDATA ADR-0008 records the measurements and the alternatives. --- CLAUDE.md | 4 +- CONTRIBUTING.md | 6 +- Queueify.Core/Services/AppData.cs | 12 +- Queueify.Launcher/Bundle.cs | 229 ++++++++++++++++++ Queueify.Launcher/Program.cs | 58 +++++ Queueify.Launcher/Queueify.Launcher.csproj | 30 +++ Queueify.Launcher/app.manifest | 14 ++ Queueify.Tests/AppDataTests.cs | 21 ++ Queueify.Tests/BundleTests.cs | 144 +++++++++++ Queueify.Tests/Queueify.Tests.csproj | 1 + Queueify.slnx | 1 + Queueify/MainWindow.xaml.cs | 25 +- Queueify/Queueify.csproj | 24 +- Queueify/TaskbarIdentity.cs | 69 ++++++ README.md | 15 +- SECURITY.md | 2 +- docs/ARCHITECTURE.md | 9 +- docs/RELEASING.md | 9 +- docs/TESTING.md | 15 +- docs/adr/0001-portable-winui3-app.md | 2 +- docs/adr/0007-single-trimmed-exe.md | 2 +- docs/adr/0008-native-aot-and-a-starter-exe.md | 61 +++++ docs/adr/README.md | 3 +- tests/tools/Release.Tests.ps1 | 6 + tests/ui/Queueify.SyncUiTests.ps1 | 21 +- tests/ui/Queueify.UiTests.ps1 | 39 ++- tools/Pack/Pack.csproj | 12 + tools/Pack/Program.cs | 8 + tools/package.ps1 | 101 ++++++-- tools/release.ps1 | 2 +- 30 files changed, 864 insertions(+), 81 deletions(-) create mode 100644 Queueify.Launcher/Bundle.cs create mode 100644 Queueify.Launcher/Program.cs create mode 100644 Queueify.Launcher/Queueify.Launcher.csproj create mode 100644 Queueify.Launcher/app.manifest create mode 100644 Queueify.Tests/BundleTests.cs create mode 100644 Queueify/TaskbarIdentity.cs create mode 100644 docs/adr/0008-native-aot-and-a-starter-exe.md create mode 100644 tools/Pack/Pack.csproj create mode 100644 tools/Pack/Program.cs diff --git a/CLAUDE.md b/CLAUDE.md index c0ce52c..f9ded43 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -16,7 +16,7 @@ syncing through the user's own Firestore. English and Rioplatense Spanish. GPL-3 $env:DOTNET_ROOT = "$env:LOCALAPPDATA\Microsoft\dotnet" # if the SDK isn't on PATH dotnet test --project Queueify.Tests # unit tests, the TDD loop tools\firestore-emulator.ps1 -Background; $env:QUEUEIFY_FIRESTORE_EMULATOR = '127.0.0.1:8080' -tools\package.ps1 # dist\Queueify\Queueify.exe + versioned copy +tools\package.ps1 # dist\Queueify\Queueify.exe + versioned copy (AOT, ~5 min) powershell -ExecutionPolicy Bypass -File tests\ui\Queueify.UiTests.ps1 -Exe dist\Queueify\Queueify.exe tools\release.ps1 -Preview # next changelog ``` @@ -38,5 +38,7 @@ tools\release.ps1 -Preview # next changelog - The dev PC runs Windows 11 IoT Enterprise LTSC (no winget, no Microsoft Store). Git and the GitHub CLI are portable installs in `%LOCALAPPDATA%\Programs`. +- Native AOT needs the C++ build tools (installed: VS 2022 Build Tools, VCTools workload); package.ps1 + puts vswhere on PATH for it. - Windows PowerShell 5.1 reads `.ps1` files as ANSI unless they have a UTF-8 BOM: save scripts with non-ASCII text with a BOM. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15af942..6caa541 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,8 @@ Thanks for helping. Queueify aims for a small, correct and boring codebase. Read - Windows 10 2004+ or Windows 11, x64 - [.NET 10 SDK](https://dotnet.microsoft.com/download) (`global.json` pins the feature band) +- For `tools\package.ps1`: Visual Studio's C++ build tools (the *Desktop development with C++* workload, or + Build Tools with `Microsoft.VisualStudio.Workload.VCTools`): the app is compiled ahead of time to native code - Git, with the repository's hooks: `git config core.hooksPath .githooks` - Optional, for the sync tests: Java 21+ (the Firestore emulator jar is downloaded on first use) @@ -16,7 +18,7 @@ Thanks for helping. Queueify aims for a small, correct and boring codebase. Read | --- | --- | | `dotnet test --project Queueify.Tests` | Unit tests (the TDD loop) | | `tools\firestore-emulator.ps1 -Background` then `$env:QUEUEIFY_FIRESTORE_EMULATOR = '127.0.0.1:8080'` | Runs the sync tests too instead of skipping them | -| `tools\package.ps1` | Builds the portable app: one trimmed `dist\Queueify\Queueify.exe`, plus a versioned copy for the release | +| `tools\package.ps1` | Builds the portable app (about 5 minutes): one `dist\Queueify\Queueify.exe`, the starter with the app appended, plus a versioned copy for the release | | `tests\ui\Queueify.UiTests.ps1 -Exe dist\Queueify\Queueify.exe` | UI tests through Windows UI Automation | | `tests\ui\Queueify.SyncUiTests.ps1 -Exe dist\Queueify\Queueify.exe` | Sync UI test (needs the emulator) | | `tests\tools\Release.Tests.ps1` | Tests for the release tool | @@ -24,7 +26,7 @@ Thanks for helping. Queueify aims for a small, correct and boring codebase. Read Run the PowerShell scripts with `powershell -ExecutionPolicy Bypass -File