Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 b84d534c2e fix(app): page titles read in the dark theme - every page sets the text colour the navigation Frame does not pass (beta.18 PR-1)
The owner's screenshots of 0.1.0-beta.17 (2026-10-07, dark theme): every page's title and section headings - Dashboard,
Recent sessions, Games, Compare, Pick 2 to 5 sessions, Settings and its groups, Logs - near-black on the dark window.
beta.16's screenshot shows the same.

Cause: a page is shown in WPF UI's NavigationViewContentPresenter, which is a Frame, and Frame.Init sets
InheritanceBehavior.SkipToAppNow - the window's Foreground stops there. A TextBlock that sets no colour falls to the
default, which WPF UI 4.3.0's TextBlockMetadata overrides to Brushes.Black. Cards, grids and controls set their own in
their templates; the bare titles and headings did not (19 texts on six pages, 1.29:1). It came and went: a page on
screen during a theme switch did take the window's new colour, and each navigation makes a new page that does not.

- Pages/*.xaml: every Page root sets Foreground="{DynamicResource TextFillColorPrimaryBrush}".
- AccessibilityTests.EveryPageSetsItsOwnTextColour: every Page root in the App's XAML sets it. Red before: all six.
- PagesLoadTests.EveryTextIsReadableInBothThemes (Dark, Light): every surface hosted as the App hosts it - a page in
  the presenter, a window as itself, anything else in an unshown FluentWindow - and every text that shows >= 3:1 over
  the colour painted under it. Red before in Dark: the 19 titles and headings at 1.29:1; Light green.
- PagesLoadTests.Hosted puts a page in the presenter, so EveryTextFollowsAThemeSwitch checks the App's real host too.
  Until now it laid pages out straight in a window, whose colour they inherited - green over the black titles. Red
  before, both ways: a page made after the switch stayed black. It now pairs texts by their place in the tree and
  compares what shows (a switch re-applies the template of a DataGrid's collapsed scroll bar and select-all corner).
  An Appearance="Secondary" put back on one Settings text still turns it red, both ways.
- Visuals.UnderTheme switches as the App does: the accent resources derived for the theme from Windows' default accent,
  then the dictionary, and the application's own resources put back after. The accent is not in a theme dictionary, so
  a Light check measured the dark theme's link blue on the light window (1.9:1) - a colour the App never shows.
  ContrastTests uses it too; it passed systemAccentColor: true, which reads the machine's own accent palette.
- Docs: 16_WPFUI_SYNTAX (a theming bullet, a Gotchas entry), 08_UI §Contrast (the fifth hole), 14_TESTING (a page is
  measured in the Frame; a theme brings its accent), wiki App UI development, CHANGELOG [Unreleased].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 19:15:02 +07:00
poli0981andClaude Opus 5.5 15b4c6b0ec release: 0.1.0-beta.17 - the CHANGELOG section with how to update from beta.16, the accuracy block's release line, README's release lines, LIMITATIONS' version, HANDOFF's beta.17 section with D53-D54 and owner-only item 13 (beta.17 PR-5) (#285)
VERSION stays 0.1.0: the tag's numeric core. The owner (2026-10-07) approved the train end to end: merge on green CI,
then the signed tag v0.1.0-beta.17 on the merge commit. wiki.yml publishes the wiki after the Release run succeeds.

- CHANGELOG: [Unreleased] becomes [0.1.0-beta.17] - 2026-10-07, with its summary and "Updating from 0.1.0-beta.16";
  tools/release-notes.ps1 -Version 0.1.0-beta.17 extracts it.
- The accuracy block's release line (legal/ACCURACY.md, embedded in README and the Disclaimer; accuracy-check green),
  README's release lines and count, LIMITATIONS' version.
- HANDOFF: beta.16's START HERE struck; the beta.17 section - D53 (the wiki's source is the repository, published by
  wiki.yml), D54 (the guide is the wiki's End-user half, twelve pages), the traps (ui:TextBlock Appearance pins a brush;
  a Loaded class handler is not a load hook; the wiki's branch and the read-only default token; gating a stack from the
  main checkout), the findings left as tasks; owner-only item 13.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 17:55:24 +07:00
21 changed files with 319 additions and 40 deletions

No files matched your search

+20
View File
@@ -30,6 +30,26 @@ numeric core and does not move; the heading is the full version — corrected 20
### Fixed
- **Page titles and section headings read in the dark theme again.** Every page's title and its section headings — Dashboard,
Recent sessions, Games, Compare, Settings and each of its groups, Logs — were drawn near-black on the dark window
(owner's screenshots of beta.17; beta.16 had it too). A page is shown in WPF UI's navigation Frame, which passes no text
colour into the page, and a text that sets none is black; a page open during a theme switch picked the right colour up,
and the next one navigated to did not. Every page now sets the theme's text colour itself. `AccessibilityTests.EveryPageSetsItsOwnTextColour`
and `PagesLoadTests.EveryTextIsReadableInBothThemes` (every surface hosted as the App hosts it, ≥ 3:1 in both themes)
went red on the unfixed pages first; the theme-switch check now hosts pages in the Frame too, and its harness derives the
accent for each theme as the App does (`docs/08_UI.md` §Contrast, `docs/16_WPFUI_SYNTAX.md` §Gotchas, `docs/14_TESTING.md`).
## [0.1.0-beta.17] - 2026-10-07
**The seventeenth pre-release: text that keeps up with a change of theme, scroll bars hidden everywhere when you ask, a
user guide that answers more, and a wiki.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then
*More info → Run anyway*.
**Updating from `0.1.0-beta.16`:** Help ▸ Check for updates, then *Restart to update* with no game running. Nothing in
the database changes and nothing is shown again for you to accept; sessions already stored keep their status.
### Fixed
- **Text keeps up with a change of theme.** After switching between Light and Dark, the descriptions and captions of the
page in view — Settings above all, where the theme is chosen — kept the old theme's colour: light grey on white, or dark
grey on dark. Every such text now follows the switch, on every page, window and dialog (`08_UI` §Contrast,
+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.16.*
*Beta software: this page describes version 0.1.0-beta.17.*
## Games it will not measure
+3 -3
View File
@@ -12,7 +12,7 @@ pages.
<!-- 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.16`** (2026-10-06), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.17`** (2026-10-07), 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
@@ -163,7 +163,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
## Install
> **The latest pre-release is `v0.1.0-beta.16` (2026-10-06); before it `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `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`.
> **The latest pre-release is `v0.1.0-beta.17` (2026-10-07); before it `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `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**.
@@ -212,4 +212,4 @@ GPU telemetry is layered so the project never depends on a proprietary vendor li
---
**Status:** pre-release (beta). Sixteen 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). Seventeen 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.
+14
View File
@@ -845,6 +845,20 @@ palette per theme, chosen with the theme).
> summary, every dialog's content and the safety InfoBar, made under one theme, switched, and compared text by text with
> the same surface made fresh under the other — both ways). Both went red on the unfixed XAML, the second with 146 stale
> texts each way, before they went green.
>
> **A fifth hole, closed 2026-10-07 (beta.18; the owner's screenshots of beta.17 in the dark theme: every page's title and
> section headings near-black on the dark window — beta.16's screenshot shows it too).** This text had no colour of ours,
> because it had none. A page is shown in WPF UI's `NavigationViewContentPresenter`, a `Frame`, and a Frame passes no
> inherited value into its page (`InheritanceBehavior.SkipToAppNow`), so a text that sets no colour falls to the TextBlock
> default, which WPF UI 4.3.0 makes black (`16_WPFUI_SYNTAX` §Gotchas). Cards, grids and controls set their own; the bare
> titles and headings did not: 19 texts on the six pages at 1.29:1. Every check above laid a page out straight in a
> window, whose text colour the page then inherited — a page the App never draws — and a page on screen during a theme
> switch did take the window's colour, while each navigation makes a new one that does not, so it came and went. Every
> page sets `Foreground="{DynamicResource TextFillColorPrimaryBrush}"` on its root. Held two ways:
> `AccessibilityTests.EveryPageSetsItsOwnTextColour`, and `PagesLoadTests.EveryTextIsReadableInBothThemes` — every
> surface hosted as the App hosts it, a page in the presenter, and every text that shows ≥ 3:1 over the colour painted
> under it, in both themes. `EveryTextFollowsAThemeSwitch` hosts its pages in the presenter too since, and went red with
> them: a page made after a switch stayed black. All three went red on the unfixed XAML before they went green.
### DPI
+13
View File
@@ -71,6 +71,19 @@ under the new theme. `PagesLoadTests.Surfaces` builds every page, window and dia
any check that wants all of them. Colours are compared and texts only reported: another test class may change
`Strings.Culture` between the two builds.
**A page is measured in the Frame the App shows it in, and a theme brings its accent (beta.18).** WPF UI's
`NavigationViewContentPresenter` is a `Frame`, which passes no inherited value into the page, the text colour included, so
a page laid out straight in a window measures the window's colour and not the App's: the theme-switch check above did, and
stayed green over every page title drawn black (`08_UI` §Contrast, fifth hole). The rendered checks host a page in the
presenter (`PagesLoadTests.Hosted`), and `PagesLoadTests.EveryTextIsReadableInBothThemes` measures every surface's shown
texts at ≥ 3:1 in both themes. `Visuals.UnderTheme` switches as the App does — the accent resources derived for the theme
from Windows' default accent (`Visuals.DefaultAccent`, the App's derivation rather than the machine's own palette), then
the dictionary — and puts the application's own resources back afterwards. The accent lives in `Application.Resources`,
not in a theme dictionary; until then a check under Light measured the dark theme's link blue on the light window, 1.9:1,
a colour the App never shows. The theme-switch check compares what can be seen: a text only one of the two instances holds
counts where it shows, and a collapsed part is not compared (a switch re-applies the template of a DataGrid's idle scroll
bar, and its glyphs exist in the switched instance only).
**Loaded needs a shown window, and even then it is not raised everywhere (beta.17).** A tree laid out by hand never raises
Loaded, and a shown one raises it only where a subtree listens for it (`16_WPFUI_SYNTAX` §Gotchas) — so a test that calls
`RaiseEvent(Loaded)` proves a handler, never that WPF reaches it. `ScrollBarHidingTests.EverySurfaceShownWithTheOptionOnDrawsNoBar`
+13
View File
@@ -152,6 +152,8 @@ Native `Menu`, `TabControl`, `ComboBox`, `Slider`~~, `ListView`~~ are fine — t
styles (`Styles/FrameLedger.xaml`), or the `Pill` style with a `SystemFillColor*BackgroundBrush` and an explicit text
brush; `ContrastTests` refuses all five (`08_UI` §Contrast).
- Do **not** set `Background` on `FluentWindow` (kills Mica). Page backgrounds transparent by default.
- **Every `Page` root sets `Foreground="{DynamicResource TextFillColorPrimaryBrush}"`** (2026-10-07): the navigation's
Frame passes no text colour into a page, and a text with none is black (§Gotchas).
- Exception to the no-hex rule: the chart palette — defined once per theme in ~~`Styles/ChartPalette.xaml` (two dictionaries)~~ `Styles/ChartPalette.Dark.xaml` and `ChartPalette.Light.xaml` (corrected 2026-10-04), never inline.
## FlowDocument (rendered documents, beta.12)
@@ -280,3 +282,14 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
`DynamicResource`). `ContrastTests.NoTextBlockTakesItsColourFromAppearance` refuses every form in the App's XAML and code,
`PagesLoadTests.EveryTextFollowsAThemeSwitch` renders every surface through a switch both ways, and
`PagesLoadTests.WpfUisAppearanceStillKeepsTheThemeATextWasMadeUnder` turns red the day upstream follows a switch.
- [ ] **A page in the `NavigationView` inherits nothing, its text colour included.** `NavigationViewContentPresenter` is a
`Frame`, and `Frame` sets `InheritanceBehavior.SkipToAppNow`: the window's `Foreground` stops there, and a text that sets
no colour falls to the TextBlock default, which WPF UI 4.3.0's `TextBlockMetadata` makes `Brushes.Black`. Cards, grids
and controls set their own colour in their templates; the bare texts did not — every page's title and section headings
were black on the dark window, 1.3:1 (the owner's screenshots of beta.17; beta.16's show it too). It came and went: a
page on screen during a theme switch did take the window's new colour through the switch, and every navigation makes a
new page that does not. Every `Page` root sets `Foreground="{DynamicResource TextFillColorPrimaryBrush}"`
(`AccessibilityTests.EveryPageSetsItsOwnTextColour`). A check that lays a page out straight in a window measures the
window's colour, not the App's — beta.17's theme-switch check did and was green over the black titles — so the rendered
checks host a page in the presenter, and `PagesLoadTests.EveryTextIsReadableInBothThemes` measures every surface so
hosted at ≥ 3:1 in both themes.
+50 -1
View File
@@ -2011,7 +2011,7 @@ during finalize, PR-4 the scan set's creation times (D51), PR-5 the App's viewer
**Owner-only, added to the list below:** item 12.
## **START HERE** — 2026-10-06, 0.1.0-beta.16: beta.15 verified, and the chip it left
## ~~**START HERE**~~ — 2026-10-06, 0.1.0-beta.16: beta.15 verified, and the chip it left *(struck 2026-10-07: the head is §beta.17 below)*
*Status is `CHANGELOG.md` `[0.1.0-beta.16]`; this is what no other file carries. The owner, after beta.15's release
(2026-10-06): owner-only item 12 passed on real hardware ("đã chạy và ok"), do the chip beta.15 left, release, and close
@@ -2039,6 +2039,47 @@ added.*
- **The desktop app forbids polling CI** (no `gh` loop, Monitor or ScheduleWakeup): it wakes the session on a failure, a
conflict or a review comment, never on green, so a green PR waits for the owner's word or the owner's auto-merge.
## **START HERE** — 2026-10-07, 0.1.0-beta.17: text that follows a theme switch, scroll bars hidden everywhere, a wiki
*Status is `CHANGELOG.md` `[0.1.0-beta.17]`; this is what no other file carries. The owner's report (2026-10-07, three
screenshots of beta.16): Settings' descriptions kept the old theme's colour after a switch; the Dashboard kept its
scroll bar with Hide scroll bars on; "a complete wiki, concise and easy, End-user and Dev". Five stacked PRs — #281 the
theme text, #282 the scroll bars, #283 the guide's four new pages, #284 the wiki and its publishing, then the
release.*
**Decisions (owner, 2026-10-07, asked before the plan — do not re-ask):**
- **D53 — the wiki's source is the repository.** `wiki/` (Home, the sidebar, the developer pages) and `guide/` with
`LIMITATIONS.md` are assembled by `tools/wiki-build.ps1` and published to the Wiki tab by `.github/workflows/wiki.yml`
after a successful Release run (and by hand); a page edited on the tab is overwritten at the next release. English.
- **D54 — the wiki's End-user half is the user guide**, one source: it grows past D44's eight pages (the screens, every
setting, troubleshooting, a glossary — twelve) and stays embedded in the App. Tests hold that every setting the
Settings page shows and every page and menu item of the main window is named in it.
**Traps met on the way:**
- **`ui:TextBlock Appearance` pins a brush.** WPF UI 4.3.0 resolves it once (`TryFindResource`) and coerces Foreground
to it, so a theme switch leaves the text in the old theme; 129 texts used it. Every contrast check before measured a
theme as a surface was *made* under it — a switch needs the surface hosted in a `Window`, because only
`Application.Windows` hear a dictionary change (`16_WPFUI_SYNTAX` §Gotchas, `14_TESTING`).
- **A class handler on `Loaded` is not a load hook.** WPF raises Loaded only where a subtree listens for it with its own
handler, style EventSetter or template trigger — WPF UI's toggle switches carry one, which is why Settings hid its
bar and the Dashboard never did. A test that calls `RaiseEvent(Loaded)` proves the handler, never that WPF reaches it;
`ScrollChanged` reaches every scroller from its first layout.
- **The wiki's git branch is `master`, and the repository's default workflow token is read-only:** `wiki.yml` declares
`contents: write`. A release made with `GITHUB_TOKEN` fires no `release` event for another workflow; `workflow_run`
does, and runs `main`'s copy of the file — so it checks out the run's `head_sha` and links at its tag.
- **A fresh worktree cannot run the full gate** (the native configure, `CONTRIBUTING`): the stack's tip was gated in the
main checkout on a detached HEAD, and each PR's own CI ran on its branch.
- **Found while writing the guide, not fixed** (a task each): two notices can print an internal name — *"The hook
stopped (WriterSelfDisabled)…"*, and a refusal no anti-cheat names reads *"The anti-cheat guard did not hook this
game: reason RefusedKillSwitch."*; the kill switch's *Applied* strip says "at the next session start" (it applies
within 30 s); *Turn off* failing says "Nothing was enabled."; in the viewer, the exception switch, the Recording numbers and the Channel stay enabled;
`08_UI` lists a "PawnIO missing" banner that does not exist; and a release's Overlay build id reads `-dirty` (§0.1.0-beta.4,
"Found and NOT fixed", still open).
**Owner-only, added to the list below:** item 13.
## Owner-only — no PR can close these
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
@@ -2126,6 +2167,14 @@ added.*
(`12_BUILD` §Debugging) and start `FrameLedger.exe --data-dir <copy>`; the banner names the folder, the pill reads
*Viewer — no Agent*, the switches are off, and the installed App runs beside it untouched. (f) The `ja` strings
marked `review`.
13. **beta.17 on real hardware.** (a) **A theme switch:** on Settings, Dark → Light → Dark, and again with a session's
summary window open — every description and caption follows at once. (b) **Hide scroll bars** on: the Dashboard,
Games, a game's page, Logs, About, Help ▸ User guide and a drop-down list draw no bar, and the wheel still scrolls;
off, the bars come back without a restart. (c) **Help ▸ User guide** lists twelve pages and Limitations; a link to a
section opens that section. (d) **The wiki**, once the release is out: the Wiki tab shows Home, the sidebar's two
halves and a footer naming `v0.1.0-beta.17` — then tick *Restrict editing to collaborators only* (Settings ▸ General
▸ Features ▸ Wikis), or anyone can change a page until the next release overwrites it. (e) The `ja` 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
+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.16`** (2026-10-06), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.17`** (2026-10-07), 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.16`** (2026-10-06), an unsigned installer built from that tag with its
> **pre-release is `0.1.0-beta.17`** (2026-10-07), 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
@@ -9,6 +9,7 @@
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
Title="{x:Static res:Strings.Compare_Header}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False">
<!-- 08_UI §Compare: the picker (2–5, cross-game), the overlaid percentile curves, the stat table; FR-6.2's guard is the view model's. -->
<ScrollViewer VerticalScrollBarVisibility="Auto">
@@ -9,6 +9,7 @@
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
Title="{x:Static res:Strings.Dashboard_Header}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
@@ -10,6 +10,7 @@
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
Title="{x:Static res:Strings.Games_Header}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False">
<!--
08_UI §Games › Game detail. The two rows — Supports (files on disk) and Last session measured (the
+1
View File
@@ -11,6 +11,7 @@
Title="{x:Static res:Strings.Games_Header}"
AllowDrop="True"
Drop="OnDrop"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False">
<!--
08_UI §Games: search, sort, FR-1.1 add by pick or by dropping an .exe here. Since beta.11 (owner requests 2026-10-03):
+1
View File
@@ -8,6 +8,7 @@
xmlns:res="clr-namespace:FrameLedger.App"
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
Title="{x:Static res:Strings.Logs_Header}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False">
<Grid Margin="24,16,24,16">
<Grid.RowDefinitions>
@@ -8,6 +8,7 @@
xmlns:res="clr-namespace:FrameLedger.App"
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
Title="{x:Static res:Strings.Settings_Header}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Style="{StaticResource PageRoot}">
@@ -185,6 +185,24 @@ public sealed class AccessibilityTests
wrapped.Should().BeEmpty("a page without ScrollViewer.CanContentScroll=\"False\" is wrapped in WPF UI's scroller, and its own root swallows the wheel");
}
/// <summary>
/// beta.18 (the owner's screenshots of beta.17 in the dark theme: every page's title near-black on the dark window). A
/// page is shown in WPF UI's <c>NavigationViewContentPresenter</c>, a <c>Frame</c>, and a Frame sets
/// <c>InheritanceBehavior.SkipToAppNow</c>: the window's text colour never reaches the page, and a text with no colour
/// of its own is WPF UI's TextBlock default, black. Every page gives its texts the theme's colour itself.
/// </summary>
[Fact]
public void EveryPageSetsItsOwnTextColour()
{
List<string> pages = [.. AppXaml().Where(static x => string.Equals(x.Xaml.Root!.Name.LocalName, "Page", StringComparison.Ordinal)).Select(static x => x.File)];
List<string> uncoloured = [.. AppXaml().Where(static x => string.Equals(x.Xaml.Root!.Name.LocalName, "Page", StringComparison.Ordinal)
&& !string.Equals(x.Xaml.Root.Attribute("Foreground")?.Value, "{DynamicResource TextFillColorPrimaryBrush}", StringComparison.Ordinal))
.Select(static x => x.File)];
pages.Should().HaveCountGreaterThanOrEqualTo(6);
string.Join(", ", uncoloured).Should().BeEmpty("a Frame passes no text colour into a page: each sets Foreground=\"{DynamicResource TextFillColorPrimaryBrush}\" (16_WPFUI_SYNTAX §Gotchas)");
}
/// <summary>
/// A stock <c>ScrollViewer</c> takes every wheel, even with nothing left to scroll; inside a dialog that scrolls, the wheel
/// then stops at it. WPF UI's <c>PassiveScrollViewer</c> hands the wheel on at its ends (beta.14).
+5 -10
View File
@@ -23,13 +23,6 @@ public sealed class ContrastTests
{
private static readonly string[] _paletteAppearances = ["Info", "Caution", "Danger", "Success"];
/// <summary>
/// Windows' default accent. The accent brushes are not in the theme dictionaries: `ApplicationThemeManager.Apply(…,
/// updateAccent: true)` derives them from the system accent at start-up (`MainWindow`), so the test derives them the
/// same way from a fixed colour and measures WPF UI's own on-accent text against them.
/// </summary>
private static readonly Color _defaultAccent = Color.FromRgb(0x00, 0x78, 0xD4);
[Fact]
public void NoBadgeUsesAPaletteAppearance()
{
@@ -143,10 +136,12 @@ public sealed class ContrastTests
[InlineData(ApplicationTheme.Light)]
public async Task EveryPillPairMeetsAAInBothThemes(ApplicationTheme theme)
{
Dictionary<string, double> ratios = await PagesLoadTests.OnStaAsync(() =>
// The accent brushes are not in the theme dictionaries: the App derives them from the system accent at each theme
// switch, and Visuals.UnderTheme derives them the same way from Windows' default accent. Until 2026-10-07 this
// passed systemAccentColor: true, which reads the machine's own accent palette wherever Windows answers.
Dictionary<string, double> ratios = await PagesLoadTests.OnStaAsync(() => Visuals.UnderTheme(theme, () =>
{
var themed = new ThemesDictionary { Theme = theme };
ApplicationAccentColorManager.Apply(_defaultAccent, theme, systemGlassColor: false, systemAccentColor: true);
Color window = Wcag.Resolve(themed, "ApplicationBackgroundColor");
Color card = Wcag.Over(Wcag.Resolve(themed, "CardBackgroundFillColorDefault"), window);
Color pillOff = Wcag.Over(Wcag.Resolve(themed, "ControlFillColorDefault"), card);
@@ -159,7 +154,7 @@ public sealed class ContrastTests
["qualifier warning: primary text on caution"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextFillColorPrimary"), caution), caution),
["the Info badge, for the record"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextFillColorPrimary"), PaletteLightBlue()), PaletteLightBlue()),
};
});
}));
using (new FluentAssertions.Execution.AssertionScope(theme.ToString()))
{
@@ -0,0 +1,96 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using FluentAssertions;
using Wpf.Ui.Appearance;
using Wpf.Ui.Markup;
namespace FrameLedger.App.Tests;
/// <summary>
/// Every text the App shows is readable in both themes (beta.18, the owner's screenshots of beta.17 in the dark theme: each
/// page's title and section headings near-black on the dark window). Each surface is hosted as the App hosts it
/// (<see cref="Hosted"/>): a page in WPF UI's <c>NavigationViewContentPresenter</c>, which is a <c>Frame</c>, and a Frame
/// sets <c>InheritanceBehavior.SkipToAppNow</c> — nothing above it, the window's text colour included, reaches the page. A
/// text with no colour of its own then falls back to the TextBlock default, which WPF UI 4.3.0's <c>TextBlockMetadata</c>
/// sets to black. Text inside a card or a grid never showed it: their templates set a colour. The theme-switch check could
/// not see it either: it compares a switched surface with a fresh one, and black was black in both.
/// </summary>
public sealed partial class PagesLoadTests
{
/// <summary>WCAG's minimum for large text and for what a user must make out; black on the dark window is 1.3.</summary>
private const double _readableAtLeast = 3.0;
[Theory]
[InlineData(ApplicationTheme.Dark)]
[InlineData(ApplicationTheme.Light)]
public async Task EveryTextIsReadableInBothThemes(ApplicationTheme theme)
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
using Surfaces surfaces = await Surfaces.LoadAsync(s);
(int Texts, List<string> Faint) result = await OnStaAsync(() => Visuals.UnderTheme(theme, () =>
{
Color window = Wcag.Resolve(new ThemesDictionary { Theme = theme }, "ApplicationBackgroundColor");
int texts = 0;
var faint = new List<string>();
foreach ((string name, Func<FrameworkElement> build) in surfaces.All())
{
(Window host, FrameworkElement root) = Hosted(build);
try
{
Lay(root);
foreach (TextBlock text in ShownTexts(root))
{
texts++;
Color under = Visuals.PaintedUnder(text, root, window);
double ratio = Wcag.Ratio(Visuals.TextOver(text, under), under);
if (ratio < _readableAtLeast)
{
faint.Add(string.Create(CultureInfo.InvariantCulture, $"{name}: \"{text.Text}\" {ratio:0.00}:1 ({text.Foreground} on {under})"));
}
}
}
finally
{
host.Close();
}
}
return (texts, faint);
}));
result.Texts.Should().BeGreaterThan(300, "every surface was rendered and holds text");
string.Join(Environment.NewLine, result.Faint).Should().BeEmpty($"every text the App shows reads at {_readableAtLeast}:1 or better in the {theme} theme");
}
/// <summary>
/// The non-empty texts under <paramref name="root"/> that a user can see and is meant to read: no collapsed or hidden
/// element above them, and none disabled (WCAG asks nothing of an inactive control's text).
/// </summary>
private static IEnumerable<TextBlock> ShownTexts(DependencyObject root)
{
if (root is UIElement { Visibility: not Visibility.Visible } or UIElement { IsEnabled: false })
{
yield break;
}
if (root is TextBlock { Text.Length: > 0 } text && text.Foreground is SolidColorBrush)
{
yield return text;
}
int count = VisualTreeHelper.GetChildrenCount(root);
for (int i = 0; i < count; i++)
{
foreach (TextBlock child in ShownTexts(VisualTreeHelper.GetChild(root, i)))
{
yield return child;
}
}
}
}
@@ -121,17 +121,22 @@ public sealed partial class PagesLoadTests
try
{
Lay(fresh);
List<(string Path, string Text, string Colour)> before = Texts(switched);
List<(string Path, string Text, string Colour)> after = Texts(fresh);
if (before.Count != after.Count)
{
return (before.Count, [$"{name}: {before.Count} texts after the switch, {after.Count} in a fresh one"]);
}
List<DrawnText> before = Texts(switched);
List<DrawnText> after = Texts(fresh);
Dictionary<string, DrawnText> lived = before.ToDictionary(static d => d.Path, StringComparer.Ordinal);
Dictionary<string, DrawnText> made = after.ToDictionary(static d => d.Path, StringComparer.Ordinal);
// Texts are reported, never compared: another test class may change Strings.Culture between the two builds.
List<string> stale = [.. before.Zip(after)
.Where(static p => !string.Equals(p.First.Path, p.Second.Path, StringComparison.Ordinal) || !string.Equals(p.First.Colour, p.Second.Colour, StringComparison.Ordinal))
.Select(p => $"{name}: \"{p.First.Text}\" is {p.First.Colour}, made fresh {p.Second.Colour} ({p.First.Path})")];
// Texts are reported, never compared: another test class may change Strings.Culture between the two builds. What is
// compared is what a user can see (beta.18, when pages moved into the Frame): inside a collapsed part a theme switch
// re-applies a DataGrid's idle scroll bar, whose arrow glyphs then exist in the switched page only, and the select-all
// corner — collapsed, every grid here shows column headers only — kept the old theme's disabled colour.
List<string> stale =
[
.. before.Where(d => made.TryGetValue(d.Path, out DrawnText f) && (d.Shown || f.Shown) && !string.Equals(d.Colour, f.Colour, StringComparison.Ordinal))
.Select(d => $"{name}: \"{d.Text}\" is {d.Colour}, made fresh {made[d.Path].Colour} ({d.Path})"),
.. before.Where(d => d.Shown && !made.ContainsKey(d.Path)).Select(d => $"{name}: \"{d.Text}\" shows after the switch only ({d.Path})"),
.. after.Where(d => d.Shown && !lived.ContainsKey(d.Path)).Select(d => $"{name}: \"{d.Text}\" shows in a fresh one only ({d.Path})"),
];
return (before.Count, stale.Count <= _staleShownPerSurface ? stale : [.. stale.Take(_staleShownPerSurface), $"{name}: … and {stale.Count - _staleShownPerSurface} more"]);
}
finally
@@ -140,7 +145,12 @@ public sealed partial class PagesLoadTests
}
}
/// <summary>A surface in a window that is never shown: itself when it is one, otherwise as the window's content.</summary>
/// <summary>
/// A surface hosted as the App shows it, in a window that is never shown: a window as itself; a page in WPF UI's
/// <c>NavigationViewContentPresenter</c>, the shell's Frame — which passes no inherited value into the page, the text
/// colour included (beta.18; until then pages sat straight in the window here, and their black titles inherited the
/// window's colour in this check only); anything else as the window's content.
/// </summary>
private static (Window Host, FrameworkElement Root) Hosted(Func<FrameworkElement> build)
{
FrameworkElement built = build();
@@ -149,6 +159,16 @@ public sealed partial class PagesLoadTests
return (window, (FrameworkElement)window.Content);
}
if (built is Page page)
{
var frame = new Wpf.Ui.Controls.NavigationViewContentPresenter();
var shell = new Wpf.Ui.Controls.FluentWindow { Content = frame };
Lay(frame);
_ = frame.Navigate(page);
Visuals.Pump();
return (shell, frame);
}
// A FluentWindow, as the shell is: its style gives the inherited text colour by theme resource too.
var host = new Wpf.Ui.Controls.FluentWindow { Content = built };
return (host, built);
@@ -156,28 +176,34 @@ public sealed partial class PagesLoadTests
private static void Lay(FrameworkElement root) => Visuals.Layout(root, 1200, 900);
/// <summary>Every TextBlock under <paramref name="root"/> in visual-tree order: where it is, what it says, the colour it is drawn in.</summary>
private static List<(string Path, string Text, string Colour)> Texts(DependencyObject root)
/// <summary>
/// Every TextBlock under <paramref name="root"/> in visual-tree order: where it is, what it says, the colour it is drawn
/// in, and whether it shows — nothing above it collapsed or hidden.
/// </summary>
private static List<DrawnText> Texts(DependencyObject root)
{
var found = new List<(string, string, string)>();
Walk(root, root.GetType().Name, found);
var found = new List<DrawnText>();
Walk(root, root.GetType().Name, shown: true, found);
return found;
}
private static void Walk(DependencyObject node, string path, List<(string, string, string)> found)
private static void Walk(DependencyObject node, string path, bool shown, List<DrawnText> found)
{
shown &= node is not UIElement { Visibility: not Visibility.Visible };
if (node is TextBlock text)
{
found.Add((path, text.Text, text.Foreground is SolidColorBrush solid ? solid.Color.ToString(CultureInfo.InvariantCulture) : text.Foreground?.ToString(CultureInfo.InvariantCulture) ?? "null"));
found.Add(new DrawnText(path, text.Text, text.Foreground is SolidColorBrush solid ? solid.Color.ToString(CultureInfo.InvariantCulture) : text.Foreground?.ToString(CultureInfo.InvariantCulture) ?? "null", shown));
}
int count = VisualTreeHelper.GetChildrenCount(node);
for (int i = 0; i < count; i++)
{
DependencyObject child = VisualTreeHelper.GetChild(node, i);
Walk(child, string.Create(CultureInfo.InvariantCulture, $"{path}/{child.GetType().Name}[{i}]"), found);
Walk(child, string.Create(CultureInfo.InvariantCulture, $"{path}/{child.GetType().Name}[{i}]"), shown, found);
}
}
private readonly record struct DrawnText(string Path, string Text, string Colour, bool Shown);
private static Color Solid(Brush brush) => brush is SolidColorBrush solid ? solid.Color : throw new InvalidOperationException("a text whose foreground is not a solid colour");
}
+29 -3
View File
@@ -76,14 +76,31 @@ internal static class Visuals
}
/// <summary>
/// Runs <paramref name="work"/> with the App's theme dictionary swapped for <paramref name="theme"/>, and puts Dark back:
/// elements made inside take the theme's resources when they are created.
/// Windows' default accent. The App derives its accent resources from the system's at each theme switch; the checks
/// derive them from this one colour, so a result does not depend on the machine's personalisation.
/// </summary>
public static readonly Color DefaultAccent = Color.FromRgb(0x00, 0x78, 0xD4);
/// <summary>
/// Runs <paramref name="work"/> under <paramref name="theme"/> the way the App switches (<c>WpfThemeApplier</c> →
/// <c>ApplicationThemeManager.Apply(theme, …, updateAccent: true)</c>): the accent resources derived for the theme from
/// <see cref="DefaultAccent"/>, then the theme dictionary swapped. Afterwards the dictionary and the application's own
/// resources are put back as they were, so no other check inherits this one's theme. Elements made inside take the
/// theme's resources when they are created; elements made before it hear the change, as a shown window does.
/// </summary>
/// <remarks>
/// The accent is not in the theme dictionaries (WPF UI 4.3.0 writes it into <c>Application.Resources</c>), and the
/// test application's only accent is <c>Accent.xaml</c>'s default, the dark theme's: before 2026-10-07 a check under
/// Light measured a link in the dark theme's light blue on the light window, 1.9:1, a colour the App never shows.
/// </remarks>
public static T UnderTheme<T>(ApplicationTheme theme, Func<T> work)
{
System.Collections.ObjectModel.Collection<ResourceDictionary> merged = System.Windows.Application.Current.Resources.MergedDictionaries;
ResourceDictionary resources = System.Windows.Application.Current.Resources;
System.Collections.ObjectModel.Collection<ResourceDictionary> merged = resources.MergedDictionaries;
int index = merged.ToList().FindIndex(static d => d is ThemesDictionary);
ResourceDictionary original = merged[index];
Dictionary<object, object> own = resources.Keys.Cast<object>().ToDictionary(static k => k, k => resources[k]);
ApplicationAccentColorManager.Apply(DefaultAccent, theme);
merged[index] = new ThemesDictionary { Theme = theme };
try
{
@@ -92,6 +109,15 @@ internal static class Visuals
finally
{
merged[index] = original;
foreach (object added in resources.Keys.Cast<object>().Where(k => !own.ContainsKey(k)).ToList())
{
resources.Remove(added);
}
foreach ((object key, object value) in own.Where(kv => !ReferenceEquals(resources[kv.Key], kv.Value)))
{
resources[key] = value;
}
}
}
+5 -2
View File
@@ -23,7 +23,8 @@ Japanese wait for a human reviewer, never a machine draft ([`docs/09_I18N.md`](.
## Colours and theme
Colours come only from WPF UI's theme brushes, by `DynamicResource` — never a hex value, never `StaticResource` for a
theme brush. Muted text uses the App's `SecondaryText` and `TertiaryText` styles (`src/FrameLedger.App/Styles/FrameLedger.xaml`).
theme brush. Muted text uses the App's `SecondaryText` and `TertiaryText` styles (`src/FrameLedger.App/Styles/FrameLedger.xaml`),
and every page sets the theme's text colour on its root.
The chart palettes are the one place a colour is written out, once per theme.
## The traps of WPF UI 4.3.0
@@ -32,6 +33,7 @@ Each of these cost a release; the full list, with the tests that hold each, is
[`docs/16_WPFUI_SYNTAX.md`](../docs/16_WPFUI_SYNTAX.md).
- `ui:TextBlock Appearance=` looks its brush up once: a theme switch leaves the text in the old theme's colour.
- A page is shown in a `Frame`, which passes it no text colour: a text that sets none is black, on the dark theme too.
- A class handler on `Loaded` does not reach every element: WPF raises Loaded only where a subtree listens for it.
- Every page sets `ScrollViewer.CanContentScroll="False"`, or WPF UI wraps it in a scroller that eats the mouse wheel;
a scroller inside a dialog is a `ui:PassiveScrollViewer`.
@@ -45,4 +47,5 @@ Each of these cost a release; the full list, with the tests that hold each, is
`tests/FrameLedger.App.Tests` renders every page, window and dialog under the real theme dictionaries on one STA thread
(`PagesLoadTests.OnStaAsync`): contrast in both themes, a theme switch while a surface is on screen, scroll bars with the
option on in a real window, keyboard and automation names. A rendered check is run red against the unfixed XAML first.
option on in a real window, keyboard and automation names. Each surface is hosted as the App hosts it — a page in WPF UI's
navigation presenter, not straight in a window. A rendered check is run red against the unfixed XAML first.