Files
frameledger/src/FrameLedger.App/ViewModels/InputClassRowModel.cs
T
poli0981andClaude Fable 5.2 fe23342a2a feat(input): a session's summary says what it was played with - shares, controllers and batteries, two charts, marks on the frame-time chart; Trend, Compare, the CSV export (D155-D163) (#470)
* feat(input): the arithmetic of controller statistics - classes, batteries, makers, one pad seen twice (D155-D163)

Nothing reads a device yet. Domain.Input says whether an XInput state or a DualSense report is a pad in use and what
its battery is, adds a battery's readings up, counts switches and decides when two entries are one pad;
Application.Input holds one session's slices and turns them into a reading a second; InputSessionBuilder turns a
session's readings into its totals, its controllers as JSON and its timeline. TelemetrySample can carry a reading.

Every byte and reading under test was written by hand: no report from a real controller has passed through this code.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* feat(input): a session can store what it was played with - schema 0024, the .partial file's chunk 11, both tiers (D160)

Nine columns on sessions (the time in front and its four classes, the switches of method, the sources that answered,
the controllers as JSON) and three on games (what a store lists of controller support), ADD COLUMN only. The .partial
file gains chunk 11, so a session recovered after the Agent died keeps its readings. SessionFinalizer.Build stores
them before the tier branch: hooked, unhooked and recovered sessions alike. The input series are sensor_blobs rows
named input.*, which the sensors' read now leaves out and FindInputSensorsAsync returns.

Nothing produces a reading yet. A ledger this build has opened cannot be opened by 0.1.0-beta.49 or earlier.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* feat(input): the input reader, which the Agent does not start yet - raw input for controllers, XInput, the time of the last input (D155, D158, D159)

Application.Input.InputReader takes a slice about ten times a second from Infrastructure.Input.Win32InputBackend, on
the thread of InputDeviceHub, which exists only while a session has a view of it. It opens no device, sends nothing
to one and registers for no keyboard or mouse. tools/input-readonly-check.ps1 holds its Windows calls to a list.

With no controller at hand, what the reader does with one connected is not established.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(input): an arm of XInputPad.Battery's switch said what the default says (Qodana, on #464 after it merged)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(input): no using that makes the file's own qualified names redundant (InspectCode)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(input): what InspectCode reported in the reader's tests - redundant casts, a hub disposed twice, a suppression not needed

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* wip(input): the Agent records what a session was played with - the switch, the terms, the legal texts

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* style(input): import order in the Agent's composition; no redundant qualifier in a test (InspectCode)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* wip(input): what a store lists of controller support, the input libraries, the game page's three rows

* wip(input): the game page's details tests expect the three controller rows; the library names test without ToLowerInvariant

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* docs(guide): the settings page listed Controllers and input twice

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* feat(input): a session's summary says what it was played with - the shares, the controllers and their batteries, two charts, marks on the frame-time chart; Trend, Compare and the CSV export (D155-D163)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(app): the bar's gap is named by the class that has it; one sentence for the frames session's own sensors

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(app): the fixture's constant is named as the format check wants

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 22:45:09 +00:00

24 lines
1.2 KiB
C#

// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.App.Controls;
namespace FrameLedger.App.ViewModels;
/// <summary>
/// One row of the summary's "Played with" table (0.1.0-beta.50): a class of input, its share of the time the game was
/// in front and how long that was - from the row's stored totals, never recomputed from the series.
/// </summary>
/// <param name="Label"><c>Controller</c>, <c>Keyboard and mouse</c>, <c>Both at once</c> or <c>No input</c>.</param>
/// <param name="Share">One decimal (<c>83.2%</c>).</param>
/// <param name="Duration">The time the class covers.</param>
/// <param name="Segment">The row as the bar draws it.</param>
public sealed record InputClassRowModel(string Label, string Share, string Duration, InputShareSegment Segment)
{
/// <summary>The row's colour, as a one-segment bar beside its label.</summary>
public IReadOnlyList<InputShareSegment> Swatch { get; } = [Segment with { Share = 1 }];
/// <summary>The row in one line, as a screen reader reads it.</summary>
public override string ToString() => Services.SpokenText.Pair(Label, Services.SpokenText.List(Share, Duration));
}