Compare commits

...
1 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 fe03f7f4d0 feat: what a screen reader is given - every item, cell and row button named by what it shows, the display-only controls with a voice, the notices' text reachable, no silent Tab stop (D88) (beta.35 PR-2)
PagesLoadTests.Automation sweeps the UI Automation tree WPF builds for every page, window, dialog and control,
every tab shown: no Tab stop without a peer, no item named by its type, every focusable control named, no shown
text hidden in a template, no two buttons in a list sharing a name. All five went red on main first.

Fixes: every list item type speaks through ToString (Services/SpokenText) - Choice its label, a notice its title
and text, a document page its title, a session row its date, length and tier; FpsReadout, TriStateChip and
ChangeBadge get SpokenTextAutomationPeer (a Text element, no children) and leave the tab order, and the readout
says rule 6 aloud (Native, displayed and the factor together); a template column names its cells through
Controls/CellName over WPF UI's DefaultDataGridCellStyle, an empty cell read as "empty"; a row's button names its
row; the App's InfoBar template draws title and message through ContentPresenters; implicit styles take
ItemsControl, ui:Image and ui:CardControl out of the tab order; a CardExpander's expand button is named after its
header (Controls/ExpanderToggleName); the dialog hosts are no Tab stops. ScreenReaderNamesTests holds each piece.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:59:49 +07:00
50 changed files with 1184 additions and 48 deletions

No files matched your search

