Files
poli0981andClaude Opus 5.5 7d68be7c7f feat!: CaptureImage 2.0 — WPF UI, per-mode hotkeys, multi-monitor, HDR, library, game profiles (#22)
* refactor(core)!: v2 capture model, settings v3, profiles, coordinator

- remove the WinUI projects (replaced by WPF in this branch); resx files and
  ResxLocalizationService move to ViewModels so they stay framework-agnostic
- capture model: CaptureMode (Window/Region/Monitor), CaptureSource,
  CaptureOptions, MonitorInfo/HdrInfo, PixelRect; frames carry a pixel format
  (BGRA8 or scRGB FP16) so HDR captures flow through the pipeline
- HdrToneMapper (scRGB -> sRGB with a C1-continuous highlight shoulder),
  FrameOperations (crop, force opaque)
- AppSettings v3: one hotkey per mode, HDR/PNG/cursor/window-frame options,
  start-with-Windows, arm-on-startup, game profiles; unknown fields round-trip
  via JsonExtensionData; SettingsMigrator moves v1/v2 files forward
- GameProfile + ProfileResolver (exe path > exe name > Steam AppId)
- FileNameStrategy: fixed Windows-invalid set, strips bidi/zero-width
  characters, guards CON/NUL/COM1..., caps length, working {counter}, {Mode}
- CaptureFileWriter: encode off-thread to .tmp, move without overwrite, retry on
  name races, optional JPEG XR HDR sidecar
- CaptureCoordinator replaces the Stateless state machine and the duplicated
  save pipeline in DashboardViewModel: one capture at a time (busy requests are
  ignored instead of throwing), cancellable countdown/selection/preview,
  frozen-snapshot region capture across monitors, profile auto-arm
- interfaces for the WinEvent watcher, RegisterHotKey service, display/HDR
  info, region selector, library, shell, sound, autostart, diagnostics

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(infra)!: RegisterHotKey, WinEvent watcher, WGC monitor/HDR capture, WIC

- hotkeys: Win32 RegisterHotKey on a dedicated message-loop thread (no global
  keyboard *and mouse* hook any more), MOD_NOREPEAT, real conflict detection,
  temporary keys for the region overlay; SharpHook and HotkeyConflictSniffer gone
- window list: SetWinEventHook (create/destroy/show/hide/rename/minimize/
  foreground) replaces WMI polling every 2 s; TargetCatalog runs off the UI thread,
  skips cloaked windows and reads exe paths with QueryFullProcessImageName (works
  for elevated games); bounded LRU icon cache
- DisplayService: monitors in physical pixels with DPI, HDR state per output via
  IDXGIOutput6 on every adapter, SDR white level via DisplayConfig
- WgcCaptureEngine: window and monitor sources, BGRA8 or FP16 HDR, client-area /
  ContentSize crop on the GPU, cancellable timeout, late frames disposed, device
  lost -> recreate and retry once, no RCW leaks (vtable interop), safe readback
- encoders: SkiaSharp (PNG with selectable zlib level, JPEG 4:4:4 at q>=90, WebP)
  without extra copies or premultiplied-alpha transparency; WIC for TIFF and the
  JPEG XR HDR sidecar
- JsonSettingsStore v3: real atomic replace, serialized writes, backups of
  corrupt/older/newer files, v1 file adopted from the install folder, validated
  import that rejects UNC output folders
- CaptureLibraryService (index + WIC thumbnails + Recycle Bin), ShellService,
  SoundService, PerformanceModeService (EcoQoS), AutostartService,
  DiagnosticsExporter, OCR from BGRA frames with cached engines, Velopack 1.2
  WaitExitThenApplyUpdates, log path redaction, VDF depth limit
- packages: + Microsoft.Windows.CsWin32 (build-time), Vortice.Direct2D1 (WIC);
  - SharpHook, Stateless, System.Management, System.IO.Abstractions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(viewmodels)!: v2 view models for the WPF shell

Rewrite the view-model layer against the v2 Core abstractions, with no
framework or OS calls inside view models:

- Shell (tray tooltip, arm/disarm, capture per mode, exit through
  IAppLifetime), Dashboard (in-place window list refreshed by WinEvent
  notifications only while visible, target lock, per-hotkey status),
  Library (lazy thumbnails, filters, copy/OCR/pin/delete to Recycle Bin),
  Profiles (editor, create from a Dashboard window), Settings (write-
  through, per-mode hotkey recorder with conflict checks, import/export,
  reset, diagnostics), Logs (batched, paused, filtered), Update (localized
  status, cancellable check/download, apply on exit), About, Preview.
- Coordinator gains SuspendHotkeys() so the recorder receives combinations
  that are currently registered.
- IImageDecoder + WIC implementation for library copy/OCR/pin.
- Localization service uses source-generated logging, narrows its catch
  and can match the OS language to a shipped culture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(ui)!: WPF + WPF UI shell, tray, overlays and 11-language strings

Replace the WinUI 3 front end with WPF on .NET 10 and WPF UI 4.3:

- CaptureImage.UI: FluentWindow + NavigationView (Dashboard, Library,
  Profiles, Settings, Logs, Update, About) with pages resolved from DI,
  {loc:Tr} live localization, RTL + per-window language, WPF UI themes
  (System/Light/Dark/High contrast), snackbar in the window and
  non-activating, capture-excluded toast pop-ups when it isn't in front.
- Region selection: one frozen overlay per monitor placed in physical
  pixels at the monitor's DPI; Esc/Enter also registered as temporary
  hotkeys so they work while a game holds the keyboard.
- Preview window, pinned thumbnails, clipboard (bitmap + PNG), dialogs,
  hotkey recorder (Alt combos, Print Screen key-up).
- Tray icon (H.NotifyIcon.Wpf) with an armed indicator; re-added after
  Explorer restarts.
- CaptureImage.App: Velopack hooks first, per-user single instance over a
  CurrentUserOnly pipe, Serilog (async file + in-memory, user paths
  redacted), validated container, --data-dir / --instance-id /
  --minimized / --smoke-test / --screenshots, PerMonitorV2 + long paths
  manifest, multi-size app icon, commit recorded for "2.0.0 (abc1234)".
- Strings: 306 keys translated into all 11 languages; tests compare key
  sets per culture without fallback, check placeholders and that every
  key the code uses exists and every key is used.
- Settings records keep unknown JSON fields with a settable
  ExtensionData (the source generator can't bind init-only ones).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(ui)!: view-model and FlaUI suites, WPF publish smoke, stricter analyzers

- 135 view-model tests (settings write-through and reload, hotkey recorder
  with suspension, conflicts and validation, in-place window list,
  profiles, library filters and delete, log viewer batching, update flow,
  shell tray state, About links and third-party coverage, preview/OCR).
- CaptureImage.App.UiTests: FlaUI end-to-end tests against the real exe
  with a temporary data folder and instance id (navigation, arming,
  language switch, Arabic RTL, hotkey recorder, hide to tray + second
  launch). They skip unless CAPTUREIMAGE_UI_TESTS=1; new `ui-tests` job.
- CI publish-smoke publishes framework-dependent, runs --smoke-test with
  page screenshots (uploaded as an artifact) and checks the payload;
  deadcode now covers the UI and App projects.
- Release: framework-dependent publish + smoke test, vpk --framework
  net10-x64-desktop and --icon. Package .pdb/.xml stay out of the
  installer (publish 143 MB -> 51 MB, Setup ~28 MB).
- src/ builds with AnalysisMode=Recommended (warnings are errors);
  CA1716/CA1873 off with reasons, CA1822 off for bound view models.
- Test projects moved to the "tests" solution folder; Dependabot groups
  and the license ignore list follow the new dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: redundant casts and an unused P/Invoke result found by InspectCode

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ui): hide and exit after Closing returns; let sign-out close the app

Hiding or shutting down from inside Window.Closing can throw ("while a
Window is closing"), and tray Exit / Windows sign-out went through
Application.Shutdown without allowing the main window to close. Defer the
hide/exit, route IAppLifetime through App.RequestExit and allow close on
SessionEnding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(changelog): v2.0 notes under Unreleased

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(logging): render enums without JSON quotes in the log file and viewer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(app): give the startup and shutdown log lines a source context

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(ui): drop the sleep-and-retry temp cleanup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ui): keep running when the tray icon can't be created

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(infra): extract window icons with Win32 and WIC instead of System.Drawing

IconExtractor now takes the executable's own 48 px icon with SHDefExtractIcon
(falling back to the shell icon from SHGetFileInfo) and encodes it to PNG with
the WIC factory the app already uses. That removes the last System.Drawing.Common
reference and its central pin, which NuGet's package pruning resolved differently
on Linux than on Windows and broke the locked restore of the audit and license jobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ui): expose pages to UI Automation as named panes

