Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 1c51cf3d0d fix(app): every list of choices, the tray's menu and the Agent pill follow a change of language at once (beta.15 PR-1)
From the beta.14 audit (chip, owner: fold the five into beta.15). A change of language rebuilds the window and its
pages, so their own text followed; two kinds did not, until a restart:

- Lists of choices built once in a static and bound with x:Static: Settings' Themes and UpdateChannels (D47's
  "Automatic (Beta)" label too), Logs' Sources and Levels, Games' Sorts. They are instance properties now, bound through
  the view model - built per page, in the language the page opens in (GameDetail's TrendMetrics has worked that way
  since beta.8). Languages stays static: each language in its own words, the same in every language.
- Singletons that outlive the rebuilt window: the tray's menu and tooltip (TrayHost) and the Agent pill and update
  banner (MainWindowViewModel). Both implement ILanguageFollower; ShellHost.Rebuild calls every registered follower once
  the new window is up. The shell's registrations moved to App.AddShell (MA0051).

Tests: LanguageFollowingTests (no view model may keep a static list of labelled choices but the languages - red on the
five lists before), SettingsViewModelTests / GamesViewModelTests / GameDetailViewModelTests (a page opened in Vietnamese
lists Vietnamese choices; the trend selector pinned for the first time), TrayHostTests (the menu relabelled, now in the
strings-culture collection).

