Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
587bb93494 | ||
|
|
32e3c5aa8e | ||
|
|
0ffecb5851 | ||
|
|
e77a130fc9 | ||
|
|
ff43d8cdb3 |
No files matched your search
@@ -210,17 +210,53 @@ jobs:
|
||||
# ledger.db, logs, the layer manifest). The same id would put the install inside
|
||||
# the ledger's folder and have the uninstaller remove every session without the
|
||||
# question 12_BUILD promises. The title the user sees is still "FrameLedger".
|
||||
# A DELTA (beta.13): vpk pack diffs against the newest full package already in --outputDir, and until beta.13 that
|
||||
# directory was always empty - so no release carried a delta and every update downloaded the whole package
|
||||
# (11_UPDATER §Built). The previous release is downloaded first; what THIS pack produced is assets.win.json, and only
|
||||
# that is kept: the previous full package moves out (not uploaded, not checksummed) and the feed lists this build
|
||||
# alone, as `vpk upload github` would write it. No previous release, or a download that fails, is a full-only
|
||||
# release - said as a warning, not a stop, because it is exactly what every release before this one was.
|
||||
- name: Pack (Velopack)
|
||||
shell: pwsh
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
dotnet tool install -g vpk --version 1.2.0
|
||||
if ($LASTEXITCODE -ne 0) { throw 'vpk install failed' }
|
||||
$v = '${{ steps.version.outputs.version }}'
|
||||
New-Item -ItemType Directory out/release -Force | Out-Null
|
||||
vpk download github --repoUrl "https://github.com/${{ github.repository }}" --channel win --pre --token $env:GH_TOKEN --outputDir out/release
|
||||
if ($LASTEXITCODE -ne 0) { Write-Host '::warning::the previous release could not be downloaded - this release carries a full package only' }
|
||||
Write-Host 'previous release:'
|
||||
Get-ChildItem out/release -File | ForEach-Object { Write-Host (" {0,-48} {1,12:N0}" -f $_.Name, $_.Length) }
|
||||
vpk pack --packId FrameLedger.App --packVersion $v --packDir out/app --mainExe FrameLedger.exe --packTitle FrameLedger --packAuthors FrameLedger --releaseNotes out/notes.md --outputDir out/release
|
||||
if ($LASTEXITCODE -ne 0) { throw 'vpk pack failed' }
|
||||
|
||||
$built = @((Get-Content out/release/assets.win.json -Raw | ConvertFrom-Json) | ForEach-Object { $_.RelativeFileName })
|
||||
if ($built.Count -eq 0) { throw 'vpk pack wrote no assets.win.json entries' }
|
||||
$keep = $built + @('releases.win.json', 'assets.win.json', 'RELEASES')
|
||||
New-Item -ItemType Directory out/previous -Force | Out-Null
|
||||
Get-ChildItem out/release -File | Where-Object { $keep -notcontains $_.Name } | Move-Item -Destination out/previous
|
||||
$feed = Get-Content out/release/releases.win.json -Raw | ConvertFrom-Json
|
||||
$feed.Assets = @($feed.Assets | Where-Object { $built -contains $_.FileName })
|
||||
if ($feed.Assets.Count -eq 0) { throw 'the feed lists none of this build''s packages' }
|
||||
[System.IO.File]::WriteAllText((Join-Path $PWD 'out/release/releases.win.json'), ($feed | ConvertTo-Json -Depth 8 -Compress), [System.Text.UTF8Encoding]::new($false))
|
||||
if (Test-Path out/release/RELEASES) {
|
||||
$legacy = @(Get-Content out/release/RELEASES | Where-Object { $built -contains ($_ -split ' ')[1] })
|
||||
[System.IO.File]::WriteAllLines((Join-Path $PWD 'out/release/RELEASES'), [string[]]$legacy, [System.Text.UTF8Encoding]::new($false))
|
||||
}
|
||||
|
||||
Write-Host 'this release:'
|
||||
Get-ChildItem out/release | ForEach-Object { Write-Host (" {0,-48} {1,12:N0}" -f $_.Name, $_.Length) }
|
||||
Write-Host ('feed: ' + (($feed.Assets | ForEach-Object { '{0} {1} {2}' -f $_.Type, $_.Version, $_.FileName }) -join '; '))
|
||||
if (-not (Test-Path out/release/FrameLedger.App-win-Setup.exe)) { throw 'vpk did not produce FrameLedger.App-win-Setup.exe (README §Install names it)' }
|
||||
$delta = "out/release/FrameLedger.App-$v-delta.nupkg"
|
||||
if (Get-ChildItem out/previous -Filter '*-full.nupkg' -ErrorAction SilentlyContinue) {
|
||||
if (-not (Test-Path $delta)) { throw "the previous full package was downloaded, but vpk produced no delta ($delta)" }
|
||||
} else {
|
||||
Write-Host '::warning::no previous full package - this release carries no delta'
|
||||
}
|
||||
|
||||
- name: Checksums
|
||||
shell: pwsh
|
||||
|
||||
+102
-3
@@ -30,6 +30,107 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
### Added
|
||||
|
||||
- **Settings ▸ Window ▸ Hide scroll bars.** No scroll bar is drawn anywhere in the app while it is on, and everything
|
||||
still scrolls with the mouse wheel, the keyboard and touch. Off by default; it applies at once, to the open windows
|
||||
too, and off brings every bar back.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The import list was unreadable in the dark theme.** File ▸ Import library (and Games ▸ Refresh) drew every row white
|
||||
with white text, and each tick box as a sliver at the row's edge: a row style added in beta.11 to dim the games already
|
||||
in the library fell through to Windows' own row, which is white in every theme, and WPF UI's check box is too wide for
|
||||
its 40 px column. The rows take the theme's colours again and the boxes are whole, and the list is the one thing in the
|
||||
dialog that scrolls — its intro and the count under it stay in view, where a list scrolling inside a scrolling dialog
|
||||
used to carry the intro away. Compare's session picker draws the theme's check boxes too (it drew Windows' old ones).
|
||||
- **The mouse wheel scrolled nothing on the Dashboard, Games, a game's page, Compare and Settings** — only dragging the
|
||||
scroll bar did. WPF UI wraps a page in a scroller of its own unless the page says otherwise, and inside it each page's
|
||||
own scroller had nothing to scroll and still took every wheel. Every page scrolls itself now. The Logs page had the same
|
||||
cause: its tail grew to hold every line and never followed the newest one, as it was meant to. A scroller inside a
|
||||
dialog (the consent, administrator, anti-cheat exception and bug report dialogs) hands the wheel on at its ends.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Over a chart, the wheel scrolls the page; Ctrl+wheel zooms the chart.** ScottPlot zoomed on every wheel, which with
|
||||
the pages scrolling again would have zoomed the chart and scrolled the page at once. Dragging still pans and
|
||||
double-click still resets.
|
||||
|
||||
## [0.1.0-beta.13] - 2026-10-04
|
||||
|
||||
**The thirteenth pre-release: refusal notices that say where the anti-cheat is, GPU sensors that follow the game's graphics
|
||||
card, and smaller updates.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run
|
||||
anyway*. What changed for a user:
|
||||
|
||||
- **An anti-cheat driver or service running on the PC is said as that.** While, for example, Easy Anti-Cheat's service
|
||||
runs for another game, FrameLedger hooks no game at all; the notice used to say the anti-cheat "was detected in this
|
||||
game", naming a game that may not even use it. It now says the anti-cheat is running on this PC, and the session's
|
||||
summary says the same. A finding in the game itself still says "in this game".
|
||||
- **The notice for a capture stopped mid-game** no longer promises that FrameLedger will hook the game again "when you
|
||||
enable it again" — which was not true either way. It says where the anti-cheat was found and whether hooking was
|
||||
turned off.
|
||||
- **On a PC with more than one graphics card**, the GPU figures follow the card the game draws on once it has shown its
|
||||
first frame, instead of the first card Windows lists (often a laptop's integrated GPU). Not yet tested on such a PC.
|
||||
- **Updates download only what changed**: this release carries a delta package against `0.1.0-beta.12`, so updating
|
||||
from it through the App downloads a fraction of the full ~107 MB.
|
||||
|
||||
**Updating from `0.1.0-beta.12`:**
|
||||
|
||||
- Help ▸ Check for updates downloads the delta; or quit the App (tray icon → Exit), end `FrameLedger.Agent.exe` and
|
||||
run the installer as before.
|
||||
- No database change, and no document to accept again.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A refusal because of a driver or service said the anti-cheat "was detected in this game".** The guard's checks for
|
||||
drivers and services are machine-wide: while Easy Anti-Cheat's service runs for another title, every game is refused,
|
||||
and the notice named a game the user may not even own. It now says the anti-cheat is running on this PC — a driver or
|
||||
service that may belong to another game or program — and the session summary says the same; a finding in the game
|
||||
itself still says "in this game" (`20_OPEN_QUESTIONS` §S23-3, closed). The Agent's refusal and unhook events carry the
|
||||
guard's own reason for this (`guardReason`, additive).
|
||||
- **The notice for a mid-session stop promised "FrameLedger will not inject into this game again until you enable it
|
||||
again"**, untrue both ways since beta.5: a driver or service that starts on the PC turns no hooking off, and a finding
|
||||
in the game turns it off for good. It says where the finding was, and whether hooking was turned off.
|
||||
- **On a PC with more than one graphics card, the GPU sensors could describe a card the game was not using.** The
|
||||
adapter the game draws on is now followed once it has shown its first frame: the DXGI layer switches to it,
|
||||
LibreHardwareMonitor reads that brand's GPU rather than the first one it lists (often a laptop's integrated GPU), and
|
||||
NVAPI says nothing when the game runs on an AMD or Intel card — N/A rather than another card's temperature.
|
||||
`LIMITATIONS.md` says what still describes the first card.
|
||||
- **Updates download only what changed**, from this release on: each release now carries a Velopack delta package
|
||||
against the previous one beside the full package, and an installed copy one release behind downloads the delta. No
|
||||
earlier release had one — every update so far downloaded the whole ~107 MB package — so the first update that can use
|
||||
a delta is from `0.1.0-beta.12` to this one; Velopack falls back to the full package whenever the delta does not apply.
|
||||
- **Tests that change the App's language ran beside tests that read its text**, so the second kind could read the
|
||||
wrong language once in many runs; the language-changing tests now run on their own.
|
||||
|
||||
## [0.1.0-beta.12] - 2026-10-04
|
||||
|
||||
**The twelfth pre-release: how much memory each game itself uses, documents you can read, and a user guide.** The same
|
||||
unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*. What changed for a user:
|
||||
|
||||
- **The game's own memory, in every session** — its video memory and its RAM, the figures Task Manager's Details tab
|
||||
shows for the game's process, read once a second from outside the game, whether or not the game is hooked. The
|
||||
session summary shows the median and the peak, the Sessions tab has two new columns, the Trend and Compare have the
|
||||
memory metrics, the Sensors charts draw this game's memory beside the whole graphics card's and the whole PC's, and
|
||||
the Dashboard shows it live.
|
||||
- **Statistics per series**: every sensor's mean, median, minimum and peak, at the bottom of a session's summary.
|
||||
- **Documents are rendered**, not shown as raw text: the first-start documents, Help ▸ Limitations, the update notes,
|
||||
and a new **Help ▸ About** with the program's legal notices, the third-party licences and the legal documents.
|
||||
- **A user guide** — eight short pages, under **Help ▸ User guide**.
|
||||
- **The GPL is no longer something you accept**: it is your licence, shown for information. You accept the EULA (now
|
||||
1.5), the Disclaimer (2.10) and the Privacy Policy (2.6), so the first-start window opens once after the update.
|
||||
- Links to the project's documents open the version you run, not the newest one.
|
||||
- **The Logs page's Warning and Error filters show the Agent's lines** too; they showed only the App's.
|
||||
- **Settings no longer has "Record games launched outside FrameLedger"**: the switch never did anything.
|
||||
|
||||
**Updating from `0.1.0-beta.11`:**
|
||||
|
||||
- Quit the App (tray icon → Exit) and end `FrameLedger.Agent.exe` before running the installer.
|
||||
- Schema 0018 adds the memory columns; the database opens in place, and an older version cannot open it again.
|
||||
- Sessions recorded before this version have no memory figures and no per-series statistics: they read N/A, and the
|
||||
summary says so.
|
||||
- The new `FrameLedger.ProcessStats.dll` is installed beside the Agent; without it the memory figures read N/A.
|
||||
|
||||
### Added
|
||||
|
||||
- **The game's own memory, measured from outside the game, in every session** (owner decision D43, beta.12). A new
|
||||
C++ library loaded by the Agent — never into a game — `FrameLedger.ProcessStats.dll`, reads once a second the game
|
||||
process's **dedicated and shared GPU memory** (the documented `GPU Process Memory` performance counters, which need no
|
||||
@@ -43,7 +144,7 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
(`game_vram_dedicated_*`, `game_ram_private_*`, …), the process count, the sources, and every sensor series'
|
||||
n / mean / median / min / max in `sensor_stats_json`; carried live to the Dashboard (`SessionProgress`, `SessionHeld`)
|
||||
and through the crash-recovery file (a new chunk type; beta.11's files still recover). The video-memory **budget** is
|
||||
still not measured (`20_OPEN_QUESTIONS` §M11). The App shows all of it in the next change.
|
||||
still not measured (`20_OPEN_QUESTIONS` §M11). The App shows all of it (below).
|
||||
- **Sensor statistics have a median and a minimum** beside the mean and the maximum (`SeriesAggregates`).
|
||||
- **The App shows the game's own memory everywhere a session is** (D43, beta.12), in Task Manager's units — MB below
|
||||
1 GB, GB to two decimals, 1 GB = 1024 MB. The **session summary** has two new cards, *VRAM (this game)* and *RAM (this
|
||||
@@ -71,7 +172,6 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
game, read your results, anti-cheat and safety, your data, questions and answers, and the terms in plain words — in
|
||||
the app under **Help ▸ User guide** (the first item of the Help menu) and in the repository's `guide/` folder. The
|
||||
README now opens with a pointer to it and keeps a separate section for developers and forks.
|
||||
|
||||
- **`NOTICE`, and the licence header in every source file** (owner decision D45, beta.12). FrameLedger's own material is
|
||||
GPL-3.0-only with three additional terms of the kinds GPLv3 §7 permits: keep the copyright line and the attribution in
|
||||
the program's legal notices (b), mark a modified version as different and do not call it "FrameLedger" alone (c), and
|
||||
@@ -123,7 +223,6 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
rules file's own comment and the rules workflow's header made the feed claim too, and are corrected. `docs/README.md`
|
||||
is a new index for developers. Code comments that said what is not so (a sparkline, a flyout, a layer flag "false by
|
||||
construction", two self-test counts) are corrected with them.
|
||||
|
||||
- **The first start's summary said "there is no way to override that refusal"** although a per-game user-mode exception
|
||||
has existed since beta.9, and **"Nothing is sent anywhere"** although the update check is a request to GitHub; it now
|
||||
names the exception and the one request. The README's safety table still said an exception needed two earlier
|
||||
|
||||
@@ -76,7 +76,7 @@ src/
|
||||
FrameLedger.NvapiBridge/ # C++ DLL loaded by the Agent (never a game): NVAPI telemetry, NGX state (P2 PR-E2)
|
||||
FrameLedger.ProcessStats/ # C++ DLL loaded by the Agent (never a game): the game process's memory (beta.12, D43)
|
||||
tests/ tools/ third_party/ # ctest suites; probes, hook-harness, vendor stubs; vendored headers
|
||||
# (these five lines added 2026-10-04 — the list stopped at Shm)
|
||||
# (these three lines added 2026-10-04 — the list stopped at Shm)
|
||||
FrameLedger.Domain/ # entities, metric calculators — zero dependencies
|
||||
# (Metrics/ WRITTEN 2026-09-09, P2 PR-A: frame times,
|
||||
# percentiles, lows, stutter, the FG window and its
|
||||
|
||||
+6
-1
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
|
||||
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
|
||||
page lists them in plain words; each item links to the document that has the details.
|
||||
|
||||
*Beta software: this page describes version 0.1.0-beta.11.*
|
||||
*Beta software: this page describes version 0.1.0-beta.13.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
@@ -103,6 +103,11 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
|
||||
|
||||
- GPU temperature, load, power and memory are best supported on **NVIDIA** GPUs. **AMD and Intel GPUs have
|
||||
not been tested** on real hardware yet.
|
||||
- **On a PC with more than one graphics card**, the GPU figures follow the card the game draws on once a Direct3D game
|
||||
has shown its first frame; before that, in an unmeasured session, and for OpenGL or Vulkan games they describe the
|
||||
first card Windows lists, and with two cards of one brand the temperature and load come from that brand's first card.
|
||||
The session's hardware details always name the first card. None of this has been tested on a machine with two cards.
|
||||
([Telemetry](docs/18_GPU_VENDOR_APIS.md))
|
||||
- **CPU temperature** needs *Run the agent as administrator* and the separately installed PawnIO driver, and
|
||||
has not been verified on real hardware yet. CPU load is the time the processor was busy — not Task
|
||||
Manager's "utility" figure, which can exceed 100%. ([Telemetry](docs/18_GPU_VENDOR_APIS.md))
|
||||
|
||||
@@ -9,8 +9,8 @@ anti-cheat, and look after your data, a page each. What FrameLedger cannot do is
|
||||
[Limitations](LIMITATIONS.md). Both are in the app too (Help ▸ User guide, Help ▸ Limitations).
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.11`** (2026-10-03), an unsigned installer built from that tag with its
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-04.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -153,7 +153,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest pre-release is `v0.1.0-beta.11` (2026-10-03); before it `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
|
||||
> **The latest pre-release is `v0.1.0-beta.13` (2026-10-04); before it `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
|
||||
|
||||
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
|
||||
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
|
||||
@@ -200,4 +200,4 @@ GPU telemetry is layered so the project never depends on a proprietary vendor li
|
||||
|
||||
---
|
||||
|
||||
**Status:** pre-release (beta). Eleven tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
|
||||
**Status:** pre-release (beta). Thirteen tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
|
||||
@@ -415,6 +415,7 @@ switch's rule); integers are invariant-culture within an inclusive range; choice
|
||||
| `ui.minimize_to_tray` | bool | `0` | | UI (PR-8) |
|
||||
| `ui.hide_anticheat_hooking` | bool | `1` | | UI (beta.8, 2026-09-25): the game page of an entry the guard found anti-cheat in shows the finding in place of its Hooking card (`08_UI` §Game detail) |
|
||||
| `ui.fps_decimals` | bool | `0` | | UI (beta.8, 2026-09-25): every FPS figure with two decimals ("62.40") instead of a whole number |
|
||||
| `ui.hide_scrollbars` | bool | `0` | | UI (beta.14, 2026-10-05): no scroll bar drawn anywhere; every scroller still scrolls with the wheel, the keyboard and touch (`App.Services.ScrollBarHiding`, `08_UI` §Settings) |
|
||||
| `ui.library_view` | choice `grid`\|`list` | `grid` | | UI (beta.11, 2026-10-03): the Games library as a grid of cards that fills the width, or as a list; written by the page's own switch, no Settings row (`08_UI` §Games) |
|
||||
| `capture.background` | bool | `1` | | ~~Agent~~ nobody *(corrected 2026-10-04: no Agent code ever read it, so the watcher recorded every tracked game whatever it said; beta.12 removed its switch from Settings and reserved the key — `SettingsRegistry.CaptureBackground`)* |
|
||||
| `hooking.kill_switch` | bool | `0` | | Agent (FR-2.4, since P2 PR-F) |
|
||||
|
||||
+2
-2
@@ -406,9 +406,9 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
|
||||
| `SessionHeld` | A→UI | **Added 2026-09-23.** 1 Hz while a client listens, for a session held unhooked only: `{ sessionGuid, elapsedS, gpuTempC?, cpuTempC?, gpuLoadPct?, cpuLoadPct?, gameVramDedicatedMb?, gameRamPrivateMb? }` — how long it has run and the machine's sensors (and since beta.12 the game process's own memory, read from outside it — optional, an older client ignores them). **Never `SessionProgress`**: its `presents5s`, `presentedQualifier` and `fgMode` are required, and zeros there would put measured-looking numbers on the wire for a session that measures nothing (rule 6 has nothing to show and shows nothing) |
|
||||
| `SessionProgress` | A→UI | 1 Hz: `{ sessionGuid, elapsedS, presents5s, presentedFps5s?, presentedQualifier, nativeFps5s?, displayedFps5s?, fgFactor?, fgMode, upscaler?, upscalerQuality?, upscalerDriverReported?, renderW/H?, outputW/H?, rtActive?, gpuTempC?, cpuTempC?, cpuLoadPct?, vramProcMb?, latencyUs?, fgRefusal?, fgRuntimeCensus?, gameVramDedicatedMb?, gameRamPrivateMb? }` (the last two added 2026-10-03, beta.12, optional: the game process's dedicated GPU memory and private working set, MiB, from the newest telemetry tick; `vramProcMb` stays reserved for the in-process figure and has no producer) — a 5 s rolling window over the ring through the SAME Domain calculators the row uses (`SessionProgressCalculator`, D13). **`upscalerDriverReported` added 2026-09-21, optional:** `dlss` when the NVIDIA driver reports an NGX super-resolution feature created and evaluated in the target (`03_METRICS` §The driver-reported rung), so the live card says `DLSS (driver-reported)` where no hook can name the upscaler; identity only. **`cpuLoadPct` added 2026-09-21, optional** (CPU time busy over the last telemetry tick, 0–100; `cpuTempC` has a producer from the same date, present only when the Agent is elevated with PawnIO). **Two fields added 2026-09-14, both optional (an older client ignores them, §C):** `fgRefusal` is the row's `fg_refusal` (schema 0003) — present when `fgMode` names a technology and `fgFactor` is absent, so the live card can say "DLSS-G active — factor not counted" rather than N/A; `fgRuntimeCensus` is the raw census so the `fg_runtime_loaded` chip can name the module. **Rule 6 at the wire (2026-09-13):** `nativeFps5s` / `displayedFps5s` / `fgFactor` are present only when frame generation was measured in the window; otherwise `presentedFps5s` stands alone with `presentedQualifier` (`census_not_run` · `no_fg_runtime` · `fg_runtime_loaded` · `none_withheld`, the row's `presented_qualifier` from the same function). Every unmeasured field is absent, never 0. Suppressed when no client is connected |
|
||||
| `SessionCompleted` | A→UI | `{ sessionGuid, sessionId?, exitStatus, tier, finalize, reason, gameId?, gameName? }` — UI loads the full row from SQLite; `sessionId` is null and `finalize` is `discarded` when the row was not stored (under the minimum length), or `game_removed` when its entry was removed with its sessions while it ran (2026-09-23), or **`faulted` when the session's task threw before it could finalize** (2026-09-23: it follows the `CaptureError SessionFaulted`, with `exitStatus` `interrupted` and `reason` `SessionFaulted`, so the live card and the tray let go of a session that no longer runs; the `.partial` stays for recovery); `exitStatus` is the row's vocabulary (`normal` · `crashed` · `unhooked_safety` · `degraded`); `reason` is the loop's `SessionEndReason`. **`gameId` / `gameName` added 2026-09-23, optional:** the entry the session was stored under — the finalizer's owner when it re-keyed a session whose entry was removed, else the one it started under — so the notice names the session that completed, not whatever the live card last showed |
|
||||
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff }` — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
|
||||
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff, guardReason? }` — **`guardReason` (beta.13, optional)** is the guard's own reason when it named a family; `BlockedService` / `BlockedDriver` is a finding on the PC, not in the game, and the notice says so (§S23-3); `reason` stays the session's end reason — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
|
||||
| `CaptureDegraded` | A→UI | `{ sessionGuid, from: 1, to: 2, reason }` — Tier 1 → Tier 2 mid-flight, or overlay self-disabled. **Under a two-rung ladder this means measurement STOPPED**, not that it continued at lower fidelity, and the notice must say so. *(Built: `SupervisionLost`, `WriterSelfDisabled`, `WriterStoppedBlocklisted`, `WriterNeverInstalledHooks`, `SupervisionFaulted`, `KillSwitchEngaged` — `RecordedSessionEvents.Classify` is the table.)* |
|
||||
| `SafetyUnhook` | A→UI | `{ sessionGuid, family?, signal?, hookingTurnedOff }` — anti-cheat appeared mid-session; prominent UI notice; `hookingTurnedOff` as on `CaptureRefused`. *(Built: the verdict that FIRED, not the pass that started the session — `CaptureOutcome.Verdict` carries the supervisor's last verdict on this reason since 2026-09-13.)* |
|
||||
| `SafetyUnhook` | A→UI | `{ sessionGuid, family?, signal?, hookingTurnedOff, guardReason? }` — `guardReason` as on `CaptureRefused` (beta.13) — anti-cheat appeared mid-session; prominent UI notice; `hookingTurnedOff` as on `CaptureRefused`. *(Built: the verdict that FIRED, not the pass that started the session — `CaptureOutcome.Verdict` carries the supervisor's last verdict on this reason since 2026-09-13.)* |
|
||||
| `HookingTurnedOff` | A→UI | `{ gameId, gameName?, reason, family?, signal? }` — **since 2026-09-25 (beta.8):** the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) found anti-cheat in a game whose hooking the user had turned on, and turned it off. Not a session event — no session is running — so the UI's notice carries no "record without measuring" action, only Dismiss (`SafetyNoticeKind.HookingOff`). A finding on a game whose hooking was already off sends nothing: its page and its library card change, nothing the user switched on did. Additive: a client that does not know the type ignores it (§Versioning). |
|
||||
| `CaptureError` | A→UI | `{ sessionGuid?, code, message }` — `InjectFailed`, `RingVersionMismatch`, `AttachRefused`, ~~`EtwAccessDenied`~~ (struck 2026-09-13 with the tier), ~~`PresentMonMissing`~~ (retired with the tool, 2026-08-27 — a code naming an implementation nobody chose), `TelemetryUnavailable`, `DbWriteFailed`, `SessionFaulted` (the session's task threw before finalize; the `.partial` stays for recovery, and ~~no `SessionCompleted` follows~~ a `SessionCompleted` with `finalize: faulted` follows since 2026-09-23). *(Built: `RingVersionMismatch` for a layout / record-size / build-id refusal — the "restart the game after an update" case — `AttachRefused` for the rest of the ring's refusals, `InjectFailed` for a target that could not be started, pinned, read or singled out.)* |
|
||||
| `Ping`/`Pong` | ~~both~~ UI→A | 15 s keepalive, **client-driven** (built 2026-09-13): the client pings, the Agent answers; the Agent initiates nothing on an idle connection |
|
||||
|
||||
@@ -138,6 +138,18 @@ The Menu sits in its own row **below** the TitleBar (never inside the drag regio
|
||||
> `SafetyNoticesTests` (the three kinds, the sentence per refusal reason, the strip for errors, nothing for a
|
||||
> session event, dismiss only by the user).
|
||||
>
|
||||
> **On this PC, not in this game — beta.13 (§S23-3).** A driver or a service is found machine-wide: while Easy
|
||||
> Anti-Cheat's service runs for another title, every game refuses with `BlockedService`, and the notice said the
|
||||
> family "was detected in this game". The events carry the guard's own reason (`guardReason`, `07_IPC`), and a
|
||||
> `BlockedService` / `BlockedDriver` refusal reads `Safety_Refused_MachineWide_Format` ("… is running on this PC (…): a
|
||||
> driver or service, which may belong to another game or program …"), an unhook `Safety_Unhooked_MachineWide_Format`,
|
||||
> and the summary's Tier-2 reason `Summary_Tier2_Why_MachineWide_Format`; a module, a title list or a file in the game
|
||||
> still reads "in this game". `Safety_Unhooked_Format` lost "will not inject into this game again until you enable it
|
||||
> again", untrue both ways since 2026-09-22 (a machine-wide finding turns no hooking off; a finding about the game turns
|
||||
> it off for good, which `Safety_HookingTurnedOff` then says). Without a `guardReason` — an older Agent — the notice
|
||||
> reads as before. Tests: `SafetyNoticesTests.AServiceOrDriverIsOnThisPcAndAModuleIsInThisGame`,
|
||||
> `…AnUnhookSaysWhereTheFindingWasAndPromisesNoReEnable`, `Tier2ReasonTests`.
|
||||
>
|
||||
> **Corrected 2026-09-14, after the owner saw a red bar with no way out.** WPF UI 4.3.0's `InfoBar` template has
|
||||
> **no `ContentPresenter`**, so the action button above — placed as the InfoBar's Content, the only dismissal once
|
||||
> `IsClosable="False"` removed the X — was never rendered. The view model was right and the screen was wrong.
|
||||
@@ -540,6 +552,16 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
|
||||
> `PagesLoadTests`.
|
||||
|
||||
### Settings
|
||||
> **beta.14 (owner request 2026-10-05: "an option to hide the scroll bars but still scroll").** The Window section has
|
||||
> **Hide scroll bars** (`ui.hide_scrollbars`, off by default). A bar's visibility is bound inside its scroller's template,
|
||||
> which no style reaches, so `Services.ScrollBarHiding` sets the scrollers themselves: one class handler on
|
||||
> `ScrollViewer`'s Loaded (registered at start beside `DialogKeyboard`) reaches every scroller the App shows, those inside a
|
||||
> DataGrid, a TextBox, a rendered document and a dialog included. While on, an axis that is `Auto` or `Visible` becomes
|
||||
> `Hidden` — WPF's "no bar, still scrolls": wheel, keyboard and touch — and its own value is kept on it; a `Disabled` axis is
|
||||
> never touched (it lays its content out at the viewport's width). The toggle applies to the open windows at once, and off
|
||||
> puts every kept value back. Tests: `ScrollBarHidingTests` (on hides every bar and the wheel still scrolls; off restores
|
||||
> each; a scroller that loads later follows), `SettingsViewModelTests.HidingScrollBars…`.
|
||||
|
||||
> **beta.11 (owner request 2026-10-03: "remove the Settings rows that have no button or similar").** Every row has a control
|
||||
> now: the *Games with hooking on* card shows only while a game has hooking on (its empty sentence is gone); the *Elevation*
|
||||
> card is gone and its state is the third line of *Run the agent as administrator* (its explanation a tooltip on it); the
|
||||
@@ -664,6 +686,12 @@ Agent section: elevation state with a plain explanation of what elevation *optio
|
||||
- Keyboard: ~~NavigationView items Ctrl+1…5; grids fully navigable; Esc closes flyouts/dialogs~~ — §Accessibility below, since P4 PR-8 (2026-09-15); this bullet named three behaviours and none of them was built or checked.
|
||||
- No blocking dialogs during capture; errors surface as InfoBars/tray toasts.
|
||||
- Charts and stat numbers use culture-aware formatting per active UI culture (09); colors only from theme resources or the per-theme chart palette (16 §ScottPlot).
|
||||
- **The mouse wheel scrolls whatever is under the pointer (beta.14).** Every page scrolls itself
|
||||
(`ScrollViewer.CanContentScroll="False"` on the `Page` — `16_WPFUI_SYNTAX` §Gotchas: until beta.14 the wheel scrolled
|
||||
nothing on five pages, and the Logs tail did not follow the newest line); a scroller nested in a dialog hands the wheel
|
||||
on at its ends (`ui:PassiveScrollViewer`); over a chart a plain wheel scrolls the page and **Ctrl+wheel zooms the chart**
|
||||
(`Charts/ChartWheel`, every plot through `ChartTheme.Attach`) — drag still pans and double-click still resets, as
|
||||
ScottPlot does. The import checklist scrolls inside its list and nowhere else, so its intro and its count stay put.
|
||||
|
||||
## Accessibility
|
||||
|
||||
@@ -731,6 +759,18 @@ palette per theme, chosen with the theme).
|
||||
> primary text, ≈ 12:1) but **clipping** — the pill sat in a star column with no trimming, so a sentence-length
|
||||
> qualifier overflowed the row. The qualifier text trims with an ellipsis at 260 px (the readout's tooltip carries the
|
||||
> full sentence), and the row's readout column is sized to content with the game's name trimming first.
|
||||
>
|
||||
> **A third hole, closed 2026-10-05 (beta.14; the owner's screenshot of File ▸ Import library in the dark theme: every
|
||||
> row white, its text invisible, each tick box a sliver).** A style `BasedOn="{StaticResource {x:Type DataGridRow}}"`,
|
||||
> added in beta.11 to dim the rows already in the library: WPF UI 4.3.0 keys its row style `DefaultDataGridRowStyle`
|
||||
> and defines no implicit one, so the lookup fell through to Aero2's row and its `SystemColors.WindowBrush` — a white no
|
||||
> theme reaches, under the dark theme's white text. No `#` in our XAML, no palette badge: neither check above could see
|
||||
> it, and light-theme rows read fine. The tick boxes were WPF UI's `CheckBox` (`MinWidth` 120, padding 11) in a 40 px
|
||||
> column. Held three ways: `AccessibilityTests.NoStyleIsBasedOnAnImplicitStyleTheThemeDoesNotDefine` (every `BasedOn`
|
||||
> type has a style in the App's dictionaries), `ImportReviewRenderTests` (the rendered dialog, both themes: every cell's
|
||||
> text against the composited colour painted under it ≥ 4.5:1, each ticked box drawn whole), and
|
||||
> `AccessibilityTests.NoDataGridCheckBoxColumn` (Compare's checkbox column drew an Aero2 box). Each went red on the
|
||||
> unfixed XAML before it went green.
|
||||
|
||||
### DPI
|
||||
|
||||
|
||||
+6
-1
@@ -29,7 +29,12 @@ All update HTTP goes through one `GitHubHttpClient` (also used by rules updates)
|
||||
|
||||
Binaries are not code-signed (project policy). Consequences and mitigations, documented in README and the update dialog footer:
|
||||
- SmartScreen warning on first run of a new version — expected; SHA-256 checksums (`SHA256SUMS.txt`) published with every release; CI prints them into release notes.
|
||||
- ~~Velopack delta packages reduce download size; full package fallback automatic.~~ *(Corrected 2026-10-04: no delta has been published — `release.yml` never puts the previous release in `out/release` before `vpk pack`, so every update downloads the full package; a delta needs a `vpk download github` step first.)*
|
||||
- ~~Velopack delta packages reduce download size; full package fallback automatic.~~ *(Corrected 2026-10-04: no delta has been published — `release.yml` never puts the previous release in `out/release` before `vpk pack`, so every update downloads the full package; a delta needs a `vpk download github` step first.)* **Built in beta.13:**
|
||||
`release.yml` downloads the previous release into `out/release` before `vpk pack`, so a release carries
|
||||
`FrameLedger.App-<version>-delta.nupkg` beside the full package; the previous full package is moved out (neither uploaded
|
||||
nor checksummed) and the feed lists this build alone, as `vpk upload github` would write it. Velopack applies the delta
|
||||
when the installed copy is the previous release and falls back to the full package otherwise — `0.1.0-beta.13` is the
|
||||
first release with one, so beta.12 → beta.13 is the first update that can use it (owner-only: HANDOFF item 10).
|
||||
- Never bypass or suppress OS warnings programmatically.
|
||||
|
||||
## Versioning
|
||||
|
||||
@@ -180,6 +180,7 @@ assumed to.
|
||||
cmake --build --preset x64-release
|
||||
dotnet publish src/FrameLedger.App -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -p:FrameLedgerSourceRef={tag} -o out/app
|
||||
dotnet publish src/FrameLedger.Agent -c Release -r win-x64 --self-contained -p:PublishReadyToRun=true -o out/app
|
||||
vpk download github --repoUrl https://github.com/poli0981/frameledger --channel win --pre --outputDir out/release # beta.13: the previous release, for a delta
|
||||
vpk pack --packId FrameLedger.App --packVersion {ver} --packDir out/app --mainExe FrameLedger.exe --packTitle FrameLedger --packAuthors FrameLedger --releaseNotes out/notes.md --outputDir out/release
|
||||
```
|
||||
|
||||
|
||||
@@ -136,6 +136,11 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
|
||||
`versioninfo-check` lists (`FrameLedger.ProcessStats.dll` since beta.12 — corrected 2026-10-04), `rules/detection-rules.json`; `FrameLedger.CaptureHost.exe` absent (`12_BUILD`:
|
||||
exactly two roots — `package-closure-check` proves it statically, this reads the directory); `versioninfo-check`
|
||||
run again over `out/app`, because a `.targets`-staged DLL that failed to copy is a warning to `dotnet publish`.
|
||||
- **since beta.13, `vpk download github --pre` first**, so `vpk pack` finds the previous release's full package in
|
||||
`out/release` and writes a delta; after the pack, what `assets.win.json` names is kept and the rest (the previous full
|
||||
package) moves to `out/previous`, the feed and `RELEASES` are filtered to this build, and a downloaded previous package
|
||||
with no delta beside it fails the job. A failed download is a warning: the release is full-only, as every one before it
|
||||
was (`11_UPDATER` §Built).
|
||||
- `vpk pack --packId FrameLedger.App` (the `vpk` tool pinned to the library's 1.2.0) with the release notes;
|
||||
`FrameLedger.App-win-Setup.exe` must come out, because README §Install names it. **Not `--packId FrameLedger`**:
|
||||
Velopack installs into and uninstalls `%LOCALAPPDATA%\<packId>`, which with that id is the data folder
|
||||
|
||||
+14
-1
@@ -44,6 +44,18 @@ The anti-cheat guard is the one component where a bug can cost someone an accoun
|
||||
- Blob codecs round-trip for every series in `frame_blobs` (NaN forbidden — assert), including the two-pair `render_res` encoding and the three-bit `rt_flags` byte. SQLite migrations apply cleanly from an empty file to the current schema, and re-applying is a no-op. (There is no v1→v2 upgrade to test — `06_DATA_MODEL` §Migrations.)
|
||||
- IPC pipe: framing, split reads, oversize rejection, unknown fields/types ignored, protocol mismatch.
|
||||
|
||||
### What the App draws (beta.14)
|
||||
|
||||
A page or dialog that only *loads* has proved nothing about how it looks: `PagesLoadTests` counted the import list's
|
||||
rows while every row was white text on white in the dark theme (`08_UI` §Contrast). The rendered checks run on the one
|
||||
STA thread with the App's three dictionaries (`PagesLoadTests.OnStaAsync`) and look at the result: `Visuals` lays a
|
||||
control out at a window's size, pumps the dispatcher (a `NavigationViewContentPresenter`'s navigation), swaps the theme
|
||||
dictionary for one check and puts Dark back, and composites every Border and Panel background between a text and the
|
||||
window into the colour actually painted under it; `Wcag` is the arithmetic. `ImportReviewRenderTests` measures each text
|
||||
cell against that colour in both themes and counts the accent pixels of each ticked box in a `RenderTargetBitmap`; the
|
||||
paging checks navigate a real page in WPF UI's presenter and send it the wheel. Each was run red against the unfixed XAML
|
||||
first — a rendered check that cannot fail is the counted-rows check again.
|
||||
|
||||
## Integration tests (CI-runnable, no game, no anti-cheat surface)
|
||||
|
||||
`hook-harness` is what makes this architecture testable without touching a real title:
|
||||
@@ -131,7 +143,8 @@ that it was checked against anything.
|
||||
| Mode | launch mode · attach mode · mid-session settings change |
|
||||
| Safety | game with anti-cheat → toggle disabled · simulated late AC load → unhook · double-crash → auto-disable |
|
||||
| Tier | forced Tier 2 (records duration, available sensors and the reason — and nothing else) · Tier 1 → Tier 2 degradation notice |
|
||||
| Update | Velopack delta; update deferred while a game is hooked (FR-12) — *a delta needs a previous release, so this row is reachable from the second release, not the first* *(corrected 2026-10-04: no release has carried a delta — `release.yml` never fetches the previous release before `vpk pack`, `11_UPDATER` §Built — so the update leg is a full package)* |
|
||||
| Update | Velopack delta; update deferred while a game is hooked (FR-12) — *a delta needs a previous release, so this row is reachable from the second release, not the first* *(corrected 2026-10-04: no release has carried a delta — `release.yml` never fetches the previous release before `vpk pack`, `11_UPDATER` §Built — so the update leg is a full package; **since beta.13** a release carries a delta against the previous one, and the first
|
||||
update that can use it is beta.12 → beta.13 — HANDOFF owner-only item 10)* |
|
||||
|
||||
## Release smoke
|
||||
|
||||
|
||||
+30
-2
@@ -132,9 +132,9 @@ Code-behind wires services once: `navigationService.SetNavigationControl(RootNav
|
||||
| Busy | `ui:ProgressRing` | |
|
||||
| Contextual popup | `ui:Flyout` | Popup hand-rolling |
|
||||
| Hyperlink-ish | `ui:HyperlinkButton`, `ui:Anchor` | |
|
||||
| Grid of records | native `DataGrid` (WPF UI restyles it) | third-party grids |
|
||||
| Grid of records | native `DataGrid` (WPF UI restyles it — through the grid's own `RowStyle`/`CellStyle`/`ColumnHeaderStyle` setters, so a local one is based on WPF UI's keyed style: §Gotchas, added 2026-10-05) | third-party grids |
|
||||
|
||||
Native `Menu`, `TabControl`, `ComboBox`, `Slider`, `ListView` are fine — the `ControlsDictionary` restyles standard WPF controls to Fluent automatically.
|
||||
Native `Menu`, `TabControl`, `ComboBox`, `Slider`~~, `ListView`~~ are fine — the `ControlsDictionary` restyles standard WPF controls to Fluent automatically. *(Corrected 2026-10-05: 4.3.0 has no implicit style for the native `ListView`, `ListViewItem` or `GridViewColumnHeader` — only `ui:ListView` is restyled — nor for `DataGridRow`, `DataGridCell`, `DataGridColumnHeader` or `FlowDocumentScrollViewer`; read from the loaded `ControlsDictionary`.)*
|
||||
|
||||
## Icons
|
||||
|
||||
@@ -227,6 +227,34 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
|
||||
bar with no exit, which is exactly how the safety notices shipped (2026-09-14). `Styles/FrameLedger.xaml` carries
|
||||
the upstream template plus one presenter column; `PagesLoadTests.TheInfoBarTemplateRendersItsContent` renders both
|
||||
templates and turns red when upstream gains a presenter, which is when the copy comes out.
|
||||
- [ ] **WPF UI 4.3.0 keys its DataGrid parts' styles and defines no implicit one** (`DefaultDataGridRowStyle`,
|
||||
`DefaultDataGridCellStyle`, `DefaultDataGridColumnHeaderStyle`, handed to the grid by its implicit `DataGrid` style's
|
||||
`RowStyle`/`CellStyle`/`ColumnHeaderStyle` setters). A local `RowStyle` replaces WPF UI's; based on
|
||||
`{StaticResource {x:Type DataGridRow}}` it falls through to Aero2's row, whose `SystemColors.WindowBrush` no theme
|
||||
reaches: the import list was white text on white in the dark theme (owner's screenshot, beta.14). Base it on
|
||||
`DefaultDataGridRowStyle`. `AccessibilityTests.NoStyleIsBasedOnAnImplicitStyleTheThemeDoesNotDefine` refuses any
|
||||
`BasedOn` a type the App's dictionaries hold no style for, and `ImportReviewRenderTests` measures the rendered rows.
|
||||
- [ ] **WPF UI's `CheckBox` is `MinWidth` 120 with an 11 px padding**: in a narrow grid column it draws a sliver of the box.
|
||||
`MinWidth="0" Padding="0"` there. A `DataGridCheckBoxColumn` uses WPF's own element style, an Aero2 box — use a template
|
||||
column (`AccessibilityTests.NoDataGridCheckBoxColumn`).
|
||||
- [ ] **Every page sets `ScrollViewer.CanContentScroll="False"`.** `NavigationViewContentPresenter` changes that property's
|
||||
default to true for `Page` and, on each navigation, wraps a page that keeps it in a `DynamicScrollViewer`. A page with
|
||||
its own root `ScrollViewer` inside that wrapper has infinite height, nothing to scroll — and a stock `ScrollViewer`
|
||||
marks every wheel handled even then, so the wheel scrolled nothing on five pages until beta.14 (owner: "I have to drag
|
||||
the scroll bar"); the Logs tail grew to hold every line and never followed the end.
|
||||
`AccessibilityTests.EveryPageOptsOutOfTheDynamicScrollViewer`, `PagesLoadTests.ANavigatedPageIsNot…`.
|
||||
- [ ] **A stock `ScrollViewer` nested in a scroller takes the wheel at its ends too.** Inside a dialog use
|
||||
`ui:PassiveScrollViewer`, which hands the wheel on when it cannot scroll (`AccessibilityTests.NoPlainScrollViewerInsideADialog`).
|
||||
A `ContentDialog` whose content should not scroll as a whole sets `ScrollViewer.VerticalScrollBarVisibility="Disabled"`
|
||||
on the dialog: its content row then has the window's height, and a `*` row inside it can hold a list that scrolls alone
|
||||
(`ImportReviewPrompt`).
|
||||
- [ ] **ScottPlot 5 zooms on every wheel and never marks it handled.** Without `Charts/ChartWheel` a wheel over a chart
|
||||
zoomed it and scrolled the page at once; a plain wheel is the page's, Ctrl+wheel the chart's, for every plot that
|
||||
`ChartTheme.Attach` registers.
|
||||
- [ ] **A scroll bar's visibility is bound inside its scroller's template** (`ComputedVerticalScrollBarVisibility`), so a style
|
||||
on `ScrollBar` or `ui:DynamicScrollBar` cannot hide it. Set the scroller's own `ScrollBarVisibility` to `Hidden` — no
|
||||
bar, and the wheel, the keyboard and touch still scroll (`ui:PassiveScrollViewer` treats only `Disabled` as "cannot
|
||||
scroll") — as `Services.ScrollBarHiding` does for `ui.hide_scrollbars` (beta.14).
|
||||
- [ ] **No dialog in 4.3.0 closes on Esc.** Neither `ContentDialog.cs` nor `MessageBox.cs` at the 4.3.0 tag handles a
|
||||
key (read 2026-09-15), and `ContentDialog.CloseButtonText` DEFAULTS to "Close" — an empty string is how a dialog
|
||||
says it has no Close button. `MessageBox.Close()` is `[Obsolete("Use Close with MessageBoxResult instead")]` while no
|
||||
|
||||
@@ -57,7 +57,15 @@ Implementations compose rather than compete:
|
||||
> nothing calls `SelectAdapter` outside tests. L1 stays on the first hardware adapter in DXGI's high-performance order,
|
||||
> as `HardwareSnapshotSource` does, and the handshake's `adapterLuid` is read by no managed code — so on a
|
||||
> multi-adapter machine L1 can describe an adapter the game did not present on. The game's own memory, D43, is
|
||||
> summed over every adapter and is not affected.)* Every
|
||||
> summed over every adapter and is not affected.)* **Built in beta.13:** the recorder hands the handshake's
|
||||
> `adapterLuid` to the poller at the first tick that carries one (`CaptureProgress.AdapterLuid`, noted in the
|
||||
> `.partial`), and `CompositeTelemetrySource.SelectAdapter` points L1 at it (`IGpuAdapterSelector`) and tells the layers
|
||||
> that read their own GPU its vendor (`IGpuVendorFollower`): L2 maps that vendor's GPU node instead of the first one
|
||||
> LibreHardwareMonitor lists (on a laptop often the integrated GPU), and L3 contributes nothing when the game's adapter
|
||||
> is not NVIDIA's — N/A rather than another card's temperature. **What stays first-found:** a session before the game's
|
||||
> first present, a Tier-2 session (no handshake), a game presenting through OpenGL or Vulkan (they publish no LUID), two
|
||||
> GPUs of one vendor (L2 and L3 take that vendor's first), and the session's hardware snapshot
|
||||
> (`HardwareSnapshotSource`, taken before the first present). Every
|
||||
> poller sample is stamped with QPC (`TelemetrySample.QpcTicks`), the ring's clock, and
|
||||
> `QpcClockTests` pins `Stopwatch` / `TimeProvider.GetTimestamp` to the real counter.
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ or it becomes the next stale status claim this file exists to record.
|
||||
| **S19(c)** | ✅ **resolved 2026-09-06** | The fields are constants the schema pins and the guard never reads, because the policy is code by CLAUDE.md rule 2 and `19_SAFETY`; `rules-validate` now proves the schema rejects `action: "allow"` and `signerField: "CN"` (canary 3), so the data cannot say otherwise |
|
||||
| **S19(d) residual** | ✅ **resolved 2026-08-05** | A second canary, **derived from the shipped document** rather than hand-written, carries `nameFragments: []` and must be rejected. The entry's stated consequence was overstated and is corrected in place: the generated floor would not have disappeared, `gen-ac-floor.ps1` hard-errors and the native build fails — what was unguarded is the *schema* half |
|
||||
| **S20 feed half** | 🅓 **deferred ~~to P4~~, unscheduled — P4 closed without it (corrected 2026-10-04); rationale written 2026-09-06** | **FR-7.3 stays unmet and written as unmet**: the fetch needs a shipped Agent, §S4's signing and the privacy policy's rows, all P4; until then a rules edit ships with the next release, checksum-attested |
|
||||
| **S23-3** | ~~🅓 **deferred to P3, rationale written 2026-09-06**~~ 🔴 **open: P3 shipped the refusal UI without it** *(corrected 2026-10-04: a machine-wide `BlockedService` / `BlockedDriver` notice still reads "… was detected in this game", `SafetyNotices.RefusalText`)* | `08_UI`'s refusal notice is wrong in the commonest case; the requirement reaches `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI — a string with no view would read as done |
|
||||
| **S23-3** | ~~🅓 **deferred to P3, rationale written 2026-09-06**~~ ~~🔴 **open: P3 shipped the refusal UI without it**~~ ✅ **closed in beta.13** — the events carry the guard's own reason and a `BlockedService` / `BlockedDriver` notice says the family is running on this PC (`08_UI` §Safety events) *(it was 🔴 from 2026-10-04: a machine-wide notice still read "… was detected in this game")* | `08_UI`'s refusal notice is wrong in the commonest case; the requirement reaches `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI — a string with no view would read as done |
|
||||
| **S23-5** | ✅ **resolved 2026-08-05** | Closed the way §S23-4 closed the same class — by **removing** the restatement, not correcting it — and `rules-validate` now fails when any `$comment` enumerates checks again. The rule's own first version was scoped to the wrong object and could not fire; it now walks every `$comment` and fails if it finds none |
|
||||
| **S23-6** | ✅ **closed 2026-09-06** | `license-check` binds `THIRD_PARTY_NOTICES` bidirectionally, and the accuracy blocks are now ONE text — `legal/ACCURACY.md`, embedded verbatim in `README.md` and `DISCLAIMER.md` §4, gated by `tools/accuracy-check.ps1` (self-tested both directions). Truth stays a human's job; drift between copies no longer is |
|
||||
| **S23-2** | 🚫 **owner only — no PR can close it** | `Rules / validate` is **not** a required status check on `main`. **Re-verified against the live branch protection 2026-08-05**, not repeated from the entry: `required_status_checks.contexts` is exactly `["check", "analyze (csharp, none)", "analyze (cpp, manual)"]` (`strict: true`, `enforce_admins: true`, `required_linear_history: true`). The `validate` job is path-filtered and `pull_request`-only, so a red removal check does not block the merge button. **The gate that exists to make the anti-cheat blocklist un-removable is advisory.** This is a branch-protection setting |
|
||||
@@ -137,7 +137,7 @@ either work or a rationale written down:
|
||||
correction. **S30 closed 2026-08-15 and S31 opened 2026-08-20**, and this bullet went on
|
||||
naming S30 until 2026-08-27 — so the total below stayed right by coincidence rather than
|
||||
by count.)*
|
||||
- **three ⏳** — S2 part three, S4 signing, S23-3
|
||||
- **three ⏳** — S2 part three, S4 signing, S23-3 *(S2 part three built 2026-09-06 and S23-3 closed in beta.13 — noted 2026-10-04; S4 signing stays deferred)*
|
||||
- ~~two ◐~~ ~~**three ◐**~~ **two ◐ (2026-09-04)** — S14, S23-6. ~~**S31**~~ *(moved out of ❓ on 2026-08-27 when its test landed on row P2; **resolved 2026-09-04** when the token count landed on row P1 with `tokens/batch = 1.00` — the question answered by a second count rather than by an oracle)*
|
||||
- **one 🔴** — S29, added by the audit that produced this recount; **five of its seven
|
||||
findings are now closed**, and the residue is (a) the ungated managed drain and (d) the
|
||||
@@ -3083,7 +3083,7 @@ required contexts are exactly `check`, `analyze (csharp, none)` and
|
||||
the gate that exists to make the anti-cheat blocklist un-removable is advisory.
|
||||
Fixing it is a branch-protection change, i.e. the owner's, not a code change.
|
||||
|
||||
**3. ~~🅓 Deferred to P3, rationale written 2026-09-06~~ 🔴 Open — P3 built the refusal UI without it (corrected 2026-10-04: `SafetyNotices.RefusalText` formats every named refusal as "… was detected in this game", so the measured case below still reads wrong) — `08_UI` describes a refusal notice that is wrong in the commonest case.** *(The requirement below must reach `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI, and not before: there is no UI to be wrong in yet, and a `.resx` string with no view is the kind of fix that reads as done. The spike log carries the measurement; this line is the reminder.)* It
|
||||
**3. ~~🅓 Deferred to P3, rationale written 2026-09-06~~ ~~🔴 Open~~ ✅ Closed in beta.13 (`08_UI` §Safety events: a driver or service is said as running on this PC) — P3 built the refusal UI without it (corrected 2026-10-04: `SafetyNotices.RefusalText` formats every named refusal as "… was detected in this game", so the measured case below still reads wrong) — `08_UI` describes a refusal notice that is wrong in the commonest case.** *(The requirement below must reach `08_UI` and the `Safety_*` keys in the PR that creates the first refusal UI, and not before: there is no UI to be wrong in yet, and a `.resx` string with no view is the kind of fix that reads as done. The spike log carries the measurement; this line is the reminder.)* It
|
||||
promises "the specific signal named in plain language". Measured (`spike-notes`
|
||||
§13): while any Easy Anti-Cheat title is running, **every** target — including a
|
||||
freshly spawned, unrelated process — refuses with `BlockedService` naming
|
||||
|
||||
+115
@@ -1804,6 +1804,106 @@ library and the import, PR-4 delete sessions, the charts across sessions and the
|
||||
|
||||
**Owner-only, added to the list below:** item 8.
|
||||
|
||||
## ~~**START HERE**~~ — 2026-10-04, the beta.12 train: the game's own memory, rendered documents, a user guide, the legal split *(struck the same day: the head is §beta.13 below)*
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.12]`; this is what no other file carries. The approved plan was eight PRs: PR-0 the
|
||||
recorder test that went red on a loaded runner, PR-1 `NOTICE` and the licence header (D45), PR-2 the game's memory
|
||||
measured from outside the game (C++ `FrameLedger.ProcessStats.dll`, schema 0018, D43), PR-3 the App showing it, PR-4
|
||||
Markdown rendered and a tabbed About, PR-5 the user guide and the documents a user accepts, PR-6 the documentation sweep,
|
||||
PR-7 the release.*
|
||||
|
||||
**Decisions (owner, 2026-10-03, asked before the plan — do not re-ask):**
|
||||
|
||||
- **D43 — the game's memory is measured from OUTSIDE the game, in both tiers.** A new C++ library loaded by the Agent,
|
||||
never into a game: dedicated and shared GPU memory from the documented `GPU Process Memory` performance counters (no
|
||||
handle to the game), private working set / working set / commit from `GetProcessMemoryInfo` with
|
||||
`PROCESS_QUERY_LIMITED_INFORMATION` only — a hooked game through the handle the session holds, any other through a
|
||||
handle opened for the read and closed after it, the creation time checked, every process of the executable summed.
|
||||
Task Manager's figures are the definition; no budget (§M11 stays open); not `D3DKMTQueryStatistics` ("Reserved for
|
||||
system use"). Measured first: `spike-notes` §16.
|
||||
- **D44 — a user guide in English**, `guide/`, rendered in the App (Help ▸ User guide), linked from the README.
|
||||
- **D45 — the legal split.** `legal/TRADEMARKS.md`; `FORKING.md` and `CONTRIBUTING.md`; the GPL shown as information,
|
||||
not accepted (GPLv3 §9, FR-11 changed); GPLv3 §7(b)(c)(e) additional terms in `NOTICE` and named in every source file's
|
||||
header; the Appropriate Legal Notices in a tabbed About; the EULA's consumer-law carve-out and severability; the
|
||||
Privacy Policy's section on sharing exports and bug reports; `CODE_OF_CONDUCT.md`.
|
||||
- **D46 — documentation is corrected in place** (struck, dated) with an index, `docs/README.md`; history stays.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **A test whose session length came from a fake clock but whose end came from a real 150 ms timer** went red whenever a
|
||||
loaded runner fitted fewer than six drains into it (PR-0): make the fake drive both.
|
||||
- **Two LibreHardwareMonitor `Computer`s updating in one process** threw a NullReferenceException in `GenericCpu.Update`
|
||||
in the local gate (`LhmRealHardwareTests` beside `PrivilegeFootprintTests`); the Agent's own read was already behind a
|
||||
catch. The two test classes share a collection now.
|
||||
- **A test reading resource text outside the culture collection** races a class that flips `Strings.Culture`; a class
|
||||
that adds many flips (`GameMemoryTextTests`) makes it likelier. `GamesViewModelTests` moved in; the rest are a chip. *(Ended in beta.13: the
|
||||
collection runs alone.)*
|
||||
- **`ShmDrainIntegrationTests.AnUnhookRequestStops…` failed once on CI at the injection step** (≈1 s, `IsAllowed`
|
||||
false) and passed on the re-run; it passed on the PR before. A flake to watch, not yet a fix.
|
||||
- **Markdig follows the table spec strictly**: a line without cells between a table's rows ends the table, and GitHub
|
||||
still draws it. `MarkdownRendererTests` fails any embedded document whose table would show as `|---|` text.
|
||||
- **`AccentTextFillColorPrimaryBrush` is the dark accent until `ApplicationThemeManager.Apply(…, updateAccent: true)`
|
||||
runs** — a test host that skips it draws links #003E92 on #202020; the App (and the Legal Gate, via `WpfThemeApplier`)
|
||||
applies it.
|
||||
- **`tools/license-gather.ps1` took an override only for a URL-only package**; Markdig declares BSD-2-Clause and ships no
|
||||
file, so the expression branch takes an override too now.
|
||||
- **A file git sees as mixed line endings is `-text`**: no EOL conversion, so a CRLF rewrite shows as a whole-file change.
|
||||
Keep such a file's working copy LF (`docs/legal-drift-history.md`).
|
||||
- **Inserting a `### Changed` heading after an entry in the middle of `### Added`** moves every later Added entry under
|
||||
it — read the section's headings back before committing.
|
||||
- **The stacked-branch recipe carried four PRs** (PR-3 on PR-2, PR-4 on PR-3, PR-5 on PR-4): after each squash merge,
|
||||
`git rebase --onto origin/main <old parent>` replays only the PR's own commit, and resx / CHANGELOG additions stay
|
||||
clean because each PR appends after the previous one's.
|
||||
|
||||
- **A test can hide the defect it exists to catch**: `LogTailTests` fed App-form lines into the fake *Agent* log, so
|
||||
the Logs page's level filter matched no real Agent line (Serilog's default template, a date first) and nobody saw
|
||||
it for three weeks. A fixture for another process's file is a copy of a real line from that process.
|
||||
- **A setting with `AgentReads = true` that no Agent code reads is a switch that lies**: Settings' *Record games
|
||||
launched outside FrameLedger* wrote `capture.background` and nothing read it (removed in PR-6, the key reserved).
|
||||
Before trusting a registry row's flag, grep for a reader.
|
||||
- **The audits (PR-6) found code gaps the docs had been describing as built**, each left for its own PR and named
|
||||
here so it is not rediscovered: L1 telemetry is never pointed at the game's adapter (`SelectAdapter` has no caller,
|
||||
`18_GPU_VENDOR_APIS`); a machine-wide service refusal still says "detected in this game" (§S23-3, 🔴); no release
|
||||
has carried a Velopack delta (`release.yml` never fetches the previous release); there is no rules feed (§S20). *(Three of the four closed in
|
||||
beta.13 — §S23-3, the adapter, the delta; the rules feed stays.)*
|
||||
|
||||
**Owner-only, added to the list below:** item 9.
|
||||
|
||||
## **START HERE** — 2026-10-04, the beta.13 train: the four follow-ups the beta.12 audit left
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.13]`; this is what no other file carries. The owner asked (2026-10-04) for the
|
||||
four chips the beta.12 documentation audit had left — §S23-3's wording, the App tests' culture races, L1's adapter, the
|
||||
Velopack delta — then a release and the session closed. Two PRs: PR-1 the three code changes, PR-2 the release with the
|
||||
delta in `release.yml`.*
|
||||
|
||||
**No new owner decision.** The choices below follow rules already written: a figure from the wrong graphics card is worse
|
||||
than N/A (`FlShmHandshake.AdapterLuid`'s own comment), and a finding on the PC is not a finding in the game (§S23-3,
|
||||
2026-09-06).
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **Pointing L1 at the game's adapter changes nothing visible on its own**: `CompositeTelemetrySource` merges L3 > L2 >
|
||||
L1 per field, and L2 (LibreHardwareMonitor's first GPU node) and L3 (NVAPI's first physical GPU) read their own card.
|
||||
Every layer has to agree on the card — L1 by LUID (`IGpuAdapterSelector`), the others by the adapter's vendor
|
||||
(`IGpuVendorFollower`), and L3 says nothing for an AMD or Intel adapter. Two GPUs of one vendor stay first-found.
|
||||
- **A `CaptureRefused`'s `reason` is the session's end reason** (`RefusedByGuard`), not the guard's: the App could not
|
||||
tell a service from a module until the events carried `guardReason`. A `RefusedAck`'s `Reason`, by contrast, IS the
|
||||
guard's — two "reason" fields one pipe apart that mean different things.
|
||||
- **A collection definition must be public** (xUnit1027), which CA1515 then flags in a test project that is an exe — the
|
||||
suppression carries the reason. `TestContext.Current.TestCollection.TestCollectionClassName` proves the definition
|
||||
bound, so a definition xUnit did not find fails a test instead of bringing the races back silently.
|
||||
- **`vpk download github --pre` puts the previous release's full package in `out/release`**: `vpk pack` needs it there to
|
||||
write a delta, and nothing else may ship it — `assets.win.json` names what this pack built, the rest moves to
|
||||
`out/previous`, and the feed and `RELEASES` are filtered to this build, as `vpk upload github` writes them.
|
||||
- **A 120 ms wall-clock ceiling races the second scan on a loaded runner**: the release rehearsal failed on
|
||||
`CaptureSessionTests.AGuardThatThrowsMidSessionKeepsTheRecordsItAlreadyDrained`, which ended as `Running` before the
|
||||
guard's second evaluation threw — the class beta.12's PR-0 fixed in the recorder tests. The four tests whose ending is a
|
||||
scan, a throw, the kill switch or an exit take `EndsOnItsOwn` (a 30 s safety net); a test that EXPECTS `Running` keeps
|
||||
the short ceiling, because that ceiling is its ending.
|
||||
- **The beta.12 traps about the culture race and the four code gaps are closed here** (the rules feed stays open, §S20).
|
||||
|
||||
**Owner-only, added to the list below:** item 10.
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
|
||||
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
|
||||
@@ -1853,6 +1953,21 @@ library and the import, PR-4 delete sessions, the charts across sessions and the
|
||||
on a game's page and in Settings ▸ Data. (d) *Sessions at a glance* and the Trend with a second unit. (e) The Legal
|
||||
Gate shows the Disclaimer 2.9 and the EULA 1.4 once. (f) The `ja` text of `Safety_Exception_Trial` (English until
|
||||
reviewed) and the App strings marked `review`.
|
||||
9. **beta.12 on real hardware.** (a) **The game's memory:** one hooked game and one that is not (hooking off, or a
|
||||
blocked game), each beside Task Manager's Details tab at the same moment — the summary's *VRAM (this game)* against
|
||||
*Dedicated GPU memory*, *RAM (this game)* against *Memory (private working set)*; the Dashboard's live line; the
|
||||
Sessions columns, the Trend's memory metrics and the Sensors charts. (b) **The Legal Gate** shows the EULA 1.5, the
|
||||
Disclaimer 2.10 and the Privacy Policy 2.6 once, rendered, with the GPL as *your licence*, needing no acceptance.
|
||||
(c) **Help ▸ User guide**, **Help ▸ About** (its three tabs; *Open the licences folder* in the installed copy), and
|
||||
*View on GitHub* opening the `v0.1.0-beta.12` tag. (d) The `ja` strings marked `review` (the memory labels, the
|
||||
About window, the first-start summary). (e) `docs/LIST_GAME_TESTED.md` is as of beta.10: refresh it from a copy of
|
||||
the ledger, with the games' memory figures, and approve it before it is committed (D35).
|
||||
10. **beta.13 on real hardware.** (a) **The first delta:** update an installed `0.1.0-beta.12` through Help ▸ Check for
|
||||
updates — the download is a fraction of the full ~107 MB, and the App comes back as beta.13; if it downloaded the
|
||||
full package instead, say so (Velopack falls back silently). (b) **On this PC:** with an Easy Anti-Cheat service
|
||||
running for any game, start a hook-enabled game — the notice says the anti-cheat is running on this PC, not in
|
||||
the game. (c) **Two graphics cards**, if a machine with them is at hand: the Sensors chart's GPU figures are the
|
||||
game's card. (d) The `ja` review of the new safety strings, with the others still marked for it.
|
||||
|
||||
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
|
||||
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
|
||||
|
||||
@@ -44,6 +44,9 @@ correct it by hand — your correction is labelled as yours.
|
||||
Changes to your hardware or driver are marked on it.
|
||||
- **Compare** (in the navigation on the left) — pick sessions, even of different games, and see them side by side.
|
||||
|
||||
To look closer, hold **Ctrl** and turn the mouse wheel over a chart to zoom, drag to pan, and double-click to reset. The
|
||||
wheel alone scrolls the page.
|
||||
|
||||
## Export
|
||||
|
||||
The summary's **Export CSV**, **Export JSON** and **Export PNG** buttons — or File ▸ Export — save a session to a file.
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@
|
||||
that changes what FrameLedger.Overlay or the capture host does; date the change.
|
||||
HTML comments are not part of the block.
|
||||
-->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.11`** (2026-10-03), an unsigned installer built from that tag with its
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-04.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
+2
-2
@@ -113,8 +113,8 @@ Software running inside another process can, in principle, destabilize it. Frame
|
||||
Frame timing is derived from high-resolution timestamps taken at the moment the game presents each frame; upscaling, frame-generation and ray-tracing state are read from the parameters the game passes to those APIs. This is substantially more accurate than inferring settings from files on disk, but **no measurement is guaranteed to be exact**:
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.11`** (2026-10-03), an unsigned installer built from that tag with its
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-04.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
@@ -78,6 +78,8 @@ public partial class App : System.Windows.Application
|
||||
HookCrashHandlers();
|
||||
// 08_UI §Accessibility (P4 PR-8): Esc closes the open ContentDialog or MessageBox, before any window exists.
|
||||
DialogKeyboard.Register();
|
||||
// beta.14: ui.hide_scrollbars reaches every scroller as it loads, those in a control's template too.
|
||||
ScrollBarHiding.Register();
|
||||
_run = DiagReport.Requested(e.Args) ? DiagAsync() : RunAsync();
|
||||
}
|
||||
|
||||
@@ -102,6 +104,7 @@ public partial class App : System.Windows.Application
|
||||
var registered = new RegisteredSettings(store);
|
||||
LoggingLevel.SetDebug(await registered.GetBooleanAsync(SettingsRegistry.LogDebug).ConfigureAwait(true));
|
||||
FpsDecimals.Two = await registered.GetBooleanAsync(SettingsRegistry.UiFpsDecimals).ConfigureAwait(true);
|
||||
ScrollBarHiding.Apply(await registered.GetBooleanAsync(SettingsRegistry.UiHideScrollBars).ConfigureAwait(true));
|
||||
var closePolicy = new WindowClosePolicy { MinimizeToTray = await registered.GetBooleanAsync(SettingsRegistry.UiMinimizeToTray).ConfigureAwait(true) };
|
||||
|
||||
_host = BuildHost(_db, appearance, registered, closePolicy);
|
||||
|
||||
@@ -70,10 +70,14 @@ public static class ChartTheme
|
||||
(byte)Math.Round((top.B * a) + (under.B * (1 - a))));
|
||||
}
|
||||
|
||||
/// <summary>Registers a control so a theme change re-applies and refreshes it (weakly held; a closed window is forgotten).</summary>
|
||||
/// <summary>
|
||||
/// Registers a control so a theme change re-applies and refreshes it (weakly held; a closed window is forgotten), and
|
||||
/// gives it the App's wheel: a plain wheel scrolls the page, Ctrl+wheel zooms (<see cref="ChartWheel"/>, beta.14).
|
||||
/// </summary>
|
||||
public static void Attach(WpfPlot control)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(control);
|
||||
ChartWheel.Attach(control);
|
||||
lock (_lock)
|
||||
{
|
||||
_live.RemoveAll(static w => !w.TryGetTarget(out _));
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using ScottPlot.WPF;
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// The mouse wheel over a chart (beta.14). ScottPlot 5's <see cref="WpfPlot"/> zooms on every wheel and never marks it
|
||||
/// handled, so with the pages scrolling again (<c>16_WPFUI_SYNTAX</c> §Gotchas: they did not until beta.14) a wheel over a
|
||||
/// chart would have zoomed it AND scrolled the page under the pointer. A plain wheel now belongs to the page — ScottPlot
|
||||
/// never sees it — and Ctrl+wheel to the chart, which zooms and keeps the page where it is. Every plot reaches this through
|
||||
/// <see cref="ChartTheme.Attach"/>.
|
||||
/// </summary>
|
||||
internal static class ChartWheel
|
||||
{
|
||||
/// <summary>Whether a wheel with these modifier keys zooms the chart rather than scrolling the page: Ctrl held.</summary>
|
||||
public static bool Zooms(ModifierKeys modifiers) => (modifiers & ModifierKeys.Control) == ModifierKeys.Control;
|
||||
|
||||
public static void Attach(WpfPlot plot)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(plot);
|
||||
plot.PreviewMouseWheel += OnPreviewMouseWheel;
|
||||
plot.MouseWheel += OnMouseWheel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The tunnelling half, before ScottPlot's own handler on its inner element: a plain wheel is taken from the plot and
|
||||
/// raised again on the plot's parent, from where it bubbles to the page's scroller as any other wheel would.
|
||||
/// </summary>
|
||||
private static void OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if (e.Handled || Zooms(Keyboard.Modifiers) || sender is not DependencyObject plot)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
if (VisualTreeHelper.GetParent(plot) is UIElement parent)
|
||||
{
|
||||
parent.RaiseEvent(new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta) { RoutedEvent = UIElement.MouseWheelEvent, Source = sender });
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The bubbling half, after ScottPlot has zoomed: Ctrl+wheel stops here, so the page does not scroll as well.</summary>
|
||||
private static void OnMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if (Zooms(Keyboard.Modifiers))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,8 @@
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:sp="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
|
||||
MinHeight="260">
|
||||
<!-- 08_UI §Session summary / FR-5.1: the frametime timeline, min/max decimated (FR-5.3); zoom and pan are ScottPlot's.
|
||||
<!-- 08_UI §Session summary / FR-5.1: the frametime timeline, min/max decimated (FR-5.3); zoom and pan are ScottPlot's —
|
||||
zoom with Ctrl+wheel since beta.14, a plain wheel scrolls the page (ChartWheel).
|
||||
The note above it says what the lines are not, when that is not obvious (beta.8). -->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
Safety_AdminMode_* only, versioned by AgentAdminDisclosure.Version. It states what the option adds, what it does not
|
||||
change, how Windows asks, and the risk; every colour is a theme brush.
|
||||
-->
|
||||
<ScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
|
||||
<ui:PassiveScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel>
|
||||
<ui:TextBlock Text="{x:Static vm:AgentAdminDialogViewModel.Intro}" TextWrapping="Wrap" />
|
||||
<ui:TextBlock Margin="0,14,0,0" Text="{x:Static vm:AgentAdminDialogViewModel.Adds}" TextWrapping="Wrap" />
|
||||
@@ -34,5 +34,5 @@
|
||||
IsChecked="{Binding Accepted, Mode=TwoWay}" />
|
||||
<ui:TextBlock Margin="0,12,0,0" HorizontalAlignment="Right" Appearance="Tertiary" Text="{x:Static vm:AgentAdminDialogViewModel.Version}" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</ui:PassiveScrollViewer>
|
||||
</UserControl>
|
||||
@@ -16,7 +16,7 @@
|
||||
versioned by AntiCheatExceptionDisclosure.Version. It states why the exception is offered, the risk, what is still
|
||||
refused, how it ends, and that it turns nothing on; it recommends neither choice. Every colour is a theme brush.
|
||||
-->
|
||||
<ScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
|
||||
<ui:PassiveScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel>
|
||||
<ui:TextBlock Text="{Binding Intro}" TextWrapping="Wrap" />
|
||||
<ui:TextBlock Margin="0,14,0,0" Text="{Binding Why}" TextWrapping="Wrap" />
|
||||
@@ -37,5 +37,5 @@
|
||||
Content="{x:Static vm:AntiCheatExceptionDialogViewModel.AcceptText}"
|
||||
IsChecked="{Binding Accepted, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</ui:PassiveScrollViewer>
|
||||
</UserControl>
|
||||
@@ -19,7 +19,7 @@
|
||||
<ui:TextBlock TextWrapping="Wrap" Text="{Binding Intro}" />
|
||||
<Border Margin="0,10,0,10" Padding="10,6" CornerRadius="6"
|
||||
Background="{DynamicResource ControlFillColorDefaultBrush}" BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}" BorderThickness="1">
|
||||
<ScrollViewer MaxHeight="220" VerticalScrollBarVisibility="Auto">
|
||||
<ui:PassiveScrollViewer MaxHeight="220" VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl ItemsSource="{Binding Entries}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -27,7 +27,7 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</ui:PassiveScrollViewer>
|
||||
</Border>
|
||||
<ui:HyperlinkButton Padding="0" Content="{x:Static vm:BugReportPreviewViewModel.ShowZipText}" Command="{Binding ShowZipCommand}" />
|
||||
<ui:TextBlock Margin="0,10,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:BugReportPreviewViewModel.DragInstruction}" />
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
tiers are two paragraphs of the same shape, in the order enable / do-not-enable, with nothing between
|
||||
them that reads as a recommendation. Every colour is a theme brush (16_WPFUI §Theming).
|
||||
-->
|
||||
<ScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
|
||||
<ui:PassiveScrollViewer MaxHeight="520" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel>
|
||||
<ui:TextBlock Text="{x:Static vm:ConsentDialogViewModel.Intro}" TextWrapping="Wrap" />
|
||||
|
||||
@@ -38,5 +38,5 @@
|
||||
Text="{Binding Typed, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="{x:Static vm:ConsentDialogViewModel.Phrase}" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</ui:PassiveScrollViewer>
|
||||
</UserControl>
|
||||
@@ -16,15 +16,30 @@
|
||||
or has no executable cannot be ticked (its box is disabled since beta.11 - before, a tick was taken and ignored).
|
||||
Rows already in the library are hidden unless "Show the N games already in the library" is ticked, and then
|
||||
dimmed. Import never enables hooking (the intro says so).
|
||||
|
||||
beta.14 (owner's screenshot, dark theme): every row was white with white text and every tick box a sliver. The row
|
||||
style was based on {x:Type DataGridRow}, which WPF UI 4.3.0 does not define - it keys its row style
|
||||
DefaultDataGridRowStyle and hands it to the grid through the DataGrid style's RowStyle - so the lookup fell through
|
||||
to Aero2's row template and its SystemColors.WindowBrush, which no theme reaches. The sliver is WPF UI's CheckBox
|
||||
style, MinWidth 120 and padding 11, in a 40 px column: MinWidth 0 and no padding draw the whole box. And the list
|
||||
no longer scrolls inside a dialog that scrolls too: ImportReviewPrompt turns the dialog's own
|
||||
scrolling off, so the grid takes the height the window leaves and is the one thing that scrolls - the intro and the
|
||||
count stay where they are (ImportReviewRenderTests).
|
||||
-->
|
||||
<StackPanel>
|
||||
<ui:TextBlock TextWrapping="Wrap" Text="{x:Static vm:ImportReviewViewModel.Intro}" />
|
||||
<CheckBox Margin="0,8,0,0" Content="{Binding ShowExistingText}" IsChecked="{Binding ShowExisting, Mode=TwoWay}"
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" MinHeight="120" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ui:TextBlock Grid.Row="0" TextWrapping="Wrap" Text="{x:Static vm:ImportReviewViewModel.Intro}" />
|
||||
<CheckBox Grid.Row="1" Margin="0,8,0,0" Content="{Binding ShowExistingText}" IsChecked="{Binding ShowExisting, Mode=TwoWay}"
|
||||
Visibility="{Binding HasExisting, Converter={StaticResource BoolToVis}}" />
|
||||
<DataGrid Margin="0,10,0,8" MaxHeight="360" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column"
|
||||
<DataGrid x:Name="Candidates" Grid.Row="2" Margin="0,10,0,8" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column"
|
||||
ItemsSource="{Binding Shown}" SelectionMode="Single" IsReadOnly="False">
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRowStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsExisting}" Value="True">
|
||||
<Setter Property="Opacity" Value="0.55" />
|
||||
@@ -36,7 +51,7 @@
|
||||
<DataGridTemplateColumn Width="40">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox HorizontalAlignment="Center" IsEnabled="{Binding CanImport}"
|
||||
<CheckBox MinWidth="0" Padding="0" HorizontalAlignment="Center" IsEnabled="{Binding CanImport}"
|
||||
AutomationProperties.Name="{Binding Name}"
|
||||
IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</DataTemplate>
|
||||
@@ -48,12 +63,12 @@
|
||||
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnNote}" Binding="{Binding Note}" IsReadOnly="True" Width="Auto" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<DockPanel>
|
||||
<DockPanel Grid.Row="3">
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
||||
<ui:HyperlinkButton Padding="4,0" Content="{x:Static res:Strings.Import_SelectAll}" Command="{Binding SelectAllCommand}" xmlns:res="clr-namespace:FrameLedger.App" />
|
||||
<ui:HyperlinkButton Padding="4,0" Content="{x:Static res:Strings.Import_SelectNone}" Command="{Binding SelectNoneCommand}" xmlns:res="clr-namespace:FrameLedger.App" />
|
||||
</StackPanel>
|
||||
<ui:TextBlock Appearance="Secondary" VerticalAlignment="Center" Text="{Binding SelectedText}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -8,9 +8,10 @@
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
|
||||
Title="{x:Static res:Strings.Compare_Header}">
|
||||
Title="{x:Static res:Strings.Compare_Header}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<!-- 08_UI §Compare: the picker (2–5, cross-game), the overlaid percentile curves, the stat table; FR-6.2's guard is the view model's. -->
|
||||
<ScrollViewer>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<ui:TextBlock FontTypography="Title" Text="{x:Static vm:CompareViewModel.Header}" />
|
||||
<ui:TextBlock Margin="0,16,0,0" Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:CompareViewModel.EmptyText}"
|
||||
@@ -32,7 +33,16 @@
|
||||
ItemsSource="{Binding ViewModel.Candidates}" SelectionMode="Single"
|
||||
Visibility="{Binding ViewModel.IsEmpty, Converter={StaticResource InverseBoolToVis}}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" Width="40" />
|
||||
<!-- A template column, not DataGridCheckBoxColumn: that one's element style is WPF's own, an Aero2 box on the Fluent grid; MinWidth 0
|
||||
and no padding, or WPF UI's CheckBox (MinWidth 120, padding 11) draws a sliver of the box in 40 px (beta.14). -->
|
||||
<DataGridTemplateColumn Width="40">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:CompareCandidateViewModel}">
|
||||
<CheckBox MinWidth="0" Padding="0" HorizontalAlignment="Center" AutomationProperties.Name="{Binding Label}"
|
||||
IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Game}" Binding="{Binding GameName}" IsReadOnly="True" Width="2*" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Date}" Binding="{Binding DateText}" IsReadOnly="True" Width="*" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Tier}" Binding="{Binding TierText}" IsReadOnly="True" Width="Auto" />
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
|
||||
Title="{x:Static res:Strings.Dashboard_Header}">
|
||||
<ScrollViewer>
|
||||
Title="{x:Static res:Strings.Dashboard_Header}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<ui:TextBlock FontTypography="Title" Text="{x:Static vm:DashboardViewModel.Header}" />
|
||||
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
|
||||
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
|
||||
Title="{x:Static res:Strings.Games_Header}">
|
||||
Title="{x:Static res:Strings.Games_Header}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<!--
|
||||
08_UI §Games › Game detail. The two rows — Supports (files on disk) and Last session measured (the
|
||||
hooks) — are two cards and never mixed. The hooking control opens FR-2.1's dialog; a blocked pre-scan
|
||||
disables it with the reason inline; a refusal is a persistent InfoBar on this page, never a toast.
|
||||
-->
|
||||
<ScrollViewer>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<ui:HyperlinkButton Padding="0" Command="{Binding ViewModel.BackCommand}" Content="{x:Static vm:GameDetailViewModel.BackText}" Icon="{ui:SymbolIcon ArrowLeft24}" />
|
||||
|
||||
|
||||
@@ -10,14 +10,15 @@
|
||||
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
|
||||
Title="{x:Static res:Strings.Games_Header}"
|
||||
AllowDrop="True"
|
||||
Drop="OnDrop">
|
||||
Drop="OnDrop"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<!--
|
||||
08_UI §Games: search, sort, FR-1.1 add by pick or by dropping an .exe here. Since beta.11 (owner requests 2026-10-03):
|
||||
the count in the title; a grid of cards that fills the width (UniformWrapPanel - a WrapPanel of 300 px cards left a
|
||||
card's width unused at the right) or a list (ui.library_view); Refresh reads the library again, offers the games the
|
||||
stores installed since, and marks the entries whose executable is gone.
|
||||
-->
|
||||
<ScrollViewer>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
Title="{x:Static res:Strings.Logs_Header}">
|
||||
Title="{x:Static res:Strings.Logs_Header}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<Grid Margin="24,16,24,16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
Title="{x:Static res:Strings.Settings_Header}">
|
||||
<ScrollViewer>
|
||||
Title="{x:Static res:Strings.Settings_Header}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<ui:TextBlock FontTypography="Title" Text="{x:Static vm:SettingsViewModel.Header}" />
|
||||
|
||||
@@ -310,6 +311,17 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_FpsDecimals_Label}" IsChecked="{Binding ViewModel.FpsTwoDecimals, Mode=TwoWay}" />
|
||||
</ui:CardControl>
|
||||
<!-- beta.14 (owner request 2026-10-05): no scroll bars drawn; the wheel, the keyboard and touch still scroll. -->
|
||||
<ui:CardControl Margin="0,8,0,0" Icon="{ui:SymbolIcon ArrowSortDownLines24}">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_HideScrollBars_Label}" />
|
||||
<ui:TextBlock MaxWidth="520" HorizontalAlignment="Left" Appearance="Secondary" TextWrapping="Wrap"
|
||||
Text="{x:Static res:Strings.Settings_HideScrollBars_Body}" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_HideScrollBars_Label}" IsChecked="{Binding ViewModel.HideScrollBars, Mode=TwoWay}" />
|
||||
</ui:CardControl>
|
||||
|
||||
<!--
|
||||
Updates, logging, legal. The Privacy card — the `privacy.online_metadata` toggle — is not shown
|
||||
|
||||
@@ -305,7 +305,10 @@ public static class Formats
|
||||
case "RefusedHookNotEnabled":
|
||||
return Strings.Summary_Tier2_Why_HookOff;
|
||||
case "RefusedByGuard" or "SafetyUnhook" when n.GuardFamily is { Length: > 0 } family:
|
||||
return string.Format(CultureInfo.CurrentCulture, Strings.Summary_Tier2_Why_Guard_Format, family, n.GuardSignal ?? Strings.Common_NotAvailable);
|
||||
// A driver or service is on the PC, not in the game (beta.13, §S23-3).
|
||||
return string.Format(CultureInfo.CurrentCulture,
|
||||
IsMachineWide(n.GuardReason) ? Strings.Summary_Tier2_Why_MachineWide_Format : Strings.Summary_Tier2_Why_Guard_Format,
|
||||
family, n.GuardSignal ?? Strings.Common_NotAvailable);
|
||||
case "RefusedByGuard" when n.GuardReason is { Length: > 0 } reason:
|
||||
// A refusal no family names (beta.8): the guard could not look, the game is 32-bit… — said as what it is,
|
||||
// never "… was detected in this game", which read as a finding.
|
||||
@@ -364,6 +367,18 @@ public static class Formats
|
||||
public static string GuardSentence(string reason) =>
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Guard_Refused_Format, GuardReasonText(reason));
|
||||
|
||||
/// <summary>
|
||||
/// §S23-3 (beta.13): a driver or a service is found on the PC, not in the game. The guard's checks 2 and 2b are
|
||||
/// machine-wide, so while one runs every game refuses — the measured case is Easy Anti-Cheat's service, running for
|
||||
/// another title — and a notice must not say it was detected "in this game".
|
||||
/// </summary>
|
||||
public static bool IsMachineWide(string? guardReason) => guardReason is "BlockedDriver" or "BlockedService";
|
||||
|
||||
/// <summary>A refusal the guard named a family for, as a sentence: found on this PC, or found in this game.</summary>
|
||||
public static string NamedRefusal(string? guardReason, string family, string signal) =>
|
||||
string.Format(CultureInfo.CurrentCulture,
|
||||
IsMachineWide(guardReason) ? Shared.Strings.Safety_Refused_MachineWide_Format : Shared.Strings.Safety_Refused_Named_Format, family, signal);
|
||||
|
||||
/// <summary>What a familyless guard reason means, as a clause.</summary>
|
||||
public static string GuardReasonText(string reason) => reason switch
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@ public sealed record HookingConsentResult(HookingConsentOutcome Outcome, string?
|
||||
return string.IsNullOrEmpty(Refusal.Reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(Refusal.Reason);
|
||||
}
|
||||
|
||||
return string.Format(System.Globalization.CultureInfo.CurrentCulture, Shared.Strings.Safety_Refused_Named_Format, Refusal.Family, Refusal.Signal ?? Refusal.Reason);
|
||||
// The pre-scan's reason is the guard's own: a driver or service would be on the PC, not in the game (beta.13, §S23-3).
|
||||
return Formats.NamedRefusal(Refusal.Reason, Refusal.Family, Refusal.Signal ?? Refusal.Reason);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using FrameLedger.App.Dialogs;
|
||||
using FrameLedger.App.ViewModels;
|
||||
@@ -10,7 +11,11 @@ using Wpf.Ui.Controls;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>FR-1.2's review checklist in WPF UI: a <c>ContentDialog</c> whose primary button follows the tick count; Cancel adds nothing.</summary>
|
||||
/// <summary>
|
||||
/// FR-1.2's review checklist in WPF UI: a <c>ContentDialog</c> whose primary button follows the tick count; Cancel adds nothing.
|
||||
/// The dialog's own scrolling is off (beta.14): its content row then has the height the window leaves, the list fills it and is
|
||||
/// the one thing that scrolls — a scrolling list inside a scrolling dialog pushed the intro out of sight at the list's end.
|
||||
/// </summary>
|
||||
public sealed class ImportReviewPrompt : IImportReview
|
||||
{
|
||||
private readonly IContentDialogService _dialogs;
|
||||
@@ -21,18 +26,24 @@ public sealed class ImportReviewPrompt : IImportReview
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(candidates);
|
||||
var viewModel = new ImportReviewViewModel(candidates);
|
||||
var dialog = new ContentDialog
|
||||
{
|
||||
Title = ImportReviewViewModel.Title,
|
||||
Content = new ImportReviewContent(viewModel),
|
||||
PrimaryButtonText = Strings.Import_Add,
|
||||
CloseButtonText = Strings.Common_Cancel,
|
||||
DefaultButton = ContentDialogButton.Primary,
|
||||
DialogMaxWidth = 900,
|
||||
};
|
||||
ContentDialog dialog = Create(viewModel);
|
||||
_ = dialog.SetBinding(ContentDialog.IsPrimaryButtonEnabledProperty, new Binding(nameof(ImportReviewViewModel.CanImport)) { Source = viewModel, Mode = BindingMode.OneWay });
|
||||
|
||||
ContentDialogResult result = await _dialogs.ShowAsync(dialog, ct).ConfigureAwait(true);
|
||||
return result == ContentDialogResult.Primary ? viewModel.Selected : null;
|
||||
}
|
||||
|
||||
/// <summary>The dialog as shown, without a host: a test lays it out in one of its own.</summary>
|
||||
internal static ContentDialog Create(ImportReviewViewModel viewModel, ContentDialogHost? host = null)
|
||||
{
|
||||
ContentDialog dialog = host is null ? new ContentDialog() : new ContentDialog(host);
|
||||
dialog.Title = ImportReviewViewModel.Title;
|
||||
dialog.Content = new ImportReviewContent(viewModel);
|
||||
dialog.PrimaryButtonText = Strings.Import_Add;
|
||||
dialog.CloseButtonText = Strings.Common_Cancel;
|
||||
dialog.DefaultButton = ContentDialogButton.Primary;
|
||||
dialog.DialogMaxWidth = 900;
|
||||
ScrollViewer.SetVerticalScrollBarVisibility(dialog, ScrollBarVisibility.Disabled);
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
@@ -50,16 +50,15 @@ public sealed class SafetyNotices : IDisposable
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Notice_Refused_Title_Format, refused.GameName ?? Strings.Common_NotAvailable),
|
||||
// "The session is still recorded" is true for every refusal since 2026-09-22: the loop holds a refused session
|
||||
// open, unhooked, until the game exits (it was untrue for a process that could not be opened, 2026-09-21).
|
||||
TurnedOff(RefusalText(refused.Reason, refused.Family, refused.Signal) + " " + Strings.Notice_Refused_Recording, refused.HookingTurnedOff), now);
|
||||
TurnedOff(RefusalText(refused.Reason, refused.GuardReason, refused.Family, refused.Signal) + " " + Strings.Notice_Refused_Recording, refused.HookingTurnedOff), now);
|
||||
case IpcMessageType.SafetyUnhook when IpcCodec.Payload<SafetyUnhookEvent>(envelope) is { } unhooked:
|
||||
return new SafetyNotice(SafetyNoticeKind.Unhooked, Strings.Notice_Unhooked_Title,
|
||||
TurnedOff(string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable), unhooked.HookingTurnedOff), now);
|
||||
return new SafetyNotice(SafetyNoticeKind.Unhooked, Strings.Notice_Unhooked_Title, TurnedOff(UnhookText(unhooked), unhooked.HookingTurnedOff), now);
|
||||
// The Agent's pre-scan of the library turned hooking off for a game the user had turned it on for (2026-09-25):
|
||||
// not a session event, so none of a refusal's "this run is still recorded" — no run is going on.
|
||||
case IpcMessageType.HookingTurnedOff when IpcCodec.Payload<HookingTurnedOffEvent>(envelope) is { } off:
|
||||
return new SafetyNotice(SafetyNoticeKind.HookingOff,
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Notice_HookingOff_Title_Format, off.GameName ?? Strings.Common_NotAvailable),
|
||||
TurnedOff(RefusalText(off.Reason, off.Family, off.Signal), turnedOff: true), now);
|
||||
TurnedOff(RefusalText(off.Reason, off.Reason, off.Family, off.Signal), turnedOff: true), now);
|
||||
case IpcMessageType.CaptureDegraded when IpcCodec.Payload<CaptureDegradedEvent>(envelope) is { } degraded:
|
||||
return new SafetyNotice(SafetyNoticeKind.Degraded, Strings.Notice_Degraded_Title,
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Notice_Degraded_Body_Format, degraded.Reason), now);
|
||||
@@ -71,7 +70,18 @@ public sealed class SafetyNotices : IDisposable
|
||||
/// <summary>The finding turned the game's hooking off (2026-09-22): the notice says so, because the page will.</summary>
|
||||
private static string TurnedOff(string text, bool turnedOff) => turnedOff ? text + " " + Shared.Strings.Safety_HookingTurnedOff : text;
|
||||
|
||||
private static string RefusalText(string reason, string? family, string? signal)
|
||||
/// <summary>
|
||||
/// A driver or service that started on the PC mid-session is said as that (beta.13, §S23-3) — not "detected while the
|
||||
/// game was running … until you enable it again", which was untrue twice: such a finding turns no hooking off, and a
|
||||
/// finding about the game turns it off for good (the turned-off sentence follows).
|
||||
/// </summary>
|
||||
private static string UnhookText(SafetyUnhookEvent unhooked) =>
|
||||
Formats.IsMachineWide(unhooked.GuardReason) && unhooked.Family is { } family
|
||||
? string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_MachineWide_Format, family, unhooked.Signal ?? Strings.Common_NotAvailable)
|
||||
: string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable);
|
||||
|
||||
/// <summary><paramref name="reason"/> is the session's end reason; <paramref name="guardReason"/> the guard's own, when it named a family.</summary>
|
||||
private static string RefusalText(string reason, string? guardReason, string? family, string? signal)
|
||||
{
|
||||
if (string.Equals(reason, "PreScanCouldNotVerify", StringComparison.Ordinal))
|
||||
{
|
||||
@@ -90,7 +100,7 @@ public sealed class SafetyNotices : IDisposable
|
||||
return string.IsNullOrEmpty(reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(reason);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Refused_Named_Format, family, signal ?? reason);
|
||||
return Formats.NamedRefusal(guardReason, family, signal ?? reason);
|
||||
}
|
||||
|
||||
private void OnEvent(object? sender, AgentEventArgs e)
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// <c>ui.hide_scrollbars</c> (beta.14, owner request 2026-10-05): the App draws no scroll bars, and every scroller still
|
||||
/// scrolls — with the wheel, the keyboard and touch. A bar's visibility is bound in its scroller's template, so no style can
|
||||
/// reach it; this sets the scroller's own <see cref="ScrollBarVisibility"/> instead. One class handler on
|
||||
/// <see cref="ScrollViewer"/>'s <c>Loaded</c>, registered at start beside <see cref="DialogKeyboard"/>, sees every scroller the
|
||||
/// App shows, those inside a control's template too (a DataGrid's, a TextBox's, a rendered document's, a dialog's). While
|
||||
/// on, an axis whose bar is <see cref="ScrollBarVisibility.Auto"/> or <see cref="ScrollBarVisibility.Visible"/> becomes
|
||||
/// <see cref="ScrollBarVisibility.Hidden"/> — WPF's "no bar, still scrolls" — and its own value is remembered on it;
|
||||
/// <see cref="ScrollBarVisibility.Disabled"/> is never touched, because a disabled axis lays its content out at the viewport's
|
||||
/// size and wraps text. Off puts every remembered value back, on screen at once and on the next load for the rest.
|
||||
/// </summary>
|
||||
public static class ScrollBarHiding
|
||||
{
|
||||
private static readonly DependencyProperty _ownVerticalProperty =
|
||||
DependencyProperty.RegisterAttached("OwnVertical", typeof(ScrollBarVisibility?), typeof(ScrollBarHiding), new PropertyMetadata(null));
|
||||
|
||||
private static readonly DependencyProperty _ownHorizontalProperty =
|
||||
DependencyProperty.RegisterAttached("OwnHorizontal", typeof(ScrollBarVisibility?), typeof(ScrollBarHiding), new PropertyMetadata(null));
|
||||
|
||||
private static volatile bool _hidden;
|
||||
private static int _registered;
|
||||
|
||||
/// <summary>Whether the bars are hidden right now.</summary>
|
||||
public static bool Hidden => _hidden;
|
||||
|
||||
/// <summary>Registers the class handler, once per process.</summary>
|
||||
public static void Register()
|
||||
{
|
||||
if (Interlocked.Exchange(ref _registered, 1) == 0)
|
||||
{
|
||||
EventManager.RegisterClassHandler(typeof(ScrollViewer), FrameworkElement.LoadedEvent, new RoutedEventHandler(OnLoaded), handledEventsToo: true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the preference and applies it to every scroller of every open window — at once on the App's own thread, where
|
||||
/// Settings changes it; from any other thread the windows are visited when that thread's dispatcher next runs.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD001:Avoid legacy thread switching APIs", Justification = "a WPF application has no JoinableTaskFactory; the windows belong to the dispatcher's thread, and posting to it never blocks (UiThread does the same)")]
|
||||
public static void Apply(bool hidden)
|
||||
{
|
||||
_hidden = hidden;
|
||||
if (System.Windows.Application.Current is not { } app)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (app.Dispatcher.CheckAccess())
|
||||
{
|
||||
ApplyToWindows(app);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = app.Dispatcher.InvokeAsync(() => ApplyToWindows(app));
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyToWindows(System.Windows.Application app)
|
||||
{
|
||||
foreach (Window window in app.Windows)
|
||||
{
|
||||
ApplyUnder(window);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Applies the current preference to every scroller under <paramref name="root"/>: an open window, or a test's tree.</summary>
|
||||
public static void ApplyUnder(DependencyObject root)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(root);
|
||||
if (root is ScrollViewer viewer)
|
||||
{
|
||||
Set(viewer);
|
||||
}
|
||||
|
||||
int count = VisualTreeHelper.GetChildrenCount(root);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
ApplyUnder(VisualTreeHelper.GetChild(root, i));
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ScrollViewer viewer)
|
||||
{
|
||||
Set(viewer);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Set(ScrollViewer viewer)
|
||||
{
|
||||
Axis(viewer, ScrollViewer.VerticalScrollBarVisibilityProperty, _ownVerticalProperty);
|
||||
Axis(viewer, ScrollViewer.HorizontalScrollBarVisibilityProperty, _ownHorizontalProperty);
|
||||
}
|
||||
|
||||
private static void Axis(ScrollViewer viewer, DependencyProperty axis, DependencyProperty own)
|
||||
{
|
||||
var remembered = (ScrollBarVisibility?)viewer.GetValue(own);
|
||||
if (_hidden)
|
||||
{
|
||||
if (remembered is null && viewer.GetValue(axis) is ScrollBarVisibility current and (ScrollBarVisibility.Auto or ScrollBarVisibility.Visible))
|
||||
{
|
||||
viewer.SetValue(own, current);
|
||||
viewer.SetCurrentValue(axis, ScrollBarVisibility.Hidden);
|
||||
}
|
||||
}
|
||||
else if (remembered is { } value)
|
||||
{
|
||||
viewer.ClearValue(own);
|
||||
viewer.SetCurrentValue(axis, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+9
@@ -769,6 +769,8 @@ public static class Strings
|
||||
nameof(Settings_Header),
|
||||
nameof(Settings_HideAntiCheatHooking_Body),
|
||||
nameof(Settings_HideAntiCheatHooking_Label),
|
||||
nameof(Settings_HideScrollBars_Body),
|
||||
nameof(Settings_HideScrollBars_Label),
|
||||
nameof(Settings_HookedGames_Label),
|
||||
nameof(Settings_HookedGames_Revoke),
|
||||
nameof(Settings_Interval_Body),
|
||||
@@ -873,6 +875,7 @@ public static class Strings
|
||||
nameof(Summary_Tier2_Why_ConsentChanged),
|
||||
nameof(Summary_Tier2_Why_Guard_Format),
|
||||
nameof(Summary_Tier2_Why_HookOff),
|
||||
nameof(Summary_Tier2_Why_MachineWide_Format),
|
||||
nameof(Summary_Tier2_Why_Other_Format),
|
||||
nameof(Summary_Tier2_Why_Unreadable),
|
||||
nameof(Summary_Title_Format),
|
||||
@@ -2462,6 +2465,10 @@ public static class Strings
|
||||
|
||||
public static string Settings_HideAntiCheatHooking_Label => ResourceManager.GetString(nameof(Settings_HideAntiCheatHooking_Label), Culture) ?? nameof(Settings_HideAntiCheatHooking_Label);
|
||||
|
||||
public static string Settings_HideScrollBars_Body => ResourceManager.GetString(nameof(Settings_HideScrollBars_Body), Culture) ?? nameof(Settings_HideScrollBars_Body);
|
||||
|
||||
public static string Settings_HideScrollBars_Label => ResourceManager.GetString(nameof(Settings_HideScrollBars_Label), Culture) ?? nameof(Settings_HideScrollBars_Label);
|
||||
|
||||
public static string Settings_HookedGames_Label => ResourceManager.GetString(nameof(Settings_HookedGames_Label), Culture) ?? nameof(Settings_HookedGames_Label);
|
||||
|
||||
public static string Settings_HookedGames_Revoke => ResourceManager.GetString(nameof(Settings_HookedGames_Revoke), Culture) ?? nameof(Settings_HookedGames_Revoke);
|
||||
@@ -2670,6 +2677,8 @@ public static class Strings
|
||||
|
||||
public static string Summary_Tier2_Why_HookOff => ResourceManager.GetString(nameof(Summary_Tier2_Why_HookOff), Culture) ?? nameof(Summary_Tier2_Why_HookOff);
|
||||
|
||||
public static string Summary_Tier2_Why_MachineWide_Format => ResourceManager.GetString(nameof(Summary_Tier2_Why_MachineWide_Format), Culture) ?? nameof(Summary_Tier2_Why_MachineWide_Format);
|
||||
|
||||
public static string Summary_Tier2_Why_Other_Format => ResourceManager.GetString(nameof(Summary_Tier2_Why_Other_Format), Culture) ?? nameof(Summary_Tier2_Why_Other_Format);
|
||||
|
||||
public static string Summary_Tier2_Why_Unreadable => ResourceManager.GetString(nameof(Summary_Tier2_Why_Unreadable), Culture) ?? nameof(Summary_Tier2_Why_Unreadable);
|
||||
|
||||
@@ -1457,6 +1457,10 @@
|
||||
<value>理由: ガードが拒否しました — {0}({1})。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Summary_Tier2_Why_MachineWide_Format" xml:space="preserve">
|
||||
<value>理由: このPCで {0} が動作していました({1})— ドライバーまたはサービスです。これが動作している間、FrameLedger はどのゲームにも注入しません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Summary_Tier2_Why_HookOff" xml:space="preserve">
|
||||
<value>理由: このゲームのフックはオフだったため、何も読み込まれていません。</value>
|
||||
<comment>review</comment>
|
||||
@@ -3837,4 +3841,12 @@
|
||||
<value>FrameLedger に対するあなたのライセンスです。参考として表示しています。プログラムを実行するために同意する必要はありません(GPLv3 第 9 条)。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_HideScrollBars_Label" xml:space="preserve">
|
||||
<value>スクロール バーを非表示にする</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_HideScrollBars_Body" xml:space="preserve">
|
||||
<value>アプリ内のどこにもスクロール バーを表示しません。マウス ホイール、キーボード、タッチでのスクロールは引き続き使えます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1098,6 +1098,9 @@
|
||||
<data name="Summary_Tier2_Why_Guard_Format" xml:space="preserve">
|
||||
<value>Why: the guard refused — {0} ({1}).</value>
|
||||
</data>
|
||||
<data name="Summary_Tier2_Why_MachineWide_Format" xml:space="preserve">
|
||||
<value>Why: {0} was running on this PC ({1}) — a driver or service — and FrameLedger injects into no game while it runs.</value>
|
||||
</data>
|
||||
<data name="Summary_Tier2_Why_HookOff" xml:space="preserve">
|
||||
<value>Why: hooking was off for this game, so nothing was injected.</value>
|
||||
</data>
|
||||
@@ -2888,4 +2891,10 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="FirstRun_Doc_InformationNote" xml:space="preserve">
|
||||
<value>Your licence to FrameLedger, shown for information: you do not need to accept it to run the program (GPLv3 section 9).</value>
|
||||
</data>
|
||||
<data name="Settings_HideScrollBars_Label" xml:space="preserve">
|
||||
<value>Hide scroll bars</value>
|
||||
</data>
|
||||
<data name="Settings_HideScrollBars_Body" xml:space="preserve">
|
||||
<value>No scroll bars are drawn anywhere in the app. Everything still scrolls with the mouse wheel, the keyboard and touch.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1093,6 +1093,9 @@
|
||||
<data name="Summary_Tier2_Why_Guard_Format" xml:space="preserve">
|
||||
<value>Lý do: guard đã từ chối — {0} ({1}).</value>
|
||||
</data>
|
||||
<data name="Summary_Tier2_Why_MachineWide_Format" xml:space="preserve">
|
||||
<value>Lý do: {0} đang chạy trên máy này ({1}) — một driver hoặc service — và FrameLedger không inject vào game nào khi nó còn chạy.</value>
|
||||
</data>
|
||||
<data name="Summary_Tier2_Why_HookOff" xml:space="preserve">
|
||||
<value>Lý do: hooking đang tắt cho game này, nên không có gì được inject.</value>
|
||||
</data>
|
||||
@@ -2883,4 +2886,10 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="FirstRun_Doc_InformationNote" xml:space="preserve">
|
||||
<value>Giấy phép của bạn đối với FrameLedger, hiển thị để bạn biết: bạn không cần chấp nhận nó để chạy chương trình (GPLv3 mục 9).</value>
|
||||
</data>
|
||||
<data name="Settings_HideScrollBars_Label" xml:space="preserve">
|
||||
<value>Ẩn thanh cuộn</value>
|
||||
</data>
|
||||
<data name="Settings_HideScrollBars_Body" xml:space="preserve">
|
||||
<value>Không vẽ thanh cuộn ở bất kỳ đâu trong ứng dụng. Mọi thứ vẫn cuộn được bằng con lăn chuột, bàn phím và cảm ứng.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -105,6 +105,10 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _fpsTwoDecimals;
|
||||
|
||||
/// <summary><c>ui.hide_scrollbars</c> (beta.14): no scroll bars drawn; every scroller still scrolls.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _hideScrollBars;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _onlineMetadata;
|
||||
|
||||
@@ -385,6 +389,18 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
Persist(SettingsRegistry.UiFpsDecimals, value);
|
||||
}
|
||||
|
||||
partial void OnHideScrollBarsChanged(bool value)
|
||||
{
|
||||
if (_loading)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// On screen at once — this page's own bars included — and on every scroller that loads from now on.
|
||||
ScrollBarHiding.Apply(value);
|
||||
Persist(SettingsRegistry.UiHideScrollBars, value);
|
||||
}
|
||||
|
||||
partial void OnMinimizeToTrayChanged(bool value)
|
||||
{
|
||||
if (!_loading)
|
||||
@@ -497,6 +513,7 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
UserModeExceptions = await _settings.GetBooleanAsync(SettingsRegistry.HookingUserModeExceptions).ConfigureAwait(true);
|
||||
RunElevated = await _settings.GetBooleanAsync(SettingsRegistry.CaptureRunElevated).ConfigureAwait(true);
|
||||
FpsTwoDecimals = await _settings.GetBooleanAsync(SettingsRegistry.UiFpsDecimals).ConfigureAwait(true);
|
||||
HideScrollBars = await _settings.GetBooleanAsync(SettingsRegistry.UiHideScrollBars).ConfigureAwait(true);
|
||||
OnlineMetadata = await _settings.GetBooleanAsync(SettingsRegistry.PrivacyOnlineMetadata).ConfigureAwait(true);
|
||||
UpdateChannel = await _settings.GetAsync(SettingsRegistry.UpdateChannel).ConfigureAwait(true);
|
||||
AutoCheckUpdates = await _settings.GetBooleanAsync(SettingsRegistry.UpdateAutoCheck).ConfigureAwait(true);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<ui:TitleBar Grid.Row="0" Title="{Binding ViewModel.Title}" ShowMaximize="True" ShowMinimize="True" />
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<ui:TextBlock Appearance="Secondary" TextWrapping="Wrap" Text="{x:Static vm:SessionSummaryViewModel.NotFoundText}"
|
||||
Visibility="{Binding ViewModel.NotFound, Converter={StaticResource BoolToVis}}" />
|
||||
|
||||
@@ -31,6 +31,12 @@ public sealed record CaptureProgress
|
||||
|
||||
public required NgxDriverState NgxDriver { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The adapter the game presents on, as the Overlay published it in the handshake at its first present (beta.13); 0
|
||||
/// before that, on every Tier-2 tick, and for a game that presents through OpenGL or Vulkan, which publish none.
|
||||
/// </summary>
|
||||
public ulong AdapterLuid { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// On a held session's tick (2026-09-23): the refusal it is held under — its reason, and the guard's verdict when the
|
||||
/// guard spoke — so the pipe can say, while the game runs, why nothing is measured. Null on every hooked tick.
|
||||
|
||||
@@ -725,6 +725,7 @@ public sealed class CaptureSession(
|
||||
TouchQpc = Loaded.TouchQpc,
|
||||
RuntimeModules = Loaded.Set,
|
||||
NgxDriver = Loaded.Ngx,
|
||||
AdapterLuid = sink.Handshake.AdapterLuid,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.AntiCheat;
|
||||
using FrameLedger.Shared;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
@@ -106,10 +107,12 @@ public static class RecordedSessionEvents
|
||||
{
|
||||
case Kind.Refused:
|
||||
pipe.Publish(IpcMessageType.CaptureRefused,
|
||||
new CaptureRefusedEvent(info.GameId, info.GameName, o.Reason.ToString(), NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff));
|
||||
new CaptureRefusedEvent(info.GameId, info.GameName, o.Reason.ToString(), NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff,
|
||||
GuardReasonOf(o.Verdict)));
|
||||
break;
|
||||
case Kind.SafetyUnhook:
|
||||
pipe.Publish(IpcMessageType.SafetyUnhook, new SafetyUnhookEvent(sessionGuid, NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff));
|
||||
pipe.Publish(IpcMessageType.SafetyUnhook,
|
||||
new SafetyUnhookEvent(sessionGuid, NullIfEmpty(o.Verdict.Family), NullIfEmpty(o.Verdict.Signal), o.HookingTurnedOff, GuardReasonOf(o.Verdict)));
|
||||
break;
|
||||
case Kind.Degraded:
|
||||
pipe.Publish(IpcMessageType.CaptureDegraded, new CaptureDegradedEvent(sessionGuid, From: 1, To: 2, o.Reason.ToString()));
|
||||
@@ -156,4 +159,10 @@ public static class RecordedSessionEvents
|
||||
};
|
||||
|
||||
private static string? NullIfEmpty(string? value) => string.IsNullOrEmpty(value) ? null : value;
|
||||
|
||||
/// <summary>
|
||||
/// The guard's own reason when it named a family (beta.13, §S23-3): the App says a <c>BlockedService</c> or
|
||||
/// <c>BlockedDriver</c> was found on the PC, not in the game. Null when the guard named nothing.
|
||||
/// </summary>
|
||||
private static string? GuardReasonOf(AntiCheatVerdict verdict) => string.IsNullOrEmpty(verdict.Family) ? null : verdict.Reason.ToString();
|
||||
}
|
||||
@@ -323,6 +323,7 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
{
|
||||
private readonly List<TelemetrySample> _drained = [];
|
||||
private CaptureProgress? _last;
|
||||
private ulong _adapter;
|
||||
|
||||
public DateTimeOffset? AttachedAt { get; private set; }
|
||||
|
||||
@@ -350,11 +351,29 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
public void Tick(CaptureProgress progress)
|
||||
{
|
||||
_last = progress;
|
||||
FollowAdapter(progress.AdapterLuid);
|
||||
DrainTelemetry();
|
||||
writer.OnTick(progress);
|
||||
observer?.Tick(guid, progress, _drained);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The adapter the game presents on (beta.13): the Overlay publishes its LUID at the first present, the telemetry thread
|
||||
/// is told once, and the <c>.partial</c> says whether its layers could follow — until then, and where they could not,
|
||||
/// they describe the adapter they found first (<c>18_GPU_VENDOR_APIS</c> §L1).
|
||||
/// </summary>
|
||||
private void FollowAdapter(ulong luid)
|
||||
{
|
||||
if (luid == 0 || luid == _adapter)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_adapter = luid;
|
||||
bool followed = poller?.FollowAdapter(luid) ?? false;
|
||||
writer.Note(string.Create(CultureInfo.InvariantCulture, $"adapter: luid=0x{luid:x} {(followed ? "followed" : "not followed")}"));
|
||||
}
|
||||
|
||||
public void FinalFlush()
|
||||
{
|
||||
DrainTelemetry();
|
||||
|
||||
@@ -66,6 +66,17 @@ public static class SettingsRegistry
|
||||
Default = "0",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Whether the App draws no scroll bars (beta.14, owner request 2026-10-05): every scroller still scrolls with the wheel,
|
||||
/// the keyboard and touch, it only stops showing its bar. Off by default — the bars are what every page showed until then.
|
||||
/// </summary>
|
||||
public static readonly SettingDefinition UiHideScrollBars = new()
|
||||
{
|
||||
Key = "ui.hide_scrollbars",
|
||||
Kind = SettingKind.Boolean,
|
||||
Default = "0",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// How the Games library is shown (beta.11, owner request 2026-10-03): a grid of cards that fills the width, or a list.
|
||||
/// The page's own switch writes it; Settings has no row for it.
|
||||
@@ -199,7 +210,7 @@ public static class SettingsRegistry
|
||||
/// <summary>Every definition, in the order <c>06_DATA_MODEL</c> lists them.</summary>
|
||||
public static IReadOnlyList<SettingDefinition> All { get; } =
|
||||
[
|
||||
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals, UiLibraryView,
|
||||
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals, UiHideScrollBars, UiLibraryView,
|
||||
CaptureBackground, HookingKillSwitch, HookingUserModeExceptions, CaptureRunElevated, CaptureMinSessionSeconds, TelemetryIntervalMs, RetentionRawSessionsPerGame,
|
||||
UpdateChannel, UpdateAutoCheck, PrivacyOnlineMetadata, LogDebug,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Application.Telemetry;
|
||||
|
||||
/// <summary>
|
||||
/// A telemetry layer that can be pointed at one graphics adapter (beta.13): L1 reads DXGI's identity and the adapter-wide
|
||||
/// memory counter for the adapter it is told, by the LUID the Overlay publishes in the handshake at the game's first
|
||||
/// present. Until then it describes the first hardware adapter in DXGI's high-performance order.
|
||||
/// </summary>
|
||||
public interface IGpuAdapterSelector
|
||||
{
|
||||
/// <summary>The adapter being described; null before one is known.</summary>
|
||||
GpuAdapterIdentity? Selected { get; }
|
||||
|
||||
/// <summary>Switch to the adapter with this LUID. False — and no change — for 0, or for a LUID it did not list.</summary>
|
||||
bool SelectAdapter(ulong luid);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Application.Telemetry;
|
||||
|
||||
/// <summary>
|
||||
/// A telemetry layer that reads its own GPU rather than one named by LUID (beta.13) — LibreHardwareMonitor's GPU node,
|
||||
/// NVAPI's physical GPU — told the PCI vendor of the adapter the game presents on, so it describes that vendor's GPU or
|
||||
/// nothing. A layer whose GPU is not the game's contributes no field: a confident figure from the wrong card is worse
|
||||
/// than N/A (<c>FlShmHandshake.AdapterLuid</c>'s own rule).
|
||||
/// </summary>
|
||||
public interface IGpuVendorFollower
|
||||
{
|
||||
/// <summary>The game's adapter is this PCI vendor's (<c>0x10DE</c> NVIDIA, <c>0x1002</c> AMD, <c>0x8086</c> Intel, or another).</summary>
|
||||
void FollowVendor(uint vendorId);
|
||||
}
|
||||
@@ -41,4 +41,10 @@ public interface ITelemetryPoller : IDisposable
|
||||
/// what may be opened (<see cref="GameProcess"/>). A poller with no game source ignores it.
|
||||
/// </summary>
|
||||
void Follow(GameProcess target) { }
|
||||
|
||||
/// <summary>
|
||||
/// The adapter the game presents on, by the LUID the Overlay publishes at its first present (beta.13): the layers follow
|
||||
/// it. False when the source cannot follow adapters or did not list this one — a poller without layers says false.
|
||||
/// </summary>
|
||||
bool FollowAdapter(ulong luid) => false;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace FrameLedger.Infrastructure.Telemetry;
|
||||
/// answer (N/A, layer healthy), not a fault.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class BaselineTelemetrySource : IGpuTelemetrySource
|
||||
public sealed class BaselineTelemetrySource : IGpuTelemetrySource, IGpuAdapterSelector
|
||||
{
|
||||
/// <summary>Faults tolerated before the layer is disabled. The second one disables.</summary>
|
||||
public const int MaxFaults = 2;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace FrameLedger.Infrastructure.Telemetry;
|
||||
/// Owns its layers: disposing the composite disposes them.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class CompositeTelemetrySource : IGpuTelemetrySource
|
||||
public sealed class CompositeTelemetrySource : IGpuTelemetrySource, IGpuAdapterSelector
|
||||
{
|
||||
/// <summary>Throws tolerated from one layer's <c>TryRead</c> before it is excluded. The second one excludes.</summary>
|
||||
public const int MaxFaults = 2;
|
||||
@@ -42,6 +42,7 @@ public sealed class CompositeTelemetrySource : IGpuTelemetrySource
|
||||
private readonly string?[] _lastFault;
|
||||
private readonly TelemetryLayer[] _fieldLayers = new TelemetryLayer[_fieldBits];
|
||||
private readonly Lock _lock = new();
|
||||
private GpuAdapterIdentity? _selected;
|
||||
private bool _disposed;
|
||||
|
||||
public CompositeTelemetrySource(IEnumerable<IGpuTelemetrySource> layers)
|
||||
@@ -89,6 +90,55 @@ public sealed class CompositeTelemetrySource : IGpuTelemetrySource
|
||||
public string Descriptor =>
|
||||
TelemetryLayerNames.Describe(Enumerable.Range(0, _layers.Length).Where(IsStanding).Select(i => _layers[i].Layer));
|
||||
|
||||
/// <summary>The adapter <see cref="SelectAdapter"/> last chose; null before the game's first present named one.</summary>
|
||||
public GpuAdapterIdentity? Selected
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
return _selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The adapter the game presents on (beta.13). The layer that names adapters by LUID (L1) switches to it, and every layer
|
||||
/// that reads its own GPU is told the adapter's vendor (<see cref="IGpuVendorFollower"/>), so a merged sample describes the
|
||||
/// game's card and not the first one each layer happened to find. False — nothing told — when no layer listed the LUID.
|
||||
/// Under the merge lock, so no sample mixes the old adapter with the new one.
|
||||
/// </summary>
|
||||
public bool SelectAdapter(ulong luid)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
GpuAdapterIdentity? chosen = null;
|
||||
for (int i = 0; i < _layers.Length; i++)
|
||||
{
|
||||
if (IsStanding(i) && _layers[i] is IGpuAdapterSelector selector && selector.SelectAdapter(luid))
|
||||
{
|
||||
chosen ??= selector.Selected;
|
||||
}
|
||||
}
|
||||
|
||||
if (chosen is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_selected = chosen;
|
||||
for (int i = 0; i < _layers.Length; i++)
|
||||
{
|
||||
if (IsStanding(i) && _layers[i] is IGpuVendorFollower follower)
|
||||
{
|
||||
follower.FollowVendor(chosen.VendorId);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>What a layer's last throw said, for the report. Null if it never threw.</summary>
|
||||
public string? LastFaultOf(TelemetryLayer layer)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace FrameLedger.Infrastructure.Telemetry;
|
||||
/// never reports sets nothing. <see cref="GpuSample.PresentFields"/> is the only input.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class LhmTelemetrySource : IGpuTelemetrySource
|
||||
public sealed class LhmTelemetrySource : IGpuTelemetrySource, IGpuVendorFollower
|
||||
{
|
||||
/// <summary>Faults tolerated before the layer is disabled. The second one disables.</summary>
|
||||
public const int MaxFaults = 2;
|
||||
@@ -61,6 +61,9 @@ public sealed class LhmTelemetrySource : IGpuTelemetrySource
|
||||
private int _polling;
|
||||
private int _hangCounted;
|
||||
private long _pollStartedUtcTicks;
|
||||
|
||||
/// <summary>The game adapter's PCI vendor id once known (beta.13); 0 maps the first GPU node, as before.</summary>
|
||||
private int _vendor;
|
||||
private bool _opened;
|
||||
private bool _disposed;
|
||||
private string? _lastFault;
|
||||
@@ -126,8 +129,15 @@ public sealed class LhmTelemetrySource : IGpuTelemetrySource
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One poll: refresh the tree, map the first GPU node, publish. Public so a probe or a
|
||||
/// test can drive it without the thread; the thread calls exactly this.
|
||||
/// The game presents on this vendor's adapter (beta.13): the next polls map that vendor's GPU node rather than the first
|
||||
/// one LibreHardwareMonitor lists — on a laptop that is often the integrated GPU while the game runs on the discrete one —
|
||||
/// and publish nothing when the tree has no node of that vendor.
|
||||
/// </summary>
|
||||
public void FollowVendor(uint vendorId) => Volatile.Write(ref _vendor, unchecked((int)vendorId));
|
||||
|
||||
/// <summary>
|
||||
/// One poll: refresh the tree, map the first GPU node — of the game adapter's vendor once that is known (beta.13) —
|
||||
/// publish. Public so a probe or a test can drive it without the thread; the thread calls exactly this.
|
||||
/// </summary>
|
||||
public void PollOnce()
|
||||
{
|
||||
@@ -143,10 +153,11 @@ public sealed class LhmTelemetrySource : IGpuTelemetrySource
|
||||
{
|
||||
_computer.Update();
|
||||
|
||||
uint vendor = unchecked((uint)Volatile.Read(ref _vendor));
|
||||
IHardware? gpu = null;
|
||||
foreach (IHardware hardware in _computer.Hardware)
|
||||
{
|
||||
if (SensorMap.IsGpu(hardware))
|
||||
if (SensorMap.IsGpu(hardware) && (vendor == 0 || SensorMap.IsVendor(hardware, vendor)))
|
||||
{
|
||||
gpu = hardware;
|
||||
break;
|
||||
|
||||
@@ -24,11 +24,17 @@ namespace FrameLedger.Infrastructure.Telemetry;
|
||||
/// this source never calls <c>NvAPI_D3D_GetLatency</c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class NvapiTelemetrySource : IGpuTelemetrySource
|
||||
public sealed class NvapiTelemetrySource : IGpuTelemetrySource, IGpuVendorFollower
|
||||
{
|
||||
/// <summary>Faults tolerated before the layer is disabled. The second one disables.</summary>
|
||||
public const int MaxFaults = 2;
|
||||
|
||||
/// <summary>NVIDIA's PCI vendor id: the only vendor NVAPI describes.</summary>
|
||||
private const uint _nvidiaVendorId = 0x10DE;
|
||||
|
||||
/// <summary>1 once the game's adapter is known to be another vendor's (beta.13): this layer then reads nothing.</summary>
|
||||
private int _otherVendor;
|
||||
|
||||
private readonly INvapiBridge _bridge;
|
||||
private readonly TimeProvider _clock;
|
||||
private readonly Lock _lock = new();
|
||||
@@ -109,10 +115,18 @@ public sealed class NvapiTelemetrySource : IGpuTelemetrySource
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The game presents on this vendor's adapter (beta.13). NVAPI reads NVIDIA's first physical GPU, which is not the
|
||||
/// game's when the game's adapter is AMD's or Intel's — so for any other vendor the layer contributes nothing from now
|
||||
/// on, rather than a temperature from a card the game is not using. Not a fault and not disabled: the layer is still
|
||||
/// healthy, it just has nothing true to say about this session.
|
||||
/// </summary>
|
||||
public void FollowVendor(uint vendorId) => Volatile.Write(ref _otherVendor, vendorId == _nvidiaVendorId ? 0 : 1);
|
||||
|
||||
public bool TryRead([NotNullWhen(true)] out GpuSample? sample)
|
||||
{
|
||||
sample = null;
|
||||
if (IsDisabled)
|
||||
if (IsDisabled || Volatile.Read(ref _otherVendor) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,22 @@ public static class SensorMap
|
||||
return hardware.HardwareType is HardwareType.GpuNvidia or HardwareType.GpuAmd or HardwareType.GpuIntel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a GPU node is this PCI vendor's (beta.13): NVIDIA <c>0x10DE</c>, AMD <c>0x1002</c>, Intel <c>0x8086</c>. Any
|
||||
/// other vendor has no node LibreHardwareMonitor understands.
|
||||
/// </summary>
|
||||
public static bool IsVendor(IHardware hardware, uint vendorId)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(hardware);
|
||||
return vendorId switch
|
||||
{
|
||||
0x10DE => hardware.HardwareType == HardwareType.GpuNvidia,
|
||||
0x1002 => hardware.HardwareType == HardwareType.GpuAmd,
|
||||
0x8086 => hardware.HardwareType == HardwareType.GpuIntel,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>Every sensor under a node, including its sub-hardware, in tree order.</summary>
|
||||
public static IEnumerable<ISensor> AllSensors(IHardware hardware)
|
||||
{
|
||||
|
||||
@@ -131,6 +131,9 @@ public sealed class TelemetryPoller : ITelemetryPoller
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The adapter the game presents on (beta.13): handed to the source, which points its layers at it.</summary>
|
||||
public bool FollowAdapter(ulong luid) => _source is IGpuAdapterSelector selector && selector.SelectAdapter(luid);
|
||||
|
||||
/// <summary>The game process whose memory the next ticks read (beta.12, D43); ignored without a game source.</summary>
|
||||
public void Follow(GameProcess target)
|
||||
{
|
||||
|
||||
@@ -292,14 +292,21 @@ public sealed record SessionProgressEvent
|
||||
/// </summary>
|
||||
public sealed record SessionCompletedEvent(Guid SessionGuid, long? SessionId, string ExitStatus, int Tier, string Finalize, string Reason, long? GameId = null, string? GameName = null);
|
||||
|
||||
/// <summary>The gate or the guard said no before anything was injected (<c>08_UI</c> §Safety events: never a toast).</summary>
|
||||
public sealed record CaptureRefusedEvent(long GameId, string? GameName, string Reason, string? Family, string? Signal, bool HookingTurnedOff = false);
|
||||
/// <summary>
|
||||
/// The gate or the guard said no before anything was injected (<c>08_UI</c> §Safety events: never a toast).
|
||||
/// <see cref="Reason"/> is the session's end reason; <see cref="GuardReason"/> (beta.13, optional) is the guard's own, sent
|
||||
/// when it named a family — <c>BlockedService</c> or <c>BlockedDriver</c> is a finding on the PC, not in the game (§S23-3).
|
||||
/// </summary>
|
||||
public sealed record CaptureRefusedEvent(long GameId, string? GameName, string Reason, string? Family, string? Signal, bool HookingTurnedOff = false, string? GuardReason = null);
|
||||
|
||||
/// <summary>Measurement STOPPED mid-session (two-rung ladder: there is no lower fidelity to continue at).</summary>
|
||||
public sealed record CaptureDegradedEvent(Guid SessionGuid, int From, int To, string Reason);
|
||||
|
||||
/// <summary>Anti-cheat appeared mid-session and our own guard published the stop.</summary>
|
||||
public sealed record SafetyUnhookEvent(Guid SessionGuid, string? Family, string? Signal, bool HookingTurnedOff = false);
|
||||
/// <summary>
|
||||
/// Anti-cheat appeared mid-session and our own guard published the stop. <see cref="GuardReason"/> as on
|
||||
/// <see cref="CaptureRefusedEvent"/> (beta.13): a driver or service that started on the PC is not a finding in the game.
|
||||
/// </summary>
|
||||
public sealed record SafetyUnhookEvent(Guid SessionGuid, string? Family, string? Signal, bool HookingTurnedOff = false, string? GuardReason = null);
|
||||
|
||||
public sealed record CaptureErrorEvent(Guid? SessionGuid, string Code, string Message);
|
||||
|
||||
|
||||
+6
@@ -70,10 +70,12 @@ public static class Strings
|
||||
nameof(Safety_HookingTurnedOff),
|
||||
nameof(Safety_RecordWithoutMeasuring),
|
||||
nameof(Safety_Refused_CouldNotVerify),
|
||||
nameof(Safety_Refused_MachineWide_Format),
|
||||
nameof(Safety_Refused_Named_Format),
|
||||
nameof(Safety_Refused_TargetUnreadable),
|
||||
nameof(Safety_Refused_Unnamed),
|
||||
nameof(Safety_Unhooked_Format),
|
||||
nameof(Safety_Unhooked_MachineWide_Format),
|
||||
];
|
||||
|
||||
public static string Safety_AdminMode_Accept => ResourceManager.GetString(nameof(Safety_AdminMode_Accept), Culture) ?? nameof(Safety_AdminMode_Accept);
|
||||
@@ -158,6 +160,8 @@ public static class Strings
|
||||
|
||||
public static string Safety_Refused_CouldNotVerify => ResourceManager.GetString(nameof(Safety_Refused_CouldNotVerify), Culture) ?? nameof(Safety_Refused_CouldNotVerify);
|
||||
|
||||
public static string Safety_Refused_MachineWide_Format => ResourceManager.GetString(nameof(Safety_Refused_MachineWide_Format), Culture) ?? nameof(Safety_Refused_MachineWide_Format);
|
||||
|
||||
public static string Safety_Refused_Named_Format => ResourceManager.GetString(nameof(Safety_Refused_Named_Format), Culture) ?? nameof(Safety_Refused_Named_Format);
|
||||
|
||||
public static string Safety_Refused_TargetUnreadable => ResourceManager.GetString(nameof(Safety_Refused_TargetUnreadable), Culture) ?? nameof(Safety_Refused_TargetUnreadable);
|
||||
@@ -165,4 +169,6 @@ public static class Strings
|
||||
public static string Safety_Refused_Unnamed => ResourceManager.GetString(nameof(Safety_Refused_Unnamed), Culture) ?? nameof(Safety_Refused_Unnamed);
|
||||
|
||||
public static string Safety_Unhooked_Format => ResourceManager.GetString(nameof(Safety_Unhooked_Format), Culture) ?? nameof(Safety_Unhooked_Format);
|
||||
|
||||
public static string Safety_Unhooked_MachineWide_Format => ResourceManager.GetString(nameof(Safety_Unhooked_MachineWide_Format), Culture) ?? nameof(Safety_Unhooked_MachineWide_Format);
|
||||
}
|
||||
@@ -28,9 +28,11 @@
|
||||
<data name="Safety_RecordWithoutMeasuring" xml:space="preserve"><value>Record this session without measuring it</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Refused_CouldNotVerify" xml:space="preserve"><value>FrameLedger could not verify this game's files for anti-cheat, so hooking stays off. It will check again when the game's files or the detection rules change.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Refused_Named_Format" xml:space="preserve"><value>{0} was detected in this game ({1}). FrameLedger will not inject into it, and nothing overrides that.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Refused_MachineWide_Format" xml:space="preserve"><value>{0} is running on this PC ({1}): a driver or service, which may belong to another game or program rather than this one. While it runs, FrameLedger injects into no game, and nothing overrides that.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Refused_Unnamed" xml:space="preserve"><value>An anti-cheat or anti-tamper module was detected in this game. FrameLedger will not inject into it, and nothing overrides that.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking has been turned off for this game; its page says what was found.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running. FrameLedger unhooked and will not inject into this game again until you enable it again.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running, and FrameLedger unhooked.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Capture stopped: {0} started on this PC while the game was running ({1}) — a driver or service, which may belong to another game or program — and FrameLedger unhooked. The game's next session is measured again once it is no longer running.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>The game is running, but Windows would not let FrameLedger open its process: it is protected by an anti-cheat driver, or it runs as administrator while FrameLedger does not. Nothing was injected and this run was not measured. FrameLedger will not work around another product's protection. If the game itself runs as administrator, the agent's admin mode in Settings lets FrameLedger open it; a protected process stays closed.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Make a user-mode exception for {0}?</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger found {0} in this game ({1}) and turned its hooking off. This dialog asks whether to make an exception for this game only. It recommends neither choice.</value><comment>safety: human review required</comment></data>
|
||||
|
||||
@@ -33,9 +33,11 @@
|
||||
<data name="Safety_RecordWithoutMeasuring" xml:space="preserve"><value>Record this session without measuring it</value></data>
|
||||
<data name="Safety_Refused_CouldNotVerify" xml:space="preserve"><value>FrameLedger could not verify this game's files for anti-cheat, so hooking stays off. It will check again when the game's files or the detection rules change.</value></data>
|
||||
<data name="Safety_Refused_Named_Format" xml:space="preserve"><value>{0} was detected in this game ({1}). FrameLedger will not inject into it, and nothing overrides that.</value></data>
|
||||
<data name="Safety_Refused_MachineWide_Format" xml:space="preserve"><value>{0} is running on this PC ({1}): a driver or service, which may belong to another game or program rather than this one. While it runs, FrameLedger injects into no game, and nothing overrides that.</value></data>
|
||||
<data name="Safety_Refused_Unnamed" xml:space="preserve"><value>An anti-cheat or anti-tamper module was detected in this game. FrameLedger will not inject into it, and nothing overrides that.</value></data>
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking has been turned off for this game; its page says what was found.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running. FrameLedger unhooked and will not inject into this game again until you enable it again.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running, and FrameLedger unhooked.</value></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Capture stopped: {0} started on this PC while the game was running ({1}) — a driver or service, which may belong to another game or program — and FrameLedger unhooked. The game's next session is measured again once it is no longer running.</value></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>The game is running, but Windows would not let FrameLedger open its process: it is protected by an anti-cheat driver, or it runs as administrator while FrameLedger does not. Nothing was injected and this run was not measured. FrameLedger will not work around another product's protection. If the game itself runs as administrator, the agent's admin mode in Settings lets FrameLedger open it; a protected process stays closed.</value></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Make a user-mode exception for {0}?</value></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger found {0} in this game ({1}) and turned its hooking off. This dialog asks whether to make an exception for this game only. It recommends neither choice.</value></data>
|
||||
|
||||
@@ -27,9 +27,11 @@
|
||||
<data name="Safety_RecordWithoutMeasuring" xml:space="preserve"><value>Ghi phiên này mà không đo</value></data>
|
||||
<data name="Safety_Refused_CouldNotVerify" xml:space="preserve"><value>FrameLedger không thể kiểm tra các tệp của game này về anti-cheat, nên hooking vẫn tắt. Nó sẽ kiểm tra lại khi tệp của game hoặc bộ quy tắc phát hiện thay đổi.</value></data>
|
||||
<data name="Safety_Refused_Named_Format" xml:space="preserve"><value>Đã phát hiện {0} trong game này ({1}). FrameLedger sẽ không inject vào game này, và không có cách nào vượt qua điều đó.</value></data>
|
||||
<data name="Safety_Refused_MachineWide_Format" xml:space="preserve"><value>{0} đang chạy trên máy này ({1}): một driver hoặc service, có thể thuộc về game hay chương trình khác chứ không phải game này. Khi nó còn chạy, FrameLedger không inject vào bất kỳ game nào, và không có cách nào vượt qua điều đó.</value></data>
|
||||
<data name="Safety_Refused_Unnamed" xml:space="preserve"><value>Đã phát hiện một mô-đun anti-cheat hoặc anti-tamper trong game này. FrameLedger sẽ không inject vào game này, và không có cách nào vượt qua điều đó.</value></data>
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking đã được tắt cho game này; trang của game ghi rõ đã phát hiện gì.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Đã dừng thu thập: phát hiện {0} khi game đang chạy. FrameLedger đã gỡ hook và sẽ không inject vào game này nữa cho đến khi bạn bật lại.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Đã dừng thu thập: phát hiện {0} khi game đang chạy, và FrameLedger đã gỡ hook.</value></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Đã dừng thu thập: {0} khởi động trên máy này khi game đang chạy ({1}) — một driver hoặc service, có thể thuộc về game hay chương trình khác — và FrameLedger đã gỡ hook. Phiên sau của game sẽ được đo lại khi nó không còn chạy.</value></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>Game đang chạy, nhưng Windows không cho FrameLedger mở tiến trình của nó: tiến trình được driver anti-cheat bảo vệ, hoặc game chạy với quyền quản trị còn FrameLedger thì không. Không có gì được inject và lần chạy này không được đo. FrameLedger sẽ không tìm cách vượt qua cơ chế bảo vệ của sản phẩm khác. Nếu chính game chạy với quyền quản trị, chế độ quản trị của agent trong Cài đặt cho phép FrameLedger mở nó; tiến trình được bảo vệ vẫn đóng.</value></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Tạo ngoại lệ user-mode cho {0}?</value></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger đã phát hiện {0} trong game này ({1}) và đã tắt hooking cho nó. Hộp thoại này hỏi bạn có muốn tạo ngoại lệ cho riêng game này không. Nó không khuyến nghị lựa chọn nào.</value></data>
|
||||
|
||||
@@ -111,6 +111,92 @@ public sealed class AccessibilityTests
|
||||
found.Should().BeEmpty("08_UI §Accessibility, contrast: colours come from the WPF UI theme dictionaries, whose Fluent themes meet contrast in both modes");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The import list's rows were white on white in the dark theme (beta.14): a row style <c>BasedOn="{StaticResource
|
||||
/// {x:Type DataGridRow}}"</c>, which WPF UI 4.3.0 does not define — it keys its row style <c>DefaultDataGridRowStyle</c> —
|
||||
/// so the lookup fell through to Aero2's, whose <c>SystemColors.WindowBrush</c> no theme reaches and no colour scan can see.
|
||||
/// Every type a style is based on must have a style in the App's own dictionaries.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task NoStyleIsBasedOnAnImplicitStyleTheThemeDoesNotDefine()
|
||||
{
|
||||
var typeKeyed = new Regex(@"^\{StaticResource \{x:Type (?:\w+:)?(?<type>\w+)\}\}$", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant, TimeSpan.FromSeconds(1));
|
||||
var wanted = new List<(string File, string Type)>();
|
||||
foreach ((string file, XDocument xaml) in AppXaml())
|
||||
{
|
||||
foreach (XAttribute basedOn in xaml.Descendants().Attributes().Where(static a => string.Equals(a.Name.LocalName, "BasedOn", StringComparison.Ordinal)))
|
||||
{
|
||||
Match match = typeKeyed.Match(basedOn.Value.Trim());
|
||||
if (match.Success)
|
||||
{
|
||||
wanted.Add((file, match.Groups["type"].Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HashSet<string> defined = await PagesLoadTests.OnStaAsync(() => TypeKeyedStyles(System.Windows.Application.Current.Resources));
|
||||
|
||||
wanted.Where(w => !defined.Contains(w.Type)).Select(static w => $"{w.File}: BasedOn {{x:Type {w.Type}}}").Should().BeEmpty(
|
||||
"WPF UI defines no implicit style for that type, so the style would be based on Aero2's — base it on WPF UI's keyed style (DefaultDataGridRowStyle, …)");
|
||||
}
|
||||
|
||||
/// <summary>The names of the types the dictionary (and those merged into it) has an implicit style for.</summary>
|
||||
private static HashSet<string> TypeKeyedStyles(ResourceDictionary dictionary)
|
||||
{
|
||||
var names = new HashSet<string>(StringComparer.Ordinal);
|
||||
foreach (object key in dictionary.Keys)
|
||||
{
|
||||
if (key is Type type)
|
||||
{
|
||||
_ = names.Add(type.Name);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ResourceDictionary merged in dictionary.MergedDictionaries)
|
||||
{
|
||||
names.UnionWith(TypeKeyedStyles(merged));
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
/// <summary>A <c>DataGridCheckBoxColumn</c>'s box is WPF's own element style — an Aero2 box on the Fluent grid (beta.14).</summary>
|
||||
[Fact]
|
||||
public void NoDataGridCheckBoxColumn()
|
||||
{
|
||||
AppXaml().SelectMany(static x => x.Xaml.Descendants().Where(static e => string.Equals(e.Name.LocalName, "DataGridCheckBoxColumn", StringComparison.Ordinal)).Select(_ => x.File))
|
||||
.Should().BeEmpty("a template column with a CheckBox (MinWidth=\"0\" Padding=\"0\") draws the theme's box");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WPF UI 4.3.0 wraps a page in a <c>DynamicScrollViewer</c> unless the page sets <c>ScrollViewer.CanContentScroll</c> to
|
||||
/// false; inside it the page's own root scroller has nothing to scroll and takes every wheel (beta.14: "the wheel does not
|
||||
/// scroll"). Every page opts out and scrolls itself.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EveryPageOptsOutOfTheDynamicScrollViewer()
|
||||
{
|
||||
List<string> pages = [.. AppXaml().Where(static x => string.Equals(x.Xaml.Root!.Name.LocalName, "Page", StringComparison.Ordinal)).Select(static x => x.File)];
|
||||
List<string> wrapped = [.. AppXaml().Where(static x => string.Equals(x.Xaml.Root!.Name.LocalName, "Page", StringComparison.Ordinal)
|
||||
&& !string.Equals(x.Xaml.Root.Attribute("ScrollViewer.CanContentScroll")?.Value, "False", StringComparison.Ordinal))
|
||||
.Select(static x => x.File)];
|
||||
|
||||
pages.Should().HaveCountGreaterThanOrEqualTo(6);
|
||||
wrapped.Should().BeEmpty("a page without ScrollViewer.CanContentScroll=\"False\" is wrapped in WPF UI's scroller, and its own root swallows the wheel");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A stock <c>ScrollViewer</c> takes every wheel, even with nothing left to scroll; inside a dialog that scrolls, the wheel
|
||||
/// then stops at it. WPF UI's <c>PassiveScrollViewer</c> hands the wheel on at its ends (beta.14).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NoPlainScrollViewerInsideADialog()
|
||||
{
|
||||
AppXaml().Where(static x => x.File.StartsWith("Dialogs" + Path.DirectorySeparatorChar, StringComparison.Ordinal))
|
||||
.SelectMany(static x => x.Xaml.Descendants().Where(static e => string.Equals(e.Name.LocalName, "ScrollViewer", StringComparison.Ordinal)).Select(_ => x.File))
|
||||
.Should().BeEmpty("use ui:PassiveScrollViewer inside a dialog");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheManifestIsPerMonitorV2()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Charts;
|
||||
using ScottPlot.WPF;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// The wheel over a chart (beta.14): ScottPlot zooms on every wheel and never marks it handled, so on a page that scrolls a
|
||||
/// wheel over a chart zoomed it AND scrolled the page. A plain wheel is the page's now and Ctrl+wheel the chart's. The Ctrl
|
||||
/// half reads <see cref="Keyboard.Modifiers"/>, which a test cannot press, so it is held by the pure rule; the plain half is
|
||||
/// driven end to end.
|
||||
/// </summary>
|
||||
public sealed class ChartWheelTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(ModifierKeys.None, false)]
|
||||
[InlineData(ModifierKeys.Shift, false)]
|
||||
[InlineData(ModifierKeys.Alt, false)]
|
||||
[InlineData(ModifierKeys.Control, true)]
|
||||
[InlineData(ModifierKeys.Control | ModifierKeys.Shift, true)]
|
||||
public void OnlyCtrlZooms(ModifierKeys modifiers, bool zooms) => ChartWheel.Zooms(modifiers).Should().Be(zooms);
|
||||
|
||||
/// <summary>
|
||||
/// A plain wheel over the plot reaches the page and never the plot's drawing surface, where ScottPlot listens: the probe
|
||||
/// subscribes to the surface's wheel exactly as ScottPlot does, so it is called whenever ScottPlot would zoom.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task APlainWheelOverAChartScrollsThePageAndNotTheChart()
|
||||
{
|
||||
(double Offset, int SurfaceWheels) result = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
var plot = new WpfPlot { Height = 300 };
|
||||
ChartTheme.Attach(plot);
|
||||
var page = new ScrollViewer
|
||||
{
|
||||
Height = 400,
|
||||
Content = new StackPanel { Children = { new Border { Height = 200 }, plot, new Border { Height = 900 } } },
|
||||
};
|
||||
Visuals.Layout(page, 800, 400);
|
||||
|
||||
UIElement surface = Visuals.FindAll<FrameworkElement>(plot).First(static e => string.Equals(e.GetType().Name, "SKElement", StringComparison.Ordinal));
|
||||
int surfaceWheels = 0;
|
||||
surface.MouseWheel += (_, _) => surfaceWheels++;
|
||||
var wheel = new MouseWheelEventArgs(Mouse.PrimaryDevice, Environment.TickCount, -120) { RoutedEvent = UIElement.PreviewMouseWheelEvent };
|
||||
surface.RaiseEvent(wheel);
|
||||
wheel.RoutedEvent = UIElement.MouseWheelEvent;
|
||||
surface.RaiseEvent(wheel);
|
||||
page.UpdateLayout();
|
||||
return (page.VerticalOffset, surfaceWheels);
|
||||
});
|
||||
|
||||
result.Offset.Should().BeGreaterThan(0, "a plain wheel over a chart scrolls the page it is on");
|
||||
result.SurfaceWheels.Should().Be(0, "and never reaches the surface ScottPlot zooms from: zoom is Ctrl+wheel");
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,6 @@ namespace FrameLedger.App.Tests;
|
||||
/// </summary>
|
||||
public sealed class ContrastTests
|
||||
{
|
||||
private const double _aa = 4.5;
|
||||
|
||||
private static readonly string[] _paletteAppearances = ["Info", "Caution", "Danger", "Success"];
|
||||
|
||||
/// <summary>
|
||||
@@ -91,73 +89,33 @@ public sealed class ContrastTests
|
||||
{
|
||||
var themed = new ThemesDictionary { Theme = theme };
|
||||
ApplicationAccentColorManager.Apply(_defaultAccent, theme, systemGlassColor: false, systemAccentColor: true);
|
||||
Color window = Resolve(themed, "ApplicationBackgroundColor");
|
||||
Color card = Over(Resolve(themed, "CardBackgroundFillColorDefault"), window);
|
||||
Color pillOff = Over(Resolve(themed, "ControlFillColorDefault"), card);
|
||||
Color accent = Over(Resolve(themed, "AccentFillColorDefaultBrush"), card);
|
||||
Color caution = Over(Resolve(themed, "SystemFillColorCautionBackground"), card);
|
||||
Color window = Wcag.Resolve(themed, "ApplicationBackgroundColor");
|
||||
Color card = Wcag.Over(Wcag.Resolve(themed, "CardBackgroundFillColorDefault"), window);
|
||||
Color pillOff = Wcag.Over(Wcag.Resolve(themed, "ControlFillColorDefault"), card);
|
||||
Color accent = Wcag.Over(Wcag.Resolve(themed, "AccentFillColorDefaultBrush"), card);
|
||||
Color caution = Wcag.Over(Wcag.Resolve(themed, "SystemFillColorCautionBackground"), card);
|
||||
return new Dictionary<string, double>(StringComparer.Ordinal)
|
||||
{
|
||||
["hooking off: secondary text on the pill"] = Ratio(Over(Resolve(themed, "TextFillColorSecondary"), pillOff), pillOff),
|
||||
["hooking on: on-accent text on the accent"] = Ratio(Over(Resolve(themed, "TextOnAccentFillColorPrimaryBrush"), accent), accent),
|
||||
["qualifier warning: primary text on caution"] = Ratio(Over(Resolve(themed, "TextFillColorPrimary"), caution), caution),
|
||||
["the Info badge, for the record"] = Ratio(Over(Resolve(themed, "TextFillColorPrimary"), PaletteLightBlue()), PaletteLightBlue()),
|
||||
["hooking off: secondary text on the pill"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextFillColorSecondary"), pillOff), pillOff),
|
||||
["hooking on: on-accent text on the accent"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextOnAccentFillColorPrimaryBrush"), accent), accent),
|
||||
["qualifier warning: primary text on caution"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextFillColorPrimary"), caution), caution),
|
||||
["the Info badge, for the record"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextFillColorPrimary"), PaletteLightBlue()), PaletteLightBlue()),
|
||||
};
|
||||
});
|
||||
|
||||
using (new FluentAssertions.Execution.AssertionScope(theme.ToString()))
|
||||
{
|
||||
ratios["hooking off: secondary text on the pill"].Should().BeGreaterThanOrEqualTo(_aa);
|
||||
ratios["hooking on: on-accent text on the accent"].Should().BeGreaterThanOrEqualTo(_aa);
|
||||
ratios["qualifier warning: primary text on caution"].Should().BeGreaterThanOrEqualTo(_aa);
|
||||
ratios["hooking off: secondary text on the pill"].Should().BeGreaterThanOrEqualTo(Wcag.AA);
|
||||
ratios["hooking on: on-accent text on the accent"].Should().BeGreaterThanOrEqualTo(Wcag.AA);
|
||||
ratios["qualifier warning: primary text on caution"].Should().BeGreaterThanOrEqualTo(Wcag.AA);
|
||||
}
|
||||
|
||||
if (theme == ApplicationTheme.Dark)
|
||||
{
|
||||
ratios["the Info badge, for the record"].Should().BeLessThan(_aa, "the pair this class exists for, white on #03A9F4, is what the check must be able to refuse");
|
||||
ratios["the Info badge, for the record"].Should().BeLessThan(Wcag.AA, "the pair this class exists for, white on #03A9F4, is what the check must be able to refuse");
|
||||
}
|
||||
}
|
||||
|
||||
private static Color Resolve(ResourceDictionary themed, string key)
|
||||
{
|
||||
object value = themed[key] ?? System.Windows.Application.Current.Resources[key] ?? throw new InvalidOperationException($"{key} is in neither the theme nor the merged dictionaries");
|
||||
return value switch
|
||||
{
|
||||
Color c => c,
|
||||
SolidColorBrush b => b.Color,
|
||||
_ => throw new InvalidOperationException($"{key} is not a Color or SolidColorBrush in the theme dictionary (got {value.GetType().Name})"),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>WPF UI's Palette.xaml value, the same in both themes; read from the merged dictionaries rather than typed, so a palette change upstream is measured.</summary>
|
||||
private static Color PaletteLightBlue() => Resolve(new ResourceDictionary(), "PaletteLightBlueBrush");
|
||||
|
||||
/// <summary>Source-over compositing of <paramref name="top"/> on an opaque <paramref name="under"/>.</summary>
|
||||
private static Color Over(Color top, Color under)
|
||||
{
|
||||
double a = top.A / 255.0;
|
||||
return Color.FromRgb(
|
||||
(byte)Math.Round(top.R * a + under.R * (1 - a)),
|
||||
(byte)Math.Round(top.G * a + under.G * (1 - a)),
|
||||
(byte)Math.Round(top.B * a + under.B * (1 - a)));
|
||||
}
|
||||
|
||||
/// <summary>WCAG 2.1 contrast ratio between two opaque colours.</summary>
|
||||
private static double Ratio(Color a, Color b)
|
||||
{
|
||||
double la = Luminance(a);
|
||||
double lb = Luminance(b);
|
||||
return (Math.Max(la, lb) + 0.05) / (Math.Min(la, lb) + 0.05);
|
||||
}
|
||||
|
||||
private static double Luminance(Color c)
|
||||
{
|
||||
static double Channel(byte v)
|
||||
{
|
||||
double s = v / 255.0;
|
||||
return s <= 0.03928 ? s / 12.92 : Math.Pow((s + 0.055) / 1.055, 2.4);
|
||||
}
|
||||
|
||||
return (0.2126 * Channel(c.R)) + (0.7152 * Channel(c.G)) + (0.0722 * Channel(c.B));
|
||||
}
|
||||
private static Color PaletteLightBlue() => Wcag.Resolve(new ResourceDictionary(), "PaletteLightBlueBrush");
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Import;
|
||||
using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Markup;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// The import checklist as the owner saw it (beta.14, a screenshot in the dark theme): every row white with white text, the
|
||||
/// tick boxes cut to slivers at the left edge, and a list scrolling inside a dialog that scrolled too, which carried the
|
||||
/// intro out of sight. Each check renders the dialog itself (<see cref="ImportReviewPrompt.Create"/>) laid out at a
|
||||
/// window's size under the App's dictionaries — <c>PagesLoadTests</c>' check counted the rows and looked at nothing.
|
||||
/// </summary>
|
||||
public sealed class ImportReviewRenderTests
|
||||
{
|
||||
private static ImportReviewViewModel Candidates(int count)
|
||||
{
|
||||
var list = new List<ImportCandidate>();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
string dir = string.Create(CultureInfo.InvariantCulture, $@"C:\Games\Game {i}");
|
||||
string? exe = i == 1 ? null : string.Create(CultureInfo.InvariantCulture, $@"{dir}\game{i}.exe");
|
||||
list.Add(new ImportCandidate(new StoreGame("steam", i.ToString(CultureInfo.InvariantCulture), "Game " + i.ToString(CultureInfo.InvariantCulture), dir, exe, null),
|
||||
exe, AlreadyInLibrary: i == 2, ExecutableGuessed: false));
|
||||
}
|
||||
|
||||
return new ImportReviewViewModel(list) { ShowExisting = true };
|
||||
}
|
||||
|
||||
/// <summary>The dialog in a host the size of the window's dialog area, laid out.</summary>
|
||||
private static (Wpf.Ui.Controls.ContentDialog Dialog, Grid Host) Shown(ImportReviewViewModel vm, double height)
|
||||
{
|
||||
Wpf.Ui.Controls.ContentDialog dialog = ImportReviewPrompt.Create(vm);
|
||||
var host = new Grid { Width = 1000, Height = height, Children = { dialog } };
|
||||
Visuals.Layout(host, 1000, height);
|
||||
return (dialog, host);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The text of every text cell against what is painted under it, composited down to the window (the tick box's glyph is an icon, not text). A row of a game already in the
|
||||
/// library is drawn at 0.55 opacity on purpose (inactive: its box cannot be ticked) and is measured as drawn before that dimming.
|
||||
/// </summary>
|
||||
[Theory]
|
||||
[InlineData(ApplicationTheme.Dark)]
|
||||
[InlineData(ApplicationTheme.Light)]
|
||||
public async Task EveryImportRowIsReadable(ApplicationTheme theme)
|
||||
{
|
||||
List<(string Text, double Ratio)> cells = await PagesLoadTests.OnStaAsync(() => Visuals.UnderTheme(theme, () =>
|
||||
{
|
||||
Color window = Wcag.Resolve(new ThemesDictionary { Theme = theme }, "ApplicationBackgroundColor");
|
||||
(Wpf.Ui.Controls.ContentDialog dialog, Grid host) = Shown(Candidates(4), 760);
|
||||
DataGrid grid = Visuals.Find<DataGrid>(dialog)!;
|
||||
var measured = new List<(string, double)>();
|
||||
foreach (DataGridCell cell in Visuals.FindAll<DataGridCell>(grid).Where(static c => c.Column is DataGridTextColumn))
|
||||
{
|
||||
foreach (TextBlock text in Visuals.FindAll<TextBlock>(cell).Where(static t => t.Text.Length > 0))
|
||||
{
|
||||
Color under = Visuals.PaintedUnder(text, host, window);
|
||||
measured.Add((text.Text, Wcag.Ratio(Visuals.TextOver(text, under), under)));
|
||||
}
|
||||
}
|
||||
|
||||
return measured;
|
||||
}));
|
||||
|
||||
cells.Should().NotBeEmpty("the rows were rendered and their cells hold text");
|
||||
cells.Should().OnlyContain(static c => c.Ratio >= Wcag.AA, $"08_UI §Contrast: every row reads at WCAG AA in the {theme} theme (the beta.11 rows were white on white in Dark)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The owner's screenshot showed each tick box as a sliver at the row's left edge: WPF UI's CheckBox style (MinWidth 120,
|
||||
/// padding 11) in a 40 px column. Counted in the rendered pixels: a ticked box is the accent's 20×20 square, about 380 accent-blue pixels when
|
||||
/// it is drawn whole and about 140 when it is the sliver.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheTickBoxesAreDrawnWhole()
|
||||
{
|
||||
List<int> accentPixels = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
(Wpf.Ui.Controls.ContentDialog dialog, Grid host) = Shown(Candidates(4), 760);
|
||||
var bitmap = new System.Windows.Media.Imaging.RenderTargetBitmap(1000, 760, 96, 96, PixelFormats.Pbgra32);
|
||||
bitmap.Render(host);
|
||||
byte[] pixels = new byte[1000 * 760 * 4];
|
||||
bitmap.CopyPixels(pixels, 1000 * 4, 0);
|
||||
var counts = new List<int>();
|
||||
foreach (DataGridCell cell in Visuals.FindAll<DataGridCell>(Visuals.Find<DataGrid>(dialog)!))
|
||||
{
|
||||
if (Visuals.Find<CheckBox>(cell) is { IsChecked: true } box)
|
||||
{
|
||||
// Half a row of slack above and below: the dialog's opening transform moves what is drawn a few pixels
|
||||
// from where layout puts it, and the rows on either side hold no ticked box.
|
||||
Rect area = box.TransformToAncestor(host).TransformBounds(new Rect(box.RenderSize));
|
||||
area.Inflate(0, 16);
|
||||
counts.Add(AccentPixels(pixels, 1000, area));
|
||||
}
|
||||
}
|
||||
|
||||
return counts;
|
||||
});
|
||||
|
||||
accentPixels.Should().HaveCount(2, "rows 0 and 3 start ticked; row 1 has no executable and row 2 is already in the library");
|
||||
accentPixels.Should().OnlyContain(static n => n >= 250, "a ticked box is drawn whole (about 380 accent pixels), not as a sliver (about 140)");
|
||||
}
|
||||
|
||||
/// <summary>Pixels in <paramref name="area"/> of a Pbgra32 bitmap that read as the accent's blue.</summary>
|
||||
private static int AccentPixels(byte[] pixels, int width, Rect area)
|
||||
{
|
||||
int count = 0;
|
||||
for (int y = (int)Math.Max(0, area.Top); y < (int)area.Bottom; y++)
|
||||
{
|
||||
for (int x = (int)Math.Max(0, area.Left); x < (int)Math.Min(width, area.Right); x++)
|
||||
{
|
||||
int i = ((y * width) + x) * 4;
|
||||
byte blue = pixels[i];
|
||||
byte red = pixels[i + 2];
|
||||
if (blue > 150 && red < 110)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ALongListScrollsInsideTheListAndTheIntroStaysVisible()
|
||||
{
|
||||
(double DialogScrollable, double ListScrollable, double FooterBottom, double Viewport) layout = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
(Wpf.Ui.Controls.ContentDialog dialog, _) = Shown(Candidates(60), 600);
|
||||
var body = (ScrollViewer)dialog.Template.FindName("PART_ContentScroll", dialog);
|
||||
var content = (FrameworkElement)body.Content;
|
||||
DataGrid grid = Visuals.Find<DataGrid>(content)!;
|
||||
ScrollViewer list = Visuals.Find<ScrollViewer>(grid)!;
|
||||
FrameworkElement footer = Visuals.FindAll<Wpf.Ui.Controls.TextBlock>(content).Last();
|
||||
double footerBottom = footer.TransformToAncestor(body).Transform(new Point(0, footer.ActualHeight)).Y;
|
||||
return (body.ScrollableHeight, list.ScrollableHeight, footerBottom, body.ViewportHeight);
|
||||
});
|
||||
|
||||
layout.DialogScrollable.Should().Be(0, "the dialog's own body does not scroll: nothing above the list can be carried away");
|
||||
layout.ListScrollable.Should().BeGreaterThan(0, "sixty rows scroll inside the list");
|
||||
layout.FooterBottom.Should().BeLessThanOrEqualTo(layout.Viewport + 0.5, "the selection count under the list is inside the dialog, not cut off");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Pages;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Infrastructure.Persistence;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// The mouse wheel on the pages (beta.14, owner: "the wheel does not scroll, I have to drag the scroll bar"). WPF UI 4.3.0's
|
||||
/// <see cref="NavigationViewContentPresenter"/> wraps a page in a <c>DynamicScrollViewer</c> unless the page sets
|
||||
/// <c>ScrollViewer.CanContentScroll="False"</c>; inside it the page's own root scroller had infinite height, nothing to
|
||||
/// scroll, and took every wheel all the same. Each check hosts a page the way the App does — navigated in the presenter.
|
||||
/// </summary>
|
||||
public sealed partial class PagesLoadTests
|
||||
{
|
||||
/// <summary>A page navigated in WPF UI's presenter and laid out in an area the size of the window's.</summary>
|
||||
private static NavigationViewContentPresenter Navigated(System.Windows.Controls.Page page, double height)
|
||||
{
|
||||
var presenter = new NavigationViewContentPresenter();
|
||||
var area = new Grid { Width = 1000, Height = height, Children = { presenter } };
|
||||
Visuals.Layout(area, 1000, height);
|
||||
_ = presenter.Navigate(page);
|
||||
Visuals.Pump();
|
||||
Visuals.Layout(area, 1000, height);
|
||||
Visuals.Pump();
|
||||
area.UpdateLayout();
|
||||
return presenter;
|
||||
}
|
||||
|
||||
private static void Wheel(UIElement over, int delta)
|
||||
{
|
||||
var wheel = new MouseWheelEventArgs(Mouse.PrimaryDevice, Environment.TickCount, delta) { RoutedEvent = UIElement.PreviewMouseWheelEvent };
|
||||
over.RaiseEvent(wheel);
|
||||
wheel.RoutedEvent = UIElement.MouseWheelEvent;
|
||||
over.RaiseEvent(wheel);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ANavigatedPageIsNotWrappedInTheDynamicScrollViewerAndTheWheelScrollsIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
var consent = new HookingConsent(new NoAgent(), new NoPrompt());
|
||||
(SettingsViewModel settings, LogsViewModel logs) = await SettingsAndLogsAsync(s, consent, new NoStrip());
|
||||
using LogsViewModel ownedLogs = logs;
|
||||
|
||||
(bool Wrapped, double Offset) result = await OnStaAsync(() =>
|
||||
{
|
||||
var page = new SettingsPage(settings, new SystemInfoViewModel(new FixedHardware(), new NoClipboard(), new NoStrip()));
|
||||
NavigationViewContentPresenter presenter = Navigated(page, 500);
|
||||
System.Windows.Controls.ScrollViewer root = Visuals.Find<System.Windows.Controls.ScrollViewer>(page)!;
|
||||
Wheel(Visuals.Leaf((UIElement)root.Content), -120);
|
||||
presenter.UpdateLayout();
|
||||
return (presenter.IsDynamicScrollViewerEnabled, root.VerticalOffset);
|
||||
});
|
||||
|
||||
result.Wrapped.Should().BeFalse("the page opts out of WPF UI's wrapper (ScrollViewer.CanContentScroll=\"False\")");
|
||||
result.Offset.Should().BeGreaterThan(0, "the wheel over the page's text scrolls the page");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheLogsTailIsBoundedAndFollowsTheEnd()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
var consent = new HookingConsent(new NoAgent(), new NoPrompt());
|
||||
(_, LogsViewModel logs) = await SettingsAndLogsAsync(s, consent, new NoStrip());
|
||||
using LogsViewModel ownedLogs = logs;
|
||||
|
||||
(double Height, double Offset) tail = await OnStaAsync(() =>
|
||||
{
|
||||
var page = new LogsPage(logs);
|
||||
_ = Navigated(page, 500);
|
||||
page.Tail.Text = string.Join(Environment.NewLine, Enumerable.Range(1, 400).Select(static i => "line " + i.ToString(System.Globalization.CultureInfo.InvariantCulture)));
|
||||
page.UpdateLayout();
|
||||
page.Tail.ScrollToEnd();
|
||||
page.UpdateLayout();
|
||||
return (page.Tail.ActualHeight, page.Tail.VerticalOffset);
|
||||
});
|
||||
|
||||
tail.Height.Should().BeLessThan(500, "the tail has the height the page leaves it, not one tall enough for every line");
|
||||
tail.Offset.Should().BeGreaterThan(0, "so it scrolls, and ScrollToEnd (autoscroll) shows the newest line");
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace FrameLedger.App.Tests;
|
||||
/// binding typo or a missing resource key produces is a XamlParseException at first navigation, which no
|
||||
/// view-model test sees. Runs on an STA thread with an <c>Application</c> of its own.
|
||||
/// </summary>
|
||||
public sealed class PagesLoadTests
|
||||
public sealed partial class PagesLoadTests
|
||||
{
|
||||
private sealed class NoAgent : IAgentLink
|
||||
{
|
||||
@@ -563,20 +563,29 @@ public sealed class PagesLoadTests
|
||||
(SettingsViewModel settings, LogsViewModel logs) = await SettingsAndLogsAsync(s, consent, strip);
|
||||
using LogsViewModel _ = logs;
|
||||
|
||||
string loaded = await OnStaAsync(() =>
|
||||
(string loaded, List<string> wrapped) = await OnStaAsync(() =>
|
||||
{
|
||||
Render(new DashboardPage(dashboard));
|
||||
Render(new GamesPage(games));
|
||||
Render(new GameDetailPage(detail));
|
||||
Render(new ComparePage(compare));
|
||||
Render(new SettingsPage(settings, new SystemInfoViewModel(new FixedHardware(), new NoClipboard(), strip)));
|
||||
Render(new LogsPage(logs));
|
||||
// WPF UI changes ScrollViewer.CanContentScroll's default for Page to true when its content presenter is first
|
||||
// used, as the App's NavigationView does at start-up; a page that keeps it is wrapped in a scroller (beta.14).
|
||||
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(Wpf.Ui.Controls.NavigationViewContentPresenter).TypeHandle);
|
||||
System.Windows.Controls.Page[] pages =
|
||||
[
|
||||
new DashboardPage(dashboard), new GamesPage(games), new GameDetailPage(detail), new ComparePage(compare),
|
||||
new SettingsPage(settings, new SystemInfoViewModel(new FixedHardware(), new NoClipboard(), strip)), new LogsPage(logs),
|
||||
];
|
||||
foreach (System.Windows.Controls.Page page in pages)
|
||||
{
|
||||
Render(page);
|
||||
}
|
||||
|
||||
RenderFirstRun(s);
|
||||
RenderControls(detail);
|
||||
return "dashboard,games,detail,settings,logs,firstrun,readout,chip";
|
||||
return ("dashboard,games,detail,settings,logs,firstrun,readout,chip",
|
||||
pages.Where(static p => System.Windows.Controls.ScrollViewer.GetCanContentScroll(p)).Select(static p => p.GetType().Name).ToList());
|
||||
});
|
||||
|
||||
loaded.Should().Be("dashboard,games,detail,settings,logs,firstrun,readout,chip");
|
||||
wrapped.Should().BeEmpty("every page sets ScrollViewer.CanContentScroll=\"False\", or WPF UI wraps it in a scroller its own root swallows the wheel for (16_WPFUI_SYNTAX §Gotchas)");
|
||||
settings.MinSessionSeconds.Should().Be(30);
|
||||
games.Games.Should().ContainSingle();
|
||||
detail.Sessions.Should().HaveCount(2);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
@@ -12,6 +13,7 @@ namespace FrameLedger.App.Tests;
|
||||
/// persistent notices with the signal named and the acknowledge action; a capture error is the strip's; a
|
||||
/// session event is nobody's; a notice leaves only when the user dismisses it.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the expected texts are resources that follow the UI culture")]
|
||||
public sealed class SafetyNoticesTests
|
||||
{
|
||||
[Fact]
|
||||
@@ -55,6 +57,48 @@ public sealed class SafetyNoticesTests
|
||||
strip.Shown.Should().BeEmpty("never a toast");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// §S23-3 (beta.13): while Easy Anti-Cheat's service runs for another title, EVERY game refuses with
|
||||
/// <c>BlockedService</c> (spike-notes §13), and the notice said it was detected "in this game" — a game the user may not
|
||||
/// even own. A driver or a service is said as running on this PC; a module in the game still says "in this game".
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AServiceOrDriverIsOnThisPcAndAModuleIsInThisGame()
|
||||
{
|
||||
var link = new FakeAgentLink();
|
||||
using var notices = new SafetyNotices(link, new RecordingStrip());
|
||||
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", "Easy Anti-Cheat", "EasyAntiCheat_EOS", GuardReason: "BlockedService"));
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", "Riot Vanguard", "vgk.sys", GuardReason: "BlockedDriver"));
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", "BattlEye", "BEClient_x64.dll", GuardReason: "BlockedModule"));
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", "BattlEye", "BEClient_x64.dll"));
|
||||
|
||||
string[] bodies = [.. notices.Items.Reverse().Select(static n => n.Body)];
|
||||
bodies[0].Should().StartWith(Format(Shared.Strings.Safety_Refused_MachineWide_Format, "Easy Anti-Cheat", "EasyAntiCheat_EOS"));
|
||||
bodies[1].Should().StartWith(Format(Shared.Strings.Safety_Refused_MachineWide_Format, "Riot Vanguard", "vgk.sys"));
|
||||
bodies[2].Should().StartWith(Format(Shared.Strings.Safety_Refused_Named_Format, "BattlEye", "BEClient_x64.dll"));
|
||||
bodies[3].Should().StartWith(Format(Shared.Strings.Safety_Refused_Named_Format, "BattlEye", "BEClient_x64.dll"), "an older Agent sends no guard reason");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The unhook notice promised "will not inject into this game again until you enable it again", untrue both ways since
|
||||
/// 2026-09-22: a service that starts on the PC turns no hooking off, and a finding about the game turns it off for good —
|
||||
/// which the turned-off sentence then says (beta.13).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AnUnhookSaysWhereTheFindingWasAndPromisesNoReEnable()
|
||||
{
|
||||
var link = new FakeAgentLink();
|
||||
using var notices = new SafetyNotices(link, new RecordingStrip());
|
||||
|
||||
link.Raise(IpcMessageType.SafetyUnhook, new SafetyUnhookEvent(Guid.NewGuid(), "Easy Anti-Cheat", "EasyAntiCheat_EOS", GuardReason: "BlockedService"));
|
||||
link.Raise(IpcMessageType.SafetyUnhook, new SafetyUnhookEvent(Guid.NewGuid(), "BattlEye", "BEClient_x64.dll", HookingTurnedOff: true, GuardReason: "BlockedModule"));
|
||||
|
||||
string[] bodies = [.. notices.Items.Reverse().Select(static n => n.Body)];
|
||||
bodies[0].Should().Be(Format(Shared.Strings.Safety_Unhooked_MachineWide_Format, "Easy Anti-Cheat", "EasyAntiCheat_EOS"));
|
||||
bodies[1].Should().Be(Format(Shared.Strings.Safety_Unhooked_Format, "BattlEye") + " " + Shared.Strings.Safety_HookingTurnedOff);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ACouldNotVerifyRefusalUsesItsOwnSentence()
|
||||
{
|
||||
@@ -150,4 +194,8 @@ public sealed class SafetyNoticesTests
|
||||
|
||||
notices.Items.Should().BeEmpty();
|
||||
}
|
||||
|
||||
private static string Format(string format, string first) => string.Format(CultureInfo.CurrentCulture, format, first);
|
||||
|
||||
private static string Format(string format, string first, string second) => string.Format(CultureInfo.CurrentCulture, format, first, second);
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// <c>ui.hide_scrollbars</c> (beta.14, owner request 2026-10-05: "an option to hide the scroll bars but still scroll"). Each
|
||||
/// check builds the scrollers the App shows — a plain one, a DataGrid's, a multi-line TextBox's, a rendered document's, and
|
||||
/// one whose axis is Disabled — and turns the option on and off within one job on the STA thread. The option is process-wide
|
||||
/// state, so the class runs with the other classes that write such state, one at a time.
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class ScrollBarHidingTests
|
||||
{
|
||||
/// <summary>Every kind of scroller the App has, each with more content than its height, laid out in a column.</summary>
|
||||
private static (StackPanel Root, ScrollViewer Plain, ScrollViewer Disabled) Scrollers()
|
||||
{
|
||||
var plain = new ScrollViewer { Height = 120, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Content = new Border { Height = 600 } };
|
||||
var disabled = new ScrollViewer { Height = 120, VerticalScrollBarVisibility = ScrollBarVisibility.Disabled, Content = new TextBlock { Text = "wraps" } };
|
||||
var grid = new DataGrid { Height = 120, ItemsSource = Enumerable.Range(1, 50).Select(static i => new { Row = i }).ToList() };
|
||||
var text = new TextBox
|
||||
{
|
||||
Height = 120,
|
||||
AcceptsReturn = true,
|
||||
VerticalScrollBarVisibility = ScrollBarVisibility.Auto,
|
||||
Text = string.Join(Environment.NewLine, Enumerable.Range(1, 60).Select(static i => "line " + i.ToString(System.Globalization.CultureInfo.InvariantCulture))),
|
||||
};
|
||||
var document = new FlowDocumentScrollViewer { Height = 120, Document = new FlowDocument(new Paragraph(new Run(string.Join(" ", Enumerable.Repeat("word", 600))))) };
|
||||
var root = new StackPanel { Width = 600, Children = { plain, disabled, grid, text, document } };
|
||||
Visuals.Layout(root, 600, 900);
|
||||
return (root, plain, disabled);
|
||||
}
|
||||
|
||||
private static List<ScrollViewer> All(DependencyObject root) => [.. Visuals.FindAll<ScrollViewer>(root)];
|
||||
|
||||
[Fact]
|
||||
public async Task OnHidesEveryBarAndTheWheelStillScrolls()
|
||||
{
|
||||
(int Viewers, List<string> Shown, ScrollBarVisibility DisabledAxis, double Offset) result = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
(StackPanel root, ScrollViewer plain, ScrollViewer disabled) = Scrollers();
|
||||
try
|
||||
{
|
||||
ScrollBarHiding.Apply(true);
|
||||
ScrollBarHiding.ApplyUnder(root);
|
||||
root.UpdateLayout();
|
||||
List<ScrollViewer> viewers = All(root);
|
||||
List<string> shown = [.. viewers.Where(static v => v.ComputedVerticalScrollBarVisibility == Visibility.Visible || v.ComputedHorizontalScrollBarVisibility == Visibility.Visible)
|
||||
.Select(static v => (v.TemplatedParent ?? v).GetType().Name)];
|
||||
|
||||
var wheel = new MouseWheelEventArgs(Mouse.PrimaryDevice, Environment.TickCount, -120) { RoutedEvent = UIElement.MouseWheelEvent };
|
||||
((UIElement)plain.Content).RaiseEvent(wheel);
|
||||
root.UpdateLayout();
|
||||
return (viewers.Count, shown, disabled.VerticalScrollBarVisibility, plain.VerticalOffset);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ScrollBarHiding.Apply(false);
|
||||
}
|
||||
});
|
||||
|
||||
result.Viewers.Should().BeGreaterThanOrEqualTo(5, "the plain scroller, the disabled one and those inside the grid, the box and the document");
|
||||
result.Shown.Should().BeEmpty("no scroller draws a bar while the option is on");
|
||||
result.DisabledAxis.Should().Be(ScrollBarVisibility.Disabled, "a disabled axis lays its content out at the viewport's size, and is left alone");
|
||||
result.Offset.Should().BeGreaterThan(0, "a hidden bar is still a scroller: the wheel moves it");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task OffRestoresWhatEachViewerHad()
|
||||
{
|
||||
(List<ScrollBarVisibility> Before, List<ScrollBarVisibility> Hidden, List<ScrollBarVisibility> After) result = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
(StackPanel root, _, _) = Scrollers();
|
||||
List<ScrollBarVisibility> Read() => [.. All(root).Select(static v => v.VerticalScrollBarVisibility)];
|
||||
List<ScrollBarVisibility> before = Read();
|
||||
try
|
||||
{
|
||||
ScrollBarHiding.Apply(true);
|
||||
ScrollBarHiding.ApplyUnder(root);
|
||||
List<ScrollBarVisibility> hidden = Read();
|
||||
ScrollBarHiding.Apply(false);
|
||||
ScrollBarHiding.ApplyUnder(root);
|
||||
return (before, hidden, Read());
|
||||
}
|
||||
finally
|
||||
{
|
||||
ScrollBarHiding.Apply(false);
|
||||
}
|
||||
});
|
||||
|
||||
result.Hidden.Should().NotEqual(result.Before, "the option changed something");
|
||||
result.After.Should().Equal(result.Before, "off puts back every scroller's own setting");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AScrollerThatLoadsWhileOnIsHiddenAndOneThatLoadsAfterOffIsLeftAlone()
|
||||
{
|
||||
(ScrollBarVisibility WhileOn, ScrollBarVisibility FirstAfterOff, ScrollBarVisibility LoadedAfterOff) result = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
ScrollBarHiding.Register();
|
||||
try
|
||||
{
|
||||
ScrollBarHiding.Apply(true);
|
||||
var first = new ScrollViewer { VerticalScrollBarVisibility = ScrollBarVisibility.Auto };
|
||||
first.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent, first));
|
||||
ScrollBarVisibility whileOn = first.VerticalScrollBarVisibility;
|
||||
|
||||
ScrollBarHiding.Apply(false);
|
||||
first.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent, first));
|
||||
var second = new ScrollViewer { VerticalScrollBarVisibility = ScrollBarVisibility.Visible };
|
||||
second.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent, second));
|
||||
return (whileOn, first.VerticalScrollBarVisibility, second.VerticalScrollBarVisibility);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ScrollBarHiding.Apply(false);
|
||||
}
|
||||
});
|
||||
|
||||
result.WhileOn.Should().Be(ScrollBarVisibility.Hidden, "the class handler reaches a scroller as it loads");
|
||||
result.FirstAfterOff.Should().Be(ScrollBarVisibility.Auto, "and gives it back its own setting on its next load after off");
|
||||
result.LoadedAfterOff.Should().Be(ScrollBarVisibility.Visible, "a scroller the option never touched keeps what it has");
|
||||
}
|
||||
}
|
||||
@@ -419,6 +419,28 @@ public sealed class SettingsViewModelTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task HidingScrollBarsIsOffByDefaultAndItsToggleIsPersistedAndAppliedAtOnce()
|
||||
{
|
||||
// beta.14 (owner request 2026-10-05): ui.hide_scrollbars, default 0; the scrollers on screen follow it at once.
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
Harness h = await OpenAsync(s);
|
||||
h.Vm.HideScrollBars.Should().BeFalse();
|
||||
try
|
||||
{
|
||||
h.Vm.HideScrollBars = true;
|
||||
Task pending = h.Vm.Pending;
|
||||
await pending;
|
||||
|
||||
(await h.Settings.GetBooleanAsync(SettingsRegistry.UiHideScrollBars, Ct)).Should().BeTrue();
|
||||
ScrollBarHiding.Hidden.Should().BeTrue();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ScrollBarHiding.Apply(false);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ARevokeTheAgentCannotTakeStaysInTheListAndSaysWhy()
|
||||
{
|
||||
|
||||
@@ -10,9 +10,11 @@ namespace FrameLedger.App.Tests;
|
||||
/// first gate run on xUnit.net v3 4.0.1 (2026-09-21) read "Settings" where it had just written <c>vi</c>. The race was
|
||||
/// always there; the new scheduler found it. An implicit collection: no fixture, so no definition class is needed.
|
||||
/// Since beta.8 it also holds the classes that write <c>FpsDecimals.Two</c> or read FPS text the setting changes — the
|
||||
/// same kind of process-wide formatting state.
|
||||
/// same kind of process-wide formatting state — and since beta.14 <see cref="ScrollBarHidingTests"/>, whose option is a
|
||||
/// process-wide flag that <c>SettingsViewModelTests</c> writes too.
|
||||
/// </summary>
|
||||
internal static class StringsCultureCollection
|
||||
{
|
||||
public const string Name = "strings-culture";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Since beta.13 <see cref="StringsCultureCollection"/> runs ALONE (<see cref="CollectionDefinitionAttribute.DisableParallelization"/>:
|
||||
/// after every parallel collection, and beside none). A collection only serializes its own members; every other class still
|
||||
/// ran next to them, and a class that READS resource or FPS text read the wrong language while one of these had flipped the
|
||||
/// culture — <c>GamesViewModelTests</c> on 2026-10-03, beside <c>GameMemoryTextTests</c>' many flips. Moving each reader in
|
||||
/// found the races one red run at a time; taking the writers out of the parallel phase ends them as a class.
|
||||
/// <see cref="StringsTests"/> proves the definition is the one bound.
|
||||
/// </summary>
|
||||
[CollectionDefinition(StringsCultureCollection.Name, DisableParallelization = true)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Maintainability", "CA1515:Consider making public types internal", Justification = "xUnit requires a collection definition to be public (xUnit1027)")]
|
||||
public sealed class StringsCultureDefinition;
|
||||
@@ -50,6 +50,16 @@ public sealed class StringsTests
|
||||
Strings.Keys.Should().BeEquivalentTo(keys, "Strings.Designer.cs is generated from Strings.resx and committed; tools/resx-audit.ps1 fails on drift");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.13: the culture collection's definition is the one bound — it is what takes these classes out of the parallel
|
||||
/// phase — so a definition xUnit did not find would fail here rather than bring the races back silently.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TheCultureCollectionIsBoundToTheDefinitionThatRunsItAlone()
|
||||
{
|
||||
TestContext.Current.TestCollection!.TestCollectionClassName.Should().Be(typeof(StringsCultureDefinition).FullName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheCulturePropertyOverridesTheThread()
|
||||
{
|
||||
|
||||
@@ -19,8 +19,13 @@ public sealed class Tier2ReasonTests
|
||||
.Should().Be(Strings.Summary_Tier2_Why_HookOff);
|
||||
Formats.Tier2Reason("end=RefusedHookNotEnabled; tier2: attach=NotEvaluated; guard=PreviouslyBlocked/previously blocked/BlockedModule: Easy Anti-Cheat EasyAntiCheat_EOS.dll")
|
||||
.Should().Be(string.Format(CultureInfo.CurrentCulture, Strings.Summary_Tier2_Why_Blocked_Format, "BlockedModule: Easy Anti-Cheat EasyAntiCheat_EOS.dll"));
|
||||
// A driver or service is on the PC, not in the game (beta.13, §S23-3); a module is the guard's finding in the game.
|
||||
Formats.Tier2Reason("end=RefusedByGuard; tier2: attach=NotEvaluated; guard=BlockedDriver/Riot Vanguard/vgk.sys")
|
||||
.Should().Be(string.Format(CultureInfo.CurrentCulture, Strings.Summary_Tier2_Why_Guard_Format, "Riot Vanguard", "vgk.sys"));
|
||||
.Should().Be(string.Format(CultureInfo.CurrentCulture, Strings.Summary_Tier2_Why_MachineWide_Format, "Riot Vanguard", "vgk.sys"));
|
||||
Formats.Tier2Reason("end=RefusedByGuard; tier2: attach=NotEvaluated; guard=BlockedService/Easy Anti-Cheat/EasyAntiCheat_EOS")
|
||||
.Should().Be(string.Format(CultureInfo.CurrentCulture, Strings.Summary_Tier2_Why_MachineWide_Format, "Easy Anti-Cheat", "EasyAntiCheat_EOS"));
|
||||
Formats.Tier2Reason("end=RefusedByGuard; tier2: attach=NotEvaluated; guard=BlockedModule/BattlEye/BEClient_x64.dll")
|
||||
.Should().Be(string.Format(CultureInfo.CurrentCulture, Strings.Summary_Tier2_Why_Guard_Format, "BattlEye", "BEClient_x64.dll"));
|
||||
Formats.Tier2Reason("end=TargetUnreadable; tier2: attach=NotEvaluated").Should().Be(Strings.Summary_Tier2_Why_Unreadable);
|
||||
Formats.Tier2Reason("end=AttachRefused; tier2: attach=BuildIdMismatch").Should().Be(Strings.End_AttachRefused, "every end reason has its own words since beta.8");
|
||||
Formats.Tier2Reason("end=SomethingLater; tier2: attach=NotEvaluated")
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Markup;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Visual-tree helpers for the rendered checks (beta.14), all run on <see cref="PagesLoadTests.OnStaAsync{T}"/>'s thread:
|
||||
/// find elements, pump the dispatcher, lay out at a size, swap the theme for one check, and the colour actually painted
|
||||
/// under an element — the stack of backgrounds a pixel shows, composited, rather than one control's Background property.
|
||||
/// </summary>
|
||||
internal static class Visuals
|
||||
{
|
||||
public static T? Find<T>(DependencyObject root)
|
||||
where T : DependencyObject => FindAll<T>(root).FirstOrDefault();
|
||||
|
||||
public static IEnumerable<T> FindAll<T>(DependencyObject root)
|
||||
where T : DependencyObject
|
||||
{
|
||||
int count = VisualTreeHelper.GetChildrenCount(root);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
DependencyObject child = VisualTreeHelper.GetChild(root, i);
|
||||
if (child is T hit)
|
||||
{
|
||||
yield return hit;
|
||||
}
|
||||
|
||||
foreach (T deeper in FindAll<T>(child))
|
||||
{
|
||||
yield return deeper;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The innermost element under <paramref name="root"/> along first children — where a pointer over it would land.</summary>
|
||||
public static UIElement Leaf(UIElement root)
|
||||
{
|
||||
UIElement current = root;
|
||||
while (VisualTreeHelper.GetChildrenCount(current) > 0 && VisualTreeHelper.GetChild(current, 0) is UIElement child)
|
||||
{
|
||||
current = child;
|
||||
}
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
/// <summary>Runs the dispatcher's queue down to background priority — a Frame's navigation, Loaded, a deferred layout.</summary>
|
||||
public static void Pump()
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
var frame = new DispatcherFrame();
|
||||
#pragma warning disable VSTHRD001 // a test's own STA thread: no JoinableTaskFactory exists here, and the frame is what is waited on
|
||||
_ = Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(_ =>
|
||||
{
|
||||
frame.Continue = false;
|
||||
return null;
|
||||
}), null);
|
||||
#pragma warning restore VSTHRD001
|
||||
Dispatcher.PushFrame(frame);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Layout(FrameworkElement element, double width, double height)
|
||||
{
|
||||
element.Measure(new Size(width, height));
|
||||
element.Arrange(new Rect(0, 0, width, height));
|
||||
element.UpdateLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs <paramref name="work"/> with the App's theme dictionary swapped for <paramref name="theme"/>, and puts Dark back:
|
||||
/// elements made inside take the theme's resources when they are created.
|
||||
/// </summary>
|
||||
public static T UnderTheme<T>(ApplicationTheme theme, Func<T> work)
|
||||
{
|
||||
System.Collections.ObjectModel.Collection<ResourceDictionary> merged = System.Windows.Application.Current.Resources.MergedDictionaries;
|
||||
int index = merged.ToList().FindIndex(static d => d is ThemesDictionary);
|
||||
ResourceDictionary original = merged[index];
|
||||
merged[index] = new ThemesDictionary { Theme = theme };
|
||||
try
|
||||
{
|
||||
return work();
|
||||
}
|
||||
finally
|
||||
{
|
||||
merged[index] = original;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The colour painted under <paramref name="element"/>: every Border's and Panel's background from <paramref name="root"/>
|
||||
/// down to the element, composited over <paramref name="window"/> — what a template's parts draw, which is what the eye sees.
|
||||
/// </summary>
|
||||
public static Color PaintedUnder(DependencyObject element, DependencyObject root, Color window)
|
||||
{
|
||||
var chain = new List<Brush?>();
|
||||
for (DependencyObject? at = element; at is not null; at = VisualTreeHelper.GetParent(at))
|
||||
{
|
||||
chain.Add(at switch
|
||||
{
|
||||
Border b => b.Background,
|
||||
Panel p => p.Background,
|
||||
_ => null,
|
||||
});
|
||||
if (ReferenceEquals(at, root))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Color painted = window;
|
||||
for (int i = chain.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (chain[i] is SolidColorBrush { Color.A: > 0 } solid)
|
||||
{
|
||||
painted = Wcag.Over(Color.FromArgb((byte)Math.Round(solid.Color.A * solid.Opacity), solid.Color.R, solid.Color.G, solid.Color.B), painted);
|
||||
}
|
||||
}
|
||||
|
||||
return painted;
|
||||
}
|
||||
|
||||
/// <summary>A TextBlock's text colour as drawn over <paramref name="under"/>.</summary>
|
||||
public static Color TextOver(TextBlock text, Color under) =>
|
||||
text.Foreground is SolidColorBrush brush ? Wcag.Over(brush.Color, under) : throw new InvalidOperationException("a text whose foreground is not a solid colour");
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// WCAG 2.1 contrast arithmetic for the App's colour checks (<c>08_UI</c> §Contrast): a theme key resolved to a colour,
|
||||
/// source-over compositing of a translucent colour on an opaque one, and the contrast ratio. Shared by
|
||||
/// <see cref="ContrastTests"/> and the rendered checks since beta.14.
|
||||
/// </summary>
|
||||
internal static class Wcag
|
||||
{
|
||||
/// <summary>WCAG AA for body text.</summary>
|
||||
public const double AA = 4.5;
|
||||
|
||||
public static Color Resolve(ResourceDictionary themed, string key)
|
||||
{
|
||||
object value = themed[key] ?? System.Windows.Application.Current.Resources[key] ?? throw new InvalidOperationException($"{key} is in neither the theme nor the merged dictionaries");
|
||||
return value switch
|
||||
{
|
||||
Color c => c,
|
||||
SolidColorBrush b => b.Color,
|
||||
_ => throw new InvalidOperationException($"{key} is not a Color or SolidColorBrush in the theme dictionary (got {value.GetType().Name})"),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>Source-over compositing of <paramref name="top"/> on an opaque <paramref name="under"/>.</summary>
|
||||
public static Color Over(Color top, Color under)
|
||||
{
|
||||
double a = top.A / 255.0;
|
||||
return Color.FromRgb(
|
||||
(byte)Math.Round(top.R * a + under.R * (1 - a)),
|
||||
(byte)Math.Round(top.G * a + under.G * (1 - a)),
|
||||
(byte)Math.Round(top.B * a + under.B * (1 - a)));
|
||||
}
|
||||
|
||||
/// <summary>WCAG 2.1 contrast ratio between two opaque colours.</summary>
|
||||
public static double Ratio(Color a, Color b)
|
||||
{
|
||||
double la = Luminance(a);
|
||||
double lb = Luminance(b);
|
||||
return (Math.Max(la, lb) + 0.05) / (Math.Min(la, lb) + 0.05);
|
||||
}
|
||||
|
||||
private static double Luminance(Color c)
|
||||
{
|
||||
static double Channel(byte v)
|
||||
{
|
||||
double s = v / 255.0;
|
||||
return s <= 0.03928 ? s / 12.92 : Math.Pow((s + 0.055) / 1.055, 2.4);
|
||||
}
|
||||
|
||||
return (0.2126 * Channel(c.R)) + (0.7152 * Channel(c.G)) + (0.0722 * Channel(c.B));
|
||||
}
|
||||
}
|
||||
@@ -353,6 +353,23 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
tolerance: tolerance,
|
||||
display: display);
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="Loop"/>'s options with a 30 s ceiling instead of 120 ms, for a test whose session must end on something
|
||||
/// else — a refusal at the re-scan, a guard that throws, the kill switch, an exit. A wall-clock ceiling that short lost
|
||||
/// the race to the second scan on a loaded runner and the session ended as <c>Running</c> (the beta.13 release rehearsal,
|
||||
/// 2026-10-04, <see cref="AGuardThatThrowsMidSessionKeepsTheRecordsItAlreadyDrained"/>); here the ceiling is a safety
|
||||
/// net, never the ending under test.
|
||||
/// </summary>
|
||||
private static CaptureOptions EndsOnItsOwn => new()
|
||||
{
|
||||
DrainInterval = TimeSpan.FromMilliseconds(1),
|
||||
ScanInterval = TimeSpan.FromMilliseconds(5),
|
||||
AttachBudget = TimeSpan.FromMilliseconds(50),
|
||||
MaxDuration = TimeSpan.FromSeconds(30),
|
||||
HoldInterval = TimeSpan.FromMilliseconds(1),
|
||||
LogFlushGrace = TimeSpan.FromMilliseconds(1),
|
||||
};
|
||||
|
||||
private static readonly bool[] _pauseThenResume = [true, false];
|
||||
|
||||
private sealed class SwitchablePause : ICapturePauseSource
|
||||
@@ -803,7 +820,7 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
};
|
||||
using var sink = new FakeSink();
|
||||
IGameConsentStore store = await StoreWithAsync();
|
||||
CaptureSession loop = Loop(store, guard, sink);
|
||||
CaptureSession loop = Loop(store, guard, sink, options: EndsOnItsOwn);
|
||||
|
||||
CaptureOutcome r = await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
|
||||
|
||||
@@ -850,7 +867,7 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
var guard = new CountingGuard();
|
||||
using var sink = new FakeSink();
|
||||
using var alive = new FakeLiveness { HasExited = true };
|
||||
CaptureSession loop = Loop(await StoreWithAsync(), guard, sink, alive);
|
||||
CaptureSession loop = Loop(await StoreWithAsync(), guard, sink, alive, options: EndsOnItsOwn);
|
||||
|
||||
CaptureOutcome r = await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
|
||||
|
||||
@@ -1011,7 +1028,7 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
// the capture side and is correct; losing the whole session's records with the stack is not.
|
||||
var guard = new CountingGuard();
|
||||
using var sink = new FakeSink(recordsToServe: 40);
|
||||
CaptureSession loop = Loop(await StoreWithAsync(), guard, sink);
|
||||
CaptureSession loop = Loop(await StoreWithAsync(), guard, sink, options: EndsOnItsOwn);
|
||||
guard.EvaluateThrowsAfter = 1;
|
||||
|
||||
CaptureOutcome r = await loop.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
|
||||
@@ -1041,7 +1058,7 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
var flipsAfterTwo = new DelegateKillSwitch(() => ++asks > 2);
|
||||
using var sink = new FakeSink(recordsToServe: 3);
|
||||
var stopped = new CountingGuard();
|
||||
CaptureOutcome result = await Loop(await StoreWithAsync(), stopped, sink, killSwitch: flipsAfterTwo)
|
||||
CaptureOutcome result = await Loop(await StoreWithAsync(), stopped, sink, options: EndsOnItsOwn, killSwitch: flipsAfterTwo)
|
||||
.RunAsync(_exe, Fingerprint, "payload.dll", TestContext.Current.CancellationToken);
|
||||
|
||||
result.Reason.Should().Be(SessionEndReason.KillSwitchEngaged);
|
||||
|
||||
@@ -161,6 +161,29 @@ public sealed class RecordedSessionEventsTests
|
||||
pipe.Of<SafetyUnhookEvent>().Single().HookingTurnedOff.Should().BeTrue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// §S23-3 (beta.13): the events carry the guard's own reason when it named a family, so the App can say a service or a
|
||||
/// driver was found on the PC — and nothing when the guard named nothing (the kill switch, a block already on the row).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BothSafetyEventsCarryTheGuardsReasonWhenItNamedAFamily()
|
||||
{
|
||||
var pipe = new RecordingPublisher();
|
||||
RecordedSession service = Session(SessionEndReason.RefusedByGuard, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
verdict: AntiCheatVerdict.Refused(AntiCheatRefusalReason.BlockedService, "Easy Anti-Cheat", "EasyAntiCheat_EOS"), tier: CaptureTier.NotHooked);
|
||||
RecordedSession driver = Session(SessionEndReason.SafetyUnhook, ExitStatus.UnhookedSafety, new FinalizeOutcome(FinalizeStatus.Saved, 9, 0),
|
||||
verdict: AntiCheatVerdict.Refused(AntiCheatRefusalReason.BlockedDriver, "Riot Vanguard", "vgk.sys"));
|
||||
RecordedSession killSwitch = Session(SessionEndReason.RefusedKillSwitch, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
tier: CaptureTier.NotHooked);
|
||||
|
||||
RecordedSessionEvents.PublishAll(pipe, service, _info);
|
||||
RecordedSessionEvents.PublishAll(pipe, driver, _info);
|
||||
RecordedSessionEvents.PublishAll(pipe, killSwitch, _info);
|
||||
|
||||
pipe.Of<CaptureRefusedEvent>().Select(static e => e.GuardReason).Should().Equal("BlockedService", null);
|
||||
pipe.Of<SafetyUnhookEvent>().Single().GuardReason.Should().Be("BlockedDriver");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ASafetyUnhookCarriesTheVerdictThatFired()
|
||||
{
|
||||
|
||||
@@ -93,13 +93,13 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
ValueTask.FromResult(AntiCheatVerdict.Allowed());
|
||||
}
|
||||
|
||||
private sealed class FakeSink(SteppingClock clock, int recordsToServe) : ICaptureSink
|
||||
private sealed class FakeSink(SteppingClock clock, int recordsToServe, ulong adapterLuid = 0) : ICaptureSink
|
||||
{
|
||||
private int _served;
|
||||
|
||||
public FlWriterState WriterState => new() { Status = (uint)FlStatus.Ready, HooksInstalledMask = 1, RuntimeCensus = 0x8000_0000 };
|
||||
|
||||
public FlShmHandshake Handshake => default;
|
||||
public FlShmHandshake Handshake => new() { AdapterLuid = adapterLuid };
|
||||
|
||||
public FlDisplayState? DisplayState => null;
|
||||
|
||||
@@ -174,8 +174,16 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
{
|
||||
private int _served;
|
||||
|
||||
public List<ulong> Adapters { get; } = [];
|
||||
|
||||
public string Descriptor => "l1+lhm";
|
||||
|
||||
public bool FollowAdapter(ulong luid)
|
||||
{
|
||||
Adapters.Add(luid);
|
||||
return true;
|
||||
}
|
||||
|
||||
public long Dropped => 0;
|
||||
|
||||
public void Start()
|
||||
@@ -212,12 +220,12 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
}
|
||||
|
||||
private sealed class Factory(IGameConsentStore store, FakeGuard guard, SteppingClock clock, int records, FakeLiveness liveness,
|
||||
IUserModeExceptionSwitch? exceptions = null, IDisplayProbe? display = null) : ICaptureSessionFactory
|
||||
IUserModeExceptionSwitch? exceptions = null, IDisplayProbe? display = null, ulong adapterLuid = 0) : ICaptureSessionFactory
|
||||
{
|
||||
public CaptureSession Create(ICaptureObserver observer) => new(
|
||||
store, new HookedCaptureGate(guard), guard, new FixedResolver(),
|
||||
new DelegateLivenessSource(_ => liveness),
|
||||
new DelegateRingAttacher(_ => (new FakeSink(clock, records), ShmAttachRefusal.Ok)),
|
||||
new DelegateRingAttacher(_ => (new FakeSink(clock, records, adapterLuid), ShmAttachRefusal.Ok)),
|
||||
new CaptureOptions
|
||||
{
|
||||
DrainInterval = TimeSpan.FromMilliseconds(1),
|
||||
@@ -263,6 +271,8 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
public required SteppingClock Clock { get; init; }
|
||||
|
||||
public required SqliteGameConsentStore Store { get; init; }
|
||||
|
||||
public FakePoller? Poller { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>What the driver-profile source answers (beta.8); a throwing one proves a failed read costs the column, not the session.</summary>
|
||||
@@ -278,7 +288,7 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
}
|
||||
|
||||
private async Task<Harness> MakeAsync(bool consented = true, AntiCheatVerdict? verdict = null, int records = 3_000, FakeLiveness? liveness = null, bool poller = true,
|
||||
bool clockStepsOnDrain = false, IDriverProfileSource? profiles = null, bool excepted = false, IDisplayProbe? display = null)
|
||||
bool clockStepsOnDrain = false, IDriverProfileSource? profiles = null, bool excepted = false, IDisplayProbe? display = null, ulong adapterLuid = 0)
|
||||
{
|
||||
_db ??= await LedgerDatabase.OpenAsync(Path.Combine(_dir, LedgerPaths.DatabaseFileName), ct: TestContext.Current.CancellationToken).ConfigureAwait(false);
|
||||
var store = new SqliteGameConsentStore(_db);
|
||||
@@ -302,14 +312,15 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
var games = new FakeGameRepository();
|
||||
var sessions = new FakeSessionRepository();
|
||||
var partials = new FakePartialSessionStore();
|
||||
FakePoller? fakePoller = poller ? new FakePoller(clockStepsOnDrain ? clock : null) : null;
|
||||
var recorder = new SessionRecorder(
|
||||
new Factory(store, guard, clock, records, liveness ?? _alive, excepted ? new FakeExceptionSwitch(on: true) : null, display),
|
||||
new Factory(store, guard, clock, records, liveness ?? _alive, excepted ? new FakeExceptionSwitch(on: true) : null, display, adapterLuid),
|
||||
games, new FakeSnapshots(), new FixedHardware(), partials,
|
||||
new SessionFinalizer(sessions, new RawSeriesCodec()), new NoCrashEvents(),
|
||||
_ => poller ? new FakePoller(clockStepsOnDrain ? clock : null) : null, clock,
|
||||
_ => fakePoller, clock,
|
||||
new RecorderOptions { PartialFlushInterval = TimeSpan.FromSeconds(10), MinimumSessionLength = SteppingClock.Step }, profiles: profiles,
|
||||
exceptionLapse: new UserModeExceptionLapsePolicy(store, sessions));
|
||||
return new Harness { Recorder = recorder, Games = games, Sessions = sessions, Partials = partials, Clock = clock, Store = store };
|
||||
return new Harness { Recorder = recorder, Games = games, Sessions = sessions, Partials = partials, Clock = clock, Store = store, Poller = fakePoller };
|
||||
}
|
||||
|
||||
/// <summary>D33: block the consented row for NetEase Yidun, grant its exception on these bytes, and turn hooking on again.</summary>
|
||||
@@ -405,6 +416,22 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
after.AcException.TrialFailed.Should().Be(ends);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.13: the adapter the Overlay names in the handshake reaches the telemetry thread once, however many ticks carry it;
|
||||
/// a session whose handshake names none (0, before the first present or through OpenGL) tells it nothing.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheGamesAdapterIsHandedToTheTelemetryThreadOnce()
|
||||
{
|
||||
Harness named = await MakeAsync(adapterLuid: 0x0000_0001_0000_0042);
|
||||
await named.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
|
||||
named.Poller!.Adapters.Should().Equal(0x0000_0001_0000_0042UL);
|
||||
|
||||
Harness unnamed = await MakeAsync();
|
||||
await unnamed.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
|
||||
unnamed.Poller!.Adapters.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AHookedSessionIsRecordedEndToEnd()
|
||||
{
|
||||
|
||||
@@ -24,6 +24,18 @@ public sealed class SettingsRegistryTests
|
||||
}
|
||||
|
||||
/// <summary>D33: the exception option is off unless the user turns it on — and exactly "1" is on.</summary>
|
||||
[Fact]
|
||||
public void HidingScrollBarsIsOffByDefaultAndTheAgentNeverReadsIt()
|
||||
{
|
||||
// beta.14: ui.hide_scrollbars is the App's alone; the bars are what every page showed until then.
|
||||
SettingDefinition d = SettingsRegistry.UiHideScrollBars;
|
||||
d.Key.Should().Be("ui.hide_scrollbars");
|
||||
d.Kind.Should().Be(SettingKind.Boolean);
|
||||
d.Default.Should().Be("0");
|
||||
d.AgentReads.Should().BeFalse();
|
||||
SettingsRegistry.Find("ui.hide_scrollbars").Should().BeSameAs(d);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheUserModeExceptionOptionIsOffByDefault()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Application.Telemetry;
|
||||
using FrameLedger.Infrastructure.Telemetry;
|
||||
@@ -144,6 +145,26 @@ public sealed class CompositeTelemetrySourceTests
|
||||
l2.Disposed.Should().BeTrue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.13: the game's adapter, by the LUID the Overlay published — L1 switches to it and the layers that read their own
|
||||
/// GPU are told its vendor; a LUID no layer listed changes nothing and tells nobody.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AnAdapterTheGamePresentsOnIsSelectedInL1AndItsVendorReachesTheOtherLayers()
|
||||
{
|
||||
using var l1 = new AdapterLayer(listedLuid: 0x0000_0001_0000_0042, vendor: 0x1002);
|
||||
using var l3 = new VendorLayer(TelemetryLayer.Nvapi);
|
||||
using var composite = new CompositeTelemetrySource([l1, l3]);
|
||||
|
||||
composite.SelectAdapter(0x99).Should().BeFalse("no layer listed it");
|
||||
l3.Vendors.Should().BeEmpty();
|
||||
composite.Selected.Should().BeNull();
|
||||
|
||||
composite.SelectAdapter(0x0000_0001_0000_0042).Should().BeTrue();
|
||||
composite.Selected!.VendorId.Should().Be(0x1002u);
|
||||
l3.Vendors.Should().Equal(0x1002u);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheNamesAreTheOnesTheSchemaExampleUses()
|
||||
{
|
||||
@@ -152,4 +173,72 @@ public sealed class CompositeTelemetrySourceTests
|
||||
Action none = () => TelemetryLayerNames.Of(TelemetryLayer.None);
|
||||
none.Should().Throw<ArgumentOutOfRangeException>();
|
||||
}
|
||||
|
||||
/// <summary>L1 as the composite sees it: one adapter, by LUID.</summary>
|
||||
private sealed class AdapterLayer(ulong listedLuid, uint vendor) : IGpuTelemetrySource, IGpuAdapterSelector
|
||||
{
|
||||
public TelemetryLayer Layer => TelemetryLayer.Baseline;
|
||||
|
||||
public GpuCapabilities Capabilities => GpuCapabilities.None;
|
||||
|
||||
public bool IsDisabled => false;
|
||||
|
||||
public GpuAdapterIdentity? Selected { get; private set; }
|
||||
|
||||
public bool SelectAdapter(ulong luid)
|
||||
{
|
||||
if (luid != listedLuid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Selected = new GpuAdapterIdentity
|
||||
{
|
||||
Name = "fake",
|
||||
Luid = luid,
|
||||
VendorId = vendor,
|
||||
DeviceId = 1,
|
||||
SubSysId = 0,
|
||||
Revision = 0,
|
||||
DedicatedVideoMemoryMb = 8192,
|
||||
SharedSystemMemoryMb = 16384,
|
||||
IsSoftware = false,
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryRead([NotNullWhen(true)] out GpuSample? sample)
|
||||
{
|
||||
sample = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A layer that reads its own GPU and is told the vendor.</summary>
|
||||
private sealed class VendorLayer(TelemetryLayer layer) : IGpuTelemetrySource, IGpuVendorFollower
|
||||
{
|
||||
public List<uint> Vendors { get; } = [];
|
||||
|
||||
public TelemetryLayer Layer => layer;
|
||||
|
||||
public GpuCapabilities Capabilities => GpuCapabilities.None;
|
||||
|
||||
public bool IsDisabled => false;
|
||||
|
||||
public void FollowVendor(uint vendorId) => Vendors.Add(vendorId);
|
||||
|
||||
public bool TryRead([NotNullWhen(true)] out GpuSample? sample)
|
||||
{
|
||||
sample = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,10 +37,12 @@ public sealed class LhmTelemetrySourceTests
|
||||
return s;
|
||||
}
|
||||
|
||||
private static IHardware Gpu(params ISensor[] sensors)
|
||||
private static IHardware Gpu(params ISensor[] sensors) => Gpu(HardwareType.GpuNvidia, sensors);
|
||||
|
||||
private static IHardware Gpu(HardwareType type, params ISensor[] sensors)
|
||||
{
|
||||
IHardware h = Substitute.For<IHardware>();
|
||||
h.HardwareType.Returns(HardwareType.GpuNvidia);
|
||||
h.HardwareType.Returns(type);
|
||||
h.Name.Returns("fake");
|
||||
h.Sensors.Returns(sensors);
|
||||
h.SubHardware.Returns([]);
|
||||
@@ -57,6 +59,34 @@ public sealed class LhmTelemetrySourceTests
|
||||
private static LhmTelemetrySource Source(ILhmComputer computer, ManualTimeProvider? clock = null) =>
|
||||
new(computer, new LhmTelemetryOptions(), clock ?? new ManualTimeProvider());
|
||||
|
||||
/// <summary>
|
||||
/// beta.13: a laptop's tree lists the integrated GPU first while the game runs on the discrete one. Told the game
|
||||
/// adapter's vendor, the layer maps that vendor's node; with no node of that vendor it publishes nothing.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ToldTheGamesVendorThePollMapsThatVendorsNodeOrNothing()
|
||||
{
|
||||
ILhmComputer computer = Computer(
|
||||
Gpu(HardwareType.GpuIntel, Sensor(SensorType.Temperature, "GPU Core", 48f)),
|
||||
Gpu(HardwareType.GpuNvidia, Sensor(SensorType.Temperature, "GPU Core", 66f)));
|
||||
using LhmTelemetrySource source = Source(computer);
|
||||
|
||||
source.PollOnce();
|
||||
source.TryRead(out GpuSample? first).Should().BeTrue();
|
||||
first!.TempCoreC.Should().Be(48, "before the game's adapter is known, the first node, as before");
|
||||
|
||||
source.FollowVendor(0x10DE);
|
||||
source.PollOnce();
|
||||
source.TryRead(out GpuSample? nvidia).Should().BeTrue();
|
||||
nvidia!.TempCoreC.Should().Be(66);
|
||||
|
||||
source.FollowVendor(0x1002);
|
||||
source.PollOnce();
|
||||
source.TryRead(out GpuSample? amd).Should().BeFalse("the tree has no AMD node: N/A, not another card's figure");
|
||||
amd.Should().BeNull();
|
||||
source.IsDisabled.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void APollMapsTheFirstGpuAndPublishesItsFieldsAsCapabilities()
|
||||
{
|
||||
|
||||
@@ -41,6 +41,26 @@ public sealed class NvapiTelemetrySourceTests
|
||||
bridge.Inits.Should().Be(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.13: NVAPI reads NVIDIA's first GPU, so when the game presents on AMD's or Intel's the layer says nothing rather
|
||||
/// than another card's temperature — without a fault, and back when the game's adapter is NVIDIA's.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AGameOnAnotherVendorsAdapterGetsNothingFromNvapi()
|
||||
{
|
||||
using var bridge = new FakeNvapiBridge { Sample = FakeNvapiBridge.Full };
|
||||
using var source = new NvapiTelemetrySource(bridge, new ManualTimeProvider());
|
||||
|
||||
source.FollowVendor(0x1002);
|
||||
source.TryRead(out GpuSample? amd).Should().BeFalse();
|
||||
amd.Should().BeNull();
|
||||
source.IsDisabled.Should().BeFalse("nothing went wrong; it just is not the game's card");
|
||||
|
||||
source.FollowVendor(0x10DE);
|
||||
source.TryRead(out GpuSample? nvidia).Should().BeTrue();
|
||||
nvidia!.TempCoreC.Should().Be(62);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(NativeNvapiBridge.Unavailable)]
|
||||
[InlineData(-6)]
|
||||
|
||||
@@ -24,6 +24,27 @@ public sealed class TelemetryPollerTests
|
||||
public override long GetTimestamp() => Ticks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.13: the adapter the game presents on reaches the source — the real L1 switches to a LUID DXGI listed — and a source
|
||||
/// that cannot follow adapters answers false rather than pretending.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TheGamesAdapterReachesALayerThatCanFollowIt()
|
||||
{
|
||||
using var memory = new FakeMemoryCounter(_ => () => 1024);
|
||||
using var l1 = new BaselineTelemetrySource(new FakeDxgi(FakeDxgi.Identity("first", 0x10), FakeDxgi.Identity("second", 0x20)), memory, new ManualTimeProvider());
|
||||
using var composite = new CompositeTelemetrySource([l1]);
|
||||
using var poller = new TelemetryPoller(composite, new TelemetryPollerOptions(), new ManualTimeProvider());
|
||||
|
||||
poller.FollowAdapter(0x20).Should().BeTrue();
|
||||
l1.Selected!.Name.Should().Be("second");
|
||||
poller.FollowAdapter(0xDEAD).Should().BeFalse("DXGI never listed it");
|
||||
|
||||
using var layer = new FakeLayer(TelemetryLayer.Lhm);
|
||||
using var plain = new TelemetryPoller(layer, new TelemetryPollerOptions(), new ManualTimeProvider());
|
||||
plain.FollowAdapter(0x20).Should().BeFalse("a layer that reads its own GPU is told a vendor by the composite, not a LUID");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ATickStampsTheLayersSampleWithTheCallersTimestampClock()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user