Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddba1a4b87 | ||
|
|
42fe25da6a | ||
|
|
c4e47868dd | ||
|
|
c48b1348a7 |
No files matched your search
@@ -27,8 +27,61 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.1.0-beta.11] - 2026-10-03
|
||||
|
||||
**The eleventh pre-release: a user-mode anti-cheat exception that can be reached, a library that fills the window, and
|
||||
charts and clean-up across a game's sessions.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`,
|
||||
then *More info → Run anyway*. What changed for a user:
|
||||
|
||||
- **The user-mode anti-cheat exception no longer needs earlier sessions.** A game blocked the moment it was added could
|
||||
never qualify; now its first two sessions under the exception are a trial, and one that does not go well ends the
|
||||
exception for good. Everything else it requires is unchanged, and a ban remains possible.
|
||||
- **The Games library** fills the window at any width, can be shown as a list, counts its games and has **Refresh**: it
|
||||
reads the library again, offers the games your stores installed since, and marks games whose executable is gone.
|
||||
- **Import** hides the games already in the library — you can show them, dimmed.
|
||||
- **Delete all sessions** — of one game on its page, or of every game in Settings ▸ Data.
|
||||
- **Charts across a game's sessions**: *Sessions at a glance* on the Sessions tab, and the Trend draws more metrics at once.
|
||||
- **Settings** has no row without a control.
|
||||
- **Three CrackProof games** are on the anti-cheat list (Umamusume: Pretty Derby, Heaven Burns Red, Madoka Magica Magia
|
||||
Exedra).
|
||||
- **The Disclaimer (2.9) and the EULA (1.4) say how the exception works now**, so the Legal Gate opens once after the
|
||||
update. The Privacy Policy is unchanged.
|
||||
|
||||
**Updating from `0.1.0-beta.10`:**
|
||||
|
||||
- Quit the App (tray icon → Exit) and end `FrameLedger.Agent.exe` before running the installer.
|
||||
- Schema 0017 adds one column; the database opens in place, and an older version cannot open it again.
|
||||
- Every game is re-checked once for anti-cheat (rules `2026.10.1`).
|
||||
- An exception made under beta.9 or beta.10 stays in force; if fewer than two sessions were played under it, the rest of
|
||||
its trial applies.
|
||||
|
||||
### Added
|
||||
|
||||
- **The Games library fills the window, switches to a list, counts its games and refreshes** (owner requests, beta.11).
|
||||
The cards were 300 px in a plain wrap, so a wide window left up to a card's width empty at the right and the third pill
|
||||
("Hooking off") was cut; the grid now has as many columns as fit at 300 px or wider, every card an equal share of the
|
||||
width, and the pills wrap. A button beside the sort switches to a **list** — one row per game with its store, engine,
|
||||
status, sessions, playtime and last played — and the choice is remembered (`ui.library_view`). The title counts the
|
||||
games. **Refresh** reads the library again, looks in the stores for games installed since and offers only those (*No
|
||||
new games* when there are none), and marks every entry whose executable is gone **Not installed** — the tooltip says
|
||||
when it is the drive that is not connected; nothing is removed. The page also reloads by itself when a session ends or
|
||||
an import adds games while it is open (an import made from the menu used to show only after leaving the page).
|
||||
|
||||
- **Import hides the games already in the library** (owner request, beta.11): on a re-import they were most of the list
|
||||
and pushed the new ones out of sight. *Show the N games already in the library* brings them back, dimmed, and a row
|
||||
that cannot be imported has its box disabled (a tick on it was taken and ignored).
|
||||
|
||||
- **Delete all sessions** (owner decision D40, beta.11): on a game's page, every session of that game; in Settings ▸
|
||||
**Data**, every session of every game — with their frame and sensor data and notes, after a confirmation that says how
|
||||
many. The library, the settings and every game's hooking consent stay. The capture agent deletes them (the rows are its)
|
||||
and refuses while a session is being recorded; an older agent is told to restart. A summary window still open on a
|
||||
deleted session closes. A new pipe request, `DeleteSessions`.
|
||||
|
||||
- **Charts across a game's sessions** (owner decision D39, beta.11): the Sessions tab opens with *Sessions at a glance* —
|
||||
every hooked session's frame rate (Presented FPS, or Native and Displayed where frame generation was measured, never one
|
||||
inflated line) and its 1% and 0.1% lows, oldest first; click a point to select that session. The Trend keeps its metric
|
||||
and can **draw more beside it** (*Also draw*), a second unit against the right axis, two units at most.
|
||||
|
||||
- **Three CrackProof titles on the anti-cheat title list** (owner request, beta.11): Umamusume: Pretty Derby (Steam
|
||||
`3224770`), Heaven Burns Red (`1973710`) and Madoka Magica Magia Exedra (`2987800`). Each store page states *"Uses
|
||||
Kernel Level Anti-Cheat"* and names HyperTech's CrackProof; its driver loads from `System32` under a numbered name,
|
||||
@@ -55,6 +108,10 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Settings has no row without a control** (owner request, beta.11): *Games with hooking on* shows only while a game has
|
||||
hooking on, the *Elevation* row became the admin mode row's status line, and the note under the language row is gone.
|
||||
The retention message now names Settings ▸ Recording, where retention lives.
|
||||
|
||||
- **The exception's card and list say what is true** (found with D38): an eligible game's *Anti-cheat* card said hooking
|
||||
"cannot be turned on" beside a usable *Make exception…* — it now says hooking is off unless you make one; the Settings
|
||||
list showed each game's session count twice and listed games that could never qualify, with no action — it lists only
|
||||
|
||||
+1
-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.10.*
|
||||
*Beta software: this page describes version 0.1.0-beta.11.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
> No telemetry. No accounts. All data stays on your machine.
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-09-28.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.10`** (2026-09-28), an unsigned installer built from that tag with its
|
||||
> ⚠ **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
|
||||
> 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
|
||||
@@ -152,7 +152,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest pre-release is `v0.1.0-beta.10` (2026-09-28); before it `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.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`.
|
||||
|
||||
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**.
|
||||
@@ -180,4 +180,4 @@ If you find a game with anti-cheat that FrameLedger fails to detect, please open
|
||||
|
||||
---
|
||||
|
||||
**Status:** pre-release (beta). Ten 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). 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.
|
||||
+3
-1
@@ -10,6 +10,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
- FR-1.3 Editable metadata (name, cover, publisher, version, notes); auto-detected fields badged and overridable.
|
||||
- FR-1.4 Remove game (asks whether to keep or delete its sessions).
|
||||
- FR-1.5 "Supports" row shows shipped-capability hints (DLSS/FSR/XeSS/FG) — visually distinct from measured per-session values (`05_DETECTION` §Capability hints).
|
||||
- FR-1.7 Delete all sessions (beta.11, owner decision D40): of one game from its page, or of every game from Settings ▸ Data, after a confirmation that says how many — with their frame and sensor series and notes; the library, the settings and every consent stay. The Agent deletes them (the rows are its, `06_DATA_MODEL` §Writer ownership) and refuses while a session it would delete under is being recorded.
|
||||
- FR-1.6 Recording switch per entry (2026-09-23, HANDOFF D29): off, the program is not watched at all — no session, no measurement, no injection — and a session of it that is running stops. On by default; entries an old import made for Steam's own tools start with it off. The library card says "Not recorded".
|
||||
|
||||
### FR-2 Hooking consent & control (new, safety-critical — see `19_SAFETY`)
|
||||
@@ -55,6 +56,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
- FR-6.1 Sessions table per game: date, duration, tier badge, Native, Displayed, FG×, lows, resolution + upscaler, RT/PT/RR chips, crash badge, tags.
|
||||
- FR-6.2 Compare 2–5 sessions; **mixed-tier comparisons require explicit acknowledgement** and are marked on the chart.
|
||||
- FR-6.3 Hardware snapshot per session; trend charts mark changes ("GPU driver 572.16 → 576.02").
|
||||
- FR-6.6 Charts across a game's sessions (beta.11, owner decision D39): the Sessions tab opens with an overview of every hooked session's rate and lows (Presented FPS, or Native and Displayed where frame generation was measured; 1% and 0.1% lows), a click selecting the session; and the Trend draws more metrics beside the selected one, two units at most (the second against the right axis).
|
||||
- FR-6.4 Sessions with mid-session settings changes are excluded from trends by default, with a toggle.
|
||||
- FR-6.5 Session tags and notes.
|
||||
|
||||
@@ -79,7 +81,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
> **beta.10 (D34):** "Agent elevation (optional — explains what it unlocks)" is the admin mode — *Run the agent as
|
||||
> administrator*, off by default, a disclosure before it turns on, Windows' prompt at every Agent start (`01_ARCHITECTURE`
|
||||
> ADR-9, `08_UI` §Settings).
|
||||
Language (en/vi/ja), theme, start with Windows, minimize to tray, background capture, **global hooking kill switch**, min session length, telemetry interval, retention, Agent elevation (optional — explains what it unlocks), Vulkan layer registration state, update channel, online metadata opt-in, reopen legal documents.
|
||||
Language (en/vi/ja), theme, start with Windows, minimize to tray, background capture, **global hooking kill switch**, min session length, telemetry interval, retention, Agent elevation (optional — explains what it unlocks), Vulkan layer registration state, update channel, online metadata opt-in, reopen legal documents. **beta.11 (owner request 2026-10-03: no row without a control):** Delete all sessions (FR-1.7, a *Data* section); the elevation state is a line of the admin mode's own row, not a row of its own; the hook-enabled list shows only while a game has hooking on; the language row carries no separate note.
|
||||
|
||||
### FR-11 Legal Gate
|
||||
First run blocks until the user accepts EULA, GPLv3 notice, Disclaimer, Privacy Policy. Re-shown when a document version increments. The injection risk is stated in the Disclaimer *and* repeated at per-game consent (FR-2.1) — once is not enough for something that can cost an account.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`%LOCALAPPDATA%\FrameLedger\ledger.db`. Pragmas: `journal_mode=WAL`, `synchronous=NORMAL`, `foreign_keys=ON`, `busy_timeout=5000`. `Microsoft.Data.Sqlite` + Dapper; all writes in explicit transactions.
|
||||
|
||||
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It is the one Agent write that deletes a `games` row; it never touches a consent column. **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built note). UI writes `games` (user-editable fields — since P3 PR-3 that is the FR-1.3 metadata, the `*_default` tri-states, and `removed_at`; never a `hook_*` column), `session_annotations` (tags, notes, and since schema 0002 the FR-8.3 overrides — which is WHY they are on this table and not on `sessions`), `settings`, `legal_acceptance`. Both read everything. The ports say the same in their names: `IGameRepository.UpdateMetadataAsync` / `SetTriStateDefaultAsync` / `RemoveAsync`, `ISessionAnnotationRepository`, `RegisteredSettings`, `ILegalAcceptanceStore.RecordAsync` (all P3 PR-3).
|
||||
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It is the one Agent write that deletes a `games` row; it never touches a consent column. **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **And since 2026-10-03 (beta.11, D40) the Agent deletes sessions on request** — every session of one game or of every game, `DeleteSessions` over the pipe, through `ISessionRepository.DeleteSessionsAsync` in one transaction (segments, blobs and annotations cascade), never while one is being recorded; the UI asks and never deletes a session row itself. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built note). UI writes `games` (user-editable fields — since P3 PR-3 that is the FR-1.3 metadata, the `*_default` tri-states, and `removed_at`; never a `hook_*` column), `session_annotations` (tags, notes, and since schema 0002 the FR-8.3 overrides — which is WHY they are on this table and not on `sessions`), `settings`, `legal_acceptance`. Both read everything. The ports say the same in their names: `IGameRepository.UpdateMetadataAsync` / `SetTriStateDefaultAsync` / `RemoveAsync`, `ISessionAnnotationRepository`, `RegisteredSettings`, `ILegalAcceptanceStore.RecordAsync` (all P3 PR-3).
|
||||
|
||||
## Schema (v2 — hook architecture)
|
||||
|
||||
@@ -391,6 +391,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.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 |
|
||||
| `hooking.kill_switch` | bool | `0` | | Agent (FR-2.4, since P2 PR-F) |
|
||||
| `hooking.usermode_ac_exceptions` | bool | `0` | | Agent, at every session start and command (FR-2.8, D33, 2026-09-26): off suspends every user-mode exception without deleting any; on, the user still grants each eligible game |
|
||||
|
||||
@@ -396,6 +396,7 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
|
||||
| `StopSession` | UI→A | `{ sessionGuid }` — graceful ~~unhook~~ stop + finalize → `StopAck { sessionGuid, accepted, reason? }`. *(Built 2026-09-13, PR-1b: the orchestrator names every session it starts and cancels THAT session's stop token; the loop reads it at its next tick, drains once more, and ends as `SessionEndReason.StoppedByUser` — `exit_status = normal`, the row stored like any other, the target left running. A guid nobody runs is `accepted: false`. Distinct from the host's cancellation, which leaves a `.partial`.)* |
|
||||
| `UpdateRules` | UI→A | **no payload** — a trigger, not a source. The Agent re-reads only its own `%LOCALAPPDATA%\FrameLedger\rules\` copy → `UpdateRulesAck { outcome }`. *(Built 2026-09-13, PR-1b: the seeder's `EnsureSeededAsync` outcome; a payload naming a path is ignored, and a test sends one to prove it.)* |
|
||||
| `Shutdown` | UI→A | graceful stop → `ShutdownAck`, then the host stops (sessions finalize inside its grace window). *(Built 2026-09-13, PR-1b: `IAgentLifetime`, the host's under `--serve`, a logged no-op under `--console`.)* |
|
||||
| `DeleteSessions` | UI→A | **Added 2026-10-03 (beta.11, D40).** `{ gameId? }` — every session of that game, or of every game when it is null, with their segments, frame and sensor series and annotations (they cascade) → `DeleteSessionsAck { gameId?, games, sessions }`. `Error SessionRunning` and nothing deleted while a session of that game — of any game, for all — is being recorded (`CaptureOrchestrator.IsRecording` / `IsRecordingAny`). The client names no rows beyond the game: they are the Agent's (§Writer ownership). Additive: an older Agent answers `Error UnknownType`, which the App says as "restart the agent". Carries no safety fact. |
|
||||
| `SweepRetention` | UI→A | **no payload** — a trigger, like `UpdateRules`: the Agent applies `06_DATA_MODEL` §Retention to every game with the `retention.raw_sessions_per_game` it reads itself → `SweepRetentionAck { keep, games, sessions }` (`keep` 0 = unlimited, and then nothing was swept). *(Built 2026-09-15, P4 PR-7, for Tools ▸ Database maintenance: `Application.Recording.RetentionSweep` over `ISessionRepository.SweepRetentionAllAsync`, composed into `AgentCommandHandler` under `--serve`. The client names no number because the rows are the Agent's (§Writer ownership). Additive: an older Agent answers `Error UnknownType`, which the dialog reads as "restart the Agent". Carries no safety fact.)* |
|
||||
| `SessionStarted` | A→UI | `{ sessionGuid, gameId, gameName, pid, tier, startedAt, hold? }` — **published once per session**: at the attach (tier 1, `startedAt` the attach), or — **since 2026-09-23** — at the first tick of a session held unhooked (tier 2, `startedAt` the session's start, `pid` 0 when the loop never opened the process, as a hooking-off hold never does). ~~a session that never attaches has no `SessionStarted`, only its `SessionCompleted` (tier 2)~~ — that was the beta.5 wire, and every hooking-off, refused or unreadable game read "Nothing is being captured." for as long as it ran. **`hold` (optional, tier 2 only)** is why nothing is measured: `{ reason, guardReason?, family?, signal?, hookingTurnedOff }` — the loop's `SessionEndReason` and, when the guard said anything but allow, its reason, family and signal: the same words the row's `capture_notes` will carry, so the live card and the summary read one sentence (`Formats.Tier2HoldReason` / `Tier2Reason`). The refusal's own event (`CaptureRefused` and the rest, below) goes out with this start rather than when the game exits, and is not repeated at the end |
|
||||
| `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? }` — how long it has run and the machine's sensors. **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) |
|
||||
|
||||
@@ -175,6 +175,25 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
|
||||
### Games (grid → detail)
|
||||
- `GridView`-style panel of cover cards (`ui:CardAction`): name, platform badge, engine badge, total playtime, last played, mini trend sparkline (avg Native FPS last 10 sessions). Sort/filter/`ui:AutoSuggestBox` search.
|
||||
> **The library, beta.11 (owner requests 2026-10-03).** *The empty band on the right:* the cards were 300 px in a plain
|
||||
> `WrapPanel`, so at ~1350 px three fitted and a card's width was left unused; the grid is now
|
||||
> `Controls.UniformWrapPanel` — as many columns as fit at 300 px or wider, every card an equal share of the width, each row
|
||||
> as tall as its tallest card — and the pill row wraps instead of cutting its last pill. **Grid or list** (owner's choice:
|
||||
> switch between the two): the button beside the sort shows the other view; the list is one row per game (name, store,
|
||||
> engine, status, sessions, played, last played; double-click or Enter opens it), and the choice is `ui.library_view`.
|
||||
> **The count** is in the title (*Games · 42*). **Refresh** reads the library again, then asks the stores for games installed
|
||||
> since (`ImportLibraryFlow.RunAsync(onlyNew: true)`: *No new games* and no checklist when there are none), and every entry
|
||||
> whose executable is not on disk carries a **Not installed** pill — its tooltip is the game page's own sentence for it,
|
||||
> the drive that is not connected or the path the file is gone from (`GameLibrary.ExecutableExists` and
|
||||
> `Formats.ExecutableMissingText`, asked off the UI thread on every listing, never stored; nothing is removed for it). **The page reloads by itself** while it is on screen when a session ends (`SessionCompleted`) or an
|
||||
> import adds games (`LibraryChanges` — navigating to the page already on screen does nothing in WPF UI 4.3.0, so an
|
||||
> import from the menu never showed until the page was left). **Import** (FR-1.2): the games already in the library — at
|
||||
> this path or under another drive letter — are hidden by default (*Show the N games already in the library* brings them
|
||||
> back, dimmed), and a row that cannot be imported has its box disabled; the XAML comment said "cannot be ticked" while a
|
||||
> tick was taken and ignored. Tests: `GamesViewModelTests`, `ImportLibraryFlowTests.RefreshOffersOnlyNewGamesAndSaysWhenThereAreNone`,
|
||||
> `…GamesAlreadyInTheLibraryAreHiddenUntilAskedFor`, `PagesLoadTests.TheLibraryGridFillsItsWidthAndTheListViewReplacesIt`,
|
||||
> `…TheImportChecklistRendersWithTheExistingRowsShown`.
|
||||
>
|
||||
- **Game detail:**
|
||||
- Header: cover, name, publisher, version, platform, engine+version, API + Present Mode of last session, `FpsReadout` (lifetime avg), TriState chips, Edit button.
|
||||
- **Two clearly separated rows** (`05_DETECTION` §Capability hints — conflating these was the old design's core mistake):
|
||||
@@ -274,6 +293,19 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
3. **Distribution** — FPS histogram + percentile curve of selected session(s).
|
||||
4. **Trend** — metric-over-date line (selector: Native avg / Displayed avg / 1% Low / 0.1% Low / max GPU temp), vertical **hardware-change markers** with tooltip "GPU driver 572.16 → 576.02" (FR-6.3).
|
||||
|
||||
> **Across sessions, beta.11 (owner decision D39, FR-6.6).** The **Sessions** tab opens with *Sessions at a glance*: a
|
||||
> `TrendChart` of every hooked session's Presented FPS (sessions that counted no generated frame), Native and Displayed
|
||||
> (sessions where frame generation was measured — rule 6, never one inflated line) and 1% / 0.1% lows, oldest first,
|
||||
> partial sessions hollow (`TrendSeriesBuilder.Overview`); a click near a session's points selects it in the grid and
|
||||
> scrolls to it (`TrendChart.SessionClicked`). Under it, **Delete all sessions…** (FR-1.7) for this game. The **Trend**
|
||||
> keeps its selector and adds *Also draw*: any other metric ticked is drawn on the same chart, its unit
|
||||
> (`TrendSeriesBuilder.UnitOf`: FPS, °C, %, W, MB, ×) on the left axis when it is the selected metric's and on the right
|
||||
> when it is a second one (marked ▸ in the legend); a metric in a third unit cannot be ticked, and when the selected
|
||||
> metric changes to a third unit only the first ticked unit in the list stays ticked, so every ticked box has its line;
|
||||
> the selected metric is not offered beside itself. One line alone keeps its name on the axis, as before. After any delete — here or in
|
||||
> Settings — a summary window still open on a deleted session closes, and File ▸ Export lets go of it (`SessionDeletion`;
|
||||
> ids are reused once the newest is gone). Tests: `SessionDeletionAndOverviewTests`.
|
||||
>
|
||||
> **The display mode, beta.10 (FR-7.4, `03_METRICS` §Display mode).** The **Last session measured** row adds how that
|
||||
> session was shown — the mode that lasted longest with its share and the window's size (`Display: Borderless 92% ·
|
||||
> 2560×1440`); the **Sessions** tab has a *Display* column for every session, Tier 2 included (the mode shown longest,
|
||||
@@ -445,6 +477,13 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
|
||||
> `PagesLoadTests`.
|
||||
|
||||
### Settings
|
||||
> **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
|
||||
> sentence under the language row is gone. A **Data** section has one row, **Delete all sessions…** (FR-1.7): the
|
||||
> confirmation names how many, the Agent deletes them (`DeleteSessions`), and the strip says what happened or why nothing
|
||||
> was deleted (a session being recorded, no agent, an older agent). Tests: `SettingsViewModelTests.DeleteAllSessionsAsksWithTheTotalThenGoesThroughTheAgent`.
|
||||
|
||||
Sections per FR-10 using the WPF UI settings idiom: `ui:CardControl`/`ui:CardExpander` rows with `ToggleSwitch`, `ComboBox`, `ui:NumberBox` (numeric inputs — min session length, sensor interval, retention). Language switch applies immediately (09_I18N). Theme selector (Light/Dark/System) drives `ApplicationThemeManager` (16 §Theming). **Capture section (top, most important):** the global **hooking kill switch** (`ToggleSwitch`, prominent) with a one-line summary of what it does; a list of games currently hook-enabled with a per-game revoke; Vulkan layer registration state + Register/Unregister; a link to the safety documentation. Turning the global switch off must take effect immediately, including for the Vulkan layer.
|
||||
|
||||
**System (2026-09-21, FR "show the user's hardware"):** a card above Legal stating this PC as a session's hardware snapshot would record it right now — processor, graphics card, graphics driver, memory, Windows build, primary display — through the same `IHardwareSnapshotSource` the Agent stamps sessions with, read on the thread pool when the page opens, a field that could not be read as N/A, with **Copy** (the same lines as text) and a note that nothing is sent anywhere and what CPU temperature needs. Its own `SystemInfoViewModel`, not `SettingsViewModel`'s. The same snapshot is one tertiary line under the session summary's header (it was loaded for the export and shown nowhere), and `--diag` prints it; the bug bundle's `sysinfo.json` is deliberately NOT given it — its keys are the issue link's prefill.
|
||||
|
||||
@@ -544,7 +544,9 @@ its trial, and the App says so ("trial: 1 of 2"). During the trial **any** end o
|
||||
end is recorded with its own reason and `ac_exception_trial_failed_at` is set. While it is set the sweep writes the game
|
||||
not eligible, the Agent refuses a grant (`Refused.reason = TrialFailed`, the signal is when) and the store refuses one in
|
||||
SQL; withdrawing, a game update, *Change executable* and a twin merge all keep it. A session too short to be stored, or
|
||||
one that was never hooked, proves nothing either way and is not judged. After the trial, an end is what it was under
|
||||
one that was never hooked, is not judged by its frames or its exit — it neither counts toward the two nor fails the
|
||||
trial that way — but an end of the list above still ends the exception for good during the trial: a crash while
|
||||
hooked, however short, or a finding about the game at the start. After the trial, an end is what it was under
|
||||
D33: the exception may be made again once the sweep finds the game eligible. Deleting sessions can only lengthen a trial
|
||||
— the count is read, never stored as a grant's own fact.
|
||||
|
||||
|
||||
@@ -1751,6 +1751,58 @@ release.*
|
||||
|
||||
**Owner-only, added to the list below:** item 7.
|
||||
|
||||
## 2026-10-03 — the beta.11 train: the exception's trial, the library, sessions across
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.11]`; this is what no other file carries. The approved plan was five PRs: PR-1 the
|
||||
CrackProof titles (rules `2026.10.1`), PR-2 the exception's trial (schema 0017, Disclaimer 2.9, EULA 1.4), PR-3 the
|
||||
library and the import, PR-4 delete sessions, the charts across sessions and the Settings clean-up, PR-5 the release.*
|
||||
|
||||
**Decisions (owner, 2026-10-03, asked before the plan — do not re-ask):**
|
||||
|
||||
- **D38 — the user-mode exception's evidence moved under the grant, as a trial.** The owner deleted their ledger and
|
||||
found GIRLS' FRONTLINE 2 "Not eligible: 0 successful hooked session(s), two are needed" for good: since beta.8 a game is
|
||||
blocked the moment it is added, a blocked game is never hooked without a grant, so D33's two sessions were unreachable
|
||||
for every game blocked from the start and lost with a reset ledger. Chosen: a grant needs no session; the first two
|
||||
hooked sessions under it are a trial; any end during the trial (every D33 end, or a stored hooked session with no frames
|
||||
or an abnormal exit) ends it for good (`games.ac_exception_trial_failed_at`). Every other condition is unchanged.
|
||||
Legal text: Disclaimer 2.9 (§2A) and EULA 1.4 — the EULA's "a game the Software has already measured successfully"
|
||||
would have become false (D36's rule).
|
||||
- **D39 — charts across a game's sessions: both** — *Sessions at a glance* on the Sessions tab, and *Also draw* on the
|
||||
Trend (two units at most, the second on the right axis).
|
||||
- **D40 — Delete all sessions: both places** — the game's page and Settings ▸ Data. The Agent deletes (the rows are its),
|
||||
never while a session it would delete under is being recorded.
|
||||
- **D41 — Refresh does all three**: reload the library, offer the games the stores installed since, mark the entries
|
||||
whose executable is gone (*Not installed*; nothing is removed).
|
||||
- **D42 — the library switches between a grid that fills the window and a list** (`ui.library_view`).
|
||||
- **CrackProof (owner's list, "a few, by Steam id")**: three titles whose own store pages say *"Uses Kernel Level
|
||||
Anti-Cheat"* and name CrackProof; ANOTHER EDEN, named only by a community list, is left out.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **A fresh git worktree cannot configure the native build**: CMake's MinHook FetchContent clone runs `git submodule`,
|
||||
which fails there ("'submodule' appears to be a git command, but we were not able to execute it"). Run the gate in the
|
||||
primary checkout, whose `build/native/x64-release/_deps` is cached; a worktree is for writing code and managed tests.
|
||||
- **A `DataGrid` laid out outside a window draws its star columns at their minimum** (no Loaded pass): a visual check
|
||||
renders a hosted, off-screen `Window` and pumps the dispatcher (`Dispatcher.PushFrame`), not Measure/Arrange on a page.
|
||||
- **`Native FPS` includes a measured-none session**, whose native rate is the presented one: beside Presented it is a
|
||||
second line on the same points, so the overview keeps Native and Displayed to sessions that generated frames.
|
||||
- **Both processes may change the library while the Games page is open**, and WPF UI 4.3.0 does nothing on a navigation
|
||||
to the page already on screen: the page reloads on `SessionCompleted` and on the App's own `LibraryChanges`.
|
||||
- **A grant's trial is counted from the sessions, not kept as a counter**: the lapse policy counts at each finalize
|
||||
(`CountSuccessfulUnderGrantAsync`: that family, started at or after the grant), and `ac_exception_sessions` is only
|
||||
the sweep's copy for the card. Deleting sessions can only lengthen a trial; the mark that ends one for good
|
||||
(`ac_exception_trial_failed_at`) is the only stored decision.
|
||||
- **A session summary is a window of its own, outside every page**: deleting sessions must close the ones open on a
|
||||
deleted session and let go of File ▸ Export's selection, asking the ledger whether the session is still there (both in
|
||||
`SessionDeletion`, so Settings ▸ Data does it too) — ids are reused once the newest is gone. The plan said so; PR-4's
|
||||
first version did neither, and a self-review caught it before the merge.
|
||||
- **Analyzers met:** `MA0048` (one type per file), `CA1003`/`MA0046` (an `EventArgs` type for an event), `IDE1006` (a `_`
|
||||
prefix on private consts), `CA1030` (no method named `Raise`), `MA0051` (60 lines), and `RevokeAntiCheatExceptionAsync`'s
|
||||
new `bool` before the token turned every `(path, reason, ct)` call into a compile error — pass `ct: ct`.
|
||||
- **The Bash tool's heredocs break on an odd number of apostrophes and halve backslashes**: patch scripts are files.
|
||||
|
||||
**Owner-only, added to the list below:** item 8.
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
|
||||
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
|
||||
@@ -1793,6 +1845,13 @@ release.*
|
||||
Gate shows Privacy 2.5 and Disclaimer 2.8 once. (e) The `ja` text of `Safety_AdminMode_*`, English until reviewed.
|
||||
(f) `docs/LIST_GAME_TESTED.md` — reviewed and approved by the owner before it was committed (D35, 2026-09-27);
|
||||
keep it current as games are run.
|
||||
8. **beta.11 on real hardware.** (a) GIRLS' FRONTLINE 2: the option on → *Eligible* → *Make exception…* (the disclosure
|
||||
`ac-exception-dialog/2`, with its *Trial* paragraph) → hooking on → two sessions: the card says *trial: 0 of 2*, then
|
||||
*1 of 2*, then *Exception in force since …* alone. (b) The library at your window's width, and the list; Refresh
|
||||
after installing a game, and with the USB drive unplugged (*Not installed*, the drive named). (c) Delete all sessions
|
||||
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`.
|
||||
|
||||
**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
|
||||
|
||||
+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-09-28.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.10`** (2026-09-28), an unsigned installer built from that tag with its
|
||||
> ⚠ **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
|
||||
> 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
@@ -117,8 +117,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-09-28.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.10`** (2026-09-28), an unsigned installer built from that tag with its
|
||||
> ⚠ **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
|
||||
> 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
|
||||
|
||||
@@ -272,7 +272,9 @@ internal static class AgentServices
|
||||
// D33: the user-mode exception's option and disclosure version (D38: no session count any more).
|
||||
new AntiCheatExceptionCommands(
|
||||
sp.GetRequiredService<IUserModeExceptionSwitch>(),
|
||||
AntiCheatExceptionDisclosure.Version));
|
||||
AntiCheatExceptionDisclosure.Version),
|
||||
// beta.11 (D40): Delete all sessions, of one game or of every game — the Agent's rows, deleted by the Agent.
|
||||
sp.GetRequiredService<ISessionRepository>());
|
||||
|
||||
/// <summary>
|
||||
/// <c>HelloAck.telemetrySource</c>: the layers this machine composes, read once on the first <c>Hello</c> by
|
||||
|
||||
@@ -280,6 +280,8 @@ public partial class App : System.Windows.Application
|
||||
// The admin mode's disclosure (beta.10, D34), shown before capture.run_elevated is turned on.
|
||||
builder.Services.AddSingleton<IAgentAdminPrompt, AgentAdminPrompt>();
|
||||
builder.Services.AddSingleton<AntiCheatExceptions>();
|
||||
// beta.11 (D40): Delete all sessions, of one game (its page) or of every game (Settings ▸ Data), through the Agent.
|
||||
builder.Services.AddSingleton<SessionDeletion>();
|
||||
|
||||
AddLibrary(builder.Services);
|
||||
|
||||
@@ -350,7 +352,9 @@ public partial class App : System.Windows.Application
|
||||
services.AddTransient<SystemInfoViewModel>();
|
||||
services.AddSingleton<Charts.SessionSeriesLoader>();
|
||||
services.AddSingleton<IFileSaver, FileSaver>();
|
||||
services.AddSingleton<ISessionSummaryOpener, SessionSummaryOpener>();
|
||||
services.AddSingleton<SessionSummaryOpener>();
|
||||
services.AddSingleton<ISessionSummaryOpener>(static sp => sp.GetRequiredService<SessionSummaryOpener>());
|
||||
services.AddSingleton<ISessionWindows>(static sp => sp.GetRequiredService<SessionSummaryOpener>()); // beta.11: Delete all sessions closes them
|
||||
services.AddSingleton<IMixedTierPrompt, MixedTierPrompt>();
|
||||
|
||||
// Settings, the safety notices and the Logs page (P3 PR-8a): the Run entry, the notices over the pipe's
|
||||
@@ -417,6 +421,8 @@ public partial class App : System.Windows.Application
|
||||
sp.GetRequiredService<IExecutableLocator>(),
|
||||
static line => Serilog.Log.Information("{Line}", line)));
|
||||
services.AddSingleton<IImportReview, ImportReviewPrompt>();
|
||||
// beta.11: the Games page on screen reloads when an import adds games (navigating to itself does nothing).
|
||||
services.AddSingleton<LibraryChanges>();
|
||||
services.AddSingleton<ImportLibraryFlow>();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>A click on a trend landed on a session's points (beta.11, D39): which session.</summary>
|
||||
public sealed class SessionClickedEventArgs(long sessionId) : EventArgs
|
||||
{
|
||||
public long SessionId { get; } = sessionId;
|
||||
}
|
||||
@@ -1,18 +1,33 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using ScottPlot;
|
||||
using ScottPlot.Plottables;
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>The trend line (one point per session, oldest first) with FR-6.3's hardware-change markers as labelled vertical lines.</summary>
|
||||
/// <summary>
|
||||
/// The trend: one point per session, oldest first, with FR-6.3's hardware-change markers as labelled vertical lines. Since
|
||||
/// beta.11 (owner decision D39) it draws several metrics at once — every line in the first unit against the left axis, a
|
||||
/// second unit against the right — and a click near a session's points raises <see cref="SessionClicked"/>, which the
|
||||
/// Sessions tab's overview uses to select that session.
|
||||
/// </summary>
|
||||
public partial class TrendChart : UserControl
|
||||
{
|
||||
/// <summary>How near a click must land to a session's points, in device-independent pixels.</summary>
|
||||
private const double _clickReach = 14;
|
||||
|
||||
private TrendPoint[] _all = [];
|
||||
|
||||
public TrendChart()
|
||||
{
|
||||
InitializeComponent();
|
||||
ChartTheme.Attach(Plot);
|
||||
Plot.MouseLeftButtonUp += OnPlotClicked;
|
||||
}
|
||||
|
||||
/// <summary>The session whose points a click landed on (<see cref="TrendPoint.SessionId"/>).</summary>
|
||||
public event EventHandler<SessionClickedEventArgs>? SessionClicked;
|
||||
|
||||
public ScottPlot.Plot ScottPlot => Plot.Plot;
|
||||
|
||||
public int DrawnPoints { get; private set; }
|
||||
@@ -20,9 +35,20 @@ public partial class TrendChart : UserControl
|
||||
/// <summary>How many of <see cref="DrawnPoints"/> were drawn hollow (a part of their session).</summary>
|
||||
public int HollowPoints { get; private set; }
|
||||
|
||||
public void Show(IReadOnlyList<TrendPoint> points, IReadOnlyList<HardwareChange> changes, string metricLabel)
|
||||
/// <summary>How many lines were drawn against the right axis (a second unit).</summary>
|
||||
public int RightAxisLines { get; private set; }
|
||||
|
||||
/// <summary>One metric — what the Trend drew before beta.11.</summary>
|
||||
public void Show(IReadOnlyList<TrendPoint> points, IReadOnlyList<HardwareChange> changes, string metricLabel) =>
|
||||
Show([new TrendLine(metricLabel, metricLabel, points)], changes);
|
||||
|
||||
/// <summary>
|
||||
/// Every line in <paramref name="lines"/>: the first line's unit on the left axis, the first other unit on the right,
|
||||
/// and a line in any further unit is not drawn (the selector allows two).
|
||||
/// </summary>
|
||||
public void Show(IReadOnlyList<TrendLine> lines, IReadOnlyList<HardwareChange> changes)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(points);
|
||||
ArgumentNullException.ThrowIfNull(lines);
|
||||
ArgumentNullException.ThrowIfNull(changes);
|
||||
ScottPlot.Plot plot = Plot.Plot;
|
||||
plot.Clear();
|
||||
@@ -31,31 +57,36 @@ public partial class TrendChart : UserControl
|
||||
plot.Axes.DateTimeTicksBottom();
|
||||
ChartTheme.Apply(plot);
|
||||
plot.XLabel(Strings.Trend_Axis_Date);
|
||||
plot.YLabel(metricLabel);
|
||||
DrawnPoints = points.Count;
|
||||
HollowPoints = points.Count(static t => t.SettingsChangedMidSession);
|
||||
if (points.Count > 0)
|
||||
{
|
||||
ChartPalette p = ChartTheme.Current;
|
||||
double[] xs = [.. points.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] ys = [.. points.Select(static t => t.Value)];
|
||||
Scatter line = plot.Add.Scatter(xs, ys, p.Native);
|
||||
line.LineWidth = 2;
|
||||
line.MarkerSize = 7;
|
||||
line.LegendText = metricLabel;
|
||||
string? left = lines.Count > 0 ? lines[0].Unit : null;
|
||||
string? right = lines.Select(static l => l.Unit).FirstOrDefault(u => !string.Equals(u, left, StringComparison.Ordinal));
|
||||
plot.YLabel(left ?? string.Empty);
|
||||
plot.Axes.Right.Label.Text = right ?? string.Empty;
|
||||
|
||||
// A point that describes part of its session (settings changed, or a steady state) is drawn hollow over its
|
||||
// filled one: the line still passes through it, and it cannot be read as the session's own number.
|
||||
TrendPoint[] partial = [.. points.Where(static t => t.SettingsChangedMidSession)];
|
||||
if (partial.Length > 0)
|
||||
ChartPalette p = ChartTheme.Current;
|
||||
Color[] palette = [p.Native, p.Displayed, p.Percentile, p.Sensor, p.SensorSecondary, p.Stutter, p.Histogram, p.Segment];
|
||||
var drawn = new List<TrendPoint>();
|
||||
int hollow = 0;
|
||||
int onRight = 0;
|
||||
for (int i = 0; i < lines.Count; i++)
|
||||
{
|
||||
TrendLine line = lines[i];
|
||||
bool isRight = right is not null && string.Equals(line.Unit, right, StringComparison.Ordinal);
|
||||
if (line.Points.Count == 0 || (!isRight && !string.Equals(line.Unit, left, StringComparison.Ordinal)))
|
||||
{
|
||||
double[] hx = [.. partial.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] hy = [.. partial.Select(static t => t.Value)];
|
||||
Scatter hollow = plot.Add.ScatterPoints(hx, hy, p.Data);
|
||||
hollow.MarkerSize = 6;
|
||||
hollow.MarkerShape = MarkerShape.FilledCircle;
|
||||
continue;
|
||||
}
|
||||
|
||||
hollow += AddLine(plot, line, palette[i % palette.Length], p.Data, isRight);
|
||||
onRight += isRight ? 1 : 0;
|
||||
drawn.AddRange(line.Points);
|
||||
}
|
||||
|
||||
_all = [.. drawn];
|
||||
DrawnPoints = drawn.Count;
|
||||
HollowPoints = hollow;
|
||||
RightAxisLines = onRight;
|
||||
if (drawn.Count > 0)
|
||||
{
|
||||
foreach (HardwareChange change in TrendSeriesBuilder.MergedByDay(changes))
|
||||
{
|
||||
VerticalLine marker = plot.Add.VerticalLine(change.At.LocalDateTime.ToOADate(), 1, p.StutterPso, LinePattern.Dashed);
|
||||
@@ -70,4 +101,67 @@ public partial class TrendChart : UserControl
|
||||
|
||||
Plot.Refresh();
|
||||
}
|
||||
|
||||
/// <summary>One line, its hollow points, against the left or the right axis; how many were hollow.</summary>
|
||||
private static int AddLine(ScottPlot.Plot plot, TrendLine line, Color color, Color hollowColor, bool isRight)
|
||||
{
|
||||
double[] xs = [.. line.Points.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] ys = [.. line.Points.Select(static t => t.Value)];
|
||||
Scatter scatter = plot.Add.Scatter(xs, ys, color);
|
||||
scatter.LineWidth = 2;
|
||||
scatter.MarkerSize = 7;
|
||||
scatter.LegendText = isRight ? line.Label + " ▸" : line.Label;
|
||||
if (isRight)
|
||||
{
|
||||
scatter.Axes.YAxis = plot.Axes.Right;
|
||||
}
|
||||
|
||||
// A point that describes part of its session (settings changed, or a steady state) is drawn hollow over its filled
|
||||
// one: the line still passes through it, and it cannot be read as the session's own number.
|
||||
TrendPoint[] partial = [.. line.Points.Where(static t => t.SettingsChangedMidSession)];
|
||||
if (partial.Length > 0)
|
||||
{
|
||||
double[] hx = [.. partial.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] hy = [.. partial.Select(static t => t.Value)];
|
||||
Scatter dots = plot.Add.ScatterPoints(hx, hy, hollowColor);
|
||||
dots.MarkerSize = 6;
|
||||
dots.MarkerShape = MarkerShape.FilledCircle;
|
||||
if (isRight)
|
||||
{
|
||||
dots.Axes.YAxis = plot.Axes.Right;
|
||||
}
|
||||
}
|
||||
|
||||
return partial.Length;
|
||||
}
|
||||
|
||||
/// <summary>The session whose points are nearest the click along the date axis, if any is within <see cref="_clickReach"/>.</summary>
|
||||
private void OnPlotClicked(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (_all.Length == 0 || SessionClicked is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
System.Windows.Point at = e.GetPosition(Plot);
|
||||
float scale = Plot.DisplayScale;
|
||||
double clickX = at.X * scale;
|
||||
ScottPlot.Plot plot = Plot.Plot;
|
||||
TrendPoint? nearest = null;
|
||||
double best = double.MaxValue;
|
||||
foreach (TrendPoint point in _all)
|
||||
{
|
||||
double distance = Math.Abs(plot.GetPixel(new Coordinates(point.At.LocalDateTime.ToOADate(), 0)).X - clickX);
|
||||
if (distance < best)
|
||||
{
|
||||
best = distance;
|
||||
nearest = point;
|
||||
}
|
||||
}
|
||||
|
||||
if (nearest is { } hit && best <= _clickReach * scale)
|
||||
{
|
||||
SessionClicked.Invoke(this, new SessionClickedEventArgs(hit.SessionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// One metric's line on a trend (beta.11, owner decision D39: several metrics at once): its label, the unit that decides
|
||||
/// which axis it is drawn against, and its points (one per session, oldest first).
|
||||
/// </summary>
|
||||
/// <param name="Label">The metric, as the legend names it.</param>
|
||||
/// <param name="Unit">The axis label every line in the same unit shares.</param>
|
||||
/// <param name="Points">The sessions that have the metric.</param>
|
||||
public sealed record TrendLine(string Label, string Unit, IReadOnlyList<TrendPoint> Points);
|
||||
@@ -42,6 +42,44 @@ public static class TrendSeriesBuilder
|
||||
return points;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The axis a metric is drawn against (beta.11, D39): frame rates share one, temperatures, loads and shares, power,
|
||||
/// memory and the factor each have their own — two of them at most on one chart.
|
||||
/// </summary>
|
||||
public static string UnitOf(TrendMetric metric) => metric switch
|
||||
{
|
||||
TrendMetric.PresentedFps or TrendMetric.NativeFps or TrendMetric.Displayed or TrendMetric.P1Low or TrendMetric.P01Low => Strings.Trend_Unit_Fps,
|
||||
TrendMetric.MaxGpuTemp or TrendMetric.MaxCpuTemp => Strings.Trend_Unit_Celsius,
|
||||
TrendMetric.AvgGpuPower => Strings.Trend_Unit_Watts,
|
||||
TrendMetric.MaxVramProcess or TrendMetric.AvgRam => Strings.Trend_Unit_Megabytes,
|
||||
TrendMetric.FgFactor => Strings.Trend_Unit_Factor,
|
||||
_ => Strings.Trend_Unit_Percent,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The Sessions tab's overview (beta.11, D39): every hooked session's rate and lows on one chart — Presented FPS where
|
||||
/// no generated frame was counted, Native and Displayed where frame generation was measured (rule 6: never one inflated
|
||||
/// number), and the 1% and 0.1% lows — partial sessions included and drawn hollow.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<TrendLine> Overview(IReadOnlyList<SessionRow> rows)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(rows);
|
||||
(TrendMetric Metric, string Label)[] metrics =
|
||||
[
|
||||
(TrendMetric.PresentedFps, Strings.Trend_Metric_PresentedFps),
|
||||
(TrendMetric.NativeFps, Strings.Trend_Metric_NativeFps),
|
||||
(TrendMetric.Displayed, Strings.Trend_Metric_Displayed),
|
||||
(TrendMetric.P1Low, Strings.Trend_Metric_P1Low),
|
||||
(TrendMetric.P01Low, Strings.Trend_Metric_P01Low),
|
||||
];
|
||||
// Native and Displayed only where frames were generated: on a session that counted none, Native is the Presented rate
|
||||
// already drawn, and a second line on the same points reads as a second measurement.
|
||||
HashSet<long> generated = [.. rows.Where(static r => FpsPresentation.FromRow(r).Kind == FpsReadoutKind.Generated).Select(static r => r.Id)];
|
||||
return [.. metrics.Select(m => new TrendLine(m.Label, Strings.Trend_Unit_Fps,
|
||||
[.. Points(rows, m.Metric, includeMidSessionChanges: true).Where(p => m.Metric is not (TrendMetric.NativeFps or TrendMetric.Displayed) || generated.Contains(p.SessionId))]))
|
||||
.Where(static l => l.Points.Count > 0)];
|
||||
}
|
||||
|
||||
/// <summary>How many sessions FR-6.4 leaves out at the default setting.</summary>
|
||||
public static int ExcludedCount(IReadOnlyList<SessionRow> rows) => ExcludedCount(rows, TrendMetric.PresentedFps);
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace FrameLedger.App.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// The library grid's panel (beta.11, owner request 2026-10-03: "the empty band on the right"): as many columns as
|
||||
/// <see cref="MinItemWidth"/> allows across the width it is given, every item stretched to an equal share of it, so a row
|
||||
/// is always full — a plain <see cref="WrapPanel"/> of 300 px cards left up to a card's width unused at the right. Each row
|
||||
/// is as tall as its tallest item. Not virtualizing: a library is hundreds of rows at most.
|
||||
/// </summary>
|
||||
public sealed class UniformWrapPanel : Panel
|
||||
{
|
||||
public static readonly DependencyProperty MinItemWidthProperty = DependencyProperty.Register(
|
||||
nameof(MinItemWidth), typeof(double), typeof(UniformWrapPanel), new FrameworkPropertyMetadata(300.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
|
||||
public static readonly DependencyProperty SpacingProperty = DependencyProperty.Register(
|
||||
nameof(Spacing), typeof(double), typeof(UniformWrapPanel), new FrameworkPropertyMetadata(12.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
|
||||
/// <summary>The narrowest an item may be; the column count is the most that fit at this width or wider.</summary>
|
||||
public double MinItemWidth
|
||||
{
|
||||
get => (double)GetValue(MinItemWidthProperty);
|
||||
set => SetValue(MinItemWidthProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>The gap between columns and between rows.</summary>
|
||||
public double Spacing
|
||||
{
|
||||
get => (double)GetValue(SpacingProperty);
|
||||
set => SetValue(SpacingProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>How many columns of at least <paramref name="minItemWidth"/> fit in <paramref name="width"/>, never fewer than one.</summary>
|
||||
public static int ColumnsFor(double width, double minItemWidth, double spacing)
|
||||
{
|
||||
if (double.IsNaN(width) || double.IsInfinity(width) || minItemWidth <= 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return Math.Max(1, (int)Math.Floor((width + spacing) / (minItemWidth + spacing)));
|
||||
}
|
||||
|
||||
/// <summary>Each item's width when <paramref name="columns"/> share <paramref name="width"/> with gaps between them.</summary>
|
||||
public static double ItemWidthFor(double width, int columns, double spacing) =>
|
||||
columns <= 0 ? 0 : Math.Max(0, (width - ((columns - 1) * spacing)) / columns);
|
||||
|
||||
protected override Size MeasureOverride(Size availableSize)
|
||||
{
|
||||
double width = double.IsInfinity(availableSize.Width) ? MinItemWidth : availableSize.Width;
|
||||
int columns = ColumnsFor(width, MinItemWidth, Spacing);
|
||||
double itemWidth = ItemWidthFor(width, columns, Spacing);
|
||||
double height = 0;
|
||||
double rowHeight = 0;
|
||||
int column = 0;
|
||||
int rows = 0;
|
||||
foreach (UIElement child in InternalChildren)
|
||||
{
|
||||
child.Measure(new Size(itemWidth, double.PositiveInfinity));
|
||||
rowHeight = Math.Max(rowHeight, child.DesiredSize.Height);
|
||||
if (++column == columns)
|
||||
{
|
||||
height += rowHeight;
|
||||
rows++;
|
||||
rowHeight = 0;
|
||||
column = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (column > 0)
|
||||
{
|
||||
height += rowHeight;
|
||||
rows++;
|
||||
}
|
||||
|
||||
return new Size(width, height + (Math.Max(0, rows - 1) * Spacing));
|
||||
}
|
||||
|
||||
protected override Size ArrangeOverride(Size finalSize)
|
||||
{
|
||||
int columns = ColumnsFor(finalSize.Width, MinItemWidth, Spacing);
|
||||
double itemWidth = ItemWidthFor(finalSize.Width, columns, Spacing);
|
||||
UIElement[] children = [.. InternalChildren.Cast<UIElement>()];
|
||||
double y = 0;
|
||||
for (int start = 0; start < children.Length; start += columns)
|
||||
{
|
||||
int end = Math.Min(start + columns, children.Length);
|
||||
double rowHeight = 0;
|
||||
for (int i = start; i < end; i++)
|
||||
{
|
||||
rowHeight = Math.Max(rowHeight, children[i].DesiredSize.Height);
|
||||
}
|
||||
|
||||
for (int i = start; i < end; i++)
|
||||
{
|
||||
children[i].Arrange(new Rect((i - start) * (itemWidth + Spacing), y, itemWidth, rowHeight));
|
||||
}
|
||||
|
||||
y += rowHeight + Spacing;
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,35 @@
|
||||
MinWidth="640">
|
||||
<!--
|
||||
FR-1.2's review checklist: nothing is added until the user says which; a row that is already in the library
|
||||
or has no executable cannot be ticked. Import never enables hooking (the intro says so).
|
||||
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).
|
||||
-->
|
||||
<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}"
|
||||
Visibility="{Binding HasExisting, Converter={StaticResource BoolToVis}}" />
|
||||
<DataGrid Margin="0,10,0,8" MaxHeight="360" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column"
|
||||
ItemsSource="{Binding Rows}" SelectionMode="Single" IsReadOnly="False">
|
||||
ItemsSource="{Binding Shown}" SelectionMode="Single" IsReadOnly="False">
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsExisting}" Value="True">
|
||||
<Setter Property="Opacity" Value="0.55" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" Width="40" />
|
||||
<DataGridTemplateColumn Width="40">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox HorizontalAlignment="Center" IsEnabled="{Binding CanImport}"
|
||||
AutomationProperties.Name="{Binding Name}"
|
||||
IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnPlatform}" Binding="{Binding PlatformText}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnName}" Binding="{Binding Name}" IsReadOnly="True" Width="2*" />
|
||||
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnExe}" Binding="{Binding ExeText}" IsReadOnly="True" Width="3*" />
|
||||
|
||||
@@ -215,6 +215,18 @@
|
||||
<ui:TextBlock Appearance="Secondary" TextWrapping="Wrap"
|
||||
Text="{x:Static vm:GameDetailViewModel.SessionsEmptyText}"
|
||||
Visibility="{Binding ViewModel.SessionsEmpty, Converter={StaticResource BoolToVis}}" />
|
||||
<!-- beta.11 (D39): every hooked session's rate and lows at a glance; a click selects the session below. -->
|
||||
<StackPanel Visibility="{Binding ViewModel.OverviewVisible, Converter={StaticResource BoolToVis}}">
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static vm:GameDetailViewModel.OverviewHeader}" />
|
||||
<ui:TextBlock Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.OverviewNote}" />
|
||||
<charts:TrendChart x:Name="Overview" Height="220" MinHeight="200" Margin="0,4,0,8" />
|
||||
</StackPanel>
|
||||
<!-- beta.11 (D40): the game, its settings and its consent stay; the confirmation says how many go. -->
|
||||
<StackPanel Margin="0,0,0,8" Orientation="Horizontal" HorizontalAlignment="Right"
|
||||
Visibility="{Binding ViewModel.SessionsEmpty, Converter={StaticResource InverseBoolToVis}}">
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.DeleteAllSessionsCommand}"
|
||||
Content="{x:Static vm:GameDetailViewModel.DeleteAllSessionsText}" Icon="{ui:SymbolIcon Delete24}" />
|
||||
</StackPanel>
|
||||
<DataGrid x:Name="SessionsGrid" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" HeadersVisibility="Column"
|
||||
ItemsSource="{Binding ViewModel.Sessions}" SelectionMode="Extended" MouseDoubleClick="OnSessionDoubleClick"
|
||||
SelectedItem="{Binding ViewModel.SelectedSession, Mode=TwoWay}">
|
||||
@@ -323,6 +335,21 @@
|
||||
<CheckBox Margin="16,0,0,0" VerticalAlignment="Center" Content="{x:Static vm:GameDetailViewModel.IncludeMidSessionText}"
|
||||
IsChecked="{Binding ViewModel.IncludeMidSession}" />
|
||||
</StackPanel>
|
||||
<!-- beta.11 (D39): more metrics on the same chart; a second unit is drawn against the right axis, a third cannot be ticked. -->
|
||||
<ui:TextBlock Margin="0,10,0,0" Appearance="Secondary" Text="{x:Static vm:GameDetailViewModel.TrendExtrasLabel}" />
|
||||
<ItemsControl ItemsSource="{Binding ViewModel.TrendExtras}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:TrendMetricOptionViewModel}">
|
||||
<CheckBox Margin="0,4,14,0" Content="{Binding Label}" IsChecked="{Binding IsSelected, Mode=TwoWay}" IsEnabled="{Binding IsEnabled}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ui:TextBlock Margin="0,4,0,0" Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.TrendExtrasNote}" />
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Tertiary" Text="{Binding ViewModel.TrendExcludedText}"
|
||||
Visibility="{Binding ViewModel.TrendExcludedText, Converter={StaticResource NullToCollapsed}}" />
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.TrendAverageNote}" />
|
||||
|
||||
@@ -14,6 +14,7 @@ public partial class GameDetailPage : INavigableView<GameDetailViewModel>
|
||||
InitializeComponent();
|
||||
ViewModel.SelectionPresented += OnSelectionPresented;
|
||||
ViewModel.TrendPresented += OnTrendPresented;
|
||||
Overview.SessionClicked += OnOverviewClicked;
|
||||
// The view model starts loading before this page exists, and a load that finished first raised its events to
|
||||
// nobody: the Trend tab was blank on every first open (beta.8). Draw what it holds now; a later load redraws.
|
||||
OnTrendPresented(this, EventArgs.Empty);
|
||||
@@ -23,6 +24,7 @@ public partial class GameDetailPage : INavigableView<GameDetailViewModel>
|
||||
{
|
||||
ViewModel.SelectionPresented -= OnSelectionPresented;
|
||||
ViewModel.TrendPresented -= OnTrendPresented;
|
||||
Overview.SessionClicked -= OnOverviewClicked;
|
||||
ViewModel.Detach();
|
||||
};
|
||||
}
|
||||
@@ -37,7 +39,22 @@ public partial class GameDetailPage : INavigableView<GameDetailViewModel>
|
||||
Latency.Show(ViewModel.SelectedSeries, ViewModel.SelectedSession?.Row.LatencyAvgUs, ViewModel.SelectedSession?.Row.LatencyP95Us);
|
||||
}
|
||||
|
||||
private void OnTrendPresented(object? sender, EventArgs e) => Trend.Show(ViewModel.TrendPoints, ViewModel.HardwareChanges, ViewModel.TrendMetricText);
|
||||
/// <summary>The Trend tab's lines (beta.11: several metrics at once) and the Sessions tab's overview, from one rebuild.</summary>
|
||||
private void OnTrendPresented(object? sender, EventArgs e)
|
||||
{
|
||||
Trend.Show(ViewModel.TrendLines, ViewModel.HardwareChanges);
|
||||
Overview.Show(ViewModel.OverviewLines, ViewModel.HardwareChanges);
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D39): a session picked on the overview is selected in the grid below it, and scrolled to.</summary>
|
||||
private void OnOverviewClicked(object? sender, Charts.SessionClickedEventArgs e)
|
||||
{
|
||||
ViewModel.SelectSession(e.SessionId);
|
||||
if (ViewModel.SelectedSession is { } session)
|
||||
{
|
||||
SessionsGrid.ScrollIntoView(session);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSessionDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
@@ -4,10 +4,16 @@
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
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.Games_Header}"
|
||||
AllowDrop="True"
|
||||
Drop="OnDrop">
|
||||
<!-- 08_UI §Games: cards (ui:CardAction), search, sort; FR-1.1 add by pick or by dropping an .exe here. -->
|
||||
<!--
|
||||
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>
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<Grid>
|
||||
@@ -16,8 +22,10 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Column="0" FontTypography="Title" Text="{x:Static vm:GamesViewModel.Header}" />
|
||||
<ui:TextBlock Grid.Column="0" FontTypography="Title" Text="{Binding ViewModel.HeaderText}" />
|
||||
<ui:TextBox Grid.Column="1" MinWidth="220" Margin="0,0,12,0" VerticalAlignment="Center"
|
||||
AutomationProperties.Name="{x:Static vm:GamesViewModel.SearchPlaceholder}"
|
||||
Icon="{ui:SymbolIcon Search24}"
|
||||
@@ -29,7 +37,21 @@
|
||||
ItemsSource="{x:Static vm:GamesViewModel.Sorts}"
|
||||
SelectedValue="{Binding ViewModel.Sort, Mode=TwoWay}"
|
||||
SelectedValuePath="Value" />
|
||||
<ui:Button Grid.Column="3" Appearance="Primary" VerticalAlignment="Center"
|
||||
<!-- The view switch: the one button shown is the other view. -->
|
||||
<StackPanel Grid.Column="3" Margin="0,0,8,0" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.ShowListCommand}" Icon="{ui:SymbolIcon AppsList24}"
|
||||
ToolTip="{x:Static vm:GamesViewModel.ListText}" AutomationProperties.Name="{x:Static vm:GamesViewModel.ListText}"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource InverseBoolToVis}}" />
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.ShowGridCommand}" Icon="{ui:SymbolIcon Grid24}"
|
||||
ToolTip="{x:Static vm:GamesViewModel.GridText}" AutomationProperties.Name="{x:Static vm:GamesViewModel.GridText}"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource BoolToVis}}" />
|
||||
</StackPanel>
|
||||
<ui:Button Grid.Column="4" Margin="0,0,12,0" Appearance="Secondary" VerticalAlignment="Center"
|
||||
Command="{Binding ViewModel.RefreshCommand}"
|
||||
Content="{x:Static vm:GamesViewModel.RefreshText}"
|
||||
ToolTip="{x:Static vm:GamesViewModel.RefreshToolTip}"
|
||||
Icon="{ui:SymbolIcon ArrowClockwise24}" />
|
||||
<ui:Button Grid.Column="5" Appearance="Primary" VerticalAlignment="Center"
|
||||
Command="{Binding ViewModel.AddGameCommand}"
|
||||
Content="{x:Static vm:GamesViewModel.AddText}"
|
||||
Icon="{ui:SymbolIcon Add24}" />
|
||||
@@ -42,34 +64,42 @@
|
||||
Text="{x:Static vm:GamesViewModel.NoMatchText}"
|
||||
Visibility="{Binding ViewModel.NoMatch, Converter={StaticResource BoolToVis}}" />
|
||||
|
||||
<ItemsControl Margin="0,16,0,0" ItemsSource="{Binding ViewModel.Games}">
|
||||
<!-- The grid: as many columns as fit at 300 px or wider, each card an equal share of the width. -->
|
||||
<ItemsControl x:Name="CardGrid" Margin="0,16,0,0" ItemsSource="{Binding ViewModel.Games}"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource InverseBoolToVis}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
<controls:UniformWrapPanel MinItemWidth="300" Spacing="12" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:GameCardViewModel}">
|
||||
<ui:CardAction Width="300" Margin="0,0,12,12" IsChevronVisible="False"
|
||||
<ui:CardAction IsChevronVisible="False" VerticalAlignment="Stretch" VerticalContentAlignment="Top"
|
||||
Command="{Binding DataContext.ViewModel.OpenCommand, RelativeSource={RelativeSource AncestorType=Page}}"
|
||||
CommandParameter="{Binding}"
|
||||
Icon="{ui:SymbolIcon Games24}">
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{Binding Name}" TextTrimming="CharacterEllipsis" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4,0,0">
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,0"
|
||||
<!-- Pills wrap to a second line rather than being cut (the third one was, at 300 px). -->
|
||||
<WrapPanel Margin="0,4,0,0">
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,4"
|
||||
Visibility="{Binding HasPlatform, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock Style="{StaticResource TagPillText}" Text="{Binding PlatformText}" />
|
||||
</Border>
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,0"
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,4"
|
||||
Visibility="{Binding HasEngine, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock Style="{StaticResource TagPillText}" Text="{Binding EngineText}" />
|
||||
</Border>
|
||||
<Border Style="{StaticResource HookStatePill}">
|
||||
<Border Style="{StaticResource HookStatePill}" Margin="0,0,6,4">
|
||||
<TextBlock Style="{StaticResource HookStatePillText}" Text="{Binding HookText}" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Secondary" Text="{Binding SessionsText}" />
|
||||
<Border x:Name="NotInstalledPill" Style="{StaticResource TagPill}" Margin="0,0,6,4"
|
||||
ToolTip="{Binding NotInstalledToolTip}"
|
||||
Visibility="{Binding NotInstalled, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock Style="{StaticResource TagPillText}" Text="{x:Static res:Strings.Games_Card_NotInstalled}" />
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
<ui:TextBlock Margin="0,2,0,0" Appearance="Secondary" Text="{Binding SessionsText}" />
|
||||
<ui:TextBlock Appearance="Secondary" Text="{Binding PlaytimeText}" />
|
||||
<ui:TextBlock Appearance="Secondary" Text="{Binding LastPlayedText}" />
|
||||
</StackPanel>
|
||||
@@ -77,6 +107,29 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<!-- The list: one row per game across the width; double-click or Enter opens it. -->
|
||||
<DataGrid x:Name="GameList" Margin="0,16,0,0" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False"
|
||||
CanUserSortColumns="False" HeadersVisibility="Column" IsReadOnly="True" SelectionMode="Single"
|
||||
ItemsSource="{Binding ViewModel.Games}"
|
||||
MouseDoubleClick="OnListDoubleClick" KeyDown="OnListKeyDown"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource BoolToVis}}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Name}" Binding="{Binding Name}" Width="3*" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Store}" Binding="{Binding PlatformText}" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Engine}" Binding="{Binding EngineText}" Width="*" />
|
||||
<DataGridTemplateColumn Header="{x:Static res:Strings.Games_List_Status}" Width="*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Margin="4,0" VerticalAlignment="Center" Text="{Binding StatusText}" ToolTip="{Binding NotInstalledToolTip}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Sessions}" Binding="{Binding SessionCount}" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Played}" Binding="{Binding PlaytimeValue}" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_LastPlayed}" Binding="{Binding LastPlayedValue}" Width="Auto" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using Wpf.Ui.Abstractions.Controls;
|
||||
|
||||
@@ -11,6 +12,9 @@ public partial class GamesPage : INavigableView<GamesViewModel>
|
||||
ViewModel = viewModel ?? throw new ArgumentNullException(nameof(viewModel));
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
// beta.11: the page reloads itself while it is on screen (a session ends, an import adds games), and lets go after.
|
||||
Loaded += (_, _) => ViewModel.Attach();
|
||||
Unloaded += (_, _) => ViewModel.Detach();
|
||||
}
|
||||
|
||||
public GamesViewModel ViewModel { get; }
|
||||
@@ -23,4 +27,25 @@ public partial class GamesPage : INavigableView<GamesViewModel>
|
||||
_ = ViewModel.DropAsync(paths);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The list view opens a game on a double-click, as the cards do on a click.</summary>
|
||||
private void OnListDoubleClick(object sender, MouseButtonEventArgs e) => OpenSelected();
|
||||
|
||||
/// <summary>…and on Enter, so the list is usable from the keyboard.</summary>
|
||||
private void OnListKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
OpenSelected();
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenSelected()
|
||||
{
|
||||
if (GameList.SelectedItem is GameCardViewModel card)
|
||||
{
|
||||
ViewModel.OpenCommand.Execute(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,10 @@
|
||||
<ui:TextBlock Appearance="Secondary" Text="{x:Static res:Strings.Settings_KillSwitch_Body}" TextWrapping="Wrap" />
|
||||
</ui:CardExpander>
|
||||
|
||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="True" Icon="{ui:SymbolIcon Games24}" Header="{x:Static res:Strings.Settings_HookedGames_Label}">
|
||||
<!-- beta.11 (owner request 2026-10-03: no row without a control): shown only while a game has hooking on, each with its Turn off. -->
|
||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="True" Icon="{ui:SymbolIcon Games24}" Header="{x:Static res:Strings.Settings_HookedGames_Label}"
|
||||
Visibility="{Binding ViewModel.HasHookedGames, Converter={StaticResource BoolToVis}}">
|
||||
<StackPanel>
|
||||
<ui:TextBlock Appearance="Secondary"
|
||||
Text="{x:Static res:Strings.Settings_HookedGames_Empty}"
|
||||
Visibility="{Binding ViewModel.HookedGames.Count, Converter={StaticResource ZeroToVisible}}" />
|
||||
<ItemsControl ItemsSource="{Binding ViewModel.HookedGames}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -214,23 +213,28 @@
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_Background_Label}" IsChecked="{Binding ViewModel.BackgroundCapture, Mode=TwoWay}" />
|
||||
</ui:CardControl>
|
||||
|
||||
<!-- Agent: elevation is optional and no tier needs it; the logon task arrives with the tray build. -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Agent_Header}" />
|
||||
<ui:CardExpander Margin="0,4,0,0" Icon="{ui:SymbolIcon Person24}">
|
||||
<ui:CardExpander.Header>
|
||||
<!-- beta.11 (owner request 2026-10-03: no row without a control): Data - Delete all sessions (D40). -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Data_Header}" />
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Delete24}">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_Agent_Elevation_Label}" />
|
||||
<ui:TextBlock Appearance="Secondary" Text="{Binding ViewModel.ElevationText}" />
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_DeleteSessions_Label}" />
|
||||
<ui:TextBlock MaxWidth="560" HorizontalAlignment="Left" Appearance="Secondary" Text="{x:Static res:Strings.Settings_DeleteSessions_Body}" TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</ui:CardExpander.Header>
|
||||
<ui:TextBlock Appearance="Secondary" Text="{x:Static res:Strings.Settings_Agent_Elevation_Body}" TextWrapping="Wrap" />
|
||||
</ui:CardExpander>
|
||||
</ui:CardControl.Header>
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.DeleteAllSessionsCommand}" Content="{x:Static res:Strings.Settings_DeleteSessions_Button}" />
|
||||
</ui:CardControl>
|
||||
|
||||
<!-- Agent: elevation is optional and no tier needs it. beta.11: the elevation line is the admin mode's own status, not a row of its own. -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Agent_Header}" />
|
||||
<!-- beta.10, the admin mode (D34): off by default; on shows the disclosure, and Windows asks at every Agent start. -->
|
||||
<ui:CardControl Margin="0,8,0,0" Icon="{ui:SymbolIcon Shield24}">
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Shield24}">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_Agent_RunElevated_Label}" />
|
||||
<ui:TextBlock MaxWidth="560" HorizontalAlignment="Left" Appearance="Secondary" Text="{x:Static res:Strings.Settings_Agent_RunElevated_Body}" TextWrapping="Wrap" />
|
||||
<ui:TextBlock Margin="0,4,0,0" FontTypography="BodyStrong" Text="{Binding ViewModel.ElevationText}" TextWrapping="Wrap"
|
||||
ToolTip="{x:Static res:Strings.Settings_Agent_Elevation_Body}" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_Agent_RunElevated_Label}" IsChecked="{Binding ViewModel.RunElevated, Mode=TwoWay}" />
|
||||
@@ -278,7 +282,6 @@
|
||||
SelectedValue="{Binding ViewModel.SelectedLanguage, Mode=TwoWay}"
|
||||
SelectedValuePath="Value" />
|
||||
</ui:CardControl>
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Secondary" Text="{x:Static vm:SettingsViewModel.LanguageNote}" TextWrapping="Wrap" />
|
||||
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Window_Header}" />
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Power24}">
|
||||
|
||||
@@ -27,4 +27,21 @@ public sealed class Confirmations : IConfirmations
|
||||
_ => RemoveGameChoice.Cancel,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D40): the one destructive button, in the danger colour; closing the box or Cancel deletes nothing.</summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public async Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
var box = new MessageBox
|
||||
{
|
||||
Title = gameName is null
|
||||
? Strings.DeleteSessions_AllTitle
|
||||
: string.Format(CultureInfo.CurrentCulture, Strings.DeleteSessions_GameTitle_Format, gameName),
|
||||
Content = string.Format(CultureInfo.CurrentCulture, gameName is null ? Strings.DeleteSessions_AllBody_Format : Strings.DeleteSessions_GameBody_Format, sessions),
|
||||
PrimaryButtonText = Strings.DeleteSessions_Delete,
|
||||
PrimaryButtonAppearance = ControlAppearance.Danger,
|
||||
CloseButtonText = Strings.Common_Cancel,
|
||||
};
|
||||
return await box.ShowDialogAsync(cancellationToken: ct).ConfigureAwait(true) == MessageBoxResult.Primary;
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,10 @@ namespace FrameLedger.App.Services;
|
||||
public interface IConfirmations
|
||||
{
|
||||
Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D40): delete every session of <paramref name="gameName"/>'s game — or of every game when it is null —
|
||||
/// <paramref name="sessions"/> of them; true only on the explicit delete button.
|
||||
/// </summary>
|
||||
Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// The session summary windows that are open (beta.11, owner decision D40). After Delete all sessions a window left open
|
||||
/// would show a session that is gone, and a note written from it would go to whichever session reuses its id (the table has
|
||||
/// no AUTOINCREMENT).
|
||||
/// </summary>
|
||||
public interface ISessionWindows
|
||||
{
|
||||
/// <summary>Closes every open summary window whose session is no longer in the ledger.</summary>
|
||||
Task CloseDeletedAsync(CancellationToken ct = default);
|
||||
}
|
||||
@@ -8,7 +8,8 @@ namespace FrameLedger.App.Services;
|
||||
/// <summary>
|
||||
/// File ▸ Import library… (FR-1.2, P4 PR-4): discover every installed store's titles, show the review checklist,
|
||||
/// add what the user ticked — hooking off for every one, as File ▸ Add game… would — and land on the Games page.
|
||||
/// Nothing is launched, nothing is fetched, nothing is added without a tick.
|
||||
/// Nothing is launched, nothing is fetched, nothing is added without a tick. Since beta.11 the Games page's Refresh runs
|
||||
/// it for new games only: when every title found is already in the library it says so and shows no checklist.
|
||||
/// </summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime; a cached CompositeFormat would pin the first culture")]
|
||||
public sealed class ImportLibraryFlow
|
||||
@@ -17,17 +18,22 @@ public sealed class ImportLibraryFlow
|
||||
private readonly IImportReview _review;
|
||||
private readonly IMessageStrip _strip;
|
||||
private readonly IPageNavigator _navigator;
|
||||
private readonly LibraryChanges? _changes;
|
||||
|
||||
public ImportLibraryFlow(LibraryImporter importer, IImportReview review, IMessageStrip strip, IPageNavigator navigator)
|
||||
public ImportLibraryFlow(LibraryImporter importer, IImportReview review, IMessageStrip strip, IPageNavigator navigator, LibraryChanges? changes = null)
|
||||
{
|
||||
_importer = importer ?? throw new ArgumentNullException(nameof(importer));
|
||||
_review = review ?? throw new ArgumentNullException(nameof(review));
|
||||
_strip = strip ?? throw new ArgumentNullException(nameof(strip));
|
||||
_navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
|
||||
_changes = changes;
|
||||
}
|
||||
|
||||
/// <summary>The report, or null when nothing was found or the user cancelled.</summary>
|
||||
public async Task<ImportReport?> RunAsync(CancellationToken ct = default)
|
||||
/// <summary>
|
||||
/// The report, or null when nothing was found or the user cancelled. <paramref name="onlyNew"/> (the Games page's
|
||||
/// Refresh): when no title found can be imported, say "no new games" and show nothing.
|
||||
/// </summary>
|
||||
public async Task<ImportReport?> RunAsync(bool onlyNew = false, CancellationToken ct = default)
|
||||
{
|
||||
IReadOnlyList<ImportCandidate> candidates = await _importer.DiscoverAsync(ct).ConfigureAwait(true);
|
||||
if (candidates.Count == 0)
|
||||
@@ -36,6 +42,12 @@ public sealed class ImportLibraryFlow
|
||||
return null;
|
||||
}
|
||||
|
||||
if (onlyNew && !candidates.Any(static c => c.CanImport))
|
||||
{
|
||||
_strip.Info(Strings.Import_Title, Strings.Import_NothingNew);
|
||||
return null;
|
||||
}
|
||||
|
||||
IReadOnlyList<ImportCandidate>? selected = await _review.ReviewAsync(candidates, ct).ConfigureAwait(true);
|
||||
if (selected is null || selected.Count == 0)
|
||||
{
|
||||
@@ -46,6 +58,8 @@ public sealed class ImportLibraryFlow
|
||||
_strip.Success(Strings.Import_Title, string.Format(CultureInfo.CurrentCulture, Strings.Import_Done_Format, report.Added, report.Skipped));
|
||||
if (report.Added > 0)
|
||||
{
|
||||
// The Games page, if it is the one on screen, does not reload on a navigation to itself: say so to it.
|
||||
_changes?.Announce();
|
||||
_navigator.Navigate<GamesPage>();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// The App's own "the library's rows changed" signal (beta.11, owner request 2026-10-03): an import adds entries, and a
|
||||
/// page already on screen reloads. Navigating to the page that is on screen does nothing in WPF UI 4.3.0, so the Games
|
||||
/// page never saw an import made from File ▸ Import library… while it was open. The Agent's own changes (a merge, a
|
||||
/// finding, a new session) reach the page through its session events and the Refresh button.
|
||||
/// </summary>
|
||||
public sealed class LibraryChanges
|
||||
{
|
||||
/// <summary>Raised on the thread that changed the library — the UI thread for every caller today.</summary>
|
||||
public event EventHandler? Changed;
|
||||
|
||||
/// <summary>Say that entries were added, removed or replaced.</summary>
|
||||
public void Announce() => Changed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Infrastructure.Ipc;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
using Serilog;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Delete all sessions (beta.11, owner decision D40), of one game from its page or of every game from Settings ▸ Data. The
|
||||
/// sessions are the Agent's rows (<c>06_DATA_MODEL</c> §Writer ownership), so the App asks it over the pipe, as Tools ▸
|
||||
/// Database maintenance asks for the retention sweep; the Agent refuses while a session it would delete under is being
|
||||
/// recorded. The confirmation is the caller's to ask first. After a delete it forgets what is gone, for both callers: File ▸
|
||||
/// Export's selection when it named a deleted session, and the summary windows open on one — session ids are reused once
|
||||
/// the newest is gone (no AUTOINCREMENT), so either would otherwise act on whichever session takes the id next.
|
||||
/// </summary>
|
||||
public sealed class SessionDeletion
|
||||
{
|
||||
private readonly IAgentRequests _agent;
|
||||
private readonly ISessionRepository? _sessions;
|
||||
private readonly SessionSelection? _selection;
|
||||
private readonly ISessionWindows? _windows;
|
||||
|
||||
public SessionDeletion(IAgentRequests agent, ISessionRepository? sessions = null, SessionSelection? selection = null, ISessionWindows? windows = null)
|
||||
{
|
||||
_agent = agent ?? throw new ArgumentNullException(nameof(agent));
|
||||
_sessions = sessions;
|
||||
_selection = selection;
|
||||
_windows = windows;
|
||||
}
|
||||
|
||||
/// <summary>Every session of <paramref name="gameId"/>, or of every game when it is null.</summary>
|
||||
public async Task<SessionDeletionResult> DeleteAsync(long? gameId, CancellationToken ct = default)
|
||||
{
|
||||
if (!_agent.IsConnected)
|
||||
{
|
||||
return new(SessionDeletionOutcome.AgentUnavailable);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IpcEnvelope envelope = await _agent.RequestAsync(IpcMessageType.DeleteSessions, new DeleteSessionsRequest(gameId), ct).ConfigureAwait(true);
|
||||
DeleteSessionsAck ack = IpcCodec.Payload<DeleteSessionsAck>(envelope) ?? throw new InvalidOperationException("DeleteSessions answered without a payload");
|
||||
Log.Information("sessions: deleted {Sessions} session(s) of {Games} game(s) ({Scope})", ack.Sessions, ack.Games, gameId is null ? "every game" : "game " + gameId);
|
||||
await ForgetDeletedAsync(ct).ConfigureAwait(true);
|
||||
return new(SessionDeletionOutcome.Deleted, ack.Games, ack.Sessions);
|
||||
}
|
||||
catch (IpcRequestException ex) when (string.Equals(ex.Code, IpcErrorCode.SessionRunning, StringComparison.Ordinal))
|
||||
{
|
||||
return new(SessionDeletionOutcome.SessionRunning);
|
||||
}
|
||||
catch (IpcRequestException ex) when (string.Equals(ex.Code, IpcErrorCode.UnknownType, StringComparison.Ordinal))
|
||||
{
|
||||
Log.Warning("sessions: the Agent does not know DeleteSessions ({Message})", ex.Message);
|
||||
return new(SessionDeletionOutcome.AgentTooOld);
|
||||
}
|
||||
catch (Exception ex) when (ex is IpcRequestException or InvalidOperationException or TimeoutException)
|
||||
{
|
||||
Log.Warning("sessions: DeleteSessions failed ({Message})", ex.Message);
|
||||
return new(SessionDeletionOutcome.Failed, Detail: ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The delete happened: what still names a deleted session lets go of it. A failure here is logged, not the delete's.</summary>
|
||||
private async Task ForgetDeletedAsync(CancellationToken ct)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_sessions is not null && _selection?.SessionId is long selected && await _sessions.FindByIdAsync(selected, ct).ConfigureAwait(true) is null)
|
||||
{
|
||||
_selection.Set(null);
|
||||
}
|
||||
|
||||
if (_windows is not null)
|
||||
{
|
||||
await _windows.CloseDeletedAsync(ct).ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) when (ex is not OutOfMemoryException and not OperationCanceledException)
|
||||
{
|
||||
Log.Warning(ex, "sessions: the deleted sessions' selection and windows were not all let go of");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>How a <c>DeleteSessions</c> ask ended (beta.11, D40).</summary>
|
||||
public enum SessionDeletionOutcome
|
||||
{
|
||||
/// <summary>The Agent deleted them; the counts say how many.</summary>
|
||||
Deleted,
|
||||
|
||||
/// <summary>A session it would delete under is being recorded: nothing was deleted.</summary>
|
||||
SessionRunning,
|
||||
|
||||
/// <summary>The capture agent is not connected: nothing was asked.</summary>
|
||||
AgentUnavailable,
|
||||
|
||||
/// <summary>The Agent does not know the request (an older build): nothing was deleted.</summary>
|
||||
AgentTooOld,
|
||||
|
||||
/// <summary>Anything else; the detail says what.</summary>
|
||||
Failed,
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>What a <c>DeleteSessions</c> ask did (beta.11, D40), and the sentence to tell the user.</summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed record SessionDeletionResult(SessionDeletionOutcome Outcome, int Games = 0, int Sessions = 0, string? Detail = null)
|
||||
{
|
||||
public bool Succeeded => Outcome == SessionDeletionOutcome.Deleted;
|
||||
|
||||
public string Message => Outcome switch
|
||||
{
|
||||
SessionDeletionOutcome.Deleted => string.Format(CultureInfo.CurrentCulture, Strings.DeleteSessions_Done_Format, Sessions, Games),
|
||||
SessionDeletionOutcome.SessionRunning => Strings.DeleteSessions_Running,
|
||||
SessionDeletionOutcome.AgentUnavailable => Strings.DeleteSessions_NoAgent,
|
||||
SessionDeletionOutcome.AgentTooOld => Strings.DeleteSessions_AgentTooOld,
|
||||
_ => Detail ?? Strings.Common_NotAvailable,
|
||||
};
|
||||
}
|
||||
@@ -10,15 +10,18 @@ namespace FrameLedger.App.Services;
|
||||
/// <summary>
|
||||
/// Builds a summary window per open: the view model's override prompt is bound to THAT window's dialog host,
|
||||
/// which is why the window is composed here rather than resolved whole from DI. The load runs after
|
||||
/// <c>Show()</c> so the window appears at once and fills in.
|
||||
/// <c>Show()</c> so the window appears at once and fills in. It keeps the windows it opened, so that Delete all sessions
|
||||
/// can close the ones whose session is gone (<see cref="ISessionWindows"/>, beta.11).
|
||||
/// </summary>
|
||||
public sealed class SessionSummaryOpener : ISessionSummaryOpener
|
||||
public sealed class SessionSummaryOpener : ISessionSummaryOpener, ISessionWindows
|
||||
{
|
||||
private readonly IServiceProvider _services;
|
||||
private readonly ShellHost _shell;
|
||||
|
||||
private readonly SessionSelection _selection;
|
||||
|
||||
private readonly List<(long SessionId, SessionSummaryWindow Window)> _open = [];
|
||||
|
||||
public SessionSummaryOpener(IServiceProvider services, ShellHost shell, SessionSelection selection)
|
||||
{
|
||||
_services = services ?? throw new ArgumentNullException(nameof(services));
|
||||
@@ -43,10 +46,26 @@ public sealed class SessionSummaryOpener : ISessionSummaryOpener
|
||||
{
|
||||
Owner = _shell.Current,
|
||||
};
|
||||
(long, SessionSummaryWindow) open = (sessionId, window);
|
||||
_open.Add(open);
|
||||
window.Closed += (_, _) => _open.Remove(open);
|
||||
window.Show();
|
||||
_ = LoadAsync(viewModel, sessionId);
|
||||
}
|
||||
|
||||
public async Task CloseDeletedAsync(CancellationToken ct = default)
|
||||
{
|
||||
ISessionRepository sessions = _services.GetRequiredService<ISessionRepository>();
|
||||
foreach ((long SessionId, SessionSummaryWindow Window) open in _open.ToArray())
|
||||
{
|
||||
// Still open after the read: the user may have closed it meanwhile, and a closed window is not closed twice.
|
||||
if (await sessions.FindByIdAsync(open.SessionId, ct).ConfigureAwait(true) is null && _open.Contains(open))
|
||||
{
|
||||
open.Window.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task LoadAsync(SessionSummaryViewModel viewModel, long sessionId)
|
||||
{
|
||||
try
|
||||
|
||||
Generated
+117
-6
@@ -183,6 +183,15 @@ public static class Strings
|
||||
nameof(Dashboard_Totals_Games),
|
||||
nameof(Dashboard_Totals_Playtime),
|
||||
nameof(Dashboard_Totals_ThisWeek),
|
||||
nameof(DeleteSessions_AgentTooOld),
|
||||
nameof(DeleteSessions_AllBody_Format),
|
||||
nameof(DeleteSessions_AllTitle),
|
||||
nameof(DeleteSessions_Delete),
|
||||
nameof(DeleteSessions_Done_Format),
|
||||
nameof(DeleteSessions_GameBody_Format),
|
||||
nameof(DeleteSessions_GameTitle_Format),
|
||||
nameof(DeleteSessions_NoAgent),
|
||||
nameof(DeleteSessions_Running),
|
||||
nameof(Diag_Written_Format),
|
||||
nameof(Display_Buffer_Format),
|
||||
nameof(Display_BufferEffect_Format),
|
||||
@@ -365,6 +374,7 @@ public static class Strings
|
||||
nameof(GameDetail_AntiCheat_Header),
|
||||
nameof(GameDetail_Back),
|
||||
nameof(GameDetail_ChangeExe),
|
||||
nameof(GameDetail_DeleteSessions),
|
||||
nameof(GameDetail_Details_Architecture),
|
||||
nameof(GameDetail_Details_Engine),
|
||||
nameof(GameDetail_Details_EngineVersion),
|
||||
@@ -403,6 +413,8 @@ public static class Strings
|
||||
nameof(GameDetail_Measured_Header),
|
||||
nameof(GameDetail_Measured_NotHooked),
|
||||
nameof(GameDetail_NotFound),
|
||||
nameof(GameDetail_Overview_Header),
|
||||
nameof(GameDetail_Overview_Note),
|
||||
nameof(GameDetail_Recording_Body),
|
||||
nameof(GameDetail_Recording_Header),
|
||||
nameof(GameDetail_Recording_Off),
|
||||
@@ -426,17 +438,30 @@ public static class Strings
|
||||
nameof(Games_Card_HookOn),
|
||||
nameof(Games_Card_LastPlayed_Format),
|
||||
nameof(Games_Card_NeverPlayed),
|
||||
nameof(Games_Card_NotInstalled),
|
||||
nameof(Games_Card_NotRecorded),
|
||||
nameof(Games_Card_Playtime_Format),
|
||||
nameof(Games_Card_Sessions_Format),
|
||||
nameof(Games_Empty),
|
||||
nameof(Games_Header),
|
||||
nameof(Games_Header_Count_Format),
|
||||
nameof(Games_List_Engine),
|
||||
nameof(Games_List_LastPlayed),
|
||||
nameof(Games_List_Name),
|
||||
nameof(Games_List_Played),
|
||||
nameof(Games_List_Sessions),
|
||||
nameof(Games_List_Status),
|
||||
nameof(Games_List_Store),
|
||||
nameof(Games_NoMatch),
|
||||
nameof(Games_Refresh),
|
||||
nameof(Games_Refresh_ToolTip),
|
||||
nameof(Games_Search_Placeholder),
|
||||
nameof(Games_Sort_Label),
|
||||
nameof(Games_Sort_LastPlayed),
|
||||
nameof(Games_Sort_Name),
|
||||
nameof(Games_Sort_Playtime),
|
||||
nameof(Games_View_Grid),
|
||||
nameof(Games_View_List),
|
||||
nameof(Guard_ConsentMissing),
|
||||
nameof(Guard_DriverScanFailed),
|
||||
nameof(Guard_HookNotEnabled),
|
||||
@@ -471,9 +496,11 @@ public static class Strings
|
||||
nameof(Import_Note_Moved),
|
||||
nameof(Import_Note_NoExe),
|
||||
nameof(Import_NothingFound),
|
||||
nameof(Import_NothingNew),
|
||||
nameof(Import_SelectAll),
|
||||
nameof(Import_Selected_Format),
|
||||
nameof(Import_SelectNone),
|
||||
nameof(Import_ShowExisting_Format),
|
||||
nameof(Import_Title),
|
||||
nameof(Latency_Avg),
|
||||
nameof(Latency_Axis),
|
||||
@@ -673,6 +700,10 @@ public static class Strings
|
||||
nameof(Settings_Capture_Header),
|
||||
nameof(Settings_Channel_Beta),
|
||||
nameof(Settings_Channel_Stable),
|
||||
nameof(Settings_Data_Header),
|
||||
nameof(Settings_DeleteSessions_Body),
|
||||
nameof(Settings_DeleteSessions_Button),
|
||||
nameof(Settings_DeleteSessions_Label),
|
||||
nameof(Settings_Exceptions_Body),
|
||||
nameof(Settings_Exceptions_Checking),
|
||||
nameof(Settings_Exceptions_Empty),
|
||||
@@ -687,7 +718,6 @@ public static class Strings
|
||||
nameof(Settings_Header),
|
||||
nameof(Settings_HideAntiCheatHooking_Body),
|
||||
nameof(Settings_HideAntiCheatHooking_Label),
|
||||
nameof(Settings_HookedGames_Empty),
|
||||
nameof(Settings_HookedGames_Label),
|
||||
nameof(Settings_HookedGames_Revoke),
|
||||
nameof(Settings_Interval_Body),
|
||||
@@ -698,7 +728,6 @@ public static class Strings
|
||||
nameof(Settings_KillSwitch_Off),
|
||||
nameof(Settings_KillSwitch_On),
|
||||
nameof(Settings_Language_Label),
|
||||
nameof(Settings_Language_Note),
|
||||
nameof(Settings_Legal_Header),
|
||||
nameof(Settings_Legal_Reopen),
|
||||
nameof(Settings_LogDebug_Body),
|
||||
@@ -832,6 +861,8 @@ public static class Strings
|
||||
nameof(Trend_Empty),
|
||||
nameof(Trend_Empty_Format),
|
||||
nameof(Trend_Excluded_Format),
|
||||
nameof(Trend_Extras_Label),
|
||||
nameof(Trend_Extras_Note),
|
||||
nameof(Trend_IncludeMidSession),
|
||||
nameof(Trend_Metric_Average),
|
||||
nameof(Trend_Metric_AvgCpuLoad),
|
||||
@@ -852,6 +883,12 @@ public static class Strings
|
||||
nameof(Trend_Metric_P1Low),
|
||||
nameof(Trend_Metric_PresentedFps),
|
||||
nameof(Trend_Partial_Note),
|
||||
nameof(Trend_Unit_Celsius),
|
||||
nameof(Trend_Unit_Factor),
|
||||
nameof(Trend_Unit_Fps),
|
||||
nameof(Trend_Unit_Megabytes),
|
||||
nameof(Trend_Unit_Percent),
|
||||
nameof(Trend_Unit_Watts),
|
||||
nameof(Uninstall_DataFolder_Body),
|
||||
nameof(Uninstall_DataFolder_Title),
|
||||
nameof(Update_AgentStillRunning),
|
||||
@@ -1199,6 +1236,24 @@ public static class Strings
|
||||
|
||||
public static string Dashboard_Totals_ThisWeek => ResourceManager.GetString(nameof(Dashboard_Totals_ThisWeek), Culture) ?? nameof(Dashboard_Totals_ThisWeek);
|
||||
|
||||
public static string DeleteSessions_AgentTooOld => ResourceManager.GetString(nameof(DeleteSessions_AgentTooOld), Culture) ?? nameof(DeleteSessions_AgentTooOld);
|
||||
|
||||
public static string DeleteSessions_AllBody_Format => ResourceManager.GetString(nameof(DeleteSessions_AllBody_Format), Culture) ?? nameof(DeleteSessions_AllBody_Format);
|
||||
|
||||
public static string DeleteSessions_AllTitle => ResourceManager.GetString(nameof(DeleteSessions_AllTitle), Culture) ?? nameof(DeleteSessions_AllTitle);
|
||||
|
||||
public static string DeleteSessions_Delete => ResourceManager.GetString(nameof(DeleteSessions_Delete), Culture) ?? nameof(DeleteSessions_Delete);
|
||||
|
||||
public static string DeleteSessions_Done_Format => ResourceManager.GetString(nameof(DeleteSessions_Done_Format), Culture) ?? nameof(DeleteSessions_Done_Format);
|
||||
|
||||
public static string DeleteSessions_GameBody_Format => ResourceManager.GetString(nameof(DeleteSessions_GameBody_Format), Culture) ?? nameof(DeleteSessions_GameBody_Format);
|
||||
|
||||
public static string DeleteSessions_GameTitle_Format => ResourceManager.GetString(nameof(DeleteSessions_GameTitle_Format), Culture) ?? nameof(DeleteSessions_GameTitle_Format);
|
||||
|
||||
public static string DeleteSessions_NoAgent => ResourceManager.GetString(nameof(DeleteSessions_NoAgent), Culture) ?? nameof(DeleteSessions_NoAgent);
|
||||
|
||||
public static string DeleteSessions_Running => ResourceManager.GetString(nameof(DeleteSessions_Running), Culture) ?? nameof(DeleteSessions_Running);
|
||||
|
||||
public static string Diag_Written_Format => ResourceManager.GetString(nameof(Diag_Written_Format), Culture) ?? nameof(Diag_Written_Format);
|
||||
|
||||
public static string Display_Buffer_Format => ResourceManager.GetString(nameof(Display_Buffer_Format), Culture) ?? nameof(Display_Buffer_Format);
|
||||
@@ -1563,6 +1618,8 @@ public static class Strings
|
||||
|
||||
public static string GameDetail_ChangeExe => ResourceManager.GetString(nameof(GameDetail_ChangeExe), Culture) ?? nameof(GameDetail_ChangeExe);
|
||||
|
||||
public static string GameDetail_DeleteSessions => ResourceManager.GetString(nameof(GameDetail_DeleteSessions), Culture) ?? nameof(GameDetail_DeleteSessions);
|
||||
|
||||
public static string GameDetail_Details_Architecture => ResourceManager.GetString(nameof(GameDetail_Details_Architecture), Culture) ?? nameof(GameDetail_Details_Architecture);
|
||||
|
||||
public static string GameDetail_Details_Engine => ResourceManager.GetString(nameof(GameDetail_Details_Engine), Culture) ?? nameof(GameDetail_Details_Engine);
|
||||
@@ -1639,6 +1696,10 @@ public static class Strings
|
||||
|
||||
public static string GameDetail_NotFound => ResourceManager.GetString(nameof(GameDetail_NotFound), Culture) ?? nameof(GameDetail_NotFound);
|
||||
|
||||
public static string GameDetail_Overview_Header => ResourceManager.GetString(nameof(GameDetail_Overview_Header), Culture) ?? nameof(GameDetail_Overview_Header);
|
||||
|
||||
public static string GameDetail_Overview_Note => ResourceManager.GetString(nameof(GameDetail_Overview_Note), Culture) ?? nameof(GameDetail_Overview_Note);
|
||||
|
||||
public static string GameDetail_Recording_Body => ResourceManager.GetString(nameof(GameDetail_Recording_Body), Culture) ?? nameof(GameDetail_Recording_Body);
|
||||
|
||||
public static string GameDetail_Recording_Header => ResourceManager.GetString(nameof(GameDetail_Recording_Header), Culture) ?? nameof(GameDetail_Recording_Header);
|
||||
@@ -1685,6 +1746,8 @@ public static class Strings
|
||||
|
||||
public static string Games_Card_NeverPlayed => ResourceManager.GetString(nameof(Games_Card_NeverPlayed), Culture) ?? nameof(Games_Card_NeverPlayed);
|
||||
|
||||
public static string Games_Card_NotInstalled => ResourceManager.GetString(nameof(Games_Card_NotInstalled), Culture) ?? nameof(Games_Card_NotInstalled);
|
||||
|
||||
public static string Games_Card_NotRecorded => ResourceManager.GetString(nameof(Games_Card_NotRecorded), Culture) ?? nameof(Games_Card_NotRecorded);
|
||||
|
||||
public static string Games_Card_Playtime_Format => ResourceManager.GetString(nameof(Games_Card_Playtime_Format), Culture) ?? nameof(Games_Card_Playtime_Format);
|
||||
@@ -1695,8 +1758,28 @@ public static class Strings
|
||||
|
||||
public static string Games_Header => ResourceManager.GetString(nameof(Games_Header), Culture) ?? nameof(Games_Header);
|
||||
|
||||
public static string Games_Header_Count_Format => ResourceManager.GetString(nameof(Games_Header_Count_Format), Culture) ?? nameof(Games_Header_Count_Format);
|
||||
|
||||
public static string Games_List_Engine => ResourceManager.GetString(nameof(Games_List_Engine), Culture) ?? nameof(Games_List_Engine);
|
||||
|
||||
public static string Games_List_LastPlayed => ResourceManager.GetString(nameof(Games_List_LastPlayed), Culture) ?? nameof(Games_List_LastPlayed);
|
||||
|
||||
public static string Games_List_Name => ResourceManager.GetString(nameof(Games_List_Name), Culture) ?? nameof(Games_List_Name);
|
||||
|
||||
public static string Games_List_Played => ResourceManager.GetString(nameof(Games_List_Played), Culture) ?? nameof(Games_List_Played);
|
||||
|
||||
public static string Games_List_Sessions => ResourceManager.GetString(nameof(Games_List_Sessions), Culture) ?? nameof(Games_List_Sessions);
|
||||
|
||||
public static string Games_List_Status => ResourceManager.GetString(nameof(Games_List_Status), Culture) ?? nameof(Games_List_Status);
|
||||
|
||||
public static string Games_List_Store => ResourceManager.GetString(nameof(Games_List_Store), Culture) ?? nameof(Games_List_Store);
|
||||
|
||||
public static string Games_NoMatch => ResourceManager.GetString(nameof(Games_NoMatch), Culture) ?? nameof(Games_NoMatch);
|
||||
|
||||
public static string Games_Refresh => ResourceManager.GetString(nameof(Games_Refresh), Culture) ?? nameof(Games_Refresh);
|
||||
|
||||
public static string Games_Refresh_ToolTip => ResourceManager.GetString(nameof(Games_Refresh_ToolTip), Culture) ?? nameof(Games_Refresh_ToolTip);
|
||||
|
||||
public static string Games_Search_Placeholder => ResourceManager.GetString(nameof(Games_Search_Placeholder), Culture) ?? nameof(Games_Search_Placeholder);
|
||||
|
||||
public static string Games_Sort_Label => ResourceManager.GetString(nameof(Games_Sort_Label), Culture) ?? nameof(Games_Sort_Label);
|
||||
@@ -1707,6 +1790,10 @@ public static class Strings
|
||||
|
||||
public static string Games_Sort_Playtime => ResourceManager.GetString(nameof(Games_Sort_Playtime), Culture) ?? nameof(Games_Sort_Playtime);
|
||||
|
||||
public static string Games_View_Grid => ResourceManager.GetString(nameof(Games_View_Grid), Culture) ?? nameof(Games_View_Grid);
|
||||
|
||||
public static string Games_View_List => ResourceManager.GetString(nameof(Games_View_List), Culture) ?? nameof(Games_View_List);
|
||||
|
||||
public static string Guard_ConsentMissing => ResourceManager.GetString(nameof(Guard_ConsentMissing), Culture) ?? nameof(Guard_ConsentMissing);
|
||||
|
||||
public static string Guard_DriverScanFailed => ResourceManager.GetString(nameof(Guard_DriverScanFailed), Culture) ?? nameof(Guard_DriverScanFailed);
|
||||
@@ -1775,12 +1862,16 @@ public static class Strings
|
||||
|
||||
public static string Import_NothingFound => ResourceManager.GetString(nameof(Import_NothingFound), Culture) ?? nameof(Import_NothingFound);
|
||||
|
||||
public static string Import_NothingNew => ResourceManager.GetString(nameof(Import_NothingNew), Culture) ?? nameof(Import_NothingNew);
|
||||
|
||||
public static string Import_SelectAll => ResourceManager.GetString(nameof(Import_SelectAll), Culture) ?? nameof(Import_SelectAll);
|
||||
|
||||
public static string Import_Selected_Format => ResourceManager.GetString(nameof(Import_Selected_Format), Culture) ?? nameof(Import_Selected_Format);
|
||||
|
||||
public static string Import_SelectNone => ResourceManager.GetString(nameof(Import_SelectNone), Culture) ?? nameof(Import_SelectNone);
|
||||
|
||||
public static string Import_ShowExisting_Format => ResourceManager.GetString(nameof(Import_ShowExisting_Format), Culture) ?? nameof(Import_ShowExisting_Format);
|
||||
|
||||
public static string Import_Title => ResourceManager.GetString(nameof(Import_Title), Culture) ?? nameof(Import_Title);
|
||||
|
||||
public static string Latency_Avg => ResourceManager.GetString(nameof(Latency_Avg), Culture) ?? nameof(Latency_Avg);
|
||||
@@ -2179,6 +2270,14 @@ public static class Strings
|
||||
|
||||
public static string Settings_Channel_Stable => ResourceManager.GetString(nameof(Settings_Channel_Stable), Culture) ?? nameof(Settings_Channel_Stable);
|
||||
|
||||
public static string Settings_Data_Header => ResourceManager.GetString(nameof(Settings_Data_Header), Culture) ?? nameof(Settings_Data_Header);
|
||||
|
||||
public static string Settings_DeleteSessions_Body => ResourceManager.GetString(nameof(Settings_DeleteSessions_Body), Culture) ?? nameof(Settings_DeleteSessions_Body);
|
||||
|
||||
public static string Settings_DeleteSessions_Button => ResourceManager.GetString(nameof(Settings_DeleteSessions_Button), Culture) ?? nameof(Settings_DeleteSessions_Button);
|
||||
|
||||
public static string Settings_DeleteSessions_Label => ResourceManager.GetString(nameof(Settings_DeleteSessions_Label), Culture) ?? nameof(Settings_DeleteSessions_Label);
|
||||
|
||||
public static string Settings_Exceptions_Body => ResourceManager.GetString(nameof(Settings_Exceptions_Body), Culture) ?? nameof(Settings_Exceptions_Body);
|
||||
|
||||
public static string Settings_Exceptions_Checking => ResourceManager.GetString(nameof(Settings_Exceptions_Checking), Culture) ?? nameof(Settings_Exceptions_Checking);
|
||||
@@ -2207,8 +2306,6 @@ 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_HookedGames_Empty => ResourceManager.GetString(nameof(Settings_HookedGames_Empty), Culture) ?? nameof(Settings_HookedGames_Empty);
|
||||
|
||||
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);
|
||||
@@ -2229,8 +2326,6 @@ public static class Strings
|
||||
|
||||
public static string Settings_Language_Label => ResourceManager.GetString(nameof(Settings_Language_Label), Culture) ?? nameof(Settings_Language_Label);
|
||||
|
||||
public static string Settings_Language_Note => ResourceManager.GetString(nameof(Settings_Language_Note), Culture) ?? nameof(Settings_Language_Note);
|
||||
|
||||
public static string Settings_Legal_Header => ResourceManager.GetString(nameof(Settings_Legal_Header), Culture) ?? nameof(Settings_Legal_Header);
|
||||
|
||||
public static string Settings_Legal_Reopen => ResourceManager.GetString(nameof(Settings_Legal_Reopen), Culture) ?? nameof(Settings_Legal_Reopen);
|
||||
@@ -2497,6 +2592,10 @@ public static class Strings
|
||||
|
||||
public static string Trend_Excluded_Format => ResourceManager.GetString(nameof(Trend_Excluded_Format), Culture) ?? nameof(Trend_Excluded_Format);
|
||||
|
||||
public static string Trend_Extras_Label => ResourceManager.GetString(nameof(Trend_Extras_Label), Culture) ?? nameof(Trend_Extras_Label);
|
||||
|
||||
public static string Trend_Extras_Note => ResourceManager.GetString(nameof(Trend_Extras_Note), Culture) ?? nameof(Trend_Extras_Note);
|
||||
|
||||
public static string Trend_IncludeMidSession => ResourceManager.GetString(nameof(Trend_IncludeMidSession), Culture) ?? nameof(Trend_IncludeMidSession);
|
||||
|
||||
public static string Trend_Metric_Average => ResourceManager.GetString(nameof(Trend_Metric_Average), Culture) ?? nameof(Trend_Metric_Average);
|
||||
@@ -2537,6 +2636,18 @@ public static class Strings
|
||||
|
||||
public static string Trend_Partial_Note => ResourceManager.GetString(nameof(Trend_Partial_Note), Culture) ?? nameof(Trend_Partial_Note);
|
||||
|
||||
public static string Trend_Unit_Celsius => ResourceManager.GetString(nameof(Trend_Unit_Celsius), Culture) ?? nameof(Trend_Unit_Celsius);
|
||||
|
||||
public static string Trend_Unit_Factor => ResourceManager.GetString(nameof(Trend_Unit_Factor), Culture) ?? nameof(Trend_Unit_Factor);
|
||||
|
||||
public static string Trend_Unit_Fps => ResourceManager.GetString(nameof(Trend_Unit_Fps), Culture) ?? nameof(Trend_Unit_Fps);
|
||||
|
||||
public static string Trend_Unit_Megabytes => ResourceManager.GetString(nameof(Trend_Unit_Megabytes), Culture) ?? nameof(Trend_Unit_Megabytes);
|
||||
|
||||
public static string Trend_Unit_Percent => ResourceManager.GetString(nameof(Trend_Unit_Percent), Culture) ?? nameof(Trend_Unit_Percent);
|
||||
|
||||
public static string Trend_Unit_Watts => ResourceManager.GetString(nameof(Trend_Unit_Watts), Culture) ?? nameof(Trend_Unit_Watts);
|
||||
|
||||
public static string Uninstall_DataFolder_Body => ResourceManager.GetString(nameof(Uninstall_DataFolder_Body), Culture) ?? nameof(Uninstall_DataFolder_Body);
|
||||
|
||||
public static string Uninstall_DataFolder_Title => ResourceManager.GetString(nameof(Uninstall_DataFolder_Title), Culture) ?? nameof(Uninstall_DataFolder_Title);
|
||||
|
||||
@@ -145,6 +145,10 @@
|
||||
<value>ゲーム</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Header_Count_Format" xml:space="preserve">
|
||||
<value>ゲーム · {0}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Logs_Empty" xml:space="preserve">
|
||||
<value>このソースのログファイルはまだありません。</value>
|
||||
<comment>review</comment>
|
||||
@@ -289,6 +293,14 @@
|
||||
<value>このマシンの Steam、GOG Galaxy、Epic、itch.io にインストール済みのゲームは見つかりませんでした。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>新しいゲームはありません。ストアにインストールされているゲームはすべてライブラリーにあります。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_ShowExisting_Format" xml:space="preserve">
|
||||
<value>ライブラリーにある {0} 件のゲームを表示する</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_Done_Format" xml:space="preserve">
|
||||
<value>{0} 件のゲームをフック無効で追加しました。{1} 件はそのままです。</value>
|
||||
<comment>review</comment>
|
||||
@@ -397,10 +409,6 @@
|
||||
<value>言語</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Language_Note" xml:space="preserve">
|
||||
<value>すぐに適用されます。ウィンドウは新しい言語で再構築されます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve">
|
||||
<value>ダーク</value>
|
||||
<comment>review</comment>
|
||||
@@ -969,6 +977,54 @@
|
||||
<value>セッション</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_DeleteSessions" xml:space="preserve">
|
||||
<value>すべてのセッションを削除…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Header" xml:space="preserve">
|
||||
<value>セッションの概要</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Note" xml:space="preserve">
|
||||
<value>フックした各セッションのフレームレートと Low 値(古い順)。フレーム生成が計測されたセッションでは Native と Displayed を描画します。白抜きの点はセッションの一部を表します。点をクリックすると下の一覧でそのセッションを選択します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameTitle_Format" xml:space="preserve">
|
||||
<value>{0} のすべてのセッションを削除しますか?</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllTitle" xml:space="preserve">
|
||||
<value>すべてのゲームのすべてのセッションを削除しますか?</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameBody_Format" xml:space="preserve">
|
||||
<value>{0} 件のセッションを、フレームとセンサーのデータやメモとともに削除します。ゲーム、その設定、フックへの同意は残ります。元に戻すことはできません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllBody_Format" xml:space="preserve">
|
||||
<value>すべてのゲームの {0} 件のセッションを、フレームとセンサーのデータやメモとともに削除します。ライブラリー、設定、フックへの同意はすべて残ります。元に戻すことはできません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_Delete" xml:space="preserve">
|
||||
<value>セッションを削除</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_Done_Format" xml:space="preserve">
|
||||
<value>{1} 件のゲームの {0} 件のセッションを削除しました。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_Running" xml:space="preserve">
|
||||
<value>セッションを記録中のため、何も削除していません。停止するか終了するのを待ってから、もう一度お試しください。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_NoAgent" xml:space="preserve">
|
||||
<value>キャプチャエージェントが接続されていないため、何も削除していません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_AgentTooOld" xml:space="preserve">
|
||||
<value>キャプチャエージェントがこの要求にまだ対応していません。再起動してからもう一度お試しください。何も削除していません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Tab_Trend" xml:space="preserve">
|
||||
<value>傾向</value>
|
||||
<comment>review</comment>
|
||||
@@ -977,10 +1033,58 @@
|
||||
<value>ゲームを追加…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Refresh" xml:space="preserve">
|
||||
<value>更新</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Refresh_ToolTip" xml:space="preserve">
|
||||
<value>ライブラリーを読み直し、その後にインストールされたゲームをストアから探し、実行ファイルがなくなったゲームに印を付けます</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_View_Grid" xml:space="preserve">
|
||||
<value>グリッドで表示</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_View_List" xml:space="preserve">
|
||||
<value>リストで表示</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Name" xml:space="preserve">
|
||||
<value>名前</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Store" xml:space="preserve">
|
||||
<value>ストア</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Engine" xml:space="preserve">
|
||||
<value>エンジン</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Status" xml:space="preserve">
|
||||
<value>状態</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Sessions" xml:space="preserve">
|
||||
<value>セッション</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Played" xml:space="preserve">
|
||||
<value>プレイ時間</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_LastPlayed" xml:space="preserve">
|
||||
<value>最終プレイ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Card_NotRecorded" xml:space="preserve">
|
||||
<value>記録しない</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Card_NotInstalled" xml:space="preserve">
|
||||
<value>未インストール</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Card_HookOff" xml:space="preserve">
|
||||
<value>フック無効</value>
|
||||
<comment>review</comment>
|
||||
@@ -1649,6 +1753,38 @@
|
||||
<value>指標</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Extras_Label" xml:space="preserve">
|
||||
<value>あわせて表示</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Extras_Note" xml:space="preserve">
|
||||
<value>単位は同時に2つまでです。2つ目の単位は右側の軸に描画されます(凡例に ▸ で表示)。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Fps" xml:space="preserve">
|
||||
<value>FPS</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Celsius" xml:space="preserve">
|
||||
<value>°C</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Percent" xml:space="preserve">
|
||||
<value>%</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Watts" xml:space="preserve">
|
||||
<value>W</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Megabytes" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Factor" xml:space="preserve">
|
||||
<value>×(フレーム生成)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Metric_MaxGpuTemp" xml:space="preserve">
|
||||
<value>GPU 最高 °C</value>
|
||||
<comment>review</comment>
|
||||
@@ -1821,10 +1957,6 @@
|
||||
<value>安定版</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Empty" xml:space="preserve">
|
||||
<value>フックが有効なゲームはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Label" xml:space="preserve">
|
||||
<value>フック有効なゲーム</value>
|
||||
<comment>review</comment>
|
||||
@@ -1905,6 +2037,22 @@
|
||||
<value>記録</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Data_Header" xml:space="preserve">
|
||||
<value>データ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
|
||||
<value>すべてのセッションを削除</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Body" xml:space="preserve">
|
||||
<value>すべてのゲームのすべてのセッションを、フレームとセンサーのデータやメモとともに削除します。ライブラリー、設定、各ゲームのフックへの同意は残ります。元に戻すことはできません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Button" xml:space="preserve">
|
||||
<value>すべてのセッションを削除…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Privacy_Header" xml:space="preserve">
|
||||
<value>プライバシー</value>
|
||||
<comment>review</comment>
|
||||
@@ -2350,7 +2498,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_Unlimited" xml:space="preserve">
|
||||
<value>保持は無制限に設定されています (設定 ▸ キャプチャ)。整理するものはありません。</value>
|
||||
<value>保持は無制限に設定されています (設定 ▸ 記録)。整理するものはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_NoAgent" xml:space="preserve">
|
||||
|
||||
@@ -114,6 +114,9 @@
|
||||
<data name="Games_Header" xml:space="preserve">
|
||||
<value>Games</value>
|
||||
</data>
|
||||
<data name="Games_Header_Count_Format" xml:space="preserve">
|
||||
<value>Games · {0}</value>
|
||||
</data>
|
||||
<data name="Logs_Empty" xml:space="preserve">
|
||||
<value>No log file yet for this source.</value>
|
||||
</data>
|
||||
@@ -222,6 +225,12 @@
|
||||
<data name="Import_NothingFound" xml:space="preserve">
|
||||
<value>No installed games were found in Steam, GOG Galaxy, Epic or itch.io on this machine.</value>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>No new games: every game your stores have installed is already in the library.</value>
|
||||
</data>
|
||||
<data name="Import_ShowExisting_Format" xml:space="preserve">
|
||||
<value>Show the {0} games already in the library</value>
|
||||
</data>
|
||||
<data name="Import_Done_Format" xml:space="preserve">
|
||||
<value>{0} game(s) added with hooking off; {1} left as they were.</value>
|
||||
</data>
|
||||
@@ -303,9 +312,6 @@
|
||||
<data name="Settings_Language_Label" xml:space="preserve">
|
||||
<value>Language</value>
|
||||
</data>
|
||||
<data name="Settings_Language_Note" xml:space="preserve">
|
||||
<value>Applies at once; the window is rebuilt in the new language.</value>
|
||||
</data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve">
|
||||
<value>Dark</value>
|
||||
</data>
|
||||
@@ -732,15 +738,87 @@
|
||||
<data name="GameDetail_Tab_Sessions" xml:space="preserve">
|
||||
<value>Sessions</value>
|
||||
</data>
|
||||
<data name="GameDetail_DeleteSessions" xml:space="preserve">
|
||||
<value>Delete all sessions…</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Header" xml:space="preserve">
|
||||
<value>Sessions at a glance</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Note" xml:space="preserve">
|
||||
<value>Each hooked session's frame rate and lows, oldest first. Native and Displayed are drawn where frame generation was measured; a hollow point describes part of its session. Click a point to select its session below.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameTitle_Format" xml:space="preserve">
|
||||
<value>Delete every session of {0}?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllTitle" xml:space="preserve">
|
||||
<value>Delete every session of every game?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameBody_Format" xml:space="preserve">
|
||||
<value>{0} session(s), with their frame and sensor data and their notes, are deleted. The game, its settings and its hooking consent stay. This cannot be undone.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllBody_Format" xml:space="preserve">
|
||||
<value>{0} session(s) of every game, with their frame and sensor data and their notes, are deleted. The library, your settings and every hooking consent stay. This cannot be undone.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Delete" xml:space="preserve">
|
||||
<value>Delete sessions</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Done_Format" xml:space="preserve">
|
||||
<value>Deleted {0} session(s) of {1} game(s).</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Running" xml:space="preserve">
|
||||
<value>A session is being recorded, so nothing was deleted. Stop it or let it end, then try again.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_NoAgent" xml:space="preserve">
|
||||
<value>The capture agent is not connected, so nothing was deleted.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AgentTooOld" xml:space="preserve">
|
||||
<value>The capture agent does not know this request yet; restart it and try again. Nothing was deleted.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Tab_Trend" xml:space="preserve">
|
||||
<value>Trend</value>
|
||||
</data>
|
||||
<data name="Games_Add" xml:space="preserve">
|
||||
<value>Add game…</value>
|
||||
</data>
|
||||
<data name="Games_Refresh" xml:space="preserve">
|
||||
<value>Refresh</value>
|
||||
</data>
|
||||
<data name="Games_Refresh_ToolTip" xml:space="preserve">
|
||||
<value>Read the library again, look in your stores for games installed since, and mark games whose executable is gone</value>
|
||||
</data>
|
||||
<data name="Games_View_Grid" xml:space="preserve">
|
||||
<value>Show as a grid</value>
|
||||
</data>
|
||||
<data name="Games_View_List" xml:space="preserve">
|
||||
<value>Show as a list</value>
|
||||
</data>
|
||||
<data name="Games_List_Name" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
</data>
|
||||
<data name="Games_List_Store" xml:space="preserve">
|
||||
<value>Store</value>
|
||||
</data>
|
||||
<data name="Games_List_Engine" xml:space="preserve">
|
||||
<value>Engine</value>
|
||||
</data>
|
||||
<data name="Games_List_Status" xml:space="preserve">
|
||||
<value>Status</value>
|
||||
</data>
|
||||
<data name="Games_List_Sessions" xml:space="preserve">
|
||||
<value>Sessions</value>
|
||||
</data>
|
||||
<data name="Games_List_Played" xml:space="preserve">
|
||||
<value>Played</value>
|
||||
</data>
|
||||
<data name="Games_List_LastPlayed" xml:space="preserve">
|
||||
<value>Last played</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotRecorded" xml:space="preserve">
|
||||
<value>Not recorded</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotInstalled" xml:space="preserve">
|
||||
<value>Not installed</value>
|
||||
</data>
|
||||
<data name="Games_Card_HookOff" xml:space="preserve">
|
||||
<value>Hooking off</value>
|
||||
</data>
|
||||
@@ -1242,6 +1320,30 @@
|
||||
<data name="Trend_Metric_Label" xml:space="preserve">
|
||||
<value>Metric</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Label" xml:space="preserve">
|
||||
<value>Also draw</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Note" xml:space="preserve">
|
||||
<value>Up to two units at once: a second unit is drawn against the right axis (marked ▸ in the legend).</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Fps" xml:space="preserve">
|
||||
<value>FPS</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Celsius" xml:space="preserve">
|
||||
<value>°C</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Percent" xml:space="preserve">
|
||||
<value>%</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Watts" xml:space="preserve">
|
||||
<value>W</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Megabytes" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Factor" xml:space="preserve">
|
||||
<value>× (frame generation)</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_MaxGpuTemp" xml:space="preserve">
|
||||
<value>Max GPU °C</value>
|
||||
</data>
|
||||
@@ -1371,9 +1473,6 @@
|
||||
<data name="Settings_Channel_Stable" xml:space="preserve">
|
||||
<value>Stable</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Empty" xml:space="preserve">
|
||||
<value>No game has hooking on.</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Label" xml:space="preserve">
|
||||
<value>Games with hooking on</value>
|
||||
</data>
|
||||
@@ -1434,6 +1533,18 @@
|
||||
<data name="Settings_Policy_Header" xml:space="preserve">
|
||||
<value>Recording</value>
|
||||
</data>
|
||||
<data name="Settings_Data_Header" xml:space="preserve">
|
||||
<value>Data</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
|
||||
<value>Delete all sessions</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Body" xml:space="preserve">
|
||||
<value>Every session of every game, with its frame and sensor data and its notes. The library, your settings and each game's hooking consent stay. It cannot be undone.</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Button" xml:space="preserve">
|
||||
<value>Delete all sessions…</value>
|
||||
</data>
|
||||
<data name="Settings_Privacy_Header" xml:space="preserve">
|
||||
<value>Privacy</value>
|
||||
</data>
|
||||
@@ -1768,7 +1879,7 @@
|
||||
<value>Sweep…</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_Unlimited" xml:space="preserve">
|
||||
<value>Retention is unlimited (Settings ▸ Capture), so there is nothing to sweep.</value>
|
||||
<value>Retention is unlimited (Settings ▸ Recording), so there is nothing to sweep.</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_NoAgent" xml:space="preserve">
|
||||
<value>The Agent is not connected. The raw data is the Agent's to remove; start it and try again.</value>
|
||||
|
||||
@@ -109,6 +109,9 @@
|
||||
<data name="Games_Header" xml:space="preserve">
|
||||
<value>Game</value>
|
||||
</data>
|
||||
<data name="Games_Header_Count_Format" xml:space="preserve">
|
||||
<value>Game · {0}</value>
|
||||
</data>
|
||||
<data name="Logs_Empty" xml:space="preserve">
|
||||
<value>Chưa có tệp nhật ký cho nguồn này.</value>
|
||||
</data>
|
||||
@@ -217,6 +220,12 @@
|
||||
<data name="Import_NothingFound" xml:space="preserve">
|
||||
<value>Không tìm thấy game nào đã cài trong Steam, GOG Galaxy, Epic hay itch.io trên máy này.</value>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>Không có game mới: mọi game các store đã cài đều đã có trong thư viện.</value>
|
||||
</data>
|
||||
<data name="Import_ShowExisting_Format" xml:space="preserve">
|
||||
<value>Hiện {0} game đã có trong thư viện</value>
|
||||
</data>
|
||||
<data name="Import_Done_Format" xml:space="preserve">
|
||||
<value>Đã thêm {0} game với hooking tắt; {1} giữ nguyên.</value>
|
||||
</data>
|
||||
@@ -298,9 +307,6 @@
|
||||
<data name="Settings_Language_Label" xml:space="preserve">
|
||||
<value>Ngôn ngữ</value>
|
||||
</data>
|
||||
<data name="Settings_Language_Note" xml:space="preserve">
|
||||
<value>Áp dụng ngay; cửa sổ được dựng lại bằng ngôn ngữ mới.</value>
|
||||
</data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve">
|
||||
<value>Tối</value>
|
||||
</data>
|
||||
@@ -727,15 +733,87 @@
|
||||
<data name="GameDetail_Tab_Sessions" xml:space="preserve">
|
||||
<value>Phiên chơi</value>
|
||||
</data>
|
||||
<data name="GameDetail_DeleteSessions" xml:space="preserve">
|
||||
<value>Xoá mọi phiên…</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Header" xml:space="preserve">
|
||||
<value>Tổng quan các phiên</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Note" xml:space="preserve">
|
||||
<value>Tốc độ khung hình và các mức thấp của mỗi phiên có hook, cũ nhất trước. Native và Displayed được vẽ ở phiên đo được frame generation; điểm rỗng mô tả một phần phiên. Bấm vào một điểm để chọn phiên đó bên dưới.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameTitle_Format" xml:space="preserve">
|
||||
<value>Xoá mọi phiên của {0}?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllTitle" xml:space="preserve">
|
||||
<value>Xoá mọi phiên của mọi game?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameBody_Format" xml:space="preserve">
|
||||
<value>{0} phiên, kèm dữ liệu frame, cảm biến và ghi chú, sẽ bị xoá. Game, cài đặt và consent hooking của nó vẫn giữ nguyên. Không thể hoàn tác.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllBody_Format" xml:space="preserve">
|
||||
<value>{0} phiên của mọi game, kèm dữ liệu frame, cảm biến và ghi chú, sẽ bị xoá. Thư viện, cài đặt và mọi consent hooking vẫn giữ nguyên. Không thể hoàn tác.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Delete" xml:space="preserve">
|
||||
<value>Xoá phiên</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Done_Format" xml:space="preserve">
|
||||
<value>Đã xoá {0} phiên của {1} game.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Running" xml:space="preserve">
|
||||
<value>Đang ghi một phiên nên chưa xoá gì. Hãy dừng hoặc chờ phiên kết thúc rồi thử lại.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_NoAgent" xml:space="preserve">
|
||||
<value>Agent ghi chưa kết nối nên chưa xoá gì.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AgentTooOld" xml:space="preserve">
|
||||
<value>Agent ghi chưa hỗ trợ yêu cầu này; hãy khởi động lại rồi thử lại. Chưa xoá gì.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Tab_Trend" xml:space="preserve">
|
||||
<value>Xu hướng</value>
|
||||
</data>
|
||||
<data name="Games_Add" xml:space="preserve">
|
||||
<value>Thêm game…</value>
|
||||
</data>
|
||||
<data name="Games_Refresh" xml:space="preserve">
|
||||
<value>Làm mới</value>
|
||||
</data>
|
||||
<data name="Games_Refresh_ToolTip" xml:space="preserve">
|
||||
<value>Đọc lại thư viện, tìm trong các store những game mới cài, và đánh dấu game không còn file chạy</value>
|
||||
</data>
|
||||
<data name="Games_View_Grid" xml:space="preserve">
|
||||
<value>Hiển thị dạng lưới</value>
|
||||
</data>
|
||||
<data name="Games_View_List" xml:space="preserve">
|
||||
<value>Hiển thị dạng danh sách</value>
|
||||
</data>
|
||||
<data name="Games_List_Name" xml:space="preserve">
|
||||
<value>Tên</value>
|
||||
</data>
|
||||
<data name="Games_List_Store" xml:space="preserve">
|
||||
<value>Store</value>
|
||||
</data>
|
||||
<data name="Games_List_Engine" xml:space="preserve">
|
||||
<value>Engine</value>
|
||||
</data>
|
||||
<data name="Games_List_Status" xml:space="preserve">
|
||||
<value>Trạng thái</value>
|
||||
</data>
|
||||
<data name="Games_List_Sessions" xml:space="preserve">
|
||||
<value>Phiên</value>
|
||||
</data>
|
||||
<data name="Games_List_Played" xml:space="preserve">
|
||||
<value>Đã chơi</value>
|
||||
</data>
|
||||
<data name="Games_List_LastPlayed" xml:space="preserve">
|
||||
<value>Chơi lần cuối</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotRecorded" xml:space="preserve">
|
||||
<value>Không ghi</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotInstalled" xml:space="preserve">
|
||||
<value>Chưa cài</value>
|
||||
</data>
|
||||
<data name="Games_Card_HookOff" xml:space="preserve">
|
||||
<value>Hooking tắt</value>
|
||||
</data>
|
||||
@@ -1237,6 +1315,30 @@
|
||||
<data name="Trend_Metric_Label" xml:space="preserve">
|
||||
<value>Chỉ số</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Label" xml:space="preserve">
|
||||
<value>Vẽ thêm</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Note" xml:space="preserve">
|
||||
<value>Tối đa hai đơn vị cùng lúc: đơn vị thứ hai được vẽ theo trục bên phải (đánh dấu ▸ trong chú thích).</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Fps" xml:space="preserve">
|
||||
<value>FPS</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Celsius" xml:space="preserve">
|
||||
<value>°C</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Percent" xml:space="preserve">
|
||||
<value>%</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Watts" xml:space="preserve">
|
||||
<value>W</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Megabytes" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Factor" xml:space="preserve">
|
||||
<value>× (frame generation)</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_MaxGpuTemp" xml:space="preserve">
|
||||
<value>GPU tối đa °C</value>
|
||||
</data>
|
||||
@@ -1366,9 +1468,6 @@
|
||||
<data name="Settings_Channel_Stable" xml:space="preserve">
|
||||
<value>Ổn định</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Empty" xml:space="preserve">
|
||||
<value>Chưa có game nào bật hooking.</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Label" xml:space="preserve">
|
||||
<value>Game đang bật hooking</value>
|
||||
</data>
|
||||
@@ -1429,6 +1528,18 @@
|
||||
<data name="Settings_Policy_Header" xml:space="preserve">
|
||||
<value>Ghi phiên</value>
|
||||
</data>
|
||||
<data name="Settings_Data_Header" xml:space="preserve">
|
||||
<value>Dữ liệu</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
|
||||
<value>Xoá mọi phiên</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Body" xml:space="preserve">
|
||||
<value>Mọi phiên của mọi game, kèm dữ liệu frame, cảm biến và ghi chú. Thư viện, cài đặt và consent hooking của từng game vẫn giữ nguyên. Không thể hoàn tác.</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Button" xml:space="preserve">
|
||||
<value>Xoá mọi phiên…</value>
|
||||
</data>
|
||||
<data name="Settings_Privacy_Header" xml:space="preserve">
|
||||
<value>Quyền riêng tư</value>
|
||||
</data>
|
||||
@@ -1763,7 +1874,7 @@
|
||||
<value>Dọn dẹp…</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_Unlimited" xml:space="preserve">
|
||||
<value>Lưu giữ đang là không giới hạn (Cài đặt ▸ Ghi), nên không có gì để dọn.</value>
|
||||
<value>Lưu giữ đang là không giới hạn (Cài đặt ▸ Ghi phiên), nên không có gì để dọn.</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_NoAgent" xml:space="preserve">
|
||||
<value>Agent chưa kết nối. Dữ liệu thô do Agent xoá; hãy khởi động Agent rồi thử lại.</value>
|
||||
|
||||
@@ -5,17 +5,21 @@ using FrameLedger.App.Services;
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// One library card (<c>08_UI</c> §Games): name, platform and engine badges, playtime, last played, hooking state — or, since
|
||||
/// 2026-09-23, "Not recorded" in its place for an entry whose recording is off, and since 2026-09-25 "Anti-cheat" for one
|
||||
/// the guard found anti-cheat in. The sparkline is PR-6's.
|
||||
/// One library entry (<c>08_UI</c> §Games), as a card in the grid or a row in the list: name, platform and engine badges,
|
||||
/// playtime, last played, hooking state — or, since 2026-09-23, "Not recorded" in its place for an entry whose recording is
|
||||
/// off, and since 2026-09-25 "Anti-cheat" for one the guard found anti-cheat in; since beta.11 "Not installed" beside it
|
||||
/// when its executable is not on disk (<see cref="GameLibrary.ExecutableExists"/>, read when the library is listed, never
|
||||
/// stored), with the game page's own words for why (<see cref="Formats.ExecutableMissingText"/>).
|
||||
/// </summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed class GameCardViewModel
|
||||
{
|
||||
public GameCardViewModel(GameCard card)
|
||||
public GameCardViewModel(GameCard card, bool installed = true)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(card);
|
||||
Card = card;
|
||||
NotInstalled = !installed;
|
||||
NotInstalledToolTip = installed ? null : Formats.ExecutableMissingText(card.Row.Fingerprint.ExePath);
|
||||
Id = card.Row.Id;
|
||||
Name = card.Row.Name;
|
||||
PlatformText = Formats.Platform(card.Row.Platform);
|
||||
@@ -36,7 +40,9 @@ public sealed class GameCardViewModel
|
||||
TotalSeconds = card.Summary?.TotalSeconds ?? 0;
|
||||
LastPlayedAt = card.Summary?.LastPlayedAt;
|
||||
SessionsText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_Sessions_Format, SessionCount);
|
||||
PlaytimeText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_Playtime_Format, Formats.Playtime(TotalSeconds));
|
||||
PlaytimeValue = Formats.Playtime(TotalSeconds);
|
||||
PlaytimeText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_Playtime_Format, PlaytimeValue);
|
||||
LastPlayedValue = LastPlayedAt is DateTimeOffset when ? Formats.Date(when) : Strings.Games_Card_NeverPlayed;
|
||||
LastPlayedText = LastPlayedAt is DateTimeOffset at
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_LastPlayed_Format, Formats.Date(at))
|
||||
: Strings.Games_Card_NeverPlayed;
|
||||
@@ -83,4 +89,19 @@ public sealed class GameCardViewModel
|
||||
public string PlaytimeText { get; }
|
||||
|
||||
public string LastPlayedText { get; }
|
||||
|
||||
/// <summary>The list view's playtime cell: the duration alone.</summary>
|
||||
public string PlaytimeValue { get; }
|
||||
|
||||
/// <summary>The list view's last-played cell: the date alone, or "not played yet".</summary>
|
||||
public string LastPlayedValue { get; }
|
||||
|
||||
/// <summary>beta.11: the "Not installed" pill shows — the file, or the drive it was on, is not there now.</summary>
|
||||
public bool NotInstalled { get; }
|
||||
|
||||
/// <summary>What the pill means here — the drive that is not connected, or the path the file is gone from; null when installed.</summary>
|
||||
public string? NotInstalledToolTip { get; }
|
||||
|
||||
/// <summary>The list view's status cell: what the hook pill says, and "Not installed" after it when that is so.</summary>
|
||||
public string StatusText => NotInstalled ? HookText + " · " + Strings.Games_Card_NotInstalled : HookText;
|
||||
}
|
||||
@@ -43,6 +43,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
private readonly SessionSelection _selection;
|
||||
private readonly RegisteredSettings? _settings;
|
||||
private readonly AntiCheatExceptions? _exceptions;
|
||||
private readonly SessionDeletion? _deletion;
|
||||
private readonly long? _gameId;
|
||||
|
||||
// ui.hide_anticheat_hooking (2026-09-25), read at each load; on until the settings say otherwise, as its default is.
|
||||
@@ -196,14 +197,19 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _trendEmpty = true;
|
||||
|
||||
/// <summary>beta.11 (D39): whether the Sessions tab's overview has anything to draw.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _overviewVisible;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _trendExcludedText = string.Empty;
|
||||
|
||||
public GameDetailViewModel(GameLibrary library, GameSelection selection, HookingConsent consent, IPageNavigator navigator,
|
||||
IConfirmations confirmations, IEditGamePrompt edit, IMessageStrip strip, ISessionSummaryOpener summaries,
|
||||
SessionSeriesLoader loader, IHardwareSnapshotRepository hardware, SessionSelection sessionSelection, IGamePicker picker,
|
||||
RegisteredSettings? settings = null, IAgentLink? agent = null, AntiCheatExceptions? exceptions = null)
|
||||
RegisteredSettings? settings = null, IAgentLink? agent = null, AntiCheatExceptions? exceptions = null, SessionDeletion? deletion = null)
|
||||
{
|
||||
_deletion = deletion;
|
||||
_exceptions = exceptions;
|
||||
_settings = settings;
|
||||
_agent = agent;
|
||||
@@ -345,6 +351,28 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
|
||||
public IReadOnlyList<TrendPoint> TrendPoints { get; private set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D39): what the Trend draws — the selected metric, then every metric ticked beside it. One line alone keeps
|
||||
/// its own name on the axis, as before; several are labelled by unit, a second unit on the right.
|
||||
/// </summary>
|
||||
public IReadOnlyList<TrendLine> TrendLines { get; private set; } = [];
|
||||
|
||||
/// <summary>beta.11 (D39): the metrics that can be drawn beside the selected one, ticked by the user.</summary>
|
||||
public ObservableCollection<TrendMetricOptionViewModel> TrendExtras { get; } = [];
|
||||
|
||||
/// <summary>beta.11 (D39): the Sessions tab's overview — every hooked session's rate and lows (<see cref="TrendSeriesBuilder.Overview"/>).</summary>
|
||||
public IReadOnlyList<TrendLine> OverviewLines { get; private set; } = [];
|
||||
|
||||
public static string TrendExtrasLabel => Strings.Trend_Extras_Label;
|
||||
|
||||
public static string TrendExtrasNote => Strings.Trend_Extras_Note;
|
||||
|
||||
public static string OverviewHeader => Strings.GameDetail_Overview_Header;
|
||||
|
||||
public static string OverviewNote => Strings.GameDetail_Overview_Note;
|
||||
|
||||
public static string DeleteAllSessionsText => Strings.GameDetail_DeleteSessions;
|
||||
|
||||
public IReadOnlyList<HardwareChange> HardwareChanges { get; private set; } = [];
|
||||
|
||||
public string TrendMetricText => TrendMetrics.First(c => c.Value == TrendMetric).Label;
|
||||
@@ -526,12 +554,92 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
TrendPoints = TrendSeriesBuilder.Points(_detail.Sessions, TrendMetric, IncludeMidSession);
|
||||
int excluded = IncludeMidSession ? 0 : TrendSeriesBuilder.ExcludedCount(_detail.Sessions, TrendMetric);
|
||||
TrendExcludedText = excluded > 0 ? string.Format(CultureInfo.CurrentCulture, Strings.Trend_Excluded_Format, excluded) : string.Empty;
|
||||
TrendEmpty = TrendPoints.Count == 0;
|
||||
TrendLines = BuildTrendLines();
|
||||
TrendEmpty = TrendLines.All(static l => l.Points.Count == 0);
|
||||
TrendEmptyMessage = string.Format(CultureInfo.CurrentCulture, Strings.Trend_Empty_Format, TrendMetricText);
|
||||
OverviewLines = TrendSeriesBuilder.Overview(_detail.Sessions);
|
||||
OverviewVisible = OverviewLines.Count > 0;
|
||||
OnPropertyChanged(nameof(TrendMetricText));
|
||||
TrendPresented?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D39): the selected metric's line, then each ticked metric's — and the options' state: the selected metric
|
||||
/// is not offered beside itself, and once two units are on the chart a metric in a third cannot be ticked. A metric
|
||||
/// ticked in a third unit — the selected one changed to a unit neither ticked unit shares — is unticked: the chart
|
||||
/// draws two units, and a box left ticked would name a line that is not there.
|
||||
/// </summary>
|
||||
private List<TrendLine> BuildTrendLines()
|
||||
{
|
||||
if (TrendExtras.Count == 0)
|
||||
{
|
||||
foreach (Choice<TrendMetric> choice in TrendMetrics)
|
||||
{
|
||||
var option = new TrendMetricOptionViewModel(choice.Value, choice.Label, TrendSeriesBuilder.UnitOf(choice.Value));
|
||||
option.PropertyChanged += OnTrendExtraChanged;
|
||||
TrendExtras.Add(option);
|
||||
}
|
||||
}
|
||||
|
||||
_rebuildingExtras = true;
|
||||
try
|
||||
{
|
||||
string primaryUnit = TrendSeriesBuilder.UnitOf(TrendMetric);
|
||||
string? secondUnit = null;
|
||||
foreach (TrendMetricOptionViewModel option in TrendExtras.Where(o => o.IsSelected))
|
||||
{
|
||||
if (option.Metric == TrendMetric)
|
||||
{
|
||||
option.IsSelected = false;
|
||||
}
|
||||
else if (!string.Equals(option.Unit, primaryUnit, StringComparison.Ordinal))
|
||||
{
|
||||
secondUnit ??= option.Unit;
|
||||
option.IsSelected = string.Equals(option.Unit, secondUnit, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
TrendMetricOptionViewModel[] ticked = [.. TrendExtras.Where(static o => o.IsSelected)];
|
||||
HashSet<string> units = [primaryUnit, .. ticked.Select(static o => o.Unit)];
|
||||
foreach (TrendMetricOptionViewModel option in TrendExtras)
|
||||
{
|
||||
option.IsEnabled = option.Metric != TrendMetric && (option.IsSelected || units.Count < 2 || units.Contains(option.Unit));
|
||||
}
|
||||
|
||||
if (ticked.Length == 0)
|
||||
{
|
||||
return [new TrendLine(TrendMetricText, TrendMetricText, TrendPoints)];
|
||||
}
|
||||
|
||||
List<TrendLine> lines = [new TrendLine(TrendMetricText, primaryUnit, TrendPoints)];
|
||||
lines.AddRange(ticked.Select(o => new TrendLine(o.Label, o.Unit, TrendSeriesBuilder.Points(_detail!.Sessions, o.Metric, IncludeMidSession))));
|
||||
return lines;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_rebuildingExtras = false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _rebuildingExtras;
|
||||
|
||||
private void OnTrendExtraChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (!_rebuildingExtras && string.Equals(e.PropertyName, nameof(TrendMetricOptionViewModel.IsSelected), StringComparison.Ordinal))
|
||||
{
|
||||
RebuildTrendPoints();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D39): a click on the Sessions tab's overview selects that session in the grid.</summary>
|
||||
public void SelectSession(long sessionId)
|
||||
{
|
||||
if (Sessions.FirstOrDefault(s => s.Row.Id == sessionId) is { } session)
|
||||
{
|
||||
SelectedSession = session;
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void Back() => _navigator.Navigate<GamesPage>();
|
||||
|
||||
@@ -567,6 +675,10 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
[RelayCommand]
|
||||
private Task RemoveAsync() => RunAsync(RemoveCoreAsync);
|
||||
|
||||
/// <summary>beta.11 (D40): every session of this game, after the confirmation; the game, its settings and its consent stay.</summary>
|
||||
[RelayCommand]
|
||||
private Task DeleteAllSessionsAsync() => RunAsync(DeleteAllSessionsCoreAsync);
|
||||
|
||||
[RelayCommand]
|
||||
private Task ChangeExecutableAsync() => RunAsync(ChangeExecutableCoreAsync);
|
||||
|
||||
@@ -694,6 +806,27 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
await LoadAsync().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
private async Task DeleteAllSessionsCoreAsync()
|
||||
{
|
||||
if (Game is null || Sessions.Count == 0 || !await _confirmations.DeleteSessionsAsync(Game.Name, Sessions.Count).ConfigureAwait(true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SessionDeletionResult result = _deletion is null
|
||||
? new(SessionDeletionOutcome.AgentUnavailable)
|
||||
: await _deletion.DeleteAsync(Game.Id).ConfigureAwait(true);
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
_strip.Warn(Game.Name, result.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
// SessionDeletion has let go of File ▸ Export's selection and the summary windows of what is gone (ids are reused).
|
||||
_strip.Success(Game.Name, result.Message);
|
||||
await LoadAsync().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
private async Task RemoveCoreAsync()
|
||||
{
|
||||
if (Game is null)
|
||||
|
||||
@@ -1,19 +1,39 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using FrameLedger.App.Pages;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.Application.Settings;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>The Games grid (<c>08_UI</c> §Games): every game in the library as a card, searched and sorted in memory; add by pick or drop; open by click.</summary>
|
||||
/// <summary>
|
||||
/// The Games library (<c>08_UI</c> §Games): every game in the library, searched and sorted in memory; add by pick or drop;
|
||||
/// open by click. Since beta.11 (owner requests 2026-10-03): shown as a grid of cards that fills the width or as a list
|
||||
/// (<c>ui.library_view</c>), with the count in the header; <b>Refresh</b> reloads the library, looks in the stores for games
|
||||
/// installed since and offers only those, and marks entries whose executable is gone ("Not installed"); and the page
|
||||
/// reloads by itself when a session ends or an import adds games while it is on screen.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed partial class GamesViewModel : ObservableObject
|
||||
{
|
||||
private const string _listValue = "list";
|
||||
private const string _gridValue = "grid";
|
||||
|
||||
private readonly GameLibrary _library;
|
||||
private readonly GameSelection _selection;
|
||||
private readonly IPageNavigator _navigator;
|
||||
private readonly AddGameFlow _addGame;
|
||||
private readonly ImportLibraryFlow? _import;
|
||||
private readonly RegisteredSettings? _settings;
|
||||
private readonly IAgentLink? _agent;
|
||||
private readonly LibraryChanges? _changes;
|
||||
private readonly UiThread _ui = new();
|
||||
private IReadOnlyList<GameCardViewModel> _all = [];
|
||||
private bool _viewRead;
|
||||
private bool _attached;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _search = string.Empty;
|
||||
@@ -27,17 +47,27 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _noMatch;
|
||||
|
||||
public GamesViewModel(GameLibrary library, GameSelection selection, IPageNavigator navigator, AddGameFlow addGame)
|
||||
[ObservableProperty]
|
||||
private string _headerText = Strings.Games_Header;
|
||||
|
||||
/// <summary>The list instead of the grid (<c>ui.library_view</c>); remembered when the user changes it.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _listView;
|
||||
|
||||
public GamesViewModel(GameLibrary library, GameSelection selection, IPageNavigator navigator, AddGameFlow addGame, ImportLibraryFlow? import = null,
|
||||
RegisteredSettings? settings = null, IAgentLink? agent = null, LibraryChanges? changes = null)
|
||||
{
|
||||
_library = library ?? throw new ArgumentNullException(nameof(library));
|
||||
_selection = selection ?? throw new ArgumentNullException(nameof(selection));
|
||||
_navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
|
||||
_addGame = addGame ?? throw new ArgumentNullException(nameof(addGame));
|
||||
_import = import;
|
||||
_settings = settings;
|
||||
_agent = agent;
|
||||
_changes = changes;
|
||||
Pending = LoadAsync();
|
||||
}
|
||||
|
||||
public static string Header => Strings.Games_Header;
|
||||
|
||||
public static string EmptyText => Strings.Games_Empty;
|
||||
|
||||
public static string NoMatchText => Strings.Games_NoMatch;
|
||||
@@ -48,6 +78,14 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
|
||||
public static string SortLabel => Strings.Games_Sort_Label;
|
||||
|
||||
public static string RefreshText => Strings.Games_Refresh;
|
||||
|
||||
public static string RefreshToolTip => Strings.Games_Refresh_ToolTip;
|
||||
|
||||
public static string GridText => Strings.Games_View_Grid;
|
||||
|
||||
public static string ListText => Strings.Games_View_List;
|
||||
|
||||
public static IReadOnlyList<Choice<GamesSort>> Sorts { get; } =
|
||||
[
|
||||
new(GamesSort.Name, Strings.Games_Sort_Name),
|
||||
@@ -62,11 +100,85 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
|
||||
public async Task LoadAsync(CancellationToken ct = default)
|
||||
{
|
||||
await ReadViewAsync(ct).ConfigureAwait(true);
|
||||
IReadOnlyList<GameCard> cards = await _library.ListCardsAsync(ct).ConfigureAwait(true);
|
||||
_all = [.. cards.Select(static c => new GameCardViewModel(c))];
|
||||
// Whether each executable is on disk is a file-system question per entry — a drive that is gone can take a moment
|
||||
// to say so — so it is asked off the UI thread, the game page's own way (GameLibrary.ExecutableExists).
|
||||
bool[] installed = await Task.Run(() => cards.Select(static c => GameLibrary.ExecutableExists(c.Row.Fingerprint.ExePath)).ToArray(), ct)
|
||||
.ConfigureAwait(true);
|
||||
_all = [.. cards.Select((c, i) => new GameCardViewModel(c, installed[i]))];
|
||||
HeaderText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Header_Count_Format, _all.Count);
|
||||
Apply();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Listens while the page is on screen: a session that ends changes a card's count, playtime and last played, and an
|
||||
/// import made from the menu adds cards. The page calls it on Loaded and <see cref="Detach"/> on Unloaded; the link and
|
||||
/// the notifier are singletons and must not hold the page.
|
||||
/// </summary>
|
||||
public void Attach()
|
||||
{
|
||||
if (_attached)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_agent is not null)
|
||||
{
|
||||
_agent.EventReceived += OnAgentEvent;
|
||||
}
|
||||
|
||||
if (_changes is not null)
|
||||
{
|
||||
_changes.Changed += OnLibraryChanged;
|
||||
}
|
||||
|
||||
_attached = true;
|
||||
}
|
||||
|
||||
public void Detach()
|
||||
{
|
||||
if (!_attached)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_agent is not null)
|
||||
{
|
||||
_agent.EventReceived -= OnAgentEvent;
|
||||
}
|
||||
|
||||
if (_changes is not null)
|
||||
{
|
||||
_changes.Changed -= OnLibraryChanged;
|
||||
}
|
||||
|
||||
_attached = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11: the library read again, then the stores asked for games installed since — offered in the import checklist,
|
||||
/// the games already in the library hidden — and read again when any was added. A game whose executable is gone is
|
||||
/// marked on its card by the read; nothing is removed.
|
||||
/// </summary>
|
||||
[RelayCommand]
|
||||
private async Task RefreshAsync()
|
||||
{
|
||||
Pending = LoadAsync();
|
||||
await Pending.ConfigureAwait(true);
|
||||
if (_import is not null && await _import.RunAsync(onlyNew: true).ConfigureAwait(true) is { Added: > 0 })
|
||||
{
|
||||
Pending = LoadAsync();
|
||||
await Pending.ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void ShowGrid() => ListView = false;
|
||||
|
||||
[RelayCommand]
|
||||
private void ShowList() => ListView = true;
|
||||
|
||||
[RelayCommand]
|
||||
private async Task AddGameAsync() => _ = await _addGame.RunAsync().ConfigureAwait(true);
|
||||
|
||||
@@ -96,6 +208,43 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
|
||||
partial void OnSortChanged(GamesSort value) => Apply();
|
||||
|
||||
partial void OnListViewChanged(bool value)
|
||||
{
|
||||
if (_viewRead && _settings is not null)
|
||||
{
|
||||
_ = SaveViewAsync(value);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveViewAsync(bool list) =>
|
||||
await _settings!.SetAsync(SettingsRegistry.UiLibraryView, list ? _listValue : _gridValue).ConfigureAwait(true);
|
||||
|
||||
/// <summary>The remembered view, read once per page before the first list — so reading it is not taken for a change.</summary>
|
||||
private async Task ReadViewAsync(CancellationToken ct)
|
||||
{
|
||||
if (_viewRead)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_settings is not null)
|
||||
{
|
||||
ListView = string.Equals(await _settings.GetAsync(SettingsRegistry.UiLibraryView, ct).ConfigureAwait(true), _listValue, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
_viewRead = true;
|
||||
}
|
||||
|
||||
private void OnAgentEvent(object? sender, AgentEventArgs e) => _ui.Post(() =>
|
||||
{
|
||||
if (string.Equals(e.Envelope.Type, IpcMessageType.SessionCompleted, StringComparison.Ordinal))
|
||||
{
|
||||
Pending = LoadAsync();
|
||||
}
|
||||
});
|
||||
|
||||
private void OnLibraryChanged(object? sender, EventArgs e) => _ui.Post(() => Pending = LoadAsync());
|
||||
|
||||
private void Apply()
|
||||
{
|
||||
IEnumerable<GameCardViewModel> shown = _all;
|
||||
|
||||
@@ -25,6 +25,12 @@ public sealed partial class ImportCandidateViewModel : ObservableObject
|
||||
|
||||
public bool CanImport => Candidate.CanImport;
|
||||
|
||||
/// <summary>
|
||||
/// Already in the library — at this path, or (since 2026-09-23) the same file under another drive letter. Since beta.11
|
||||
/// such a row is hidden unless the user asks to see it, and then shown dimmed with a box that cannot be ticked.
|
||||
/// </summary>
|
||||
public bool IsExisting => Candidate.AlreadyInLibrary || Candidate.MovedFrom is not null;
|
||||
|
||||
public string PlatformText => Formats.Platform(Candidate.Game.Platform);
|
||||
|
||||
public string Name => Candidate.Game.Name;
|
||||
|
||||
@@ -8,7 +8,12 @@ using FrameLedger.Application.Import;
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>FR-1.2's review checklist: every candidate the stores found, ticked by default where it can be imported; the count follows the ticks.</summary>
|
||||
/// <summary>
|
||||
/// FR-1.2's review checklist: every candidate the stores found, ticked by default where it can be imported; the count
|
||||
/// follows the ticks. Since beta.11 (owner request 2026-10-03) the games already in the library are hidden by default —
|
||||
/// on a re-import they were most of the list and pushed the new ones out of sight — and <see cref="ShowExisting"/> brings
|
||||
/// them back, dimmed, their boxes disabled.
|
||||
/// </summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime; a cached CompositeFormat would pin the first culture")]
|
||||
public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
{
|
||||
@@ -17,6 +22,9 @@ public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
[NotifyPropertyChangedFor(nameof(SelectedText))]
|
||||
private int _selectedCount;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _showExisting;
|
||||
|
||||
public ImportReviewViewModel(IReadOnlyList<ImportCandidate> candidates)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(candidates);
|
||||
@@ -27,11 +35,25 @@ public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
Rows.Add(row);
|
||||
}
|
||||
|
||||
ExistingCount = Rows.Count(static r => r.IsExisting);
|
||||
ShowExistingText = string.Format(CultureInfo.CurrentCulture, Strings.Import_ShowExisting_Format, ExistingCount);
|
||||
Refilter();
|
||||
Recount();
|
||||
}
|
||||
|
||||
/// <summary>Every candidate, shown or not.</summary>
|
||||
public ObservableCollection<ImportCandidateViewModel> Rows { get; } = [];
|
||||
|
||||
/// <summary>What the checklist shows: every row, less those already in the library unless <see cref="ShowExisting"/>.</summary>
|
||||
public ObservableCollection<ImportCandidateViewModel> Shown { get; } = [];
|
||||
|
||||
/// <summary>Rows already in the library (at this path or another drive letter).</summary>
|
||||
public int ExistingCount { get; }
|
||||
|
||||
public bool HasExisting => ExistingCount > 0;
|
||||
|
||||
public string ShowExistingText { get; }
|
||||
|
||||
public static string Title => Strings.Import_Title;
|
||||
|
||||
public static string Intro => Strings.Import_Intro;
|
||||
@@ -77,4 +99,15 @@ public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
}
|
||||
|
||||
private void Recount() => SelectedCount = Rows.Count(static r => r.IsSelected && r.CanImport);
|
||||
|
||||
partial void OnShowExistingChanged(bool value) => Refilter();
|
||||
|
||||
private void Refilter()
|
||||
{
|
||||
Shown.Clear();
|
||||
foreach (ImportCandidateViewModel r in Rows.Where(r => ShowExisting || !r.IsExisting))
|
||||
{
|
||||
Shown.Add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,9 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
private readonly IAgentLink _agent;
|
||||
private readonly IRunAtLogon _runAtLogon;
|
||||
private readonly IMessageStrip _strip;
|
||||
private readonly IConfirmations? _confirmations;
|
||||
private readonly SessionDeletion? _deletion;
|
||||
private long _sessionTotal;
|
||||
private readonly IMaintenanceState _maintenance;
|
||||
private readonly IAgentTool _tool;
|
||||
private readonly WindowClosePolicy _closePolicy;
|
||||
@@ -147,8 +150,14 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
IFirstRunFlow firstRun,
|
||||
AntiCheatExceptions? exceptions = null,
|
||||
IAgentAdminPrompt? adminPrompt = null,
|
||||
Func<bool>? agentHeld = null)
|
||||
Func<bool>? agentHeld = null,
|
||||
IConfirmations? confirmations = null,
|
||||
SessionDeletion? deletion = null)
|
||||
{
|
||||
// beta.11 (D40): Settings ▸ Data's Delete all sessions — its confirmation and its request; a composition without them
|
||||
// (a test) deletes nothing.
|
||||
_confirmations = confirmations;
|
||||
_deletion = deletion;
|
||||
// The admin mode's disclosure (a composition without it — a test — cannot turn the mode on), and the probe of the
|
||||
// data folder's instance lock the restart waits on (a test's own).
|
||||
_adminPrompt = adminPrompt;
|
||||
@@ -181,7 +190,6 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
|
||||
public static string LanguageLabel => Strings.Settings_Language_Label;
|
||||
|
||||
public static string LanguageNote => Strings.Settings_Language_Note;
|
||||
|
||||
public static IReadOnlyList<Choice<AppTheme>> Themes { get; } =
|
||||
[
|
||||
@@ -215,6 +223,9 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
|
||||
public ObservableCollection<HookedGameViewModel> HookedGames { get; } = [];
|
||||
|
||||
/// <summary>beta.11: the "Games with hooking on" card is shown only while it lists a game (a row with no control is not shown).</summary>
|
||||
public bool HasHookedGames => HookedGames.Count > 0;
|
||||
|
||||
/// <summary>
|
||||
/// D33: the games the user-mode exception concerns — in force, eligible, or held back only by the session count. The rest
|
||||
/// of the blocked games say why not on their own pages.
|
||||
@@ -513,6 +524,8 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
}
|
||||
|
||||
PresentExceptions(cards);
|
||||
OnPropertyChanged(nameof(HasHookedGames));
|
||||
_sessionTotal = cards.Sum(static c => c.Summary?.SessionCount ?? 0);
|
||||
|
||||
Shared.Ipc.HelloAck? hello = _agent.Hello;
|
||||
ElevationText = ElevationTextOf(_agent.State, hello);
|
||||
@@ -624,6 +637,33 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
[RelayCommand]
|
||||
private Task RefreshExceptionsAsync() => RefreshAsync();
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D40): every session of every game, after the confirmation, through the Agent; the library, the settings and
|
||||
/// every consent stay.
|
||||
/// </summary>
|
||||
[RelayCommand]
|
||||
private async Task DeleteAllSessionsAsync()
|
||||
{
|
||||
if (_confirmations is null || !await _confirmations.DeleteSessionsAsync(null, _sessionTotal).ConfigureAwait(true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SessionDeletionResult result = _deletion is null
|
||||
? new(SessionDeletionOutcome.AgentUnavailable)
|
||||
: await _deletion.DeleteAsync(null).ConfigureAwait(true);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_strip.Success(Strings.Settings_DeleteSessions_Label, result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
_strip.Warn(Strings.Settings_DeleteSessions_Label, result.Message);
|
||||
}
|
||||
|
||||
await RefreshCoreAsync().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
private async Task RevokeAsync(HookedGameViewModel game)
|
||||
{
|
||||
HookingConsentResult result = await _consent.DisableAsync(game.GameId).ConfigureAwait(true);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using FrameLedger.App.Charts;
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// One metric the Trend can draw beside the selected one (beta.11, owner decision D39: several metrics at once). Disabled
|
||||
/// when it is the selected metric itself, or when two units are already on the chart and it is in neither.
|
||||
/// </summary>
|
||||
public sealed partial class TrendMetricOptionViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool _isSelected;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isEnabled = true;
|
||||
|
||||
public TrendMetricOptionViewModel(TrendMetric metric, string label, string unit)
|
||||
{
|
||||
Metric = metric;
|
||||
Label = label ?? throw new ArgumentNullException(nameof(label));
|
||||
Unit = unit ?? throw new ArgumentNullException(nameof(unit));
|
||||
}
|
||||
|
||||
public TrendMetric Metric { get; }
|
||||
|
||||
public string Label { get; }
|
||||
|
||||
/// <summary>The axis it is drawn against (<see cref="TrendSeriesBuilder.UnitOf"/>).</summary>
|
||||
public string Unit { get; }
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public sealed class AgentCommandHandler
|
||||
private readonly TimeProvider _clock;
|
||||
private readonly VkLayerReconciler? _layer;
|
||||
private readonly Func<CancellationToken, ValueTask<SweepRetentionAck>>? _sweepRetention;
|
||||
private readonly ISessionRepository? _deleteSessions;
|
||||
private readonly ExecutableRelocator? _relocator;
|
||||
private readonly IExecutableArchitectureSource? _architecture;
|
||||
private readonly AntiCheatExceptionCommands? _exceptions;
|
||||
@@ -69,8 +70,10 @@ public sealed class AgentCommandHandler
|
||||
CaptureOrchestrator orchestrator, CapturePause pause, IAgentLifetime lifetime, Func<CancellationToken, ValueTask<string>> updateRules,
|
||||
string? disclosureVersion = null, TimeProvider? clock = null, VkLayerReconciler? layer = null,
|
||||
Func<CancellationToken, ValueTask<SweepRetentionAck>>? sweepRetention = null, ExecutableRelocator? relocator = null,
|
||||
IExecutableArchitectureSource? architecture = null, AntiCheatExceptionCommands? exceptions = null)
|
||||
IExecutableArchitectureSource? architecture = null, AntiCheatExceptionCommands? exceptions = null, ISessionRepository? deleteSessions = null)
|
||||
{
|
||||
// beta.11 (D40): DeleteSessions — composed under --serve over the Agent's own repository; absent, not answered (UnknownType).
|
||||
_deleteSessions = deleteSessions;
|
||||
// D33: the user-mode exception's collaborators — its option, its evidence, its disclosure version. Absent, no
|
||||
// exception applies to SetHookEnabled and SetAntiCheatException is not answered (UnknownType).
|
||||
_exceptions = exceptions;
|
||||
@@ -117,10 +120,34 @@ public sealed class AgentCommandHandler
|
||||
IpcMessageType.SetAntiCheatException when _exceptions is not null => await SetAntiCheatExceptionAsync(request, _exceptions, ct).ConfigureAwait(false),
|
||||
IpcMessageType.SweepRetention when _sweepRetention is not null =>
|
||||
IpcCodec.Encode(IpcMessageType.SweepRetentionAck, request.Id, await _sweepRetention(ct).ConfigureAwait(false)),
|
||||
IpcMessageType.DeleteSessions when _deleteSessions is not null => await DeleteSessionsAsync(request, _deleteSessions, ct).ConfigureAwait(false),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): every session of one game, or of every game — never while a session it would delete
|
||||
/// under is being recorded (that session would land after the delete, and a summary the App opened could point at a
|
||||
/// reused id). The rows are the Agent's (<c>06_DATA_MODEL</c> §Writer ownership), so the Agent deletes them.
|
||||
/// </summary>
|
||||
private async ValueTask<byte[]> DeleteSessionsAsync(IpcEnvelope request, ISessionRepository sessions, CancellationToken ct)
|
||||
{
|
||||
DeleteSessionsRequest? payload = IpcCodec.Payload<DeleteSessionsRequest>(request);
|
||||
if (payload is null)
|
||||
{
|
||||
return Malformed(request, "DeleteSessions carries no payload");
|
||||
}
|
||||
|
||||
bool running = payload.GameId is { } one ? _orchestrator.IsRecording(one) : _orchestrator.IsRecordingAny();
|
||||
if (running)
|
||||
{
|
||||
return Error(request, IpcErrorCode.SessionRunning, "a session is being recorded; nothing was deleted — stop it or let it end, then try again");
|
||||
}
|
||||
|
||||
RetentionSweepResult deleted = await sessions.DeleteSessionsAsync(payload.GameId, ct).ConfigureAwait(false);
|
||||
return IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, request.Id, new DeleteSessionsAck(payload.GameId, deleted.Games, deleted.Sessions));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identity only (<c>07_IPC</c>: "carries no hooking state"): every entry's row is ensured, hooking off when new.
|
||||
/// Nothing is removed — removing a game is the App's FR-1.4 (with its "keep the sessions?" question), never a
|
||||
|
||||
@@ -59,6 +59,13 @@ public interface ISessionRepository
|
||||
/// </summary>
|
||||
ValueTask<RetentionSweepResult> SweepRetentionAllAsync(int keep, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): delete every session of <paramref name="gameId"/>, or of every game when it is null, in
|
||||
/// one transaction — segments, frame and sensor series and annotations cascade with them (schema 0001's foreign keys).
|
||||
/// Nothing about the games, their consent or the settings is touched. The Agent's to call (§Writer ownership).
|
||||
/// </summary>
|
||||
ValueTask<RetentionSweepResult> DeleteSessionsAsync(long? gameId, CancellationToken ct = default);
|
||||
|
||||
ValueTask<FrameBlobs?> FindFramesAsync(long sessionId, CancellationToken ct = default);
|
||||
|
||||
/// <summary>The session's segments in frame order (the ribbon, <c>08_UI</c> §Session summary).</summary>
|
||||
|
||||
@@ -63,6 +63,18 @@ public static class SettingsRegistry
|
||||
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.
|
||||
/// </summary>
|
||||
public static readonly SettingDefinition UiLibraryView = new()
|
||||
{
|
||||
Key = "ui.library_view",
|
||||
Kind = SettingKind.Choice,
|
||||
Default = "grid",
|
||||
Choices = ["grid", "list"],
|
||||
};
|
||||
|
||||
/// <summary>Whether the Agent's watcher records tracked games that the App did not launch (FR-3.1/FR-3.3).</summary>
|
||||
public static readonly SettingDefinition CaptureBackground = new()
|
||||
{
|
||||
@@ -178,7 +190,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,
|
||||
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals, UiLibraryView,
|
||||
CaptureBackground, HookingKillSwitch, HookingUserModeExceptions, CaptureRunElevated, CaptureMinSessionSeconds, TelemetryIntervalMs, RetentionRawSessionsPerGame,
|
||||
UpdateChannel, UpdateAutoCheck, PrivacyOnlineMetadata, LogDebug,
|
||||
];
|
||||
|
||||
@@ -104,6 +104,15 @@ public sealed class CaptureOrchestrator
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Whether any session started here is still running — what deleting every session waits for (beta.11).</summary>
|
||||
public bool IsRecordingAny()
|
||||
{
|
||||
lock (_table)
|
||||
{
|
||||
return _running.Values.Any(static r => !r.Task.IsCompleted);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Poll until cancelled, then wait for every running session to finalize.</summary>
|
||||
public async Task RunAsync(CancellationToken ct)
|
||||
{
|
||||
|
||||
@@ -217,6 +217,20 @@ public sealed class SqliteSessionRepository : ISessionRepository
|
||||
}, ct);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D40): one transaction — count what goes, then delete; <c>PRAGMA foreign_keys = ON</c> (LedgerDatabase) lets
|
||||
/// segments, frame and sensor series and annotations go with their sessions.
|
||||
/// </summary>
|
||||
public ValueTask<RetentionSweepResult> DeleteSessionsAsync(long? gameId, CancellationToken ct = default) =>
|
||||
_db.WriteAsync(async (c, tx, token) =>
|
||||
{
|
||||
const string scope = "FROM sessions WHERE (@gameId IS NULL OR game_id = @gameId)";
|
||||
long games = await c.ExecuteScalarAsync<long>(new CommandDefinition("SELECT COUNT(DISTINCT game_id) " + scope, new { gameId }, tx,
|
||||
cancellationToken: token)).ConfigureAwait(false);
|
||||
int sessions = await c.ExecuteAsync(new CommandDefinition("DELETE " + scope, new { gameId }, tx, cancellationToken: token)).ConfigureAwait(false);
|
||||
return new RetentionSweepResult(checked((int)games), sessions);
|
||||
}, ct);
|
||||
|
||||
public ValueTask<FrameBlobs?> FindFramesAsync(long sessionId, CancellationToken ct = default) =>
|
||||
_db.ReadAsync((c, token) => SqliteReaders.ReadOneAsync(
|
||||
c, new CommandDefinition(_selectFrames, new { sessionId }, cancellationToken: token), ReadFrames), ct);
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace FrameLedger.Shared.Ipc;
|
||||
[JsonSerializable(typeof(ShutdownAck))]
|
||||
[JsonSerializable(typeof(SweepRetentionRequest))]
|
||||
[JsonSerializable(typeof(SweepRetentionAck))]
|
||||
[JsonSerializable(typeof(DeleteSessionsRequest))]
|
||||
[JsonSerializable(typeof(DeleteSessionsAck))]
|
||||
public sealed partial class IpcJsonContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
@@ -57,6 +57,13 @@ public static class IpcMessageType
|
||||
public const string SweepRetention = "SweepRetention";
|
||||
public const string SweepRetentionAck = "SweepRetentionAck";
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): delete every session of one game, or of every game — the Agent's rows (§Writer
|
||||
/// ownership), deleted by the Agent, refused while a session it would delete under is still being recorded.
|
||||
/// </summary>
|
||||
public const string DeleteSessions = "DeleteSessions";
|
||||
public const string DeleteSessionsAck = "DeleteSessionsAck";
|
||||
|
||||
public const string SessionStarted = "SessionStarted";
|
||||
public const string SessionProgress = "SessionProgress";
|
||||
|
||||
@@ -96,6 +103,9 @@ public static class IpcErrorCode
|
||||
|
||||
/// <summary>D33: <c>SetAntiCheatException true</c> while <c>hooking.usermode_ac_exceptions</c> is off — nothing is granted.</summary>
|
||||
public const string ExceptionsOff = "ExceptionsOff";
|
||||
|
||||
/// <summary>beta.11: <c>DeleteSessions</c> while a session of that game (or of any game, for all) is being recorded — nothing is deleted.</summary>
|
||||
public const string SessionRunning = "SessionRunning";
|
||||
}
|
||||
|
||||
/// <summary>Codes a <see cref="CaptureErrorEvent"/> carries (<c>07_IPC</c> §Messages, <c>CaptureError</c>).</summary>
|
||||
@@ -362,3 +372,13 @@ public sealed record SweepRetentionRequest;
|
||||
/// series were removed. Aggregates and segments are never touched.
|
||||
/// </summary>
|
||||
public sealed record SweepRetentionAck(int Keep, int Games, int Sessions);
|
||||
|
||||
/// <summary>
|
||||
/// <c>DeleteSessions</c> (beta.11, D40): every session of <see cref="GameId"/>, or of every game when it is null — with
|
||||
/// their segments, frame and sensor series and annotations (they cascade). The library, the settings and every consent
|
||||
/// stay. Refused with <c>Error SessionRunning</c> while such a session is being recorded.
|
||||
/// </summary>
|
||||
public sealed record DeleteSessionsRequest(long? GameId);
|
||||
|
||||
/// <summary>What was deleted: the sessions, and how many games they belonged to.</summary>
|
||||
public sealed record DeleteSessionsAck(long? GameId, int Games, int Sessions);
|
||||
@@ -66,9 +66,17 @@ public sealed class GameDetailViewModelTests
|
||||
public void GoBack() => Pages.Add("back");
|
||||
}
|
||||
|
||||
private sealed class FakeConfirmations(RemoveGameChoice choice) : IConfirmations
|
||||
private sealed class FakeConfirmations(RemoveGameChoice choice, bool deleteSessions = false) : IConfirmations
|
||||
{
|
||||
public List<(string? Game, long Sessions)> DeleteAsked { get; } = [];
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(choice);
|
||||
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
DeleteAsked.Add((gameName, sessions));
|
||||
return Task.FromResult(deleteSessions);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FakeEdit(GameMetadata? answer) : IEditGamePrompt
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Controls;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner requests 2026-10-03): the library page counts its games, reloads itself while on screen when a session
|
||||
/// ends or an import adds games, lets go when it leaves, and its grid's columns fill the width.
|
||||
/// </summary>
|
||||
public sealed class GamesViewModelTests
|
||||
{
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
private sealed class NoNavigation : IPageNavigator
|
||||
{
|
||||
public void Navigate<TPage>()
|
||||
where TPage : class
|
||||
{
|
||||
}
|
||||
|
||||
public void GoBack()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NoPicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => null;
|
||||
}
|
||||
|
||||
private sealed class NoStrip : IMessageStrip
|
||||
{
|
||||
public void Info(string title, string body)
|
||||
{
|
||||
}
|
||||
|
||||
public void Success(string title, string body)
|
||||
{
|
||||
}
|
||||
|
||||
public void Warn(string title, string body)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ThePageOnScreenReloadsWhenAnImportAddsGamesOrASessionEndsAndNotAfterItLeaves()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow alpha = await s.GameAsync("Alpha");
|
||||
var selection = new GameSelection();
|
||||
var nav = new NoNavigation();
|
||||
var link = new FakeAgentLink();
|
||||
var changes = new LibraryChanges();
|
||||
var vm = new GamesViewModel(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, new NoStrip()), agent: link, changes: changes);
|
||||
Task loaded = vm.Pending;
|
||||
await loaded;
|
||||
vm.HeaderText.Should().EndWith("1");
|
||||
vm.Attach();
|
||||
vm.Attach(); // a second Loaded does not subscribe twice
|
||||
|
||||
_ = await s.GameAsync("Bravo");
|
||||
changes.Announce();
|
||||
Task afterImport = vm.Pending;
|
||||
await afterImport;
|
||||
vm.Games.Should().HaveCount(2, "an import made from the menu while the page is on screen");
|
||||
vm.HeaderText.Should().EndWith("2");
|
||||
|
||||
long session = await s.SessionAsync(alpha.Id, DateTimeOffset.UtcNow);
|
||||
link.Raise(IpcMessageType.SessionCompleted, new SessionCompletedEvent(Guid.NewGuid(), session, "normal", 1, "saved", "exited", alpha.Id, "Alpha"));
|
||||
Task afterSession = vm.Pending;
|
||||
await afterSession;
|
||||
vm.Games.Single(static g => string.Equals(g.Name, "Alpha", StringComparison.Ordinal)).SessionCount.Should().Be(1);
|
||||
|
||||
vm.Detach();
|
||||
Task before = vm.Pending;
|
||||
_ = await s.GameAsync("Charlie");
|
||||
changes.Announce();
|
||||
vm.Pending.Should().BeSameAs(before, "a page that left holds nothing and reloads nothing");
|
||||
vm.Games.Should().HaveCount(2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ACardSaysWhetherItsExecutableIsThereAndWhy()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow row = await s.GameAsync("Gone", @"Q:\Games\Gone\gone.exe");
|
||||
|
||||
new GameCardViewModel(new GameCard(row, null)).NotInstalled.Should().BeFalse("installed unless the listing said otherwise");
|
||||
var missing = new GameCardViewModel(new GameCard(row, null), installed: false);
|
||||
missing.NotInstalled.Should().BeTrue();
|
||||
missing.NotInstalledToolTip.Should().Be(Formats.ExecutableMissingText(@"Q:\Games\Gone\gone.exe"), "the game page's own words for why");
|
||||
missing.StatusText.Should().Contain(Strings.Games_Card_NotInstalled);
|
||||
|
||||
await using ScratchLedger s2 = await ScratchLedger.OpenAsync();
|
||||
var listed = new GamesViewModel(s2.Library, new GameSelection(), new NoNavigation(),
|
||||
new AddGameFlow(s2.Library, new NoPicker(), new GameSelection(), new NoNavigation(), new NoStrip()));
|
||||
string here = typeof(GamesViewModelTests).Assembly.Location;
|
||||
_ = await s2.GameAsync("Here", here);
|
||||
_ = await s2.GameAsync("Gone", Path.Combine(AppContext.BaseDirectory, "no-such-game.exe"));
|
||||
await listed.LoadAsync(Ct);
|
||||
listed.Games.Single(static g => string.Equals(g.Name, "Here", StringComparison.Ordinal)).NotInstalled.Should().BeFalse();
|
||||
listed.Games.Single(static g => string.Equals(g.Name, "Gone", StringComparison.Ordinal)).NotInstalled.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1200, 3)]
|
||||
[InlineData(1248, 4)]
|
||||
[InlineData(1235, 3)]
|
||||
[InlineData(624, 2)]
|
||||
[InlineData(250, 1)]
|
||||
[InlineData(double.PositiveInfinity, 1)]
|
||||
public void TheGridHasAsManyColumnsAsFitAtTheMinimumWidth(double width, int columns)
|
||||
{
|
||||
UniformWrapPanel.ColumnsFor(width, 300, 12).Should().Be(columns);
|
||||
if (!double.IsInfinity(width))
|
||||
{
|
||||
double item = UniformWrapPanel.ItemWidthFor(width, columns, 12);
|
||||
item.Should().BeGreaterThanOrEqualTo(columns == 1 ? 0 : 300);
|
||||
((columns * item) + ((columns - 1) * 12)).Should().BeApproximately(width, 0.001, "a row fills the width");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public sealed class ImportLibraryFlowTests : IDisposable
|
||||
var importer = new LibraryImporter([store], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { });
|
||||
var flow = new ImportLibraryFlow(importer, review, strip, nav);
|
||||
|
||||
ImportReport? report = await flow.RunAsync(Ct);
|
||||
ImportReport? report = await flow.RunAsync(ct: Ct);
|
||||
|
||||
report.Should().NotBeNull();
|
||||
report!.Added.Should().Be(1);
|
||||
@@ -114,17 +114,55 @@ public sealed class ImportLibraryFlowTests : IDisposable
|
||||
var nav = new FakeNavigator();
|
||||
var review = new ScriptedReview(static _ => null);
|
||||
var empty = new ImportLibraryFlow(new LibraryImporter([new ScriptedStore()], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }), review, strip, nav);
|
||||
(await empty.RunAsync(Ct)).Should().BeNull();
|
||||
(await empty.RunAsync(ct: Ct)).Should().BeNull();
|
||||
strip.Kinds.Should().Equal("info");
|
||||
review.Shown.Should().BeEmpty("nothing to review");
|
||||
|
||||
string exe = await ExeAsync("Game");
|
||||
var cancelled = new ImportLibraryFlow(new LibraryImporter([new ScriptedStore(new StoreGame("epic", "g", "Game", Path.GetDirectoryName(exe)!, exe, null))], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }), review, strip, nav);
|
||||
(await cancelled.RunAsync(Ct)).Should().BeNull();
|
||||
(await cancelled.RunAsync(ct: Ct)).Should().BeNull();
|
||||
(await s.Games.ListAsync(Ct)).Should().BeEmpty();
|
||||
nav.Pages.Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11: the Games page's Refresh runs the import for new games only — every title already in the library means "no
|
||||
/// new games" and no checklist; a new one opens it, and the page on screen is told the library changed.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task RefreshOffersOnlyNewGamesAndSaysWhenThereAreNone()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string old = await ExeAsync("Old");
|
||||
await s.Games.EnsureAsync(new ExecutableIdentitySource().Read(old)!.Value, "Old", Ct);
|
||||
var oldStore = new ScriptedStore(new StoreGame("epic", "old", "Old", Path.GetDirectoryName(old)!, old, null));
|
||||
var review = new ScriptedReview(static c => [.. c.Where(static x => x.CanImport)]);
|
||||
var strip = new RecordingStrip();
|
||||
var nav = new FakeNavigator();
|
||||
var changes = new LibraryChanges();
|
||||
int announced = 0;
|
||||
changes.Changed += (_, _) => announced++;
|
||||
var flow = new ImportLibraryFlow(new LibraryImporter([oldStore], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }),
|
||||
review, strip, nav, changes);
|
||||
|
||||
(await flow.RunAsync(onlyNew: true, Ct)).Should().BeNull();
|
||||
review.Shown.Should().BeEmpty("nothing new, so no checklist");
|
||||
strip.Kinds.Should().Equal("info");
|
||||
announced.Should().Be(0);
|
||||
|
||||
string fresh = await ExeAsync("Fresh");
|
||||
var both = new ScriptedStore(new StoreGame("epic", "old", "Old", Path.GetDirectoryName(old)!, old, null),
|
||||
new StoreGame("epic", "fresh", "Fresh", Path.GetDirectoryName(fresh)!, fresh, null));
|
||||
flow = new ImportLibraryFlow(new LibraryImporter([both], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }),
|
||||
review, strip, nav, changes);
|
||||
|
||||
ImportReport? report = await flow.RunAsync(onlyNew: true, Ct);
|
||||
|
||||
report!.Added.Should().Be(1);
|
||||
announced.Should().Be(1, "the Games page on screen reloads");
|
||||
nav.Pages.Should().Equal(nameof(GamesPage));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheReviewCountsTicksAndSelectAllSkipsWhatCannotBeImported()
|
||||
{
|
||||
@@ -150,4 +188,33 @@ public sealed class ImportLibraryFlowTests : IDisposable
|
||||
vm.SelectedCount.Should().Be(1);
|
||||
vm.Selected.Should().ContainSingle().Which.Should().Be(can);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner request 2026-10-03): the games already in the library — at this path or under another drive letter —
|
||||
/// are hidden by default and come back, still unimportable, when the user asks; the count names how many.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GamesAlreadyInTheLibraryAreHiddenUntilAskedFor()
|
||||
{
|
||||
var can = new ImportCandidate(new StoreGame("steam", "1", "A", @"C:\a", @"C:\a\a.exe", null), @"C:\a\a.exe", AlreadyInLibrary: false, ExecutableGuessed: false);
|
||||
var already = new ImportCandidate(new StoreGame("steam", "2", "B", @"C:\b", @"C:\b\b.exe", null), @"C:\b\b.exe", AlreadyInLibrary: true, ExecutableGuessed: false);
|
||||
var none = new ImportCandidate(new StoreGame("steam", "3", "C", @"C:\c", null, null), null, AlreadyInLibrary: false, ExecutableGuessed: true);
|
||||
var moved = new ImportCandidate(new StoreGame("steam", "4", "D", @"D:\d", @"D:\d\d.exe", null), @"D:\d\d.exe", AlreadyInLibrary: false, ExecutableGuessed: false,
|
||||
MovedFrom: @"H:\d\d.exe");
|
||||
var vm = new ImportReviewViewModel([can, already, none, moved]);
|
||||
|
||||
vm.ExistingCount.Should().Be(2);
|
||||
vm.HasExisting.Should().BeTrue();
|
||||
vm.ShowExistingText.Should().Contain("2");
|
||||
vm.Shown.Select(static r => r.Name).Should().Equal(["A", "C"], "a title with no executable is new and says why it cannot be imported");
|
||||
|
||||
vm.ShowExisting = true;
|
||||
vm.Shown.Select(static r => r.Name).Should().Equal(["A", "B", "C", "D"]);
|
||||
vm.Shown.Where(static r => r.IsExisting).Should().OnlyContain(static r => !r.CanImport, "shown dimmed, never importable");
|
||||
|
||||
vm.SelectAllCommand.Execute(null);
|
||||
vm.SelectedCount.Should().Be(1, "showing them makes them no more importable");
|
||||
vm.ShowExisting = false;
|
||||
vm.Shown.Should().HaveCount(2);
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,8 @@ public sealed class PagesLoadTests
|
||||
|
||||
private sealed class NoConfirm : IConfirmations
|
||||
{
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default) => Task.FromResult(false);
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(RemoveGameChoice.Cancel);
|
||||
}
|
||||
|
||||
@@ -253,6 +255,102 @@ public sealed class PagesLoadTests
|
||||
element.UpdateLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner request 2026-10-03: "the empty band on the right"): the library's cards share the whole width — every
|
||||
/// card in a row as wide as the others, the row as wide as the panel — and the list view renders with the grid gone, the
|
||||
/// choice remembered. Under the real dictionaries, so a style or binding typo is red here.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheLibraryGridFillsItsWidthAndTheListViewReplacesIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
foreach (string name in new[] { "Alpha", "Bravo", "Charlie", "Delta", "Echo" })
|
||||
{
|
||||
_ = await s.GameAsync(name);
|
||||
}
|
||||
|
||||
var selection = new GameSelection();
|
||||
var nav = new NoNavigation();
|
||||
var strip = new NoStrip();
|
||||
var settings = new MemorySettings();
|
||||
var games = new GamesViewModel(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, strip),
|
||||
settings: new RegisteredSettings(settings));
|
||||
Task pending = games.Pending;
|
||||
await pending;
|
||||
games.HeaderText.Should().EndWith("5");
|
||||
games.Games.Should().OnlyContain(static g => g.NotInstalled, "the scratch entries point at files that do not exist");
|
||||
|
||||
(double PanelWidth, double[] CardWidths, int Columns) grid = await OnStaAsync(() =>
|
||||
{
|
||||
var page = new GamesPage(games);
|
||||
Render(page);
|
||||
UniformWrapPanel panel = Find<UniformWrapPanel>(page)!;
|
||||
double[] widths = [.. panel.Children.Cast<FrameworkElement>().Select(static c => c.ActualWidth)];
|
||||
return (panel.ActualWidth, widths, UniformWrapPanel.ColumnsFor(panel.ActualWidth, panel.MinItemWidth, panel.Spacing));
|
||||
});
|
||||
|
||||
grid.Columns.Should().BeGreaterThan(1);
|
||||
grid.CardWidths.Should().OnlyContain(w => Math.Abs(w - grid.CardWidths[0]) < 0.5, "every card is an equal share");
|
||||
((grid.Columns * grid.CardWidths[0]) + ((grid.Columns - 1) * 12)).Should().BeApproximately(grid.PanelWidth, 1, "a full row leaves no band unused");
|
||||
|
||||
games.ShowListCommand.Execute(null);
|
||||
(bool ListShown, bool GridShown) list = await OnStaAsync(() =>
|
||||
{
|
||||
var page = new GamesPage(games);
|
||||
Render(page);
|
||||
return (((FrameworkElement)page.FindName("GameList")).Visibility == Visibility.Visible,
|
||||
((FrameworkElement)page.FindName("CardGrid")).Visibility == Visibility.Visible);
|
||||
});
|
||||
|
||||
list.ListShown.Should().BeTrue();
|
||||
list.GridShown.Should().BeFalse();
|
||||
settings.Rows.Should().ContainKey("ui.library_view").WhoseValue.Should().Be("list", "the choice is remembered");
|
||||
}
|
||||
|
||||
/// <summary>beta.11: the import checklist renders with the rows already in the library shown, dimmed, under the real dictionaries.</summary>
|
||||
[Fact]
|
||||
public async Task TheImportChecklistRendersWithTheExistingRowsShown()
|
||||
{
|
||||
var vm = new ImportReviewViewModel(
|
||||
[
|
||||
new Application.Import.ImportCandidate(new Application.Import.StoreGame("steam", "1", "A", @"C:\a", @"C:\a\a.exe", null), @"C:\a\a.exe",
|
||||
AlreadyInLibrary: false, ExecutableGuessed: false),
|
||||
new Application.Import.ImportCandidate(new Application.Import.StoreGame("steam", "2", "B", @"C:\b", @"C:\b\b.exe", null), @"C:\b\b.exe",
|
||||
AlreadyInLibrary: true, ExecutableGuessed: false),
|
||||
])
|
||||
{ ShowExisting = true };
|
||||
|
||||
int rows = await OnStaAsync(() =>
|
||||
{
|
||||
var content = new Dialogs.ImportReviewContent(vm);
|
||||
Render(content);
|
||||
return Find<System.Windows.Controls.DataGrid>(content)!.Items.Count;
|
||||
});
|
||||
|
||||
rows.Should().Be(2);
|
||||
}
|
||||
|
||||
/// <summary>The first descendant of <paramref name="root"/> of type <typeparamref name="T"/> in the visual tree, or null.</summary>
|
||||
private static T? Find<T>(DependencyObject root)
|
||||
where T : DependencyObject
|
||||
{
|
||||
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(root); i++)
|
||||
{
|
||||
DependencyObject child = System.Windows.Media.VisualTreeHelper.GetChild(root, i);
|
||||
if (child is T hit)
|
||||
{
|
||||
return hit;
|
||||
}
|
||||
|
||||
if (Find<T>(child) is { } deeper)
|
||||
{
|
||||
return deeper;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.8 (owner request 2026-09-25): an anti-cheat game's page under the real dictionaries — the finding's card is
|
||||
/// rendered, and the Hooking card, whose switch could only be refused, is not while <c>ui.hide_anticheat_hooking</c> is
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Charts;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Infrastructure.Ipc;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// beta.11: Delete all sessions (owner decision D40) through the Agent, from the game page; and the charts across a game's
|
||||
/// sessions (D39) — the Sessions tab's overview, and the Trend's second metric and second unit.
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class SessionDeletionAndOverviewTests
|
||||
{
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
/// <summary>An Agent that answers DeleteSessions as scripted, and records what it was asked.</summary>
|
||||
private sealed class ScriptedAgent : IAgentRequests
|
||||
{
|
||||
public HelloAck? Hello => null;
|
||||
|
||||
public bool IsConnected { get; set; } = true;
|
||||
|
||||
public List<DeleteSessionsRequest> Asked { get; } = [];
|
||||
|
||||
public Func<DeleteSessionsRequest, Task<IpcEnvelope>> Answer { get; set; } = static r =>
|
||||
Task.FromResult(IpcCodec.Decode(IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, "1", new DeleteSessionsAck(r.GameId, 1, 2))));
|
||||
|
||||
public Task<IpcEnvelope> RequestAsync<TRequest>(string type, TRequest payload, CancellationToken ct = default)
|
||||
where TRequest : class
|
||||
{
|
||||
type.Should().Be(IpcMessageType.DeleteSessions);
|
||||
var request = (DeleteSessionsRequest)(object)payload;
|
||||
Asked.Add(request);
|
||||
return Answer(request);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Confirm(bool yes) : IConfirmations
|
||||
{
|
||||
public List<(string? Game, long Sessions)> Asked { get; } = [];
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(RemoveGameChoice.Cancel);
|
||||
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
Asked.Add((gameName, sessions));
|
||||
return Task.FromResult(yes);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Strip : IMessageStrip
|
||||
{
|
||||
public List<string> Lines { get; } = [];
|
||||
|
||||
public void Info(string title, string body) => Lines.Add("info:" + body);
|
||||
|
||||
public void Success(string title, string body) => Lines.Add("success:" + body);
|
||||
|
||||
public void Warn(string title, string body) => Lines.Add("warn:" + body);
|
||||
}
|
||||
|
||||
private sealed class Nav : IPageNavigator
|
||||
{
|
||||
public void Navigate<TPage>()
|
||||
where TPage : class
|
||||
{
|
||||
}
|
||||
|
||||
public void GoBack()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NoEdit : IEditGamePrompt
|
||||
{
|
||||
public Task<GameMetadata?> EditAsync(GameMetadata current, string? provenanceJson, CancellationToken ct = default) => Task.FromResult<GameMetadata?>(null);
|
||||
}
|
||||
|
||||
private sealed class NoSummaries : ISessionSummaryOpener
|
||||
{
|
||||
public void Open(long sessionId)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NoPicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => null;
|
||||
}
|
||||
|
||||
/// <summary>The summary windows, counting how often they were asked to close the deleted sessions' ones.</summary>
|
||||
private sealed class Windows : ISessionWindows
|
||||
{
|
||||
public int Asked { get; private set; }
|
||||
|
||||
public Task CloseDeletedAsync(CancellationToken ct = default)
|
||||
{
|
||||
Asked++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The scripted Agent deletes for real, as the Agent's repository would.</summary>
|
||||
private static Func<DeleteSessionsRequest, Task<IpcEnvelope>> DeletesFrom(ScratchLedger s) => async r =>
|
||||
{
|
||||
RetentionSweepResult gone = await s.Sessions.DeleteSessionsAsync(r.GameId, Ct).ConfigureAwait(false);
|
||||
return IpcCodec.Decode(IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, "1", new DeleteSessionsAck(r.GameId, gone.Games, gone.Sessions)));
|
||||
};
|
||||
|
||||
private sealed class NoPrompt : IConsentPrompt
|
||||
{
|
||||
public Task<bool> ShowAsync(string gameName, CancellationToken ct = default) => Task.FromResult(false);
|
||||
}
|
||||
|
||||
private static async Task<GameDetailViewModel> PageAsync(ScratchLedger s, long gameId, IConfirmations confirm, SessionDeletion? deletion, IMessageStrip strip,
|
||||
SessionSelection? selection = null)
|
||||
{
|
||||
var vm = new GameDetailViewModel(s.Library, new GameSelection { GameId = gameId }, new HookingConsent(new ScriptedAgent(), new NoPrompt()), new Nav(),
|
||||
confirm, new NoEdit(), strip, new NoSummaries(), new SessionSeriesLoader(s.Sessions),
|
||||
new Infrastructure.Persistence.SqliteHardwareSnapshotRepository(s.Db), selection ?? new SessionSelection(), new NoPicker(), deletion: deletion);
|
||||
Task pending = vm.Pending;
|
||||
await pending.ConfigureAwait(false);
|
||||
return vm;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheRequestSaysWhatTheAgentDidOrWhyNothingWasDeleted()
|
||||
{
|
||||
var agent = new ScriptedAgent();
|
||||
var deletion = new SessionDeletion(agent);
|
||||
|
||||
SessionDeletionResult done = await deletion.DeleteAsync(7, Ct);
|
||||
done.Should().Be(new SessionDeletionResult(SessionDeletionOutcome.Deleted, 1, 2));
|
||||
done.Message.Should().Contain("2");
|
||||
agent.Asked.Should().Equal(new DeleteSessionsRequest(7));
|
||||
|
||||
agent.Answer = static _ => throw new IpcRequestException(IpcErrorCode.SessionRunning, "running");
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.SessionRunning);
|
||||
|
||||
agent.Answer = static _ => throw new IpcRequestException(IpcErrorCode.UnknownType, "older agent");
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.AgentTooOld);
|
||||
|
||||
agent.IsConnected = false;
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.AgentUnavailable);
|
||||
agent.Asked.Should().HaveCount(3, "nothing is asked of an Agent that is not there");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The game page asks first and deletes nothing on a no; on a yes the Agent deletes, the page says so, reloads empty, and
|
||||
/// File ▸ Export no longer points at a session that is gone.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheGamePageAsksThenTheAgentDeletesAndThePageReloads()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
long first = await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-2));
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-1));
|
||||
|
||||
var strip = new Strip();
|
||||
var agent = new ScriptedAgent();
|
||||
GameDetailViewModel no = await PageAsync(s, game.Id, new Confirm(false), new SessionDeletion(agent), strip);
|
||||
await no.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
agent.Asked.Should().BeEmpty("a no deletes nothing");
|
||||
no.Sessions.Should().HaveCount(2);
|
||||
|
||||
agent.Answer = DeletesFrom(s);
|
||||
var confirm = new Confirm(true);
|
||||
var selection = new SessionSelection();
|
||||
selection.Set(first);
|
||||
GameDetailViewModel yes = await PageAsync(s, game.Id, confirm, new SessionDeletion(agent, s.Sessions, selection), strip, selection);
|
||||
await yes.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
|
||||
confirm.Asked.Should().Equal(("Alpha", 2L));
|
||||
agent.Asked.Should().Equal(new DeleteSessionsRequest(game.Id));
|
||||
yes.Sessions.Should().BeEmpty();
|
||||
yes.SessionsEmpty.Should().BeTrue();
|
||||
strip.Lines.Should().ContainSingle(static l => l.StartsWith("success:", StringComparison.Ordinal));
|
||||
selection.SessionId.Should().BeNull("an id that is gone can be reused by the next session");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// After a delete — from the game page or from Settings — SessionDeletion lets go of what still names a deleted session:
|
||||
/// File ▸ Export's selection (a session that is still there stays selected) and the summary windows. A refused delete
|
||||
/// touches neither.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AfterADeleteWhatNamedADeletedSessionLetsGoOfIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow alpha = await s.GameAsync("Alpha");
|
||||
GameRow beta = await s.GameAsync("Beta");
|
||||
long gone = await s.SessionAsync(alpha.Id, DateTimeOffset.UtcNow.AddHours(-2));
|
||||
long kept = await s.SessionAsync(beta.Id, DateTimeOffset.UtcNow.AddHours(-1));
|
||||
|
||||
var agent = new ScriptedAgent { Answer = DeletesFrom(s) };
|
||||
var selection = new SessionSelection();
|
||||
var windows = new Windows();
|
||||
var deletion = new SessionDeletion(agent, s.Sessions, selection, windows);
|
||||
|
||||
selection.Set(gone);
|
||||
(await deletion.DeleteAsync(alpha.Id, Ct)).Outcome.Should().Be(SessionDeletionOutcome.Deleted);
|
||||
selection.SessionId.Should().BeNull("Export would otherwise name a session that is gone, or the next one to take its id");
|
||||
windows.Asked.Should().Be(1, "the summary windows close the deleted sessions' ones");
|
||||
|
||||
selection.Set(kept);
|
||||
(await deletion.DeleteAsync(alpha.Id, Ct)).Outcome.Should().Be(SessionDeletionOutcome.Deleted);
|
||||
selection.SessionId.Should().Be(kept, "the other game's session is still there");
|
||||
windows.Asked.Should().Be(2);
|
||||
|
||||
agent.Answer = static _ => throw new IpcRequestException(IpcErrorCode.SessionRunning, "running");
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.SessionRunning);
|
||||
selection.SessionId.Should().Be(kept, "nothing was deleted");
|
||||
windows.Asked.Should().Be(2, "nothing was deleted");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// D39: the overview draws every hooked session's rate and lows; the Trend draws a ticked metric beside the selected
|
||||
/// one, a second unit on the right, and offers no third unit.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheOverviewAndTheTrendDrawSeveralMetricsTwoUnitsAtMost()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddDays(-2), native: 60);
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddDays(-1), native: 70);
|
||||
GameDetailViewModel vm = await PageAsync(s, game.Id, new Confirm(false), null, new Strip());
|
||||
|
||||
vm.OverviewVisible.Should().BeTrue();
|
||||
vm.OverviewLines.Should().NotBeEmpty().And.OnlyContain(static l => l.Unit == Strings.Trend_Unit_Fps && l.Points.Count == 2);
|
||||
vm.OverviewLines.Select(static l => l.Label).Should().NotContain(Strings.Trend_Metric_NativeFps,
|
||||
"no session generated frames, so Native would only repeat the Presented line");
|
||||
|
||||
vm.TrendLines.Should().ContainSingle("only the selected metric until another is ticked");
|
||||
TrendMetricOptionViewModel selected = vm.TrendExtras.Single(o => o.Metric == vm.TrendMetric);
|
||||
selected.IsEnabled.Should().BeFalse("the selected metric is not offered beside itself");
|
||||
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxGpuTemp).IsSelected = true;
|
||||
vm.TrendLines.Should().HaveCount(2);
|
||||
vm.TrendLines[1].Unit.Should().Be(Strings.Trend_Unit_Celsius);
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.AvgGpuPower).IsEnabled.Should().BeFalse("watts would be a third unit");
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.P1Low).IsEnabled.Should().BeTrue("a frame rate is the first unit");
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxCpuTemp).IsEnabled.Should().BeTrue("°C is already on the chart");
|
||||
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxGpuTemp).IsSelected = false;
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.AvgGpuPower).IsEnabled.Should().BeTrue("back to one unit");
|
||||
|
||||
// °C and a frame rate ticked, then the selected metric changed to watts: one of the two ticked units goes, so the
|
||||
// boxes name exactly the lines the chart draws.
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxGpuTemp).IsSelected = true;
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.P1Low).IsSelected = true;
|
||||
vm.TrendLines.Select(static l => l.Unit).Distinct(StringComparer.Ordinal).Should().HaveCount(2);
|
||||
vm.TrendMetric = TrendMetric.AvgGpuPower;
|
||||
vm.TrendLines.Select(static l => l.Unit).Distinct(StringComparer.Ordinal).Should().HaveCount(2, "the chart draws two units");
|
||||
vm.TrendLines[0].Unit.Should().Be(TrendSeriesBuilder.UnitOf(TrendMetric.AvgGpuPower));
|
||||
vm.TrendExtras.Count(static o => o.IsSelected).Should().Be(vm.TrendLines.Count - 1, "every ticked box has its line");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(TrendMetric.PresentedFps, "FPS")]
|
||||
[InlineData(TrendMetric.P01Low, "FPS")]
|
||||
[InlineData(TrendMetric.MaxGpuTemp, "°C")]
|
||||
[InlineData(TrendMetric.AvgGpuLoad, "%")]
|
||||
[InlineData(TrendMetric.DisplayBorderlessShare, "%")]
|
||||
[InlineData(TrendMetric.AvgGpuPower, "W")]
|
||||
[InlineData(TrendMetric.AvgRam, "MB")]
|
||||
public void EachMetricHasItsUnit(TrendMetric metric, string unit) => TrendSeriesBuilder.UnitOf(metric).Should().StartWith(unit);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public sealed class SettingsViewModelTests
|
||||
}
|
||||
|
||||
private static async Task<Harness> OpenAsync(ScratchLedger s, FakeAgentLink? agent = null, FakeRun? run = null, FakeMaintenance? maintenance = null, FakeTool? tool = null,
|
||||
IAgentAdminPrompt? adminPrompt = null)
|
||||
IAgentAdminPrompt? adminPrompt = null, IConfirmations? confirmations = null, SessionDeletion? deletion = null)
|
||||
{
|
||||
maintenance ??= new FakeMaintenance();
|
||||
tool ??= new FakeTool();
|
||||
@@ -144,12 +144,71 @@ public sealed class SettingsViewModelTests
|
||||
var shell = new ShellHost(new ServiceCollection().BuildServiceProvider(), null!, null!, closePolicy);
|
||||
// The instance-lock probe is the test's (never the real folder's): no Agent holds it, so a restart never waits.
|
||||
var vm = new SettingsViewModel(appearance, new NoTheme(), shell, settings, s.Library, new HookingConsent(agent, new NoPrompt()), agent, run, strip, maintenance, tool, closePolicy, firstRun,
|
||||
adminPrompt: adminPrompt, agentHeld: static () => false);
|
||||
adminPrompt: adminPrompt, agentHeld: static () => false, confirmations: confirmations, deletion: deletion);
|
||||
Task pending = vm.Pending;
|
||||
await pending.ConfigureAwait(false);
|
||||
return new Harness { Ledger = s, Settings = settings, Agent = agent, Run = run, Strip = strip, Vm = vm, Maintenance = maintenance, Tool = tool, ClosePolicy = closePolicy, FirstRun = firstRun };
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D40): Settings ▸ Data asks with the total, deletes nothing on a no, and deletes every game's through the Agent on a yes.</summary>
|
||||
[Fact]
|
||||
public async Task DeleteAllSessionsAsksWithTheTotalThenGoesThroughTheAgent()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow alpha = await s.GameAsync("Alpha");
|
||||
GameRow bravo = await s.GameAsync("Bravo");
|
||||
await s.SessionAsync(alpha.Id, DateTimeOffset.UtcNow.AddHours(-2));
|
||||
await s.SessionAsync(bravo.Id, DateTimeOffset.UtcNow.AddHours(-1));
|
||||
var confirm = new DeleteConfirm();
|
||||
var agent = new DeletingAgent(s);
|
||||
Harness h = await OpenAsync(s, confirmations: confirm, deletion: new SessionDeletion(agent));
|
||||
|
||||
await h.Vm.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
confirm.Asked.Should().Equal(((string?)null, 2L));
|
||||
agent.Asked.Should().BeEmpty("a no deletes nothing");
|
||||
|
||||
confirm.Answer = true;
|
||||
await h.Vm.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
agent.Asked.Should().Equal(new DeleteSessionsRequest(null));
|
||||
(await s.Sessions.SummariseByGameAsync(Ct)).Should().BeEmpty();
|
||||
(await s.Games.ListAsync(Ct)).Should().HaveCount(2, "the library stays");
|
||||
h.Vm.HasHookedGames.Should().BeFalse("no game has hooking on, so that card is not shown");
|
||||
}
|
||||
|
||||
private sealed class DeleteConfirm : IConfirmations
|
||||
{
|
||||
public bool Answer { get; set; }
|
||||
|
||||
public List<(string? Game, long Sessions)> Asked { get; } = [];
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(RemoveGameChoice.Cancel);
|
||||
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
Asked.Add((gameName, sessions));
|
||||
return Task.FromResult(Answer);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>An Agent that deletes in the scratch ledger as the real one does in its own.</summary>
|
||||
private sealed class DeletingAgent(ScratchLedger s) : IAgentRequests
|
||||
{
|
||||
public HelloAck? Hello => null;
|
||||
|
||||
public bool IsConnected => true;
|
||||
|
||||
public List<DeleteSessionsRequest> Asked { get; } = [];
|
||||
|
||||
public async Task<IpcEnvelope> RequestAsync<TRequest>(string type, TRequest payload, CancellationToken ct = default)
|
||||
where TRequest : class
|
||||
{
|
||||
var request = (DeleteSessionsRequest)(object)payload;
|
||||
Asked.Add(request);
|
||||
RetentionSweepResult gone = await s.Sessions.DeleteSessionsAsync(request.GameId, ct).ConfigureAwait(false);
|
||||
return IpcCodec.Decode(IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, "1", new DeleteSessionsAck(request.GameId, gone.Games, gone.Sessions)));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LoadsTheRegistrysEffectiveValuesAndWritesNothing()
|
||||
{
|
||||
|
||||
@@ -183,7 +183,7 @@ public sealed class AgentCommandHandlerTests : IAsyncDisposable
|
||||
var handler = new AgentCommandHandler(games, consent, guard, identity, orchestrator, pause, lifetime,
|
||||
_ => { h.RulesUpdates++; return ValueTask.FromResult("AlreadyCurrent"); },
|
||||
disclosureVersion, new FakeClock(), sweepRetention: sweep, architecture: architecture,
|
||||
exceptions: exceptions ? new AntiCheatExceptionCommands(option, _exceptionDisclosure) : null);
|
||||
exceptions: exceptions ? new AntiCheatExceptionCommands(option, _exceptionDisclosure) : null, deleteSessions: sessions);
|
||||
h = new Harness
|
||||
{
|
||||
Handler = handler,
|
||||
@@ -438,6 +438,47 @@ public sealed class AgentCommandHandlerTests : IAsyncDisposable
|
||||
payload.Reason.Should().NotBeNullOrEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): DeleteSessions deletes the Agent's own rows — one game's, or every game's — and answers
|
||||
/// the counts; a request with no payload is malformed; and nothing runs here, so nothing is refused for a recording.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task DeleteSessionsDeletesTheAgentsRowsAndAnswersTheCounts()
|
||||
{
|
||||
Harness h = await BuildAsync().ConfigureAwait(true);
|
||||
long game = h.Games.Rows[_exe].Id;
|
||||
foreach (long owner in new[] { game, game, game + 1 })
|
||||
{
|
||||
h.Sessions.Stored.Add(new FinalizedSession
|
||||
{
|
||||
Row = new SessionRow
|
||||
{
|
||||
SessionGuid = Guid.NewGuid(),
|
||||
GameId = owner,
|
||||
SnapshotId = 1,
|
||||
StartedAt = DateTimeOffset.UnixEpoch,
|
||||
EndedAt = DateTimeOffset.UnixEpoch.AddMinutes(1),
|
||||
QpcEpoch = 0,
|
||||
QpcFrequency = 1,
|
||||
Tier = Domain.Sessions.CaptureTier.Hooked,
|
||||
Mode = Domain.Sessions.CaptureMode.Attach,
|
||||
ExitStatus = Domain.Sessions.ExitStatus.Normal,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
IpcEnvelope one = await AskAsync(h.Handler, IpcMessageType.DeleteSessions, new DeleteSessionsRequest(game)).ConfigureAwait(true);
|
||||
IpcCodec.Payload<DeleteSessionsAck>(one).Should().Be(new DeleteSessionsAck(game, 1, 2));
|
||||
h.Sessions.Stored.Should().ContainSingle().Which.Row.GameId.Should().Be(game + 1);
|
||||
|
||||
IpcEnvelope all = await AskAsync(h.Handler, IpcMessageType.DeleteSessions, new DeleteSessionsRequest(null)).ConfigureAwait(true);
|
||||
IpcCodec.Payload<DeleteSessionsAck>(all).Should().Be(new DeleteSessionsAck(null, 1, 1));
|
||||
h.Sessions.Stored.Should().BeEmpty();
|
||||
|
||||
IpcEnvelope malformed = await AskAsync(h.Handler, IpcMessageType.DeleteSessions).ConfigureAwait(true);
|
||||
IpcCodec.Payload<ErrorAck>(malformed)!.Code.Should().Be(IpcErrorCode.Malformed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LaunchGameIsTheOrchestratorsAnswer()
|
||||
{
|
||||
|
||||
@@ -91,6 +91,19 @@ internal sealed class FakeSessionRepository : ISessionRepository
|
||||
public ValueTask<long> CountSinceAsync(DateTimeOffset since, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult((long)Stored.Count(s => s.Row.StartedAt >= since));
|
||||
|
||||
/// <summary>beta.11 (D40): every session of the game, or of every game, leaves the store.</summary>
|
||||
public ValueTask<RetentionSweepResult> DeleteSessionsAsync(long? gameId, CancellationToken ct = default)
|
||||
{
|
||||
List<FinalizedSession> gone = [.. Stored.Where(s => gameId is null || s.Row.GameId == gameId)];
|
||||
int games = gone.Select(static s => s.Row.GameId).Distinct().Count();
|
||||
foreach (FinalizedSession session in gone)
|
||||
{
|
||||
Stored.Remove(session);
|
||||
}
|
||||
|
||||
return ValueTask.FromResult(new RetentionSweepResult(games, gone.Count));
|
||||
}
|
||||
|
||||
/// <summary>D38: each game's successful sessions under its grant in force, as the tests say; a game not named has none.</summary>
|
||||
public Dictionary<long, int> SuccessfulUnderGrant { get; } = [];
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ public sealed class UserModeExceptionLapsePolicyTests
|
||||
.Should().BeNull("a session under no exception is never the exception's business");
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), ExitStatus.Crashed, _stored, inTrial: true)
|
||||
.Should().Be(UserModeExceptionLapse.SessionCrashed, "a more specific reason is said as itself, and still marks the trial failed");
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), ExitStatus.Crashed, _stored with { StoredHooked = false, FrameCount = 0 }, inTrial: true)
|
||||
.Should().Be(UserModeExceptionLapse.SessionCrashed, "a session too short to keep is not judged by its frames, but a crash while hooked still ends it");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -432,6 +432,7 @@ public sealed class CaptureOrchestratorTests
|
||||
|
||||
recorder.Requests.Should().ContainSingle("one session per executable, whatever id its entry has now");
|
||||
o.IsRecording(original.Id).Should().BeTrue();
|
||||
o.IsRecordingAny().Should().BeTrue("beta.11: what deleting every session waits for");
|
||||
log.Should().Contain(l => l.Contains("one at a time", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
|
||||
@@ -394,6 +394,45 @@ public sealed class SqliteSessionRepositoryTests
|
||||
accepted.AcceptedAt.Should().Be(DateTimeOffset.FromUnixTimeMilliseconds(1_700_000_000_000));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): Delete all sessions — one game's, then every game's — takes their segments, frame and
|
||||
/// sensor series with them (they cascade), leaves the other game's sessions until asked, and never a games row.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task DeletingSessionsTakesTheirSeriesAndLeavesTheGames()
|
||||
{
|
||||
await using LedgerFixture f = await LedgerFixture.OpenAsync();
|
||||
(long gameId, long snapshotId) = await SeedAsync(f);
|
||||
long other = (await new SqliteGameRepository(f.Db).EnsureAsync(new() { ExePath = @"C:\Games\Other\other.exe", SizeBytes = 1, MtimeUnixMs = 1 }, "O", Ct)).Id;
|
||||
var repo = new SqliteSessionRepository(f.Db);
|
||||
foreach (long owner in new[] { gameId, gameId, other })
|
||||
{
|
||||
await repo.InsertFinalizedAsync(new FinalizedSession
|
||||
{
|
||||
Row = Row(owner, snapshotId),
|
||||
Segments = [new SegmentRow { SwapchainId = 1, StartFrame = 0, EndFrame = 9 }],
|
||||
Frames = Frames(10),
|
||||
Sensors = [new SensorBlob { Series = "gpu_temp", Hz = 1, Codec = SeriesCodec.Tag, Data = SeriesCodec.EncodeFloat32([60f]) }],
|
||||
}, Ct);
|
||||
}
|
||||
|
||||
(await repo.DeleteSessionsAsync(gameId, Ct)).Should().Be(new RetentionSweepResult(1, 2));
|
||||
(await repo.ListByGameAsync(gameId, 10, Ct)).Should().BeEmpty();
|
||||
(await repo.ListByGameAsync(other, 10, Ct)).Should().ContainSingle("only the game asked for");
|
||||
(await CountAsync(f, "frame_blobs")).Should().Be(1, "the series went with their sessions");
|
||||
(await CountAsync(f, "sensor_blobs")).Should().Be(1);
|
||||
(await CountAsync(f, "session_segments")).Should().Be(1);
|
||||
|
||||
(await repo.DeleteSessionsAsync(null, Ct)).Should().Be(new RetentionSweepResult(1, 1));
|
||||
(await CountAsync(f, "sessions")).Should().Be(0);
|
||||
(await CountAsync(f, "frame_blobs")).Should().Be(0);
|
||||
(await CountAsync(f, "games")).Should().Be(2, "the library stays");
|
||||
(await repo.DeleteSessionsAsync(null, Ct)).Should().Be(new RetentionSweepResult(0, 0));
|
||||
}
|
||||
|
||||
private static Task<long> CountAsync(LedgerFixture f, string table) =>
|
||||
f.Db.ReadAsync((c, ct) => c.ExecuteScalarAsync<long>(new CommandDefinition("SELECT COUNT(*) FROM " + table, cancellationToken: ct)), Ct).AsTask();
|
||||
|
||||
/// <summary>
|
||||
/// D38 (owner decision 2026-10-03): a grant's trial counts its own sessions — hooked under that family, from the grant on,
|
||||
/// frames recorded, <c>normal</c> — and nothing else: a crash, a safety unhook, a degraded or Tier-2 session, one that
|
||||
|
||||
Reference in new issue
Block a user