Docs: 09_I18N (runtime switching), CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 05:13:24 +07:00
poli0981andClaude Opus 5.5 68f115d57d release: 0.1.0-beta.14 - CHANGELOG section with how to update from beta.13, release lines, HANDOFF train section and owner-only item 11 (beta.14 PR-9) (#272)
VERSION stays 0.1.0: the tag's numeric core. The tag waits for the owner's confirmation, and PR-5 / PR-7 for the owner's
approval of the Privacy Policy 2.7 wording.

"Updating from 0.1.0-beta.13" says the three things a beta.13 user must do differently: choose Beta first (beta.13's
default stable channel finds no pre-release), update with no game running (beta.13 still auto-applies at start), and that
schema 0019 cannot be opened by an earlier version.



docs(handoff): two more traps of the beta.14 train - the 31-character build id ten commits after a tag, and the hosted runner that was never acquired (beta.14 PR-9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 05:12:48 +07:00
23 changed files with 373 additions and 32 deletions

No files matched your search

+36
View File
@@ -28,6 +28,42 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Fixed
- **After a change of language some text stayed in the old one** until FrameLedger restarted: the theme and update-channel
lists in Settings, the log and level lists on the Logs page, the sort order on the Games page, the tray icon's menu and
the Agent's status in the title bar. They follow the language at once now.
## [0.1.0-beta.14] - 2026-10-06
**The fourteenth pre-release: a wheel that scrolls, updates that find this channel and wait for your games, crashes told
apart from memory reports, and new measurements.** The same unsigned installer: verify its hash against
`SHA256SUMS.txt`, then *More info → Run anyway*. What changed for a user:
- **The mouse wheel scrolls every page, dialog and chart**; over a chart the wheel scrolls the page and **Ctrl+wheel**
zooms the chart. **Settings ▸ Window ▸ Hide scroll bars** draws no bar and still scrolls. The import list is readable
in the dark theme.
- **Updates come from the channel of the copy you run** — a beta looks for betas — and are never applied on their own
when the App starts; restarting to update waits while a game FrameLedger measured is still running, and says so.
- **A game that crashed reads *crashed*, and only then**: a Windows memory report about a game no longer counts as a
crash, and an Unreal Engine game that opens its crash reporter and closes is recorded as crashed, the reporter named.
- **A game starting up or closing during FrameLedger's anti-cheat check** is read again once instead of refused, and a
check that could not read a game that had already closed ends the session as the game's own exit.
- **New in every session's summary**: time below 30 and 60 FPS and below the monitor's refresh rate, how even the frames
were, VSync and tearing, the graphics card's clocks, fan and memory temperature, how much of the time its power limit
or heat held it back (NVIDIA), frames per watt, and a render scale chart. Trend and Compare have them too.
- **FrameLedger's own programs say what they are** in Explorer and Task Manager (*FrameLedger Agent*).
**Updating from `0.1.0-beta.13`:**
1. **First choose *Beta* in Settings ▸ Updates.** beta.13 looks for stable releases by default, and every release so far
is a pre-release, so it finds nothing until you do. From beta.14 on the channel follows the copy you run.
2. **Update with no game running.** beta.13 still applies a downloaded update the next time the App starts, stopping the
Agent to do it; beta.14 no longer does.
3. **The database is migrated in place** (schema 0019, new columns only). An earlier version cannot open it afterwards.
4. Sessions already stored keep their status — a few may still read *crashed* because Windows logged a memory report
about the game. The Privacy Policy (version 2.7) is shown once for you to accept.
### Added
- **Settings ▸ Window ▸ Hide scroll bars.** No scroll bar is drawn anywhere in the app while it is on, and everything
+1 -1
View File
@@ -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.13.*
*Beta software: this page describes version 0.1.0-beta.14.*
## Games it will not measure
+3 -3
View File
@@ -10,7 +10,7 @@ anti-cheat, and look after your data, a page each. What FrameLedger cannot do is
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.14`** (2026-10-06), 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
@@ -161,7 +161,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
## Install
> **The latest pre-release is `v0.1.0-beta.13` (2026-10-04); before it `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
> **The latest pre-release is `v0.1.0-beta.14` (2026-10-06); before it `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
@@ -208,4 +208,4 @@ GPU telemetry is layered so the project never depends on a proprietary vendor li
---
**Status:** pre-release (beta). Thirteen tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
**Status:** pre-release (beta). Fourteen 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.
+6
View File
@@ -17,6 +17,12 @@ Languages: **en** (neutral/default) · **vi** · **ja**. Same `.resx` pattern as
- One `Strings.resx` (+ `Strings.vi.resx`, `Strings.ja.resx`) per assembly that has user-visible text (`App`, `Shared` ~~for error codes~~ for the safety family, the `Safety_*` keys — corrected 2026-10-04). Access through a generated strongly-typed class; **no string literals in XAML/C# for user-visible text** (analyzer TODO: Meziantou MA0011/manual review in PR checklist). **As built (P3 PR-2, 2026-09-13):** the class is `Strings.Designer.cs`, written by `tools/resx-gen.ps1 -Resx <file>` and **committed** — not the SDK's `ResXFileCodeGenerator`, which the SDK-style WPF project does not run — with `Culture`, `ResourceManager`, `Keys`, and one property per key; the audit below fails when it is stale. The first family is `src/FrameLedger.App/Strings.resx` (65 keys); `Shared`'s arrives with PR-4's `Safety_*` text, because an empty family is what the audit refuses.
- XAML binding via `{x:Static res:Strings.Key}` ~~plus a `LocalizeExtension` for the few dynamic cases~~ *(corrected 2026-10-04: no `LocalizeExtension` exists; text that varies is composed in the view model from `Strings.*`)*.
- **Runtime switching:** setting change → set `CultureInfo.CurrentUICulture` + `Thread` defaults → re-create the main window shell (cheap; state preserved via VM). Persist in `settings`.
**Two kinds of text did not follow, until beta.15:** a list of choices built once in a static (Settings' themes and update
channels, the Logs page's two lists, the Games page's sort order — `x:Static` read the list built in the language the
App started in), and the singletons that outlive the rebuilt window (the tray's menu, the title bar's Agent pill and the
update banner). The lists are per page now, bound through the view model; the singletons implement
`ILanguageFollower`, which `ShellHost.Rebuild` calls once the new window is up. `LanguageFollowingTests` refuses a new
static list of labelled choices — the language list, each language in its own words, is the one exception.
- `SatelliteResourceLanguages` = `en;vi;ja` in ~~the App csproj~~ `Directory.Build.props` (corrected 2026-10-04) to keep publish size down.
## Key conventions
+75 -1
View File
@@ -1869,7 +1869,7 @@ PR-7 the release.*
**Owner-only, added to the list below:** item 9.
## **START HERE** — 2026-10-04, the beta.13 train: the four follow-ups the beta.12 audit left
## ~~**START HERE**~~ — 2026-10-04, the beta.13 train: the four follow-ups the beta.12 audit left *(struck 2026-10-06: the head is §beta.14 below)*
*Status is `CHANGELOG.md` `[0.1.0-beta.13]`; this is what no other file carries. The owner asked (2026-10-04) for the
four chips the beta.12 documentation audit had left — §S23-3's wording, the App tests' culture races, L1's adapter, the
@@ -1904,6 +1904,69 @@ than N/A (`FlShmHandshake.AdapterLuid`'s own comment), and a finding on the PC i
**Owner-only, added to the list below:** item 10.
## **START HERE** — 2026-10-06, the beta.14 train: contrast and the wheel, the update audit, crash reporters, assembly metadata, new measurements
*Status is `CHANGELOG.md` `[0.1.0-beta.14]`; this is what no other file carries. The owner's list (2026-10-05, with a
screenshot of the import list in the dark theme): the contrast, a review of the update logic, games recorded as crashed
by an engine's crash reporter (prevention; SILENT HILL 2 as the example), assembly metadata, new metrics and charts, and
a wheel that scrolls with an option to hide the scroll bars. Nine stacked PRs — PR-1 contrast and the wheel, PR-2 the
scroll-bar option, PR-3 the update audit, PR-4 the guard's retry, PR-5 crash classification, PR-6 assembly metadata,
PR-7 the metrics' Agent half (schema 0019), PR-8 their App half, PR-9 the release — plus one test fix (#268).*
**Decisions (owner, 2026-10-05, asked before the plan — do not re-ask):**
- **D47 — the update channel follows the running copy.** `update.channel` gained `auto`, the default: a pre-release
copy asks for pre-releases, a stable one for stable; an explicit *Stable* or *Beta* in Settings wins
(`Update/UpdateChannelPolicy`). Until beta.14 the default was `stable` and every release is a pre-release, so an
installed copy never found an update (the owner's own `velopack` log: "No releases found").
- **D48 — the guard's narrow fix, both halves.** A scan-set member still loading (`ERROR_PARTIAL_COPY`) or already gone
is read again once, ~250 ms later, before the guard refuses; still unreadable still refuses, and `ACCESS_DENIED` is
never retried. A refused re-scan for a could-not-read reason (`ProcessUnreadable`, `ModuleScanFailed`,
`ProcessTreeUnavailable` — never a finding) when the game itself had exited ends as the game's exit
(`ExitScanRelabel`, the note `scan_at_exit=`). CLAUDE.md rule 2 is unchanged: a failure still refuses.
- **D49 — all four metric groups.** The render scale over time; time below 30 / 60 / the refresh rate and frame to frame;
the facts the row stored and nothing showed (VSync and tearing, ray tracing's share, focus, capture quality, the
displayed 1 % low); the card's clocks, fan, memory temperature, limits, and frames per watt.
- **D50 — the managed binaries' identity.** Company and Product "FrameLedger", the copyright the native `FL_COPYRIGHT`
word for word; `versioninfo-check` reads both kinds and compares them.
**Traps met on the way:**
- **WPF UI 4.3.0 keys its DataGrid styles** (`DefaultDataGridRowStyle`) and defines no implicit row style: a `RowStyle`
`BasedOn="{StaticResource {x:Type DataGridRow}}"` falls through to Aero2's row and `SystemColors.WindowBrush` — white
under the dark theme's white text. Its `CheckBox` has `MinWidth` 120. Both in `16_WPFUI_SYNTAX` §Gotchas now.
- **`NavigationViewContentPresenter` makes a `Page`'s `CanContentScroll` true and wraps it in its own scroller**; a page's
own root `ScrollViewer` is then measured unbounded, has nothing to scroll, and still marks every wheel handled. ScottPlot
never marks the wheel handled.
- **`Keyboard.Modifiers` is the machine's real keyboard, from any thread** (a fresh background thread's `GetKeyState`
reported the machine's NumLock): a local gate went red on the chart-wheel test while a Ctrl was held. A test that sends
input sets the keys itself (`ChartWheel.CurrentModifiers`, #268).
- **Velopack 1.2.0 applies a downloaded update at the next start by default** (`SetAutoApplyOnStartup`), before FR-12's
check and with the Agent killed; `VelopackHooks` turns it off and a pending package is adopted instead.
- **The plain "time below X" rule fabricates drops**: a game capped at 60 read 50.0 % "below 60" from present-timing
jitter (measured on a copy of the owner's ledger); a rolling mean does not help. The margins of `FramePacing` and what
they cost are in `03_METRICS` §Pacing.
- **A WER 1001 is not a crash by its number**: `RADAR_PRE_LEAK_64` is Windows' memory-leak detector, and a substring match
on the executable's name stored an ordinary The Witcher 3 session as crashed. `CrashEventMatcher` reads the event name
and the typed process id.
- **No chart palette colour was 60 apart from all six on the temperatures plot** — `Chart_Histogram` equals
`Chart_Native` — so the seventh line got a key of its own (`Chart_SensorTertiary`); `ChartMathTests` caught it.
- **Meziantou's MA0051 (60 lines, 40 statements) split** `FrameTimeSeries`'s two builders into one `Kept` accumulator,
the summary's cards into three methods and Compare's rows into two; `dotnet format` wants one property per line in an
object initializer, even in a test.
- **The `fl_ring` anti-vacuity flake** (§Traps) fired on #264's CI and passed on the re-run, as written.
- **`git describe` is 31 characters ten commits after a tag** (`v0.1.0-beta.13-10-g15ec7c1c5fd4`) — the most
`FlShmHandshake.buildId` holds. `ShmHandshakeValidatorTests` appended `"x"` to the id for its mismatch case, the helper
cut it back to 31, and the check read `Ok`: red from the tenth commit after every tag, locally and on CI (#273 uses
another id of the same length).
- **"The job was not acquired by Runner of type hosted even after multiple attempts"**: with seven CI runs in flight a
queued Windows job was cancelled after ~15 minutes, twice, without a step having run. Nothing in the code; re-run the
job when fewer runs are queued.
- **The Privacy Policy 2.7 holds the merge of PR-5 and PR-7**: their wording (§4 the crash reports and the programs a
game starts, §1 the card's sensor series) is the owner's to approve before they land, as the plan said.
**Owner-only, added to the list below:** item 11.
## Owner-only — no PR can close these
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
@@ -1968,6 +2031,17 @@ than N/A (`FlShmHandshake.AdapterLuid`'s own comment), and a finding on the PC i
running for any game, start a hook-enabled game — the notice says the anti-cheat is running on this PC, not in
the game. (c) **Two graphics cards**, if a machine with them is at hand: the Sensors chart's GPU figures are the
game's card. (d) The `ja` review of the new safety strings, with the others still marked for it.
11. **beta.14 on real hardware.** (a) **The update from beta.13:** choose *Beta* in Settings ▸ Updates, Help ▸ Check for
updates, then *Restart to update* with no game running; Settings then reads *Automatic (Beta)*. The `velopack:` lines
in `ui-*.log` say what was downloaded — a delta of about 2 MB; say so if it was the full package. (b) **Explorer ▸
Properties ▸ Details** of `FrameLedger.exe` and `FrameLedger.Agent.exe` name FrameLedger and the copyright; Task Manager
lists *FrameLedger Agent*. (c) **The wheel** on every page, the dialogs and the summary window; over a chart the wheel
scrolls the page and Ctrl+wheel zooms; the Logs page follows the newest line. (d) **Hide scroll bars** on and off,
without a restart. (e) **The import list in the dark theme**, and Compare's tick boxes. (f) **A crash**: an Unreal game
that crashes reads *crashed (… CrashReportClient.exe)*; The Witcher 3 closed normally no longer reads *crashed*. (g)
**The new measurements** on the RTX 5080: the VSync share against the game's own VSync setting, the render scale
against the DLSS mode, the clocks, fan and limits. (h) The `ja` strings marked `review`. (i) **The Privacy Policy 2.7
wording — before PR-5 and PR-7 merge.**
**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
+1 -1
View File
@@ -12,7 +12,7 @@
HTML comments are not part of the block.
-->
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.14`** (2026-10-06), 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
+1 -1
View File
@@ -114,7 +114,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
<!-- accuracy-block:begin -->
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
> **pre-release is `0.1.0-beta.13`** (2026-10-04), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.14`** (2026-10-06), 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
+18 -8
View File
@@ -291,14 +291,7 @@ public partial class App : System.Windows.Application
AddLibrary(builder.Services);
// The shell: the window is TRANSIENT because a language change rebuilds it (09_I18N §Mechanics); the
// shell host tracks the live one. Pages and their view models are transient (16 §Navigation).
builder.Services.AddSingleton<ShellHost>();
builder.Services.AddSingleton<IShellPresence>(static sp => sp.GetRequiredService<ShellHost>());
builder.Services.AddSingleton<TrayViewModel>();
builder.Services.AddSingleton<TrayHost>();
builder.Services.AddTransient<MainWindow>();
builder.Services.AddSingleton<MainWindowViewModel>();
AddShell(builder.Services);
builder.Services.AddTransient<DashboardPage>();
builder.Services.AddTransient<DashboardViewModel>();
builder.Services.AddTransient<GamesPage>();
@@ -315,6 +308,23 @@ public partial class App : System.Windows.Application
return builder.Build();
}
/// <summary>
/// The shell: the window is TRANSIENT because a language change rebuilds it (09_I18N §Mechanics); the shell host tracks
/// the live one. Pages and their view models are transient (16 §Navigation). The singletons that wrote their text once
/// read it again after a change of language (beta.15, <see cref="ILanguageFollower"/>, called by ShellHost.Rebuild).
/// </summary>
private static void AddShell(IServiceCollection services)
{
services.AddSingleton<ShellHost>();
services.AddSingleton<IShellPresence>(static sp => sp.GetRequiredService<ShellHost>());
services.AddSingleton<TrayViewModel>();
services.AddSingleton<TrayHost>();
services.AddTransient<MainWindow>();
services.AddSingleton<MainWindowViewModel>();
services.AddSingleton<ILanguageFollower>(static sp => sp.GetRequiredService<TrayHost>());
services.AddSingleton<ILanguageFollower>(static sp => sp.GetRequiredService<MainWindowViewModel>());
}
/// <summary>The Agent over the pipe (07_IPC §Client behavior): connect, start it when it is not there, tell the shell.</summary>
private static void AddAgentLink(IServiceCollection services)
{
+1 -1
View File
@@ -38,7 +38,7 @@
<ComboBox Grid.Column="2" MinWidth="150" Margin="0,0,12,0" VerticalAlignment="Center"
AutomationProperties.Name="{x:Static res:Strings.A11y_Games_Sort}"
DisplayMemberPath="Label"
ItemsSource="{x:Static vm:GamesViewModel.Sorts}"
ItemsSource="{Binding ViewModel.Sorts}"
SelectedValue="{Binding ViewModel.Sort, Mode=TwoWay}"
SelectedValuePath="Value" />
<!-- The view switch: the one button shown is the other view. -->
+2 -2
View File
@@ -25,14 +25,14 @@
Margin="0,0,8,4"
AutomationProperties.Name="{x:Static res:Strings.A11y_Logs_Source}"
DisplayMemberPath="Label"
ItemsSource="{x:Static vm:LogsViewModel.Sources}"
ItemsSource="{Binding ViewModel.Sources}"
SelectedValue="{Binding ViewModel.Source, Mode=TwoWay}"
SelectedValuePath="Value" />
<ComboBox MinWidth="170"
Margin="0,0,8,4"
AutomationProperties.Name="{x:Static res:Strings.A11y_Logs_Level}"
DisplayMemberPath="Label"
ItemsSource="{x:Static vm:LogsViewModel.Levels}"
ItemsSource="{Binding ViewModel.Levels}"
SelectedValue="{Binding ViewModel.Level, Mode=TwoWay}"
SelectedValuePath="Value" />
<ui:TextBox MinWidth="220"
+2 -2
View File
@@ -268,7 +268,7 @@
<ComboBox MinWidth="180"
AutomationProperties.Name="{x:Static vm:SettingsViewModel.ThemeLabel}"
DisplayMemberPath="Label"
ItemsSource="{x:Static vm:SettingsViewModel.Themes}"
ItemsSource="{Binding ViewModel.Themes}"
SelectedValue="{Binding ViewModel.SelectedTheme, Mode=TwoWay}"
SelectedValuePath="Value" />
</ui:CardControl>
@@ -340,7 +340,7 @@
<ComboBox MinWidth="140"
AutomationProperties.Name="{x:Static res:Strings.Settings_UpdateChannel_Label}"
DisplayMemberPath="Label"
ItemsSource="{x:Static vm:SettingsViewModel.UpdateChannels}"
ItemsSource="{Binding ViewModel.UpdateChannels}"
SelectedValue="{Binding ViewModel.UpdateChannel, Mode=TwoWay}"
SelectedValuePath="Value" />
</ui:CardControl>
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.App.Services;
/// <summary>
/// A long-lived piece of the UI that read its text when it was made and must read it again after a language change
/// (beta.15). A language change rebuilds the window and its pages (<see cref="ShellHost.Rebuild"/>), so everything transient
/// follows on its own; a singleton — the tray's menu, the title bar's Agent pill — kept the language it started in until
/// its state next changed. <see cref="ShellHost.Rebuild"/> calls every registered follower once the new window is up.
/// </summary>
public interface ILanguageFollower
{
/// <summary>Reads every text again in the current UI culture. Called on the UI thread.</summary>
void FollowLanguage();
}
+8 -1
View File
@@ -71,12 +71,19 @@ public sealed class ShellHost(IServiceProvider services, INavigationService navi
/// <summary>The page the shell will open on, kept across a rebuild.</summary>
public void Remember(Type page) => _page = page;
/// <summary>A new window in the current UI culture; the old one closes after the new one is up.</summary>
/// <summary>
/// A new window in the current UI culture; the old one closes after the new one is up. The long-lived pieces that
/// read their text once — the tray's menu, the Agent pill — read it again (<see cref="ILanguageFollower"/>, beta.15).
/// </summary>
public void Rebuild()
{
MainWindow? old = _current;
Show();
old?.Close();
foreach (ILanguageFollower follower in services.GetServices<ILanguageFollower>())
{
follower.FollowLanguage();
}
}
public Window? Current => _current;
+36 -4
View File
@@ -15,12 +15,16 @@ namespace FrameLedger.App.Services;
/// and tooltip follow the state, the context menu is the four items, a left click opens the window, and the
/// FR-3.8 balloon's click opens the saved session. Created once the shell is up, on the UI thread.
/// </summary>
public sealed class TrayHost : IDisposable
public sealed class TrayHost : IDisposable, ILanguageFollower
{
private readonly TrayViewModel _viewModel;
private readonly WindowClosePolicy _policy;
private TaskbarIcon? _icon;
private System.Drawing.Icon? _image;
private MenuItem? _open;
private MenuItem? _pause;
private MenuItem? _status;
private MenuItem? _exit;
public TrayHost(TrayViewModel viewModel, WindowClosePolicy policy)
{
@@ -40,12 +44,16 @@ public sealed class TrayHost : IDisposable
try
{
var menu = new ContextMenu();
menu.Items.Add(new MenuItem { Header = Strings.Tray_Open, Command = _viewModel.OpenCommand });
_open = new MenuItem { Header = Strings.Tray_Open, Command = _viewModel.OpenCommand };
menu.Items.Add(_open);
var pause = new MenuItem { Header = _viewModel.PauseText, Command = _viewModel.TogglePauseCommand };
_pause = pause;
menu.Items.Add(pause);
menu.Items.Add(new MenuItem { Header = Strings.Tray_AgentStatus, Command = _viewModel.AgentStatusCommand });
_status = new MenuItem { Header = Strings.Tray_AgentStatus, Command = _viewModel.AgentStatusCommand };
menu.Items.Add(_status);
menu.Items.Add(new Separator());
menu.Items.Add(new MenuItem { Header = Strings.Tray_Exit, Command = _viewModel.ExitCommand });
_exit = new MenuItem { Header = Strings.Tray_Exit, Command = _viewModel.ExitCommand };
menu.Items.Add(_exit);
_image = TrayIcons.For(_viewModel.State);
var icon = new TaskbarIcon
@@ -111,6 +119,30 @@ public sealed class TrayHost : IDisposable
_image = null;
}
/// <summary>
/// The menu and the tooltip in the current language (beta.15): they were written once, when the icon was made, and a
/// change of language left them in the first one. Nothing before the icon exists.
/// </summary>
public void FollowLanguage()
{
if (_icon is null || _open is null || _pause is null || _status is null || _exit is null)
{
return;
}
_open.Header = Strings.Tray_Open;
_pause.Header = _viewModel.PauseText;
_status.Header = Strings.Tray_AgentStatus;
_exit.Header = Strings.Tray_Exit;
_icon.ToolTipText = _viewModel.Tooltip;
}
/// <summary>The menu's items as shown, in order, for a test; empty before the icon exists.</summary>
internal IReadOnlyList<string> MenuHeaders =>
_open is null || _pause is null || _status is null || _exit is null
? []
: [.. new[] { _open, _pause, _status, _exit }.Select(static m => m.Header as string ?? string.Empty)];
private void OnViewModelChanged(MenuItem pause, PropertyChangedEventArgs e)
{
if (_icon is null)
@@ -89,7 +89,8 @@ public sealed partial class GamesViewModel : ObservableObject
public static string ListText => Strings.Games_View_List;
public static IReadOnlyList<Choice<GamesSort>> Sorts { get; } =
/// <summary>The sort orders, labelled in the language this page opened in (beta.15: a static list kept the first language).</summary>
public IReadOnlyList<Choice<GamesSort>> Sorts { get; } =
[
new(GamesSort.Name, Strings.Games_Sort_Name),
new(GamesSort.LastPlayed, Strings.Games_Sort_LastPlayed),
@@ -63,13 +63,14 @@ public sealed partial class LogsViewModel : ObservableObject, IDisposable
public static string Header => Strings.Logs_Header;
public static IReadOnlyList<Choice<LogSource>> Sources { get; } =
/// <summary>The two logs, labelled in the language this page opened in (beta.15: a static list kept the first language).</summary>
public IReadOnlyList<Choice<LogSource>> Sources { get; } =
[
new(LogSource.Ui, Strings.Logs_Source_Ui),
new(LogSource.Agent, Strings.Logs_Source_Agent),
];
public static IReadOnlyList<Choice<LogLevelFilter>> Levels { get; } =
public IReadOnlyList<Choice<LogLevelFilter>> Levels { get; } =
[
new(LogLevelFilter.All, Strings.Logs_Level_All),
new(LogLevelFilter.WarningAndAbove, Strings.Logs_Level_Warning),
@@ -18,7 +18,7 @@ using Wpf.Ui.Controls;
namespace FrameLedger.App.ViewModels;
/// <summary>The shell's state: the Agent pill, the offline banner, and the menu commands that exist in this build.</summary>
public sealed partial class MainWindowViewModel : ObservableObject, IDisposable
public sealed partial class MainWindowViewModel : ObservableObject, IDisposable, ILanguageFollower
{
private readonly AgentConnection _agent;
private readonly ISnackbarService _snackbar;
@@ -124,6 +124,16 @@ public sealed partial class MainWindowViewModel : ObservableObject, IDisposable
[RelayCommand]
private Task RestartToUpdateAsync() => _updates.RestartToUpdateAsync();
/// <summary>
/// The Agent pill, its banner and the update banner in the current language (beta.15): this view model outlives a
/// rebuilt window, and its texts were read at the last change of state.
/// </summary>
public void FollowLanguage()
{
Refresh();
RefreshUpdate();
}
private void Refresh()
{
(string text, ControlAppearance appearance) = AgentStatusPresentation.Pill(_agent.State);
@@ -196,13 +196,18 @@ public sealed partial class SettingsViewModel : ObservableObject
public static string LanguageLabel => Strings.Settings_Language_Label;
public static IReadOnlyList<Choice<AppTheme>> Themes { get; } =
/// <summary>
/// The themes, labelled in the language this page opened in (beta.15): a static list kept the language the App started
/// in after a change of language, while the rest of the rebuilt page followed it.
/// </summary>
public IReadOnlyList<Choice<AppTheme>> Themes { get; } =
[
new(AppTheme.System, Strings.Settings_Theme_System),
new(AppTheme.Light, Strings.Settings_Theme_Light),
new(AppTheme.Dark, Strings.Settings_Theme_Dark),
];
/// <summary>Each language in its own words, so the same in every language: the one list that may stay static.</summary>
public static IReadOnlyList<Choice<string>> Languages { get; } =
[
new("en", "English"),
@@ -212,9 +217,10 @@ public sealed partial class SettingsViewModel : ObservableObject
/// <summary>
/// D47 (beta.14): Automatic first, its label saying what it resolves to for this copy — "Automatic (Beta)" on a
/// pre-release — then the two explicit choices, either of which wins over the copy.
/// pre-release — then the two explicit choices, either of which wins over the copy. Per page since beta.15, so the
/// labels follow a change of language.
/// </summary>
public static IReadOnlyList<Choice<string>> UpdateChannels { get; } =
public IReadOnlyList<Choice<string>> UpdateChannels { get; } =
[
new(Update.UpdateChannelPolicy.Automatic, string.Format(CultureInfo.CurrentCulture, Strings.Settings_Channel_Auto_Format,
Update.UpdateChannelPolicy.IsPrerelease(UiIdentity.Version) ? Strings.Settings_Channel_Beta : Strings.Settings_Channel_Stable)),
@@ -953,4 +953,27 @@ public sealed class GameDetailViewModelTests
(await BuildAsync(s, without.Id)).Vm.AnyLatency.Should().BeFalse();
(await BuildAsync(s, with.Id)).Vm.AnyLatency.Should().BeTrue();
}
/// <summary>beta.8 made the trend selector per page; beta.15 pins it: a page opened in Vietnamese lists Vietnamese metrics.</summary>
[Fact]
public async Task TheTrendSelectorIsInTheLanguageThePageOpenedIn()
{
CultureInfo? previous = Strings.Culture;
try
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
GameRow game = await s.GameAsync("Alpha");
Strings.Culture = CultureInfo.GetCultureInfo("en");
string english = Strings.Trend_Metric_PresentedFps;
(GameDetailViewModel en, _, _, _, _) = await BuildAsync(s, game.Id);
Strings.Culture = CultureInfo.GetCultureInfo("vi");
(GameDetailViewModel vi, _, _, _, _) = await BuildAsync(s, game.Id);
en.TrendMetrics[0].Label.Should().Be(english);
vi.TrendMetrics[0].Label.Should().Be(Strings.Trend_Metric_PresentedFps).And.NotBe(english);
}
finally
{
Strings.Culture = previous;
}
}
}
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.IO;
using FluentAssertions;
using FrameLedger.App.Controls;
@@ -131,4 +132,31 @@ public sealed class GamesViewModelTests
((columns * item) + ((columns - 1) * 12)).Should().BeApproximately(width, 0.001, "a row fills the width");
}
}
/// <summary>beta.15: the sort order is labelled in the language the page opened in.</summary>
[Fact]
public async Task TheSortListIsInTheLanguageThePageOpenedIn()
{
CultureInfo? previous = Strings.Culture;
try
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
var selection = new GameSelection();
var nav = new NoNavigation();
GamesViewModel Open() => new(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, new NoStrip()));
Strings.Culture = CultureInfo.GetCultureInfo("en");
GamesViewModel english = Open();
string englishName = Strings.Games_Sort_Name;
Strings.Culture = CultureInfo.GetCultureInfo("vi");
GamesViewModel vietnamese = Open();
await english.Pending;
await vietnamese.Pending;
english.Sorts[0].Label.Should().Be(englishName);
vietnamese.Sorts[0].Label.Should().Be(Strings.Games_Sort_Name).And.NotBe(englishName);
}
finally
{
Strings.Culture = previous;
}
}
}
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Reflection;
using FluentAssertions;
using FrameLedger.App.ViewModels;
namespace FrameLedger.App.Tests;
/// <summary>
/// beta.15: a list of choices built once, in a static, keeps the language the App started in after a change of language,
/// while the page around it — rebuilt — follows. The themes, the update channels, the Logs page's two lists and the
/// Games page's sort order were such lists until beta.15; this keeps a new one from appearing. The language list is the
/// one exception: each language is named in its own words, the same in every language.
/// </summary>
public sealed class LanguageFollowingTests
{
[Fact]
public void NoViewModelKeepsAStaticListOfLabelledChoices()
{
string[] statics =
[
.. typeof(SettingsViewModel).Assembly.GetTypes()
.Where(static t => string.Equals(t.Namespace, "FrameLedger.App.ViewModels", StringComparison.Ordinal))
.SelectMany(static t => t.GetProperties(BindingFlags.Public | BindingFlags.Static).Select(p => (Type: t, Property: p)))
.Where(static x => x.Property.PropertyType.IsGenericType
&& x.Property.PropertyType.GetGenericTypeDefinition() == typeof(IReadOnlyList<>)
&& x.Property.PropertyType.GetGenericArguments()[0] is { IsGenericType: true } item
&& item.GetGenericTypeDefinition() == typeof(Choice<>))
.Select(static x => x.Type.Name + "." + x.Property.Name),
];
statics.Should().Equal(["SettingsViewModel.Languages"], "every other list is labelled in a language, and must be built per page");
}
}
@@ -682,4 +682,28 @@ public sealed class SettingsViewModelTests
Strings.Culture = previous;
}
}
/// <summary>beta.15: the theme and channel lists are labelled in the language the page opened in — a rebuilt page follows a change.</summary>
[Fact]
public async Task TheChoiceListsAreInTheLanguageThePageOpenedIn()
{
CultureInfo? previous = Strings.Culture;
try
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
Strings.Culture = CultureInfo.GetCultureInfo("en");
Harness english = await OpenAsync(s);
string englishSystem = Strings.Settings_Theme_System;
string englishStable = Strings.Settings_Channel_Stable;
Strings.Culture = CultureInfo.GetCultureInfo("vi");
Harness vietnamese = await OpenAsync(s);
english.Vm.Themes[0].Label.Should().Be(englishSystem);
vietnamese.Vm.Themes[0].Label.Should().Be(Strings.Settings_Theme_System).And.NotBe(englishSystem);
vietnamese.Vm.UpdateChannels.Single(static c => string.Equals(c.Value, "stable", StringComparison.Ordinal)).Label.Should().Be(Strings.Settings_Channel_Stable).And.NotBe(englishStable);
}
finally
{
Strings.Culture = previous;
}
}
}
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Windows.Threading;
using FluentAssertions;
using FrameLedger.App.Services;
@@ -16,6 +17,7 @@ namespace FrameLedger.App.Tests;
/// a thread-pool thread and <see cref="TrayHost.Dispose"/> removed the icon there — a WPF object whose disposal unsubscribes
/// <c>Application.Exit</c>, both owned by the UI thread.
/// </summary>
[Collection(StringsCultureCollection.Name)]
public sealed class TrayHostTests
{
private sealed class Shell : IShellPresence
@@ -88,4 +90,34 @@ public sealed class TrayHostTests
error.Should().BeNull("the icon is removed on the thread that owns it, whatever thread asks");
stillCreated.Should().BeFalse();
}
/// <summary>beta.15: the tray outlives a rebuilt window, and its menu was written once; a change of language relabels it.</summary>
[Fact]
public async Task AChangeOfLanguageRelabelsTheTraysMenu()
{
CultureInfo? previous = Strings.Culture;
try
{
(IReadOnlyList<string> before, IReadOnlyList<string> after, IReadOnlyList<string> expected) = await PagesLoadTests.OnStaAsync(static () =>
{
Strings.Culture = CultureInfo.GetCultureInfo("en");
var link = new FakeAgentLink();
using var updates = new UpdateService(new FakeUpdateClient(), link, new RegisteredSettings(new MemorySettings()), new FakeUpdatePrompts(), new Shell(), new RecordingStrip());
using var viewModel = new TrayViewModel(link, new Shell(), new Summaries(), new Navigation(), updates);
using var tray = new TrayHost(viewModel, new WindowClosePolicy());
tray.Create();
IReadOnlyList<string> english = tray.MenuHeaders;
Strings.Culture = CultureInfo.GetCultureInfo("vi");
tray.FollowLanguage();
return (english, tray.MenuHeaders, (IReadOnlyList<string>)[Strings.Tray_Open, viewModel.PauseText, Strings.Tray_AgentStatus, Strings.Tray_Exit]);
});
before.Should().HaveCount(4);
after.Should().Equal(expected);
after[0].Should().NotBe(before[0], "the menu was written in English and the language is now Vietnamese");
}
finally
{
Strings.Culture = previous;
}
}
}