WPF creates no automation peer for Page, so the pages' automation ids and titles
never reached UI Automation: screen readers had no region to announce and the UI
tests could not find a page. Each page now creates a pane peer named after its
localized title.

The language UI test also waits for the debounced settings write instead of
reading settings.json once, which raced on the CI runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(core): v2 Core test suite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: run the audit and license checks on Windows runners

NuGet prunes the WPF projects' Windows Desktop packages (System.Drawing.Common,
System.Diagnostics.EventLog, ...) only when restoring on Windows, so a locked
restore on Linux could never match the lock files. Both jobs now restore exactly
like the build job. The license job's restore is split so a failed package
restore can't be masked by the tool restore that follows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: v2 README, contributor guides, legal texts and contacts

- README, ARCHITECTURE, RELEASING, dev_env and pc_spec (+ Vietnamese) describe the WPF app,
  per-mode hotkeys, library, profiles, HDR, the framework-dependent installer and the new data
  folder; new screenshots rendered from seeded demo data (no personal windows or paths).
- PRIVACY, TERMS, DISCLAIMER, THIRD_PARTY_NOTICES and NOTICE match what v2 does and ships
  (clipboard, OCR, WinEvent hook, named pipe, library index, autostart, diagnostics export).
- New CONTRIBUTING, CODE_OF_CONDUCT, SUPPORT and CODEOWNERS; issue and PR templates updated.
- Contacts: contact@poli0981.dev and https://poli0981.dev/links, plus the role aliases
  (security@, privacy@, legal@, copyright@, dmca@, takedown@, code@, sponsor@, games@, collab@,
  press@) where each one belongs.