+11 -4
View File
@@ -44,6 +44,14 @@ The same keys are in the user guide, [The screens](guide/07-screens.md#keyboard-
- **Every page, menu, dialog and setting can be reached and used with Narrator.** The owner checked this on
2026-11-09, keyboard only with the mouse disconnected, on 0.1.0-beta.34 and 0.1.0-alpha.3, and found no fault.
- **Every button, switch and box that shows no text of its own has a name**, from the same translations as the screen.
- **Lists, drop-down options and table cells are read by the words they show**, and a button repeated on each row names
its row — *Open: 11/9/2026 14:03*, *Play: Cyberpunk 2077*, *Turn off: Cyberpunk 2077*.
- **The frame-rate readout says the game's own frames, the displayed frames and the frame-generation factor together**
(*Native 62 FPS, displayed 118 FPS, frame generation ×1.9*) — never the larger number alone; a ray-tracing chip says its
value and where it came from (*Ray Tracing: Yes, measured*).
- **The notices above the page can be read where they are shown**, and the button that answers one says which notice it
answers.
- **Tab goes from control to control**: pictures, lists and the rows of Settings are not stops of their own.
- **Dialogs say they are dialogs** and keep the focus inside them until they close.
### Seeing the screen
@@ -64,7 +72,9 @@ from the same translations. The documents — the user guide, this page, the leg
## How it is checked
- **On every build**, by the project's own tests: every control that shows no text has a name; no colour is written
- **On every build**, by the project's own tests: what a screen reader is given for every page, window and dialog —
every place Tab stops has a name, no list or table item is read by its program name, no text is hidden from a screen
reader inside a control, no two buttons in a list share a name; every control that shows no text has a name; no colour is written
into a screen; every text reads against its background in both themes and after a theme switch; **Esc** closes the
open dialog without an answer; **Ctrl+1** … **Ctrl+5** open the pages in their order; the program declares it follows
each screen's scaling.
@@ -80,9 +90,6 @@ Each one with what to do instead. A barrier that is not on this list is worth re
its points or its name. The numbers are written out elsewhere: a session's figures and *Statistics per series* in its
summary, the table under the Compare chart, the list of changes under a trend chart, and **File ▸ Export ▸ Session
CSV** or **Session JSON**.
- **Some names a screen reader hears are wrong.** Items in drop-down lists and several lists can be read by an
internal name rather than the text shown; the frame-rate readout, the ray-tracing chips and the text of the notices
above the page are not read as text; some buttons in a list all have the same name, such as *Open*.
- **Nothing is announced when it appears** — a safety notice, a banner, a short message at the bottom of the window or
the result of **Tools ▸ Database maintenance**. A safety notice stays above the page until you answer it.
- **Headings are not marked as headings**, so a screen reader's heading keys do not move between the sections of a
+11
View File
@@ -49,6 +49,17 @@ numeric core and does not move; the heading is the full version — corrected 20
pull-request template. The `accessibility` label exists, and so do `safety` and `priority-high`, which the *Safety gap*
form had named since its first day without either existing — so GitHub had never applied them.
- **A screen reader reads what the window shows** (decision D88's goal; measured in the UI Automation tree WPF builds on
every page, window and dialog, every tab — `PagesLoadTests.Automation`). Drop-down options were read as an internal
record (*Choice { Value = dark, Label = Dark }*), lists and table rows by their program names, table cells drawn by a
template as *Item: …, Column Display Index: n*, and the terms window's list by each document's whole text; each now
reads the words it shows, and an empty cell reads *empty*. The frame-rate readout says Native, Displayed and the
factor together (CLAUDE.md rule 6, in speech), a ray-tracing chip its value and where it came from, a change badge its
number. The safety notices' title and message reach a screen reader (they were hidden inside the notice's template),
and the notice's button says which notice it answers. A button repeated on each row names its row (*Open: …*, *Play:
…*, *Turn off: …*). Tab no longer stops on pictures, lists, Settings' rows, the FPS readout, the chips or the dialog
host, where it found nothing to say; an expander's button is named after its header.
### Changed
- **Documents corrected**: charts do take focus and keys (`docs/08_UI.md` said neither — `ChartKeyboardTests` measures
+22 -2
View File
@@ -1054,6 +1054,25 @@ handled key — so whether Esc alone would close a dialog through `IsCancel` is
— corrected 2026-10-04): every `Button`, `ToggleButton`, `ToggleSwitch`, `CheckBox`, `RadioButton`, `ComboBox`,
`TextBox`, `NumberBox`, `PasswordBox`, `Slider` and `HyperlinkButton` in the App's XAML either has content or a name. A new
unnamed one is red.
- **What a screen reader is given, swept on every surface (beta.35, D88).** `PagesLoadTests.Automation` hosts every page,
window, dialog and control as the App hosts it, every tab shown in turn, and reads the UI Automation tree WPF builds — the
tree Narrator reads: **no Tab stop without an automation peer** (a plain `Control`, WPF UI's `Image`, `Card` and
`CardControl` take the focus with no peer or an empty name), **no item named by its type** (WPF names a list's, a
drop-down's and a grid row's item by `ToString()`, and a template column's cell, which has no text of its own, by
`Item: <row>, Column Display Index: n`), **every focusable control named**, **no shown text hidden in a template** (a
`TextBlock` whose templated parent is not a `ContentPresenter` is no control element), and **no two buttons in a list
sharing a name**. All five went red on `main` first — the type-named items filled 190 lines over the surfaces and their
tabs, the silent stops 37, and the safety InfoBar's title and message were hidden — and the fixes are: every item type speaks (`ToString()` through `Services/SpokenText`: `Choice` its
label, a notice its title and text, a document page its title, a session row its date, length and tier…); the display-only
controls (`FpsReadout`, `TriStateChip`, `ChangeBadge`) have a `Controls/SpokenTextAutomationPeer` — a Text element named
by their words, no children — and leave the tab order; a template column names its cells through
`Controls/CellName` (a cell style based on WPF UI's `DefaultDataGridCellStyle`, an empty cell read as *empty*); a row's
button names its row (*Open: …*, *Play: …*, *Turn off: …*); the App's InfoBar template draws its title and message through
`ContentPresenter`s; implicit styles take a plain `ItemsControl`, WPF UI's `Image` and `CardControl` out of the tab order;
a `CardExpander`'s expand button is named after its header (`Controls/ExpanderToggleName` — WPF UI 4.3.0 leaves it
unnamed). **The FPS readout says rule 6 aloud**: *Native 62 FPS, displayed 118 FPS, frame generation ×1.9*, a steady factor
with its share, a stand-alone number with its qualifier (`FpsPresentation.Spoken`). `ScreenReaderNamesTests` holds each
piece.
- Status lines that change after an action (the Database maintenance result) are `AutomationProperties.LiveSetting="Polite"`.
*(Corrected 2026-11-09: this announces nothing. WPF raises `LiveRegionChanged` only when the app raises it — "you
explicitly raise an event", Microsoft's* What's new in accessibility *for 4.7.1 — and `TextBlockAutomationPeer` raises
@@ -1160,10 +1179,11 @@ ScottPlot reads once when the control is made, before it has a window.
is the owner's.~~ **The owner's pass, 2026-11-09: keyboard only with the mouse disconnected, and Narrator, on
0.1.0-beta.34 and 0.1.0-alpha.3 — every page, menu, dialog and setting reached and used, no fault.**
- **What that pass could not show**, found the same day by measuring the UI Automation tree WPF builds (in memory, on
.NET 10.0.14 — not by listening): a drop-down's items are named by a record's printed form (`Choice { Value = dark,
.NET 10.0.14 — not by listening): ~~a drop-down's items are named by a record's printed form (`Choice { Value = dark,
Label = Dark }`) and plain lists' items by their type; a control with no automation peer that still takes focus — a
chart, the FPS readout, the RT/PT/RR chips, the game's artwork — is a Tab stop Narrator says nothing about; text inside
a control template (the safety notices' title and message, the readout, the chips) is hidden from the control view;
a control template (the safety notices' title and message, the readout, the chips) is hidden from the control view~~
*(closed the same day, §Screen readers above, except a chart's: a plot is still a stop with no peer)*;
nothing is announced; no text is a heading; several charts tell series apart by colour alone; page transitions play
with Windows' animation effects off; Windows contrast themes are not followed. `ACCESSIBILITY.md` §Known limitations
states each to users with what to do instead.
+15
View File
@@ -266,6 +266,21 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
bar with no exit, which is exactly how the safety notices shipped (2026-09-14). `Styles/FrameLedger.xaml` carries
the upstream template plus one presenter column; `PagesLoadTests.TheInfoBarTemplateRendersItsContent` renders both
templates and turns red when upstream gains a presenter, which is when the copy comes out.
- [ ] **What a screen reader is given is the UI Automation tree, and WPF builds it with four holes** (beta.35, D88;
`PagesLoadTests.Automation` sweeps every surface for each). (1) **A control with no automation peer** — a plain `Control`
or `ContentControl`, WPF UI's `Image`, `Card`, `Badge`, `InfoBar` (measured on .NET 10.0.14) — is skipped by the tree; if
it is also focusable (a `Control` is, by default) it is a Tab stop Narrator says nothing about. Give a display-only
control a peer (`Controls/SpokenTextAutomationPeer`) and take it out of the tab order; `ui:CardControl` has a peer with an
empty name even with a string `Header` — the App's implicit style takes it out of the tab order. (2) **A list's,
drop-down's or grid row's item is named by its `ToString()`**: a record's is its printed form (`Choice { Value = dark,
Label = Dark }`), a class's its full type name. Every item type overrides it (`Services/SpokenText` builds the words).
(3) **A `TextBlock` written straight into a `ControlTemplate` is no control element** (`TextBlockAutomationPeer`: not when
its templated parent is something other than a `ContentPresenter`): draw a template's text through a `ContentPresenter`
(the App's InfoBar template), or give the control a peer that says it. (4) **A `DataGridTemplateColumn`'s cell has no text
of its own**, so WPF names it `Item: <row>, Column Display Index: n`: name it with `controls:CellName.Path` (a cell style
based on `DefaultDataGridCellStyle`, the one WPF UI's grid gives every cell). Also: a plain `ItemsControl` is focusable
(the App's implicit style says no), and WPF UI's `CardExpander` leaves its expand button (`ExpanderToggleButton`)
unnamed (`Controls/ExpanderToggleName`, set by the App's implicit CardExpander style).
- [ ] **WPF UI 4.3.0 keys its DataGrid parts' styles and defines no implicit one** (`DefaultDataGridRowStyle`,
`DefaultDataGridCellStyle`, `DefaultDataGridColumnHeaderStyle`, handed to the grid by its implicit `DataGrid` style's
`RowStyle`/`CellStyle`/`ColumnHeaderStyle` setters). A local `RowStyle` replaces WPF UI's; based on
@@ -27,4 +27,7 @@ public sealed record ChangeMarker(int Number, DateTimeOffset At, IReadOnlyList<s
/// <summary>The tooltip near the marker: the number and the day, then the changes.</summary>
public string ToolTipText => string.Format(CultureInfo.CurrentCulture, Strings.Trend_Change_Heading_Format, NumberText, DateText) + Environment.NewLine + Text;
/// <summary>The row as a screen reader reads it (beta.35, D88): its number — the chart's badge — the day and the changes.</summary>
public override string ToString() => string.Format(CultureInfo.CurrentCulture, Strings.A11y_ChangeMarker_Format, NumberText, DateText, SpokenText.List([.. Lines]));
}
+69
View File
@@ -0,0 +1,69 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Data;
namespace FrameLedger.App.Controls;
/// <summary>
/// beta.35 (D88): the words a screen reader reads for a template column's cells. A <c>DataGridTemplateColumn</c>'s cell has no
/// text of its own — its template draws it — so WPF names it <c>Item: FrameLedger.App.ViewModels.SessionItemViewModel, Column
/// Display Index: 3</c>. Set on the column, <see cref="PathProperty"/> gives every cell of it the row's text at that path as its
/// name, through a cell style based on WPF UI's own (<c>DefaultDataGridCellStyle</c>, the one its DataGrid gives every cell), so
/// the cells look as they did.
/// </summary>
public static class CellName
{
/// <summary>The key of WPF UI 4.3.0's cell style, which its DataGrid sets as <c>CellStyle</c>.</summary>
public const string WpfUiCellStyleKey = "DefaultDataGridCellStyle";
public static readonly DependencyProperty PathProperty = DependencyProperty.RegisterAttached(
"Path", typeof(string), typeof(CellName), new PropertyMetadata(null, OnPathChanged));
public static string? GetPath(DataGridColumn column)
{
ArgumentNullException.ThrowIfNull(column);
return (string?)column.GetValue(PathProperty);
}
public static void SetPath(DataGridColumn column, string? value)
{
ArgumentNullException.ThrowIfNull(column);
column.SetValue(PathProperty, value);
}
/// <summary>
/// The cell style that names a cell by the row's text at <paramref name="path"/>, based on <paramref name="basedOn"/>. An
/// empty text is read as the word for empty: a cell WPF finds no text in is named by its fallback again.
/// </summary>
public static Style Named(string path, Style? basedOn)
{
ArgumentException.ThrowIfNullOrWhiteSpace(path);
var style = new Style(typeof(DataGridCell), basedOn);
style.Setters.Add(new Setter(AutomationProperties.NameProperty, new Binding(path) { Mode = BindingMode.OneWay, Converter = SaysEmpty.Instance }));
return style;
}
/// <summary>A cell's text, or the word for empty when there is none.</summary>
public static string Spoken(object? value) => value?.ToString() is { } text && !string.IsNullOrWhiteSpace(text) ? text : Strings.A11y_Empty;
private sealed class SaysEmpty : IValueConverter
{
public static readonly SaysEmpty Instance = new();
public object Convert(object? value, Type targetType, object? parameter, System.Globalization.CultureInfo culture) => Spoken(value);
public object ConvertBack(object? value, Type targetType, object? parameter, System.Globalization.CultureInfo culture) => Binding.DoNothing;
}
private static void OnPathChanged(DependencyObject element, DependencyPropertyChangedEventArgs e)
{
if (element is DataGridColumn column && e.NewValue is string { Length: > 0 } path)
{
column.CellStyle = Named(path, column.CellStyle ?? System.Windows.Application.Current?.TryFindResource(WpfUiCellStyleKey) as Style);
}
}
}
@@ -1,7 +1,9 @@
// 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.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Media;
using FrameLedger.App.Charts;
@@ -40,6 +42,10 @@ public sealed class ChangeBadge : Control
set => SetValue(TextProperty, value);
}
/// <summary>beta.35 (D88): the badge in words — "Change 1" — the number that links the row to the chart's badge.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
protected override AutomationPeer OnCreateAutomationPeer() => new SpokenTextAutomationPeer(this, () => string.Format(CultureInfo.CurrentCulture, Strings.A11y_Change_Format, Text));
/// <summary>The palette for the theme the element's resources hold now; the applied theme's when none is reachable.</summary>
internal ChartPalette Palette() => GetValue(_themeProperty) is Color background ? ChartPalette.ForBackground(background) : ChartTheme.Current;
@@ -0,0 +1,101 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
namespace FrameLedger.App.Controls;
/// <summary>
/// beta.35 (D88): WPF UI 4.3.0's <c>CardExpander</c> draws its expand button, the template part <c>ExpanderToggleButton</c>,
/// apart from its header and with no name, so a screen reader reached a Tab stop it could only call "toggle button". Set on
/// every CardExpander by the App's implicit style, this names that button after the header — its text, or the first line of
/// text a composed header shows — once the template exists.
/// </summary>
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
public static class ExpanderToggleName
{
/// <summary>The template part WPF UI's CardExpander template names its expand button.</summary>
public const string PartName = "ExpanderToggleButton";
public static readonly DependencyProperty IsEnabledProperty = DependencyProperty.RegisterAttached(
"IsEnabled", typeof(bool), typeof(ExpanderToggleName), new PropertyMetadata(false, OnIsEnabledChanged));
public static bool GetIsEnabled(DependencyObject element)
{
ArgumentNullException.ThrowIfNull(element);
return (bool)element.GetValue(IsEnabledProperty);
}
public static void SetIsEnabled(DependencyObject element, bool value)
{
ArgumentNullException.ThrowIfNull(element);
element.SetValue(IsEnabledProperty, value);
}
/// <summary>The words for an expander's header: the text itself, or the first non-empty text a composed header holds.</summary>
public static string? HeaderText(object? header) => header switch
{
string text when !string.IsNullOrWhiteSpace(text) => text,
DependencyObject element => FirstText(element),
_ => null,
};
/// <summary>Names the expander's button now, if its template has been applied; false while it has not.</summary>
public static bool TryName(Control expander)
{
ArgumentNullException.ThrowIfNull(expander);
if (expander.Template?.FindName(PartName, expander) is not ToggleButton toggle)
{
return false;
}
if (HeaderText((expander as HeaderedContentControl)?.Header) is { } header)
{
AutomationProperties.SetName(toggle, string.Format(CultureInfo.CurrentCulture, Strings.A11y_ToggleSection_Format, header));
}
return true;
}
private static void OnIsEnabledChanged(DependencyObject element, DependencyPropertyChangedEventArgs e)
{
if (element is not Control expander || e.NewValue is not true || TryName(expander))
{
return;
}
// The template is applied in the first measure; name the button after the first layout that made it.
void OnLayoutUpdated(object? sender, EventArgs args)
{
if (TryName(expander))
{
expander.LayoutUpdated -= OnLayoutUpdated;
}
}
expander.LayoutUpdated += OnLayoutUpdated;
}
private static string? FirstText(DependencyObject root)
{
if (root is TextBlock { Text.Length: > 0 } text)
{
return text.Text;
}
foreach (object child in LogicalTreeHelper.GetChildren(root))
{
if (child is DependencyObject element && FirstText(element) is { } found)
{
return found;
}
}
return null;
}
}
@@ -2,6 +2,7 @@
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Windows;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using FrameLedger.App.Services;
@@ -25,4 +26,7 @@ public sealed class FpsReadout : Control
get => (FpsReadoutModel)GetValue(ModelProperty);
set => SetValue(ModelProperty, value);
}
/// <summary>beta.35 (D88): the readout in words — Native, Displayed and the factor together (rule 6) — and the tooltip's text as help.</summary>
protected override AutomationPeer OnCreateAutomationPeer() => new SpokenTextAutomationPeer(this, () => Model?.SpokenText, () => Model?.QualifierTooltip);
}
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Windows;
using System.Windows.Automation.Peers;
namespace FrameLedger.App.Controls;
/// <summary>
/// The voice of a control that only shows something (beta.35, D88) — the FPS readout, a ray-tracing chip, a change badge.
/// A plain <c>Control</c> has no automation peer, and WPF hides the text in its template from the control view, so a
/// screen reader was given nothing for these. This peer is a Text element named by what the control says in words, with
/// no children, so the template's pieces are not read a second time.
/// </summary>
/// <param name="owner">The control.</param>
/// <param name="name">Its words, read when the screen reader asks; the control's own <c>AutomationProperties.Name</c> wins.</param>
/// <param name="help">More words, where the eye has a tooltip; optional.</param>
public sealed class SpokenTextAutomationPeer(FrameworkElement owner, Func<string?> name, Func<string?>? help = null) : FrameworkElementAutomationPeer(owner)
{
protected override AutomationControlType GetAutomationControlTypeCore() => AutomationControlType.Text;
protected override string GetClassNameCore() => Owner.GetType().Name;
protected override string GetNameCore()
{
string own = base.GetNameCore();
return own.Length > 0 ? own : name() ?? string.Empty;
}
protected override string GetHelpTextCore()
{
string own = base.GetHelpTextCore();
return own.Length > 0 ? own : help?.Invoke() ?? string.Empty;
}
protected override List<AutomationPeer>? GetChildrenCore() => null;
}
@@ -2,6 +2,7 @@
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Windows;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using FrameLedger.App.ViewModels;
@@ -24,4 +25,7 @@ public sealed class TriStateChip : Control
get => (TriStateChipModel?)GetValue(ModelProperty);
set => SetValue(ModelProperty, value);
}
/// <summary>beta.35 (D88): the chip in words, with where its value came from — the tooltip's to the eye.</summary>
protected override AutomationPeer OnCreateAutomationPeer() => new SpokenTextAutomationPeer(this, () => Model?.AccessibleName);
}
@@ -6,6 +6,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DataContext="{d:DesignInstance Type=vm:ImportReviewViewModel}"
@@ -48,7 +49,7 @@
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Width="40">
<DataGridTemplateColumn Width="40" controls:CellName.Path="Name">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox MinWidth="0" Padding="0" HorizontalAlignment="Center" IsEnabled="{Binding CanImport}"
@@ -60,7 +61,7 @@
<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*" />
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnNote}" Binding="{Binding Note}" IsReadOnly="True" Width="Auto" />
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnNote}" Binding="{Binding Note}" IsReadOnly="True" Width="Auto" controls:CellName.Path="Note" />
</DataGrid.Columns>
</DataGrid>
<DockPanel Grid.Row="3">
+2 -1
View File
@@ -155,6 +155,7 @@
Severity="{Binding Severity}"
Title="{Binding Title}">
<ui:Button Appearance="Secondary"
AutomationProperties.HelpText="{Binding AccessibleName}"
Command="{Binding DataContext.ViewModel.DismissNoticeCommand, RelativeSource={RelativeSource AncestorType=Window}}"
CommandParameter="{Binding}"
Content="{Binding ActionText}" />
@@ -193,6 +194,6 @@
</ui:NavigationView>
<ui:SnackbarPresenter x:Name="SnackbarPresenter" Grid.Row="3" VerticalAlignment="Bottom" />
<ui:ContentDialogHost x:Name="DialogHost" Grid.Row="3" />
<ui:ContentDialogHost x:Name="DialogHost" Grid.Row="3" Focusable="False" />
</Grid>
</ui:FluentWindow>
+4 -3
View File
@@ -7,6 +7,7 @@
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"
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
Title="{x:Static res:Strings.Compare_Header}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
@@ -62,7 +63,7 @@
<DataGrid.Columns>
<!-- A template column, not DataGridCheckBoxColumn: that one's element style is WPF's own, an Aero2 box on the Fluent grid; MinWidth 0
and no padding, or WPF UI's CheckBox (MinWidth 120, padding 11) draws a sliver of the box in 40 px (beta.14). -->
<DataGridTemplateColumn Width="40">
<DataGridTemplateColumn Width="40" controls:CellName.Path="Label">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:CompareCandidateViewModel}">
<CheckBox MinWidth="0" Padding="0" HorizontalAlignment="Center" AutomationProperties.Name="{Binding Label}"
@@ -74,7 +75,7 @@
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Date}" Binding="{Binding DateText}" SortMemberPath="StartedAt" IsReadOnly="True" Width="Auto" MinWidth="150" />
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Tier}" Binding="{Binding TierText}" IsReadOnly="True" Width="Auto" MinWidth="64" />
<DataGridTextColumn Header="{x:Static res:Strings.Compare_Col_Fps}" Binding="{Binding ReadoutLine}" IsReadOnly="True" Width="Auto" MinWidth="220" />
<DataGridTemplateColumn Header="{x:Static res:Strings.Compare_Col_MidSession}" IsReadOnly="True" Width="Auto" MinWidth="150" SortMemberPath="SettingsChangedMidSession">
<DataGridTemplateColumn Header="{x:Static res:Strings.Compare_Col_MidSession}" IsReadOnly="True" Width="Auto" MinWidth="150" SortMemberPath="SettingsChangedMidSession" controls:CellName.Path="SettingsChangedText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:CompareCandidateViewModel}">
<StackPanel Margin="4,0" Orientation="Horizontal" VerticalAlignment="Center">
@@ -86,7 +87,7 @@
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!-- the filler: the width the columns above do not need, so they stay together on a wide window -->
<DataGridTemplateColumn Width="*" CanUserSort="False" CanUserResize="False" IsReadOnly="True" />
<DataGridTemplateColumn Width="*" CanUserSort="False" CanUserResize="False" IsReadOnly="True" controls:CellName.Path="Label" />
</DataGrid.Columns>
</DataGrid>
+1 -1
View File
@@ -135,7 +135,7 @@
<ItemsControl Margin="0,8,0,0" ItemsSource="{Binding ViewModel.Recent}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type vm:RecentSessionViewModel}">
<ui:CardAction Margin="0,0,0,6" IsChevronVisible="True"
<ui:CardAction Margin="0,0,0,6" IsChevronVisible="True" AutomationProperties.Name="{Binding AccessibleName}"
Command="{Binding DataContext.ViewModel.OpenSessionCommand, RelativeSource={RelativeSource AncestorType=Page}}"
CommandParameter="{Binding}">
<Grid>
+14 -12
View File
@@ -74,6 +74,8 @@
Visibility="{Binding ViewModel.ArtCover, Converter={StaticResource NullToCollapsed}}">
<ui:Image.Style>
<Style TargetType="ui:Image" BasedOn="{StaticResource DefaultImageStyle}">
<!-- beta.35 (D88): a picture, not a stop for Tab (the App's implicit ui:Image style says so for the others) -->
<Setter Property="Focusable" Value="False" />
<Setter Property="Width" Value="120" />
<Setter Property="Height" Value="180" />
<Style.Triggers>
@@ -314,7 +316,7 @@
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static res:Strings.Sessions_Col_Date}" Binding="{Binding DateText}" />
<DataGridTextColumn Header="{x:Static res:Strings.Sessions_Col_Duration}" Binding="{Binding DurationText}" />
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Tier}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Tier}" controls:CellName.Path="TierText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<Border Style="{StaticResource Pill}" Margin="0" ToolTip="{Binding TierTooltip}">
@@ -323,21 +325,21 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Native}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Native}" controls:CellName.Path="NativeText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<TextBlock Text="{Binding NativeText}" ToolTip="{Binding FpsTooltip}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Displayed}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Displayed}" controls:CellName.Path="DisplayedText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<TextBlock Text="{Binding DisplayedText}" ToolTip="{Binding FpsTooltip}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Fg}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Fg}" controls:CellName.Path="FgText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<TextBlock Text="{Binding FgText}" ToolTip="{Binding FpsTooltip}" />
@@ -349,14 +351,14 @@
<DataGridTextColumn Header="{x:Static res:Strings.Sessions_Col_Resolution}" Binding="{Binding ResolutionText}" />
<DataGridTextColumn Header="{x:Static res:Strings.Sessions_Col_GpuTemp}" Binding="{Binding GpuTempText}" />
<!-- beta.12 (D43): the game's own memory, both tiers; mean, the shared / working-set / commit peaks in the tooltip -->
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_GameVram}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_GameVram}" controls:CellName.Path="GameVramText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<TextBlock Text="{Binding GameVramText}" ToolTip="{Binding GameVramTooltip}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_GameRam}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_GameRam}" controls:CellName.Path="GameRamText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<TextBlock Text="{Binding GameRamText}" ToolTip="{Binding GameRamTooltip}" />
@@ -365,14 +367,14 @@
</DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static res:Strings.Sessions_Col_Api}" Binding="{Binding ApiText}" />
<!-- beta.10: both tiers; the tooltip carries every share, the window, the back buffer and the source -->
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Display}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Display}" controls:CellName.Path="DisplayModeText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<TextBlock Text="{Binding DisplayModeText}" ToolTip="{Binding DisplayModeTooltip}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn controls:CellName.Path="FeaturesText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<StackPanel Orientation="Horizontal">
@@ -383,7 +385,7 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Exit}">
<DataGridTemplateColumn Header="{x:Static res:Strings.Sessions_Col_Exit}" controls:CellName.Path="ExitText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<StackPanel Orientation="Horizontal">
@@ -394,11 +396,11 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static res:Strings.Sessions_Col_Tags}" Binding="{Binding TagsText}" />
<DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static res:Strings.Sessions_Col_Tags}" Binding="{Binding TagsText}" controls:CellName.Path="TagsText" />
<DataGridTemplateColumn controls:CellName.Path="OpenName">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type vm:SessionItemViewModel}">
<ui:Button Appearance="Secondary" Padding="8,2" Content="{x:Static res:Strings.Summary_Open}"
<ui:Button Appearance="Secondary" Padding="8,2" Content="{x:Static res:Strings.Summary_Open}" AutomationProperties.Name="{Binding OpenName}"
Command="{Binding DataContext.ViewModel.OpenSessionCommand, RelativeSource={RelativeSource AncestorType=Page}}"
CommandParameter="{Binding}" />
</DataTemplate>
+5 -5
View File
@@ -110,7 +110,7 @@
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type vm:GameCardViewModel}">
<Grid>
<ui:CardAction IsChevronVisible="False" VerticalAlignment="Stretch" VerticalContentAlignment="Top"
<ui:CardAction IsChevronVisible="False" VerticalAlignment="Stretch" VerticalContentAlignment="Top" AutomationProperties.Name="{Binding AccessibleName}"
Command="{Binding DataContext.ViewModel.OpenCommand, RelativeSource={RelativeSource AncestorType=Page}}"
CommandParameter="{Binding}"
Icon="{ui:SymbolIcon Games24}">
@@ -142,7 +142,7 @@
</ui:CardAction>
<!-- beta.21 (D59): Play, over the card's corner rather than inside it, so the card stays one button. -->
<ui:Button Margin="0,10,10,0" Padding="6,4" HorizontalAlignment="Right" VerticalAlignment="Top"
AutomationProperties.Name="{x:Static res:Strings.Play_Button}"
AutomationProperties.Name="{Binding PlayName}"
Command="{Binding DataContext.ViewModel.PlayCommand, RelativeSource={RelativeSource AncestorType=Page}}"
CommandParameter="{Binding}"
Icon="{ui:SymbolIcon Play24}"
@@ -163,11 +163,11 @@
Visibility="{Binding ViewModel.ListView, Converter={StaticResource BoolToVis}}">
<DataGrid.Columns>
<!-- beta.21 (D59): Play, as on the cards. -->
<DataGridTemplateColumn Header="{x:Static res:Strings.Play_Button}" Width="Auto">
<DataGridTemplateColumn Header="{x:Static res:Strings.Play_Button}" Width="Auto" controls:CellName.Path="PlayName">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ui:Button Margin="2,0" Padding="6,2" Appearance="Transparent"
AutomationProperties.Name="{x:Static res:Strings.Play_Button}"
AutomationProperties.Name="{Binding PlayName}"
Command="{Binding DataContext.ViewModel.PlayCommand, RelativeSource={RelativeSource AncestorType=Page}}"
CommandParameter="{Binding}"
Icon="{ui:SymbolIcon Play24}"
@@ -179,7 +179,7 @@
<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 Header="{x:Static res:Strings.Games_List_Status}" Width="*" controls:CellName.Path="StatusText">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="4,0" VerticalAlignment="Center" Text="{Binding StatusText}" ToolTip="{Binding NotInstalledToolTip}" />
+3 -3
View File
@@ -48,7 +48,7 @@
<ui:TextBlock Grid.Column="0" VerticalAlignment="Center" Text="{Binding Name}" />
<ui:Button Grid.Column="1"
Appearance="Secondary"
Command="{Binding RevokeCommand}"
AutomationProperties.Name="{Binding RevokeName}" Command="{Binding RevokeCommand}"
Content="{x:Static res:Strings.Settings_HookedGames_Revoke}" />
</Grid>
</DataTemplate>
@@ -112,11 +112,11 @@
</StackPanel>
<StackPanel Grid.Column="1" Margin="12,0,0,0" VerticalAlignment="Center" Orientation="Horizontal">
<ui:Button Appearance="Secondary"
Command="{Binding GrantCommand}"
AutomationProperties.Name="{Binding GrantName}" Command="{Binding GrantCommand}"
Content="{x:Static res:Strings.Settings_Exceptions_Grant}"
Visibility="{Binding CanGrant, Converter={StaticResource BoolToVis}}" />
<ui:Button Appearance="Secondary"
Command="{Binding WithdrawCommand}"
AutomationProperties.Name="{Binding WithdrawName}" Command="{Binding WithdrawCommand}"
Content="{x:Static res:Strings.Settings_Exceptions_Withdraw}"
Visibility="{Binding CanWithdraw, Converter={StaticResource BoolToVis}}" />
</StackPanel>
@@ -12,4 +12,7 @@ public sealed record DocumentPage(string Title, string Text, string Path, bool I
{
/// <summary>The same file on GitHub, at this build's source.</summary>
public Uri Url => RepositoryLinks.Blob(Path);
/// <summary>The page list's item as a screen reader reads it (beta.35): the title, never the page's whole text.</summary>
public override string ToString() => Title;
}
@@ -122,6 +122,25 @@ public static class FpsPresentation
public static string PresentedLine(double? presented) => string.Format(CultureInfo.CurrentCulture, Strings.Fps_Presented_Format, Formats.Fps(presented));
/// <summary>
/// The readout in words, for a screen reader (beta.35, D88). CLAUDE.md rule 6 holds for speech as it does for the eye:
/// <c>Native 62 FPS, displayed 118 FPS, frame generation ×1.9</c> — the three together, never the displayed number alone —
/// a steady factor with the share of the session it covers, and a stand-alone number with its qualifier.
/// </summary>
public static string Spoken(FpsReadoutModel model)
{
ArgumentNullException.ThrowIfNull(model);
return model.Kind switch
{
FpsReadoutKind.Generated when model.Factor is double factor => model.SteadyShare is double share
? string.Format(CultureInfo.CurrentCulture, Strings.A11y_Fps_GeneratedSteady_Format, Formats.Fps(model.Native), Formats.Fps(model.Displayed), factor, share * 100)
: string.Format(CultureInfo.CurrentCulture, Strings.A11y_Fps_Generated_Format, Formats.Fps(model.Native), Formats.Fps(model.Displayed), factor),
FpsReadoutKind.Presented or FpsReadoutKind.IdentifiedUncounted when model.QualifierText is { } qualifier =>
string.Format(CultureInfo.CurrentCulture, Strings.A11y_Fps_Presented_Format, Formats.Fps(model.Presented), qualifier),
_ => model.Line,
};
}
public static string FactorChip(double factor) => FactorChip(factor, steadyShare: null);
/// <summary>The factor chip; a steady-state factor always carries the share of the session it describes: <c>×2.0 FG · 75%</c>.</summary>
@@ -78,4 +78,10 @@ public sealed record FpsReadoutModel
public bool QualifierIsWarning => Kind == FpsReadoutKind.IdentifiedUncounted || Qualifier is FpsQualifier.RuntimeLoaded or FpsQualifier.Withheld;
public string? FactorChip => Kind == FpsReadoutKind.Generated && Factor is double f ? FpsPresentation.FactorChip(f, SteadyShare) : null;
/// <summary>
/// The readout as a screen reader says it (beta.35, D88) — CLAUDE.md rule 6 holds for speech too: Native, Displayed and
/// the factor together, a steady factor with the share it covers; a stand-alone number with its qualifier.
/// </summary>
public string SpokenText => FpsPresentation.Spoken(this);
}
@@ -10,4 +10,8 @@ namespace FrameLedger.App.Services;
/// whether it is a plain text shown as written rather than Markdown (the GPL's <c>LICENSE</c>) — and, since beta.12 (D45),
/// whether Accept covers it: the GPL is shown for information and needs no acceptance (GPLv3 §9).
/// </summary>
public sealed record LegalDocument(string Key, string Title, string Version, string Text, Uri Url, string Path = "", bool IsPlainText = false, bool RequiresAcceptance = true);
public sealed record LegalDocument(string Key, string Title, string Version, string Text, Uri Url, string Path = "", bool IsPlainText = false, bool RequiresAcceptance = true)
{
/// <summary>The terms window's list item as a screen reader reads it (beta.35, D88): the title, never the whole document.</summary>
public override string ToString() => Title;
}
@@ -14,4 +14,9 @@ public sealed record SafetyNotice(SafetyNoticeKind Kind, string Title, string Bo
/// <summary>The one action FR-14 allows on a refusal — acknowledging that the session is recorded without measuring — and a plain Dismiss otherwise (no session is running for the others).</summary>
public string ActionText => Kind == SafetyNoticeKind.Refused ? Shared.Strings.Safety_RecordWithoutMeasuring : Strings.Notice_Dismiss;
/// <summary>The notice in one sentence (beta.35, D88): the list item's name, and its button's help text — what it acknowledges.</summary>
public string AccessibleName => SpokenText.TitleAndBody(Title, Body);
public override string ToString() => AccessibleName;
}
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace FrameLedger.App.Services;
/// <summary>
/// What a screen reader says for a thing the App shows in pieces (beta.35, D88) — a label and its value, a notice's title
/// and text, a list of facts — in the UI's language. WPF reads a list's item by its <c>ToString()</c> and a template's
/// text only through its control, so the item types and the controls that draw text in a template speak through these.
/// </summary>
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
public static class SpokenText
{
/// <summary><c>Runs as: Direct3D 12</c>.</summary>
public static string Pair(string label, string? value) =>
string.IsNullOrWhiteSpace(value) ? label : string.Format(CultureInfo.CurrentCulture, Strings.A11y_Pair_Format, label, value);
/// <summary><c>Game: hooking refused. Easy Anti-Cheat was detected in this game.</c></summary>
public static string TitleAndBody(string title, string? body) =>
string.IsNullOrWhiteSpace(body) ? title : string.Format(CultureInfo.CurrentCulture, Strings.A11y_TitleAndBody_Format, title, body);
/// <summary>The non-empty parts, in order, separated as the language separates a list.</summary>
public static string List(params string?[] parts)
{
ArgumentNullException.ThrowIfNull(parts);
return string.Join(Strings.A11y_List_Separator, parts.Where(static p => !string.IsNullOrWhiteSpace(p)).Select(static p => p!.Trim()));
}
}
+39
View File
@@ -29,18 +29,31 @@ public static class Strings
/// <summary>Every key, for an audit that walks them.</summary>
public static IReadOnlyList<string> Keys { get; } =
[
nameof(A11y_Change_Format),
nameof(A11y_ChangeMarker_Format),
nameof(A11y_Chip_Format),
nameof(A11y_Compare_Best_Format),
nameof(A11y_Compare_Filter_Fg),
nameof(A11y_Compare_Filter_Game),
nameof(A11y_Compare_Filter_Tier),
nameof(A11y_Empty),
nameof(A11y_Fps_Generated_Format),
nameof(A11y_Fps_GeneratedSteady_Format),
nameof(A11y_Fps_Presented_Format),
nameof(A11y_Games_Filter_Engine),
nameof(A11y_Games_Filter_Installed),
nameof(A11y_Games_Filter_Played),
nameof(A11y_Games_Filter_State),
nameof(A11y_Games_Filter_Store),
nameof(A11y_Games_Sort),
nameof(A11y_List_Separator),
nameof(A11y_Logs_Level),
nameof(A11y_Logs_Source),
nameof(A11y_Logs_Tail),
nameof(A11y_Pair_Format),
nameof(A11y_SensorStat_Format),
nameof(A11y_TitleAndBody_Format),
nameof(A11y_ToggleSection_Format),
nameof(About_Doc_Notice),
nameof(About_Doc_Packages),
nameof(About_Doc_ThirdParty),
@@ -1229,12 +1242,28 @@ public static class Strings
nameof(Viewer_ChangesThisPc_Off),
];
public static string A11y_Change_Format => ResourceManager.GetString(nameof(A11y_Change_Format), Culture) ?? nameof(A11y_Change_Format);
public static string A11y_ChangeMarker_Format => ResourceManager.GetString(nameof(A11y_ChangeMarker_Format), Culture) ?? nameof(A11y_ChangeMarker_Format);
public static string A11y_Chip_Format => ResourceManager.GetString(nameof(A11y_Chip_Format), Culture) ?? nameof(A11y_Chip_Format);
public static string A11y_Compare_Best_Format => ResourceManager.GetString(nameof(A11y_Compare_Best_Format), Culture) ?? nameof(A11y_Compare_Best_Format);
public static string A11y_Compare_Filter_Fg => ResourceManager.GetString(nameof(A11y_Compare_Filter_Fg), Culture) ?? nameof(A11y_Compare_Filter_Fg);
public static string A11y_Compare_Filter_Game => ResourceManager.GetString(nameof(A11y_Compare_Filter_Game), Culture) ?? nameof(A11y_Compare_Filter_Game);
public static string A11y_Compare_Filter_Tier => ResourceManager.GetString(nameof(A11y_Compare_Filter_Tier), Culture) ?? nameof(A11y_Compare_Filter_Tier);
public static string A11y_Empty => ResourceManager.GetString(nameof(A11y_Empty), Culture) ?? nameof(A11y_Empty);
public static string A11y_Fps_Generated_Format => ResourceManager.GetString(nameof(A11y_Fps_Generated_Format), Culture) ?? nameof(A11y_Fps_Generated_Format);
public static string A11y_Fps_GeneratedSteady_Format => ResourceManager.GetString(nameof(A11y_Fps_GeneratedSteady_Format), Culture) ?? nameof(A11y_Fps_GeneratedSteady_Format);
public static string A11y_Fps_Presented_Format => ResourceManager.GetString(nameof(A11y_Fps_Presented_Format), Culture) ?? nameof(A11y_Fps_Presented_Format);
public static string A11y_Games_Filter_Engine => ResourceManager.GetString(nameof(A11y_Games_Filter_Engine), Culture) ?? nameof(A11y_Games_Filter_Engine);
public static string A11y_Games_Filter_Installed => ResourceManager.GetString(nameof(A11y_Games_Filter_Installed), Culture) ?? nameof(A11y_Games_Filter_Installed);
@@ -1247,12 +1276,22 @@ public static class Strings
public static string A11y_Games_Sort => ResourceManager.GetString(nameof(A11y_Games_Sort), Culture) ?? nameof(A11y_Games_Sort);
public static string A11y_List_Separator => ResourceManager.GetString(nameof(A11y_List_Separator), Culture) ?? nameof(A11y_List_Separator);
public static string A11y_Logs_Level => ResourceManager.GetString(nameof(A11y_Logs_Level), Culture) ?? nameof(A11y_Logs_Level);
public static string A11y_Logs_Source => ResourceManager.GetString(nameof(A11y_Logs_Source), Culture) ?? nameof(A11y_Logs_Source);
public static string A11y_Logs_Tail => ResourceManager.GetString(nameof(A11y_Logs_Tail), Culture) ?? nameof(A11y_Logs_Tail);
public static string A11y_Pair_Format => ResourceManager.GetString(nameof(A11y_Pair_Format), Culture) ?? nameof(A11y_Pair_Format);
public static string A11y_SensorStat_Format => ResourceManager.GetString(nameof(A11y_SensorStat_Format), Culture) ?? nameof(A11y_SensorStat_Format);
public static string A11y_TitleAndBody_Format => ResourceManager.GetString(nameof(A11y_TitleAndBody_Format), Culture) ?? nameof(A11y_TitleAndBody_Format);
public static string A11y_ToggleSection_Format => ResourceManager.GetString(nameof(A11y_ToggleSection_Format), Culture) ?? nameof(A11y_ToggleSection_Format);
public static string About_Doc_Notice => ResourceManager.GetString(nameof(About_Doc_Notice), Culture) ?? nameof(About_Doc_Notice);
public static string About_Doc_Packages => ResourceManager.GetString(nameof(About_Doc_Packages), Culture) ?? nameof(About_Doc_Packages);
+52
View File
@@ -4828,4 +4828,56 @@
<value>アルファ版 — プレリリース版の .NET である {0} で動作</value>
<comment>review</comment>
</data>
<data name="A11y_Pair_Format" xml:space="preserve">
<value>{0}:{1}</value>
<comment>review</comment>
</data>
<data name="A11y_TitleAndBody_Format" xml:space="preserve">
<value>{0}。{1}</value>
<comment>review</comment>
</data>
<data name="A11y_List_Separator" xml:space="preserve">
<value>、</value>
<comment>review</comment>
</data>
<data name="A11y_Empty" xml:space="preserve">
<value>空欄</value>
<comment>review</comment>
</data>
<data name="A11y_Chip_Format" xml:space="preserve">
<value>{0}:{1}({2})</value>
<comment>review</comment>
</data>
<data name="A11y_Change_Format" xml:space="preserve">
<value>変更 {0}</value>
<comment>review</comment>
</data>
<data name="A11y_ChangeMarker_Format" xml:space="preserve">
<value>変更 {0}、{1}:{2}</value>
<comment>review</comment>
</data>
<data name="A11y_Compare_Best_Format" xml:space="preserve">
<value>{0}(最良)</value>
<comment>review</comment>
</data>
<data name="A11y_SensorStat_Format" xml:space="preserve">
<value>{0}:平均 {1}、中央値 {2}、最小 {3}、最大 {4}({5} 回の読み取り)</value>
<comment>review</comment>
</data>
<data name="A11y_Fps_Generated_Format" xml:space="preserve">
<value>ネイティブ {0} FPS、表示 {1} FPS、フレーム生成 ×{2:0.0}</value>
<comment>review</comment>
</data>
<data name="A11y_Fps_GeneratedSteady_Format" xml:space="preserve">
<value>ネイティブ {0} FPS、表示 {1} FPS、フレーム生成 ×{2:0.0}(セッションの {3:0}%)</value>
<comment>review</comment>
</data>
<data name="A11y_Fps_Presented_Format" xml:space="preserve">
<value>表示された {0} FPS(Presented)。{1}</value>
<comment>review</comment>
</data>
<data name="A11y_ToggleSection_Format" xml:space="preserve">
<value>表示/非表示:{0}</value>
<comment>review</comment>
</data>
</root>
+39
View File
@@ -3632,4 +3632,43 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="About_Runtime_Alpha_Format" xml:space="preserve">
<value>Alpha build — runs on {0}, a prerelease .NET</value>
</data>
<data name="A11y_Pair_Format" xml:space="preserve">
<value>{0}: {1}</value>
</data>
<data name="A11y_TitleAndBody_Format" xml:space="preserve">
<value>{0}. {1}</value>
</data>
<data name="A11y_List_Separator" xml:space="preserve">
<value>, </value>
</data>
<data name="A11y_Empty" xml:space="preserve">
<value>empty</value>
</data>
<data name="A11y_Chip_Format" xml:space="preserve">
<value>{0}: {1}, {2}</value>
</data>
<data name="A11y_Change_Format" xml:space="preserve">
<value>Change {0}</value>
</data>
<data name="A11y_ChangeMarker_Format" xml:space="preserve">
<value>Change {0}, {1}: {2}</value>
</data>
<data name="A11y_Compare_Best_Format" xml:space="preserve">
<value>{0}, the best</value>
</data>
<data name="A11y_SensorStat_Format" xml:space="preserve">
<value>{0}: mean {1}, median {2}, lowest {3}, highest {4}, over {5} readings</value>
</data>
<data name="A11y_Fps_Generated_Format" xml:space="preserve">
<value>Native {0} FPS, displayed {1} FPS, frame generation ×{2:0.0}</value>
</data>
<data name="A11y_Fps_GeneratedSteady_Format" xml:space="preserve">
<value>Native {0} FPS, displayed {1} FPS, frame generation ×{2:0.0} for {3:0}% of the session</value>
</data>
<data name="A11y_Fps_Presented_Format" xml:space="preserve">
<value>{0} presented FPS. {1}</value>
</data>
<data name="A11y_ToggleSection_Format" xml:space="preserve">
<value>Show or hide: {0}</value>
</data>
</root>
+39
View File
@@ -3627,4 +3627,43 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="About_Runtime_Alpha_Format" xml:space="preserve">
<value>Bản alpha — chạy trên {0}, một phiên bản .NET chưa phát hành chính thức</value>
</data>
<data name="A11y_Pair_Format" xml:space="preserve">
<value>{0}: {1}</value>
</data>
<data name="A11y_TitleAndBody_Format" xml:space="preserve">
<value>{0}. {1}</value>
</data>
<data name="A11y_List_Separator" xml:space="preserve">
<value>, </value>
</data>
<data name="A11y_Empty" xml:space="preserve">
<value>trống</value>
</data>
<data name="A11y_Chip_Format" xml:space="preserve">
<value>{0}: {1}, {2}</value>
</data>
<data name="A11y_Change_Format" xml:space="preserve">
<value>Thay đổi {0}</value>
</data>
<data name="A11y_ChangeMarker_Format" xml:space="preserve">
<value>Thay đổi {0}, {1}: {2}</value>
</data>
<data name="A11y_Compare_Best_Format" xml:space="preserve">
<value>{0}, tốt nhất</value>
</data>
<data name="A11y_SensorStat_Format" xml:space="preserve">
<value>{0}: trung bình {1}, trung vị {2}, thấp nhất {3}, cao nhất {4}, trên {5} lần đọc</value>
</data>
<data name="A11y_Fps_Generated_Format" xml:space="preserve">
<value>FPS gốc (Native) {0}, FPS hiển thị {1}, tạo khung hình ×{2:0.0}</value>
</data>
<data name="A11y_Fps_GeneratedSteady_Format" xml:space="preserve">
<value>FPS gốc (Native) {0}, FPS hiển thị {1}, tạo khung hình ×{2:0.0} trong {3:0}% phiên</value>
</data>
<data name="A11y_Fps_Presented_Format" xml:space="preserve">
<value>{0} FPS được trình chiếu (Presented). {1}</value>
</data>
<data name="A11y_ToggleSection_Format" xml:space="preserve">
<value>Hiện hoặc ẩn: {0}</value>
</data>
</root>
+48 -5
View File
@@ -123,6 +123,27 @@
when there is no content. PagesLoadTests.TheInfoBarTemplateRendersItsContent renders both templates and
fails the day upstream gains a ContentPresenter, so this copy is removed rather than kept out of habit.
-->
<!--
beta.35 (D88): what a screen reader is given. A plain ItemsControl is a Tab stop that holds nothing to say (WPF makes it
focusable; its items' own controls take the focus); WPF UI's Image and CardControl take the focus with no automation
peer or with an empty name - a Tab stop Narrator says nothing about; a CardExpander's expand button has no name. The
App's lists, pictures and setting rows are not stops; an expander's button is named after its header
(Controls/ExpanderToggleName). PagesLoadTests.Automation holds all four.
-->
<Style TargetType="ItemsControl">
<Setter Property="Focusable" Value="False" />
</Style>
<Style TargetType="{x:Type ui:Image}" BasedOn="{StaticResource DefaultImageStyle}">
<Setter Property="Focusable" Value="False" />
</Style>
<Style TargetType="{x:Type ui:CardControl}" BasedOn="{StaticResource {x:Type ui:CardControl}}">
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
</Style>
<Style TargetType="{x:Type ui:CardExpander}" BasedOn="{StaticResource {x:Type ui:CardExpander}}">
<Setter Property="controls:ExpanderToggleName.IsEnabled" Value="True" />
</Style>
<Style TargetType="{x:Type ui:InfoBar}">
<Setter Property="Background">
<Setter.Value>
@@ -165,12 +186,28 @@
<Border Margin="0,2,14,0" VerticalAlignment="Top">
<ui:SymbolIcon x:Name="SymbolIcon" VerticalAlignment="Top" Filled="True" FontSize="16" />
</Border>
<!--
beta.35 (D88): the title and the message through ContentPresenters. A TextBlock written straight
into a template is hidden from the control view of the UI Automation tree (its templated parent is
the InfoBar, which has no peer), so a safety notice's words reached no screen reader; a text a
ContentPresenter makes is a control element.
-->
<WrapPanel Grid.Column="1" VerticalAlignment="Top">
<TextBlock x:Name="TitleText" Margin="0,0,14,0" ScrollViewer.CanContentScroll="False"
Text="{TemplateBinding Title}" TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="SemiBold" TextWrapping="Wrap" />
<TextBlock Margin="0" ScrollViewer.CanContentScroll="False" Text="{TemplateBinding Message}"
TextElement.FontSize="{TemplateBinding FontSize}" TextWrapping="Wrap" />
<ContentPresenter x:Name="TitleText" Margin="0,0,14,0" Content="{TemplateBinding Title}"
TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontWeight="SemiBold">
<ContentPresenter.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" TextWrapping="Wrap" />
</DataTemplate>
</ContentPresenter.ContentTemplate>
</ContentPresenter>
<ContentPresenter Margin="0" Content="{TemplateBinding Message}" TextElement.FontSize="{TemplateBinding FontSize}">
<ContentPresenter.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" TextWrapping="Wrap" />
</DataTemplate>
</ContentPresenter.ContentTemplate>
</ContentPresenter>
</WrapPanel>
<!-- The one addition: the InfoBar's Content, which is where the action button goes. -->
<ContentPresenter x:Name="ActionContent" Grid.Column="2" Margin="12,0,0,0" VerticalAlignment="Center"
@@ -246,6 +283,9 @@
when a frame-generation runtime was loaded / the counted none was withheld.
-->
<Style TargetType="{x:Type controls:FpsReadout}">
<!-- beta.35 (D88): shown, not operated - read through its peer (SpokenTextAutomationPeer), no Tab stop. -->
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:FpsReadout}">
@@ -290,6 +330,9 @@
<!-- TriStateChip (08_UI §Tri-state feature chips): Yes filled accent · No outlined · N/A dashed, muted. -->
<Style TargetType="{x:Type controls:TriStateChip}">
<Setter Property="Margin" Value="0,0,8,0" />
<!-- beta.35 (D88): read through its peer; where a chip can be changed, the button around it is the stop. -->
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:TriStateChip}">
+8 -1
View File
@@ -4,4 +4,11 @@
namespace FrameLedger.App.ViewModels;
/// <summary>A value and the text it shows as, for a ComboBox bound by value.</summary>
public sealed record Choice<T>(T Value, string Label);
public sealed record Choice<T>(T Value, string Label)
{
/// <summary>
/// What a screen reader reads for the option (beta.35, D88): WPF names a drop-down's item by its <c>ToString()</c>, and a
/// record's own was <c>Choice { Value = dark, Label = Dark }</c>.
/// </summary>
public override string ToString() => Label;
}
@@ -63,4 +63,7 @@ public sealed partial class CompareCandidateViewModel : ObservableObject
public bool SettingsChangedMidSession { get; }
public string Label => GameName + " · " + DateText + " (" + TierText + ")";
/// <summary>The row as a screen reader reads it (beta.35, D88) — the same words as its tick box.</summary>
public override string ToString() => Label;
}
@@ -4,4 +4,9 @@
namespace FrameLedger.App.ViewModels;
/// <summary>One cell of Compare's stat table: the text, and whether it is the best of its row (never for N/A).</summary>
public sealed record CompareCell(string Text, bool IsBest);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
public sealed record CompareCell(string Text, bool IsBest)
{
/// <summary>The cell as a screen reader reads it (beta.35, D88): bold says "the best" to the eye, these words to the ear.</summary>
public override string ToString() => IsBest ? string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.A11y_Compare_Best_Format, Text) : Text;
}
@@ -4,4 +4,8 @@
namespace FrameLedger.App.ViewModels;
/// <summary>One row of Compare's stat table: the metric and one cell per compared session, in the selection's order.</summary>
public sealed record CompareRowViewModel(string Metric, IReadOnlyList<CompareCell> Cells);
public sealed record CompareRowViewModel(string Metric, IReadOnlyList<CompareCell> Cells)
{
/// <summary>The row as a screen reader reads it (beta.35, D88): the metric, then each session's value in order.</summary>
public override string ToString() => Services.SpokenText.Pair(Metric, Services.SpokenText.List([.. Cells.Select(static c => c.ToString())]));
}
@@ -50,4 +50,11 @@ public sealed partial class ExceptionGameViewModel
[RelayCommand]
private Task WithdrawAsync() => _withdraw(this);
/// <summary>The row's buttons, naming the game they act on (beta.35, D88).</summary>
public string GrantName => SpokenText.Pair(Strings.Settings_Exceptions_Grant.TrimEnd('…'), Name);
public string WithdrawName => SpokenText.Pair(Strings.Settings_Exceptions_Withdraw, Name);
public override string ToString() => Name;
}
@@ -19,4 +19,7 @@ public sealed record FgMixRowModel(string Label, string Share, string Rates, str
{
/// <summary>The row's colour, as a one-segment bar beside its label.</summary>
public IReadOnlyList<FgMixSegment> Swatch { get; } = [Segment with { Share = 1 }];
/// <summary>The row in one line (beta.35, D88): the state, its share, its own rates and its time — never a factor alone.</summary>
public override string ToString() => Services.SpokenText.Pair(Label, Services.SpokenText.List(Share, Rates, Duration));
}
@@ -23,6 +23,7 @@ public sealed partial class GameCardViewModel : ObservableObject
/// <summary>beta.11: the "Not installed" pill shows — the file, or the drive it was on, is not there now.</summary>
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(StatusText))]
[NotifyPropertyChangedFor(nameof(AccessibleName))]
private bool _notInstalled;
/// <summary>What the pill means here — the drive that is not connected, or the path the file is gone from; null when installed.</summary>
@@ -154,4 +155,12 @@ public sealed partial class GameCardViewModel : ObservableObject
&& string.Equals(Card.Row.Platform, other.Card.Row.Platform, StringComparison.Ordinal)
&& string.Equals(Card.Row.StoreId, other.Card.Row.StoreId, StringComparison.Ordinal);
}
/// <summary>The card and the list's row as a screen reader reads them (beta.35, D88): the game and its state.</summary>
public string AccessibleName => SpokenText.List(Name, StatusText);
/// <summary>The card's Play button, naming the game it starts.</summary>
public string PlayName => SpokenText.Pair(Strings.Play_Button, Name);
public override string ToString() => AccessibleName;
}
@@ -4,4 +4,8 @@
namespace FrameLedger.App.ViewModels;
/// <summary>One line of the game page's Details card (beta.8): a label and what the game's files — or its store — say.</summary>
public sealed record GameDetailRow(string Label, string Value);
public sealed record GameDetailRow(string Label, string Value)
{
/// <summary>The line as a screen reader reads it (beta.35, D88): <c>Runs as: Direct3D 12</c>.</summary>
public override string ToString() => Services.SpokenText.Pair(Label, Value);
}
@@ -17,4 +17,9 @@ public sealed partial class HookedGameViewModel(long gameId, string name, Func<H
[RelayCommand]
private Task RevokeAsync() => revoke(this);
/// <summary>The row's button, naming the game whose hooking it turns off (beta.35, D88).</summary>
public string RevokeName => Services.SpokenText.Pair(Strings.Settings_HookedGames_Revoke, Name);
public override string ToString() => Name;
}
@@ -42,4 +42,7 @@ public sealed partial class ImportCandidateViewModel : ObservableObject
/// <summary>Already in the library (under this drive letter or, since 2026-09-23, another), no executable found, or a guessed executable the user should check.</summary>
public string Note { get; }
/// <summary>The row as a screen reader reads it (beta.35, D88).</summary>
public override string ToString() => Name;
}
@@ -7,4 +7,8 @@ namespace FrameLedger.App.ViewModels;
/// <summary>One stated fact: what it is, and its value as text (N/A included).</summary>
[StructLayout(LayoutKind.Auto)]
public readonly record struct LabelledValue(string Label, string Value);
public readonly record struct LabelledValue(string Label, string Value)
{
/// <summary>The fact as a screen reader reads it (beta.35, D88).</summary>
public override string ToString() => Services.SpokenText.Pair(Label, Value);
}
@@ -195,4 +195,7 @@ public sealed partial class LiveCaptureViewModel : ObservableObject
IsHeld = false;
HeldReason = GameName = TierText = ElapsedText = GpuTempText = CpuTempText = MemoryText = string.Empty;
}
/// <summary>The live card as a screen reader reads it (beta.35, D88): the game, how it is recorded, for how long.</summary>
public override string ToString() => SpokenText.List(GameName, TierText, ElapsedText);
}
@@ -40,4 +40,9 @@ public sealed class RecentSessionViewModel
public FpsReadoutModel Readout { get; }
public bool IsCrashed { get; }
/// <summary>The Dashboard's recent session as a screen reader reads it (beta.35, D88).</summary>
public string AccessibleName => SpokenText.List(GameName, DateText, DurationText, TierText, Readout.SpokenText);
public override string ToString() => AccessibleName;
}
@@ -7,4 +7,10 @@ namespace FrameLedger.App.ViewModels;
/// One row of the summary's statistics table (beta.12): a series' stored mean, median, minimum and peak as text in its own
/// unit, and how many readings they are over — from <c>sessions.sensor_stats_json</c>, never recomputed.
/// </summary>
public sealed record SensorStatRowModel(string Series, string Mean, string Median, string Min, string Max, string Readings);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
public sealed record SensorStatRowModel(string Series, string Mean, string Median, string Min, string Max, string Readings)
{
/// <summary>The row as a screen reader reads it (beta.35, D88), each number with what it is.</summary>
public override string ToString() =>
string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.A11y_SensorStat_Format, Series, Mean, Median, Min, Max, Readings);
}
@@ -118,4 +118,15 @@ public sealed class SessionItemViewModel
public TriStateChipModel Pt { get; }
public TriStateChipModel Rr { get; }
/// <summary>The row as a screen reader reads it (beta.35, D88): when, how long, and whether it was measured.</summary>
public string AccessibleName => SpokenText.List(DateText, DurationText, TierText);
/// <summary>The row's Open button, naming the session it opens — three rows would otherwise read "Open" three times.</summary>
public string OpenName => SpokenText.Pair(Strings.Summary_Open, DateText);
/// <summary>The ray-tracing chips' cell in words: each chip with its value and where the value came from.</summary>
public string FeaturesText => SpokenText.List(Rt.AccessibleName, Pt.AccessibleName, Rr.AccessibleName);
public override string ToString() => AccessibleName;
}
@@ -4,4 +4,8 @@
namespace FrameLedger.App.ViewModels;
/// <summary>One stat card of the session summary: a label and its value as text (N/A where the tier has none).</summary>
public sealed record StatCardModel(string Label, string Value, string? Suffix = null);
public sealed record StatCardModel(string Label, string Value, string? Suffix = null)
{
/// <summary>The card as a screen reader reads it (beta.35, D88): <c>Average: 62 FPS</c>.</summary>
public override string ToString() => Services.SpokenText.Pair(Label, string.IsNullOrEmpty(Suffix) ? Value : Value + " " + Suffix);
}
@@ -31,4 +31,7 @@ public sealed partial class TrendMetricOptionViewModel : ObservableObject
/// <summary>The axis it is drawn against (<see cref="TrendSeriesBuilder.UnitOf"/>).</summary>
public string Unit { get; }
/// <summary>The option as a screen reader reads it (beta.35, D88).</summary>
public override string ToString() => Label;
}
@@ -29,6 +29,15 @@ public sealed record TriStateChipModel(string Label, Tri Value, TriStateSource S
public string Text => Label + ": " + ValueText;
/// <summary>
/// The chip as a screen reader reads it (beta.35, D88): its label, its value and where the value came from — the source
/// is the tooltip's to the eye, and a tooltip on a chip that takes no focus never reaches the ear.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
public string AccessibleName => string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.A11y_Chip_Format, Label, ValueText, SourceText);
public override string ToString() => AccessibleName;
public bool IsYes => Value == Tri.Yes;
public bool IsNo => Value == Tri.No;
@@ -65,7 +65,7 @@
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type vm:TriStateChipModel}">
<!-- FR-8.3: click → the override dialog -->
<Button Padding="0" Background="Transparent" BorderThickness="0"
<Button Padding="0" Background="Transparent" BorderThickness="0" AutomationProperties.Name="{Binding AccessibleName}"
Command="{Binding DataContext.ViewModel.OverrideCommand, RelativeSource={RelativeSource AncestorType=Window}}"
CommandParameter="{Binding}">
<controls:TriStateChip Model="{Binding}" />
@@ -244,6 +244,6 @@
</StackPanel>
</StackPanel>
</ScrollViewer>
<ui:ContentDialogHost x:Name="DialogHost" Grid.Row="1" />
<ui:ContentDialogHost x:Name="DialogHost" Grid.Row="1" Focusable="False" />
</Grid>
</ui:FluentWindow>
@@ -0,0 +1,269 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using FluentAssertions;
namespace FrameLedger.App.Tests;
/// <summary>
/// What a screen reader is given (beta.35, D88): the UI Automation tree WPF builds for every surface, hosted as the App
/// hosts it, with every tab of a TabControl shown in turn. These are measurements of the tree, not of speech: what Narrator
/// says is read from this tree, so a name missing here is a name it cannot say. The owner's Narrator pass of 2026-11-09
/// found no fault and could not see these — a record's printed form read as an item's name, a Tab stop with nothing to
/// say, a notice's text hidden inside a template.
/// </summary>
public sealed partial class PagesLoadTests
{
/// <summary>A record's printed form — <c>Choice { Value = dark, Label = Dark }</c> — which WPF reads as an item's name.</summary>
[GeneratedRegex(@"^\w+(`\d+)? \{ .*\}$", RegexOptions.CultureInvariant | RegexOptions.Singleline | RegexOptions.ExplicitCapture, 1000)]
private static partial Regex RecordDump();
/// <summary>Every surface, every tab shown in turn: the surface's name and its root, laid out, for each visit.</summary>
private static List<string> SweepEverySurface(Surfaces surfaces, Action<string, FrameworkElement, List<string>> check)
{
var found = new List<string>();
foreach ((string name, Func<FrameworkElement> build) in surfaces.All())
{
(Window host, FrameworkElement root) = Hosted(build);
try
{
Lay(root);
check(name, root, found);
foreach (TabControl tabs in Visuals.FindAll<TabControl>(root).ToList())
{
for (int i = 0; i < tabs.Items.Count; i++)
{
tabs.SelectedIndex = i;
Visuals.Pump();
Lay(root);
check(string.Create(CultureInfo.InvariantCulture, $"{name} (tab {i})"), root, found);
}
}
}
finally
{
host.Close();
}
}
return [.. found.Distinct(StringComparer.Ordinal)];
}
/// <summary>The elements a user can reach: nothing above them collapsed or hidden, none disabled.</summary>
private static IEnumerable<UIElement> Reachable(DependencyObject root)
{
if (root is UIElement { Visibility: not Visibility.Visible } or UIElement { IsEnabled: false })
{
yield break;
}
if (root is UIElement element)
{
yield return element;
}
int count = VisualTreeHelper.GetChildrenCount(root);
for (int i = 0; i < count; i++)
{
foreach (UIElement child in Reachable(VisualTreeHelper.GetChild(root, i)))
{
yield return child;
}
}
}
private static bool IsTabStop(UIElement element) => element.Focusable && KeyboardNavigation.GetIsTabStop(element);
private static string Describe(string surface, DependencyObject element)
{
string name = element is FrameworkElement { Name.Length: > 0 } named ? "#" + named.Name : string.Empty;
string context = element is FrameworkElement { DataContext: { } data } ? " over " + data.GetType().Name : string.Empty;
return $"{surface}: {element.GetType().Name}{name}{context}";
}
/// <summary>
/// A control that takes the focus but has no automation peer is a Tab stop Narrator says nothing about: WPF raises a
/// focus event only for an element with a peer. Plain <c>Control</c>s, WPF UI's <c>Image</c> and ScottPlot's plot are such
/// controls unless they are given a peer or taken out of the tab order.
/// </summary>
[Fact]
public async Task NoSurfaceHasASilentTabStop()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
using Surfaces surfaces = await Surfaces.LoadAsync(s);
List<string> silent = await OnStaAsync(() => SweepEverySurface(surfaces, static (name, root, found) =>
{
foreach (UIElement element in Reachable(root).Where(IsTabStop))
{
if (UIElementAutomationPeer.CreatePeerForElement(element) is null && !string.Equals(element.GetType().Name, "WpfPlot", StringComparison.Ordinal))
{
found.Add(Describe(name, element));
}
}
}));
string.Join(Environment.NewLine, silent).Should().BeEmpty("a Tab stop with no automation peer says nothing to a screen reader (ScottPlot's plot is beta.35 PR-4's)");
}
/// <summary>
/// WPF names a list's item by the item's <c>ToString()</c> — a drop-down's options, a list's rows, a grid's cells with no
/// text of their own — so an item type that does not say what it shows is read as its type, or a record's whole printed
/// form. Measured 2026-11-09: a theme option was <c>Choice { Value = dark, Label = Dark }</c>.
/// </summary>
[Fact]
public async Task NoSurfaceNamesAnItemByItsType()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
using Surfaces surfaces = await Surfaces.LoadAsync(s);
List<string> typeNamed = await OnStaAsync(() => SweepEverySurface(surfaces, static (name, root, found) =>
{
foreach (ItemsControl list in Reachable(root).OfType<ItemsControl>())
{
foreach (object? item in list.Items)
{
if (item is null or string or ValueType and IConvertible || item is UIElement)
{
continue;
}
string text = item.ToString() ?? string.Empty;
if (text.Length == 0 || string.Equals(text, item.GetType().ToString(), StringComparison.Ordinal) || RecordDump().IsMatch(text))
{
found.Add($"{name}: {list.GetType().Name}{(list.Name.Length > 0 ? "#" + list.Name : string.Empty)} item {item.GetType().Name} reads \"{Shorten(text)}\"");
}
}
}
// A grid's cells as the grid's peer hands them out: a cell with no text of its own falls back to WPF's
// "Item: …, Column Display Index: n".
foreach (DataGrid grid in Reachable(root).OfType<DataGrid>())
{
foreach (AutomationPeer row in UIElementAutomationPeer.CreatePeerForElement(grid)?.GetChildren() ?? [])
{
foreach (AutomationPeer cell in row.GetChildren() ?? [])
{
string cellName = cell.GetName();
if (cellName.StartsWith("Item: ", StringComparison.Ordinal) || cellName.Contains("FrameLedger.", StringComparison.Ordinal) || RecordDump().IsMatch(cellName))
{
found.Add($"{name}: {grid.GetType().Name}{(grid.Name.Length > 0 ? "#" + grid.Name : string.Empty)} cell reads \"{Shorten(cellName)}\"");
}
}
}
}
}));
string.Join(Environment.NewLine, typeNamed).Should().BeEmpty("an item is read by the text it shows, never by its type");
}
/// <summary>Every control the keyboard reaches has a name a screen reader can say.</summary>
[Fact]
public async Task EveryFocusableControlOnEverySurfaceHasAName()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
using Surfaces surfaces = await Surfaces.LoadAsync(s);
List<string> unnamed = await OnStaAsync(() => SweepEverySurface(surfaces, static (name, root, found) =>
{
foreach (UIElement element in Reachable(root).Where(IsTabStop))
{
if (UIElementAutomationPeer.CreatePeerForElement(element) is { } peer && string.IsNullOrWhiteSpace(peer.GetName()) && !Anonymous(element))
{
found.Add(Describe(name, element) + " (" + peer.GetType().Name + ")");
}
}
}));
string.Join(Environment.NewLine, unnamed).Should().BeEmpty("a control the keyboard reaches is announced by its name; an unnamed one is read as its type alone");
}
/// <summary>
/// The containers a screen reader passes through without stopping to read them — a scroller, a list's own panel — whose
/// content carries the names.
/// </summary>
private static bool Anonymous(UIElement element) => element is ScrollViewer or ScrollBar or Thumb or Frame;
/// <summary>
/// WPF hides a TextBlock inside a control's template from the control view of the UI Automation tree (its
/// <c>TextBlockAutomationPeer</c> is no control element when its templated parent is not a <c>ContentPresenter</c>). Such a
/// text reaches a screen reader only through its control: the control has a peer, and the peer has a name. The safety
/// notices' title and message were such texts in the App's own InfoBar template.
/// </summary>
[Fact]
public async Task NoShownTextIsHiddenFromAScreenReader()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
using Surfaces surfaces = await Surfaces.LoadAsync(s);
List<string> hidden = await OnStaAsync(() => SweepEverySurface(surfaces, static (name, root, found) =>
{
foreach (TextBlock text in ShownTexts(root))
{
if (text.TemplatedParent is null or ContentPresenter || text.TemplatedParent is not UIElement owner)
{
continue;
}
AutomationPeer? peer = UIElementAutomationPeer.CreatePeerForElement(owner);
if ((peer is null || string.IsNullOrWhiteSpace(peer.GetName())) && owner is not Wpf.Ui.Controls.TitleBar)
{
found.Add($"{name}: \"{Shorten(text.Text)}\" inside {owner.GetType().Name}'s template ({(peer is null ? "no peer" : "a peer with no name")})");
}
}
}));
string.Join(Environment.NewLine, hidden).Should().BeEmpty("text inside a template reaches a screen reader only through its control's peer and name");
}
/// <summary>
/// Buttons repeated in a list say which row they act on: three *Open* buttons in a game's sessions, read one after another,
/// do not say which session each opens.
/// </summary>
[Fact]
public async Task NoTwoButtonsInOneListShareAName()
{
await using ScratchLedger s = await ScratchLedger.OpenAsync();
using Surfaces surfaces = await Surfaces.LoadAsync(s);
List<string> twins = await OnStaAsync(() => SweepEverySurface(surfaces, static (name, root, found) =>
{
foreach (ItemsControl list in Reachable(root).OfType<ItemsControl>().Where(static l => l.Items.Count > 1 && l is not MenuBase and not ComboBox and not TabControl))
{
// One entry per row: the names of the buttons each realised row holds; a name found in two rows is a twin.
var rowsByName = new Dictionary<string, int>(StringComparer.Ordinal);
for (int i = 0; i < list.Items.Count; i++)
{
if (list.ItemContainerGenerator.ContainerFromIndex(i) is not DependencyObject row)
{
continue;
}
foreach (string button in Reachable(row).OfType<ButtonBase>().Where(static b => b is not ToggleButton)
.Select(static b => UIElementAutomationPeer.CreatePeerForElement(b)?.GetName() ?? string.Empty)
.Where(static n => n.Length > 0).Distinct(StringComparer.Ordinal))
{
rowsByName[button] = rowsByName.GetValueOrDefault(button) + 1;
}
}
foreach ((string button, int rows) in rowsByName.Where(static p => p.Value > 1))
{
found.Add($"{name}: {rows} rows each hold a button named \"{button}\" in {list.GetType().Name}{(list.Name.Length > 0 ? "#" + list.Name : string.Empty)}");
}
}
}));
string.Join(Environment.NewLine, twins).Should().BeEmpty("a button repeated on each row names its row");
}
private static string Shorten(string text) => text.Length <= 80 ? text : text[..77] + "...";
}
@@ -0,0 +1,210 @@
// 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.Automation;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using FluentAssertions;
using FrameLedger.App.Charts;
using FrameLedger.App.Controls;
using FrameLedger.App.Services;
using FrameLedger.App.ViewModels;
using FrameLedger.Application.TriState;
using FrameLedger.Domain.Metrics;
namespace FrameLedger.App.Tests;
/// <summary>
/// The words a screen reader is given (beta.35, D88), one piece at a time; <c>PagesLoadTests.Automation</c> sweeps every
/// surface for the same faults. English, with the thread's number format pinned, since the words are the translations'.
/// </summary>
[Collection(StringsCultureCollection.Name)]
public sealed class ScreenReaderNamesTests
{
private static T InEnglish<T>(Func<T> read)
{
CultureInfo strings = Strings.Culture ?? CultureInfo.CurrentUICulture;
CultureInfo thread = CultureInfo.CurrentCulture;
Strings.Culture = CultureInfo.GetCultureInfo("en");
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
try
{
return read();
}
finally
{
Strings.Culture = strings;
CultureInfo.CurrentCulture = thread;
}
}
[Fact]
public async Task ADropDownsOptionIsReadByItsLabelNotItsRecord()
{
var option = new Choice<string>("dark", "Dark");
string name = await PagesLoadTests.OnStaAsync(() => UIElementAutomationPeer.CreatePeerForElement(new ComboBoxItem { Content = option })!.GetName());
option.ToString().Should().Be("Dark");
name.Should().Be("Dark", "WPF names a drop-down's item by the item's ToString(); the record's own was 'Choice { Value = dark, Label = Dark }'");
}
/// <summary>CLAUDE.md rule 6 in speech: Native, Displayed and the factor together; a steady factor with its share.</summary>
[Fact]
public void TheReadoutSaysNativeDisplayedAndTheFactorTogether()
{
(string Generated, string Steady, string Presented, string None, string Unavailable, string Qualifier, string Fps62, string Fps118) said = InEnglish(() => (
new FpsReadoutModel { Kind = FpsReadoutKind.Generated, Native = 62, Displayed = 118, Factor = 1.9 }.SpokenText,
new FpsReadoutModel { Kind = FpsReadoutKind.Generated, Native = 62, Displayed = 118, Factor = 1.9, SteadyShare = 0.75 }.SpokenText,
new FpsReadoutModel { Kind = FpsReadoutKind.Presented, Presented = 62, Qualifier = FpsQualifier.NoRuntime }.SpokenText,
new FpsReadoutModel { Kind = FpsReadoutKind.None, Native = 144 }.SpokenText,
FpsReadoutModel.Unavailable.SpokenText,
FpsPresentation.QualifierText(FpsQualifier.NoRuntime),
Formats.Fps(62),
Formats.Fps(118)));
said.Generated.Should().Be($"Native {said.Fps62} FPS, displayed {said.Fps118} FPS, frame generation ×1.9");
said.Steady.Should().Be($"Native {said.Fps62} FPS, displayed {said.Fps118} FPS, frame generation ×1.9 for 75% of the session");
said.Presented.Should().Be($"{said.Fps62} presented FPS. {said.Qualifier}", "a stand-alone number is never said without its qualifier");
said.None.Should().EndWith("FPS").And.NotContain("×");
said.Unavailable.Should().Be("N/A");
}
[Fact]
public void EveryItemIsReadAsItShows()
{
var said = InEnglish(() => new
{
Chip = new TriStateChipModel("Ray Tracing", Tri.Yes, TriStateSource.Measured).ToString(),
Notice = new SafetyNotice(SafetyNoticeKind.Refused, "Alpha: hooking refused", "Easy Anti-Cheat was found.", DateTimeOffset.UnixEpoch).ToString(),
Detail = new GameDetailRow("Runs as", "Direct3D 12").ToString(),
Fact = new LabelledValue("GPU", "RTX 5080").ToString(),
Card = new StatCardModel("Average", "62", "FPS").ToString(),
Best = new CompareCell("62", IsBest: true).ToString(),
Row = new CompareRowViewModel("Average", [new CompareCell("62", true), new CompareCell("58", false)]).ToString(),
Change = new ChangeMarker(2, DateTimeOffset.UnixEpoch, ["GPU driver 576.02"]).ToString(),
Sensor = new SensorStatRowModel("GPU temperature", "60 °C", "61 °C", "40 °C", "70 °C", "120").ToString(),
Page = new DocumentPage("Accessibility", "# Accessibility\n\nA long text.", "ACCESSIBILITY.md").ToString(),
});
said.Chip.Should().Be("Ray Tracing: Yes, measured", "the source is the tooltip's to the eye and the chip takes no focus");
said.Notice.Should().Be("Alpha: hooking refused. Easy Anti-Cheat was found.");
said.Detail.Should().Be("Runs as: Direct3D 12");
said.Fact.Should().Be("GPU: RTX 5080");
said.Card.Should().Be("Average: 62 FPS");
said.Best.Should().Be("62, the best", "bold says it to the eye");
said.Row.Should().Be("Average: 62, the best, 58");
said.Change.Should().StartWith("Change 2, ").And.EndWith(": GPU driver 576.02");
said.Sensor.Should().Be("GPU temperature: mean 60 °C, median 61 °C, lowest 40 °C, highest 70 °C, over 120 readings");
said.Page.Should().Be("Accessibility", "a page list's item is its title, never the page's whole text");
}
/// <summary>A control that only shows something speaks through its own peer: a Text element, its words, no children.</summary>
[Fact]
public async Task TheControlsThatOnlyShowSpeakThroughTheirPeers()
{
var model = new FpsReadoutModel { Kind = FpsReadoutKind.Presented, Presented = 62, Qualifier = FpsQualifier.RuntimeLoaded };
var facts = await PagesLoadTests.OnStaAsync(() =>
{
var readout = new FpsReadout { Model = model };
AutomationPeer readoutPeer = UIElementAutomationPeer.CreatePeerForElement(readout)!;
var chip = new TriStateChip { Model = new TriStateChipModel("RT", Tri.No, TriStateSource.Manual) };
var badge = new ChangeBadge { Text = "3" };
var named = new FpsReadout { Model = model };
AutomationProperties.SetName(named, "set by hand");
var styled = new FpsReadout { Model = model };
var host = new Wpf.Ui.Controls.FluentWindow { Content = styled };
Visuals.Layout(styled, 400, 100);
host.Close();
return new
{
Type = readoutPeer.GetAutomationControlType(),
Name = readoutPeer.GetName(),
Help = readoutPeer.GetHelpText(),
Children = readoutPeer.GetChildren(),
Class = readoutPeer.GetClassName(),
Chip = UIElementAutomationPeer.CreatePeerForElement(chip)!.GetName(),
ChipText = chip.Model!.AccessibleName,
Badge = UIElementAutomationPeer.CreatePeerForElement(badge)!.GetName(),
Own = UIElementAutomationPeer.CreatePeerForElement(named)!.GetName(),
styled.Focusable,
};
});
facts.Type.Should().Be(AutomationControlType.Text);
facts.Name.Should().Be(model.SpokenText);
facts.Help.Should().Be(model.QualifierTooltip, "the tooltip's words, which a chip that takes no focus never shows the keyboard");
facts.Children.Should().BeNull("the template's pieces are not read a second time");
facts.Class.Should().Be(nameof(FpsReadout));
facts.Chip.Should().Be(facts.ChipText);
facts.Badge.Should().EndWith("3");
facts.Own.Should().Be("set by hand", "a name the XAML gives wins over the control's own words");
facts.Focusable.Should().BeFalse("shown, not operated: the App's style takes it out of the tab order");
}
[Fact]
public async Task ATemplateColumnsCellsAreNamedByTheirRowsTextOverWpfUisCellStyle()
{
var facts = await PagesLoadTests.OnStaAsync(() =>
{
var column = new DataGridTemplateColumn();
CellName.SetPath(column, "NativeText");
Style style = column.CellStyle;
var setter = (Setter)style.Setters.Single();
return new
{
style.TargetType,
BasedOnWpfUi = ReferenceEquals(style.BasedOn, System.Windows.Application.Current.TryFindResource(CellName.WpfUiCellStyleKey)),
setter.Property,
Path = ((Binding)setter.Value).Path.Path,
Again = CellName.Named("X", basedOn: null).BasedOn,
};
});
facts.TargetType.Should().Be<DataGridCell>();
facts.BasedOnWpfUi.Should().BeTrue("the cells keep WPF UI's look: its DataGrid gives every cell DefaultDataGridCellStyle");
facts.Property.Should().Be(AutomationProperties.NameProperty);
facts.Path.Should().Be("NativeText");
facts.Again.Should().BeNull();
InEnglish(() => (CellName.Spoken(null), CellName.Spoken(" "), CellName.Spoken("62"))).Should().Be(("empty", "empty", "62"),
"a cell with no text is said to be empty, never WPF's 'Item: …, Column Display Index: n'");
}
[Fact]
public async Task AnExpandersButtonIsNamedAfterItsHeader()
{
var facts = await PagesLoadTests.OnStaAsync(() =>
{
var composed = new StackPanel { Children = { new TextBlock { Text = "Kill switch" }, new TextBlock { Text = "Off" } } };
var expander = new Wpf.Ui.Controls.CardExpander { Header = "Details", Content = new TextBlock { Text = "inside" } };
var host = new Wpf.Ui.Controls.FluentWindow { Content = expander };
try
{
Visuals.Layout(expander, 600, 300);
Visuals.Pump();
var toggle = (ToggleButton?)expander.Template?.FindName(ExpanderToggleName.PartName, expander);
return new
{
Text = ExpanderToggleName.HeaderText("Details"),
Composed = ExpanderToggleName.HeaderText(composed),
Nothing = ExpanderToggleName.HeaderText(null),
Styled = ExpanderToggleName.GetIsEnabled(expander),
Toggle = toggle is null ? null : AutomationProperties.GetName(toggle),
};
}
finally
{
host.Close();
}
});
facts.Text.Should().Be("Details");
facts.Composed.Should().Be("Kill switch", "a composed header is named by the first text it shows");
facts.Nothing.Should().BeNull();
facts.Styled.Should().BeTrue("the App's implicit CardExpander style turns the naming on for every expander");
facts.Toggle.Should().EndWith("Details", "WPF UI 4.3.0's expand button has no name of its own (beta.35)");
}
}