- CLAUDE.md covers the v2 layout, required checks, release steps, the Windows-only restore and
  how README screenshots are made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(infra): v2 Infrastructure test suite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: address the SonarCloud findings on the v2 branch

- S2190: LocalizationSource.FlowDirection shared its name with the FlowDirection enum it
  returns, which reads as a recursive property; it is now CurrentFlowDirection.
- S8949: the coordinator's hotkey and auto-arm paths pass CancellationToken.None explicitly
  (a hotkey capture has no caller to cancel it; CancelCurrent() still stops it).
- S6640: unsafe code is how the Infrastructure assembly talks to Win32, Direct3D and WinRT; the
  rule is acknowledged once for that assembly with a justification instead of per call site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:52:30 +07:00

2.3 KiB

Development environment

The toolchain used to build, test and release CaptureImage. Hardware reference: pc_spec.md. Vietnamese version: i18n/vi/dev_env.md.

Toolchain

Tool Version Purpose
.NET SDK 10.0 (exact feature band pinned in global.json) Build, test, run
Windows 11 22H2 or later Required by the WPF app and Windows.Graphics.Capture
Git 2.40 or later Source control
GPG with Ed25519 support Signed commits and tags (required on main and for release tags)
GitHub CLI (gh) recent Pull requests, releases, attestation checks
Node.js 22 LTS or later markdownlint-cli2 for the docs check (optional locally)

The Windows SDK projections come from NuGet with the target framework (net10.0-windows10.0.22621.0); no separate Windows SDK install is needed. CI uses actions/setup-dotnet with global-json-file: global.json, so local and CI SDKs match.

.NET tools used by CI are pinned in .config/dotnet-tools.json and installed with dotnet tool restore: vpk (Velopack), JetBrains InspectCode, nuget-license, ReportGenerator and CycloneDX.

Editors

  • JetBrains Rider (primary) — the ReSharper inspections match the deadcode CI check.
  • Visual Studio 2026 or Visual Studio Code with the C# Dev Kit also work.

Build, test, run

git clone https://github.com/poli0981/captureimg.git
cd captureimg
dotnet build CaptureImage.sln -c Release
dotnet test --solution CaptureImage.sln -c Release
dotnet run --project src/CaptureImage.App -c Release -- --data-dir .\.devdata --instance-id dev

Warnings are errors and src/ uses the recommended .NET analyzers, so a clean local build means the CI build will compile too. See CONTRIBUTING.md for the formatting commands and the full list of required checks.

Release tooling

Releases are produced by GitHub Actions from signed tags — see RELEASING.md.