Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
beb248c8bd
|
||
|
|
df113c0888 |
No files matched your search
+22
-1
@@ -28,6 +28,26 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- **The documents in the app scroll further and smoothly** — the user guide, Help ▸ Limitations, About's documents, the
|
||||
Legal Gate and the update notes. A wheel notch moved them a fixed short step whatever the wheel or touchpad sent;
|
||||
it now moves the number of lines Windows is set to scroll (a screen if it is set to that), about twice as far by
|
||||
default, in proportion for a touchpad, and glides there unless Windows' animations are off. At the end of the update
|
||||
notes the wheel scrolls the window instead; Ctrl+wheel still zooms. A page is drawn once when it is opened, not two or
|
||||
three times, and going back to a page you have read in the same window is immediate.
|
||||
|
||||
### Security
|
||||
|
||||
- **Four itch.io downloads this project's documentation used as examples carry malware.** HELLO, HELLO WORLD!, A Doll's
|
||||
Locket - Remake, City of Bones and Träumerei Chapter 2 put the same 213 MB program in front of their RPG Maker game.
|
||||
Read without running it, it ships a registry file that switches off Windows' script scanning (AMSI) and adds
|
||||
Microsoft Defender exclusions, carries an encrypted payload, and checks for virtual machines and debuggers before it
|
||||
starts the game. The documentation called it a launcher and, for A Doll's Locket, said to measure it with the agent
|
||||
running as administrator: that advice is withdrawn. If you installed one of them, remove it and scan your PC.
|
||||
FrameLedger itself does not change: it reads a game's files to find its engine and anti-cheat, and does not judge
|
||||
whether a game is safe (`docs/spike-notes.md` §20).
|
||||
|
||||
### Fixed
|
||||
|
||||
- **An anti-cheat kept beside a game's executable is found before anything is injected.** The safety check looked three folder
|
||||
@@ -102,7 +122,8 @@ helper is not changed: re-point it with *Change executable…*.
|
||||
deeper) and the import took it as the game. A helper named by the store is skipped now and the executable is guessed —
|
||||
the import list says so — and the guess takes the executable beside NW.js's `nw.dll` and `package.json`, the process
|
||||
that draws (`css\Game.exe` there; its launcher asks for administrator, so it is measured with *Run the agent as
|
||||
administrator* on). The import also no longer offers a store's game again when the library has it at another
|
||||
administrator* on — *withdrawn 2026-10-13: that launcher is malware, do not run it; [0.1.0-beta.21]'s Security*). The
|
||||
import also no longer offers a store's game again when the library has it at another
|
||||
executable: an entry already there is re-pointed with *Change executable…* (`docs/05_DETECTION.md` §Library import).
|
||||
- **The Games page shows its newest read of the library.** When two reads overlapped — a session ending while an import
|
||||
added games — the one that started first could finish last and be shown, an older list until the next read.
|
||||
|
||||
@@ -163,6 +163,9 @@ you accept the prompt. Turn it on only if you trust everything that runs under y
|
||||
GeForce RTX 5080 with an Intel Core i7-14700KF on Windows 11); other hardware is untested.
|
||||
- **No real Vulkan or OpenGL game has been measured yet** — only FrameLedger's own test program.
|
||||
- There is **no in-game overlay**; everything is shown in the FrameLedger window.
|
||||
- **FrameLedger does not tell whether a game is safe to run.** It reads a game's files to find its engine and its
|
||||
anti-cheat, never to judge it, and recording or measuring a game vouches for nothing. Four itch.io downloads this
|
||||
project once used as examples turned out to carry malware ([details](docs/spike-notes.md)).
|
||||
|
||||
## Your data
|
||||
|
||||
|
||||
+11
-4
@@ -277,7 +277,8 @@ the game's files* once the sweep has read a row of these engines and found none.
|
||||
**Where it is read.** Beside the row's executable first: `UnityPlayer.dll` (else the shallowest one the walk listed) and
|
||||
`<exe>_Data` (else a `*_Data` beside that player); `<exe>.pck`. RPG Maker's files are looked for beside the executable and
|
||||
up to two folders above it, as `RpgMakerTitle` already looked for a title — a launcher-fronted game keeps its runtime in
|
||||
a subfolder (A Doll's Locket's `css\`, HELLO, HELLO WORLD!'s `swiftshader\`); a `Library=` that points outside the ini's
|
||||
a subfolder (A Doll's Locket's `css\`, HELLO, HELLO WORLD!'s `swiftshader\` — *both "launchers" are malware, D57,
|
||||
`spike-notes.md` §20*); a `Library=` that points outside the ini's
|
||||
folder is named and not read. Version resources and at most a few kilobytes of any file; the whole detection of one entry
|
||||
measured 24 ms to 4.1 s on the owner's USB drive, nearly all of it the install's walk, once per executable and rules
|
||||
version. The Privacy Policy says so since 2.8 (§4).
|
||||
@@ -359,7 +360,12 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
|
||||
> toast helper. The pick was **butler's verdict**, taken as is: butler stores a *filtered* verdict (the shallowest
|
||||
> candidates, minus those whose manifest asks for elevation) and does not rank what is left, and on that install the
|
||||
> 213 MB `DollsLocket.exe` launcher asks for administrator while the NW.js runtime sits a level deeper in `css\`, so the
|
||||
> helper was the whole verdict (read from the owner's `butler.db`, read-only). Three changes:
|
||||
> helper was the whole verdict (read from the owner's `butler.db`, read-only). *(Corrected 2026-10-13, owner decision
|
||||
> D57: that "launcher" — the same 213 MB program HELLO, HELLO WORLD!, City of Bones and Träumerei put in front of their
|
||||
> runtime — is malware: it ships a registry file that switches off Windows' script scanning and adds Microsoft Defender
|
||||
> exclusions (`spike-notes.md` §20). Do not run it. The admin-mode sentence below is withdrawn; the three changes stand
|
||||
> as rules about helpers and NW.js layouts, and the import still takes a store's own pick when it is not a helper.)*
|
||||
> Three changes:
|
||||
> **(1)** a verdict candidate whose whole name is a runtime helper (`ExecutableLocator.RuntimeHelperNames`:
|
||||
> `notification_helper`, `crashpad_handler`, `UnityCrashHandler64/32`, `CrashReportClient`, NW.js's `nwjc` and
|
||||
> `chromedriver`) or that sits in a Unity plugin folder is skipped, and with nothing left the locator guesses and the
|
||||
@@ -369,8 +375,9 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
|
||||
> rule's own signal — as an NW.js runtime (owner decision D56), below the Unity and Unreal layouts (an NW.js folder can
|
||||
> be a tool shipped beside such a game) and above a name match (the launcher in front of the runtime is named after the
|
||||
> install): the install's guess is `css\Game.exe`, the process that draws, as D28 pointed HELLO, HELLO WORLD!'s entry at
|
||||
> its runtime by hand. That runtime starts elevated (its launcher asks for administrator), so it is measured with the
|
||||
> admin mode on (D34). **(3)** Discovery matches a store title to an entry by **platform + store id** as well as by
|
||||
> its runtime by hand. ~~That runtime starts elevated (its launcher asks for administrator), so it is measured with the
|
||||
> admin mode on (D34).~~ *(Withdrawn 2026-10-13, D57: it starts elevated because the malware in front of it asks for
|
||||
> administrator.)* **(3)** Discovery matches a store title to an entry by **platform + store id** as well as by
|
||||
> path: the entry an earlier import made at another executable is "already in the library" (the log names its path),
|
||||
> so a corrected guess never adds the same game a second time — that entry is re-pointed with Change executable…, and
|
||||
> nothing rewrites it by itself (D25/D27). Tests: `ExecutableLocatorTests.AnNwjsRuntimeBeatsTheLauncherNamedAfterTheInstallAndItsHelpersAreDropped`,
|
||||
|
||||
+9
-2
@@ -66,7 +66,14 @@ WPF + **WPF UI (Wpf.Ui, Fluent)**. Shell = `ui:FluentWindow` with custom `ui:Tit
|
||||
> off** — a tag is shown as the text it is; **no image is fetched** — its description stands in; a node the renderer
|
||||
> does not know is shown as its own source text, and `MarkdownRendererTests` proves for every embedded document that
|
||||
> no word of its plain text is lost and no table is left as `|---|` source. The GPL's `LICENSE` is not Markdown: it is
|
||||
> shown as written, monospace. Colours and the font are theme resources (`16_WPFUI_SYNTAX` §FlowDocument). Links
|
||||
> shown as written, monospace. Colours and the font are theme resources (`16_WPFUI_SYNTAX` §FlowDocument).
|
||||
> **The wheel and the render, beta.21 (owner request 2026-10-13: "scrolling the documents is slow"):** a notch moves
|
||||
> Windows' *lines to scroll* at a browser's line (100/3 DIP; three lines = 100 DIP, scaled by the zoom; a delta in
|
||||
> proportion, so a touchpad's small deltas move a little; Windows' *one screen at a time* a screen) and eases there in
|
||||
> about 120 ms unless Windows' animations are off — WPF moved a fixed 48 DIP per message, whatever its delta. At its ends
|
||||
> the view leaves the wheel to what holds it (the update notes' dialog), and Ctrl+wheel stays the zoom. A page is
|
||||
> rendered once (`MarkdownView.Show`; three bindings changing ask for one render, ahead of layout), and a view keeps the
|
||||
> last 16 documents it rendered, so going back to a page costs its layout only (`MarkdownViewTests`). Links
|
||||
> follow `Markdown/MarkdownLinks`: http, https and mailto through `IUrlOpener`; `#section` scrolls to the heading
|
||||
> (GitHub's anchors); a relative path resolves against the document's place in the repository and opens in the App
|
||||
> when the window holds that page, on GitHub otherwise — **at this build's own source** (`Services/RepositoryLinks`:
|
||||
@@ -294,7 +301,7 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
- **Game detail:**
|
||||
- Header: cover, name, publisher, version, platform, engine+version, API + Present Mode of last session, `FpsReadout` (lifetime avg), TriState chips, Edit button.
|
||||
- **Two clearly separated rows** (`05_DETECTION` §Capability hints — conflating these was the old design's core mistake):
|
||||
- **Supports** — greyed capability chips from files on disk ("Supports DLSS-G", "Supports XeSS"). Static inference.
|
||||
- **Supports** — greyed capability chips from files on disk ("Supports DLSS-G", "Supports XeSS"). Static inference. With none: *not scanned yet* until the Agent's sweep has read the executable, then *none found* (beta.21 — it read "not scanned yet" for every game that ships none of the files).
|
||||
- **Last session measured** — accent chips with real values ("DLSS Quality · 1440p → 2160p", "Frame Generation DLSS-G ×1.9", "Ray Tracing: Yes"). Measured.
|
||||
- **Hooking control** (`ui:CardControl` with `ToggleSwitch`): off by default. Turning it on opens the consent dialog (FR-2.1). When the static anti-cheat pre-scan blocked it, the switch is **disabled** with the reason shown inline and no way to force it. When auto-disabled after crashes, an `InfoBar` explains and offers manual re-enable.
|
||||
|
||||
|
||||
@@ -250,6 +250,11 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
|
||||
A `ContentDialog` whose content should not scroll as a whole sets `ScrollViewer.VerticalScrollBarVisibility="Disabled"`
|
||||
on the dialog: its content row then has the window's height, and a `*` row inside it can hold a list that scrolls alone
|
||||
(`ImportReviewPrompt`).
|
||||
- [ ] **A `ScrollViewer` moves a FIXED 48 DIP per wheel message, whatever its delta** (`ScrollViewer._mouseWheelDelta`,
|
||||
read from .NET 10.0.12; measured on a `FlowDocumentScrollViewer`: deltas of −1, −15, −120 and −360 each moved 48). It
|
||||
ignores Windows' *lines to scroll*, and a precision touchpad's small deltas each jump the whole step — a long document
|
||||
read as slow and jerky while its layout cost about a millisecond a step. `Controls/MarkdownView` handles
|
||||
`PreviewMouseWheel` itself (beta.21): the delta in proportion at Windows' lines, eased, unhandled at its ends.
|
||||
- [ ] **ScottPlot 5 zooms on every wheel and never marks it handled.** Without `Charts/ChartWheel` a wheel over a chart
|
||||
zoomed it and scrolled the page at once; a plain wheel is the page's, Ctrl+wheel the chart's, for every plot that
|
||||
`ChartTheme.Attach` registers.
|
||||
|
||||
+7
-3
@@ -1494,7 +1494,8 @@ wrongly-named entry through `SessionRecorder`'s `EnsureAsync`); the running tabl
|
||||
launch election registers its session and defers to the watcher's. **What it costs:** a game whose FOLDER moved records
|
||||
nothing until *Change executable* — accepted, because the alternative is exactly what put HHW's sessions under Flower
|
||||
in Us. **D28 (owner, same day):** HHW itself is measured by pointing an entry at `swiftshader\Game.exe` (the NW.js
|
||||
runtime its .NET launcher starts); no launcher-following in beta.6.
|
||||
runtime its .NET launcher starts); no launcher-following in beta.6. *(Corrected 2026-10-13, D57: that ".NET launcher"
|
||||
is malware — `spike-notes.md` §20. Nothing here asks for it to be run.)*
|
||||
|
||||
**Decision (D26, owner: "the library still shows two entries side by side after the drive letter changed, with the
|
||||
data unchanged").** The Agent merges two entries for one executable under two drive letters by itself: the stale
|
||||
@@ -2142,7 +2143,9 @@ then the release.*
|
||||
finding does to the game).
|
||||
- **D56 — an NW.js runtime is the import's game**: an executable beside `nw.dll` + `package.json` ranks as the engine's
|
||||
own layout, below Unity's and Unreal's and above a name match, so a launcher-fronted RPG Maker MV/MZ install is pointed
|
||||
at the process that draws. D28 did that by hand for HELLO, HELLO WORLD!; the locator now picks the same file.
|
||||
at the process that draws. D28 did that by hand for HELLO, HELLO WORLD!; ~~the locator now picks the same file~~
|
||||
*(corrected 2026-10-13: the locator does, and an import never asks it there — itch's own pick names the program in
|
||||
front, which is not a helper, so the import takes it; and that program is malware, D57 — §beta.21)*.
|
||||
- **The owner's existing A Doll's Locket entry is not rewritten** (D25/D27): *Change executable…* re-points it, and the
|
||||
import no longer offers a twin of the same store title.
|
||||
- **The train (owner, 2026-10-12, after the PRs were up):** "commit, push và release luôn" — each PR squash-merged by the
|
||||
@@ -2323,7 +2326,8 @@ game's engine" — was shown to the owner with #299 and released on their word.
|
||||
Demo and 衔蝶 (the App's restart at 17:47 had started the ten minutes again), the library then reading *Games · 46*.
|
||||
*(The item as written:)* (a) **A Doll's Locket - Remake:** its page ▸ *Change executable…* opens in `Dolls
|
||||
Locket\`; pick `css\Game.exe`. Its launcher asks for administrator, so the runtime is measured only with *Run the agent
|
||||
as administrator* on — otherwise the session says why nothing was measured. (b) **Refresh** offers no second A Doll's
|
||||
as administrator* on — otherwise the session says why nothing was measured. *(Withdrawn 2026-10-13, D57: that
|
||||
launcher is malware — do not run it; `spike-notes.md` §20.)* (b) **Refresh** offers no second A Doll's
|
||||
Locket. (c) **Engine versions:** a Unity game's page (*Unity 2022.3.62f2* on Umamusume, *Unity 2019.4.40* on GIRLS'
|
||||
FRONTLINE 2), Godot's (*Godot 4.4.1* on 衔蝶), RPG Maker's (*RPG Maker MZ 1.10.0*, *RPG Maker MV 1.6.2* on Flower in
|
||||
Us, *RPG Maker VX Ace (RGSS 3.0.1)*), each with its *Engine version* line. (d) **Uninstall a game that has no session**
|
||||
|
||||
@@ -48,7 +48,7 @@ with the 2026-09-16 recovery and with library entries removed since.
|
||||
|
||||
| Game | Why nothing was measured | When | Evidence |
|
||||
|---|---|---|---|
|
||||
| HELLO, HELLO WORLD! | A 32-bit game (RPG Maker MV): refused by the guard once, and two sessions with hooking switched off — each recorded with its duration and sensors | 2026-09-23 | database |
|
||||
| HELLO, HELLO WORLD! | A 32-bit game (RPG Maker MV): refused by the guard once, and two sessions with hooking switched off — each recorded with its duration and sensors. *Its itch.io download puts malware in front of the game — do not run it (noted 2026-10-13, [spike-notes §20](spike-notes.md))* | 2026-09-23 | database |
|
||||
| Umamusume: Pretty Derby | Three sessions played with hooking switched off for the game | 2026-09-27 | database |
|
||||
| Sekiro: Shadows Die Twice | One session played with hooking switched off | 2026-09-25 | database |
|
||||
| GIRLS' FRONTLINE 2: EXILIUM | One session whose process Windows would not let FrameLedger open, and two recovered after the agent itself stopped mid-session (*interrupted*) | 2026-09-22 → 09-23 | database |
|
||||
|
||||
+47
-3
@@ -2656,9 +2656,11 @@ Godot, RPG Maker.
|
||||
- **Detect time** is the whole detection of one entry — the install's walk, the rules and the second read — on the USB
|
||||
drive; the second read itself is a version resource and at most a few kilobytes. It runs once per executable and rules
|
||||
version, like Unreal's.
|
||||
- **Four of the itch installs front their runtime with a 213 MB .NET launcher** (HELLO, HELLO WORLD!, A Doll's Locket -
|
||||
Remake — whose launcher asks for administrator —, City of Bones and Träumerei) — the reason the import's choice of
|
||||
executable changed in the same train (`05_DETECTION` §Library import, D56).
|
||||
- ~~**Four of the itch installs front their runtime with a 213 MB .NET launcher**~~ **Four of the itch installs put a
|
||||
213 MB .NET program in front of their runtime, and it is malware** *(corrected 2026-10-13, owner decision D57 — §20;
|
||||
do not run it)* (HELLO, HELLO WORLD!, A Doll's Locket - Remake — whose launcher asks for administrator —, City of
|
||||
Bones and Träumerei) — read as a launcher, the reason the import's choice of executable changed in the same train
|
||||
(`05_DETECTION` §Library import, D56).
|
||||
- **Not measured:** RPG Maker 2000/2003 (`RPG_RT.exe`; none installed, and no rule detects it), XP and VX (no install —
|
||||
their RGSS1/RGSS2 libraries are read by the same rule as VX Ace's, unmeasured), a Unity build older than 2019 (its
|
||||
player is the executable, with no `UnityPlayer.dll`), a Godot 3 export, and a Godot pack appended to the executable
|
||||
@@ -2728,3 +2730,45 @@ executable changes.
|
||||
|
||||
- **Not measured:** that the game loads `ACE-Base64.dll` (no session has run since), and whether ACE's other titles
|
||||
keep the same layout.
|
||||
|
||||
## 20 · The launcher in front of four itch installs is malware *(2026-10-13, beta.21, owner decision D57)*
|
||||
|
||||
§17 read the 213 MB program four itch.io downloads put in front of their RPG Maker game as a *launcher*, and the
|
||||
documentation built on that reading (D28, D56's rationale, HANDOFF item 15(a), which told the owner to run A Doll's
|
||||
Locket's with the agent as administrator). Read on 2026-10-13 without running anything — file listings, the itch
|
||||
receipt, version resources, the .NET metadata strings and the files beside it — it is not a launcher. **It is malware.
|
||||
Do not run it.**
|
||||
|
||||
| Download (itch) | The program | SHA-256 | Beside it |
|
||||
|---|---|---|---|
|
||||
| HELLO, HELLO WORLD! (5015466) | `HELLOHELLOWORLD.exe`, 213,572,096 bytes | `053553514C3E34865393654477631DEFB50B36509F44B8ADC5B1E555E1F64FD1` | `locales\ml.reg`, `locales\ko.xml` |
|
||||
| A Doll's Locket - Remake (5085165) | `DollsLocket.exe`, 213,745,664 bytes | `51D3271AD0FFAF3652DAB9F66C1279CB2CA16F46A6AB2E5173D032600C1E5E53` | `data\Items.reg`, `data\Armors.xml` |
|
||||
| City of Bones | `CityofBones.exe`, 213,557,760 bytes | `CA81BE260941E7BE2D87FE6852E7DAD0D432A84F071C2C578A7BD06BE7E61248` | `System\Windowskin.reg`, `System\RGSS301.xml` |
|
||||
| Träumerei Chapter 2 | `TräumereiChapter2.exe`, 213,559,808 bytes | `65D4CCB7065227A0ED08D8977CA2F00F1E2A6DDC5F375C2C32E115D90DE29E4D` | `System\Game.reg`, `System\RGSS301.xml` |
|
||||
|
||||
- **The four programs are one .NET program**, unsigned, its version resource Visual Studio's template named after each
|
||||
game (`HELLOHELLOWORLD`, version 1.0.0.7, "Copyright © 2026"), and nearly all of its size embedded resources.
|
||||
- **Beside each, two files named like the game's own.** A 3,060-byte Windows registry file — byte-identical in all four —
|
||||
that sets `AmsiEnable = 0` under `HKCU` and `HKLM\SOFTWARE\Microsoft\Windows Script\Settings` (it switches off
|
||||
Windows' script scanning), and under `HKLM\SOFTWARE\Policies\Microsoft\Windows Defender` adds exclusions for the `.exe`
|
||||
and `.msi` extensions and for `powershell.exe`, `rundll32.exe`, `msiexec.exe` and `regasm.exe`, and sets
|
||||
`SpynetReporting = 0` and `SubmitSamplesConsent = 2` (no cloud protection, no samples sent). And a 3,216-byte `.xml`
|
||||
that is no XML: high-entropy bytes, a different blob in each download.
|
||||
- **What the program's own metadata names** (type and member names, read as strings): checks for virtual machines
|
||||
(VMware, VirtualBox, QEMU, Hyper-V, Xen, KVM, Bochs, Parallels — through WMI, the registry and the firmware) and for
|
||||
debuggers (`IsDebuggerPresent`, `CheckRemoteDebuggerPresent`, `NtQueryInformationProcess` on the debug port, object and
|
||||
flags, hardware breakpoints, debugger windows); AES decryption of Base64 text; PowerShell run inside the process
|
||||
(`CreateRunspace`, `AddScript`); registry writes; steps named `RunPayload` and `PayloadStep`; and the game it starts
|
||||
afterwards — the RPG Maker runtime beside it (`swiftshader\Game.exe`, `css\Game.exe`, `Game.exe` with
|
||||
`RGSS301.dll`), which is what makes it look like the game.
|
||||
- **Where it sits in each download:** the itch receipt of HELLO, HELLO WORLD! lists the program, the runtime in
|
||||
`swiftshader\` and both disguised files as what the download installed; nothing was added afterwards.
|
||||
|
||||
**What changes in FrameLedger (D57): the documentation, not the import.** The import still takes a store's own pick when
|
||||
it is not a helper (beta.19) — FrameLedger reads a game's files to find its engine and anti-cheat, never to judge
|
||||
whether it is safe, and a store's verdict stays the store's. What is corrected in place: §17's bullet, `05_DETECTION`
|
||||
§Library import (D56's rationale and its admin-mode sentence), HANDOFF D28, D56 and item 15(a), the beta.19 CHANGELOG
|
||||
entry, and the HELLO, HELLO WORLD! row of `LIST_GAME_TESTED.md`; `LIMITATIONS.md` says FrameLedger does not tell a safe
|
||||
game from an unsafe one.
|
||||
|
||||
- **Not measured, and not to be:** what the payload does. Nothing here was run, decrypted or uploaded anywhere.
|
||||
@@ -110,6 +110,8 @@ public partial class App : System.Windows.Application
|
||||
_host = BuildHost(_db, appearance, registered, closePolicy);
|
||||
await _host.StartAsync().ConfigureAwait(true);
|
||||
Log.Information("ui: started ({Version}), ledger {Ledger}", UiIdentity.Version, UiPaths.Database);
|
||||
// beta.21: tier 0 is software rendering (a VM without a GPU, Remote Desktop) - every scroll drawn on the CPU.
|
||||
Log.Information("ui: render tier {Tier} (2 = the GPU draws; 0 = software)", System.Windows.Media.RenderCapability.Tier >> 16);
|
||||
if (UiPaths.IsViewer)
|
||||
{
|
||||
Log.Warning("ui: a VIEWER over {Folder} (--data-dir, D52): no Agent is started or contacted, nothing on this PC is changed", UiPaths.DataDirectory);
|
||||
@@ -192,7 +194,8 @@ public partial class App : System.Windows.Application
|
||||
Log.Warning(ex, "diag: the hardware could not be read; its lines are n/a");
|
||||
}
|
||||
|
||||
string report = DiagReport.Build(UiIdentity.Version, UiPaths.DataDirectory, UiPaths.Logs, schema, values, new AgentLauncher().CanLaunch, now, hardware);
|
||||
string report = DiagReport.Build(UiIdentity.Version, UiPaths.DataDirectory, UiPaths.Logs, schema, values, new AgentLauncher().CanLaunch, now, hardware,
|
||||
System.Windows.Media.RenderCapability.Tier >> 16);
|
||||
string path = DiagReport.Write(UiPaths.Logs, report, now);
|
||||
await Console.Out.WriteLineAsync(string.Format(CultureInfo.CurrentCulture, Strings.Diag_Written_Format, path)).ConfigureAwait(true);
|
||||
Log.Information("ui: --diag written to {Path}", path);
|
||||
|
||||
@@ -97,9 +97,8 @@ public partial class DocumentBrowser : UserControl
|
||||
|
||||
private void ShowPage(DocumentPage? page)
|
||||
{
|
||||
View.DocumentPath = page?.Path;
|
||||
View.IsPlainText = page?.IsPlainText ?? false;
|
||||
View.MarkdownText = page?.Text ?? string.Empty;
|
||||
// One render, now (beta.21): the three properties one by one rendered the old text under the new path first.
|
||||
View.Show(page?.Text ?? string.Empty, page?.IsPlainText ?? false, page?.Path);
|
||||
AutomationProperties.SetName(View, page?.Title ?? string.Empty);
|
||||
PageChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Threading;
|
||||
using FrameLedger.App.Markdown;
|
||||
using FrameLedger.App.Services;
|
||||
|
||||
@@ -18,8 +21,32 @@ namespace FrameLedger.App.Controls;
|
||||
/// (<see cref="RepositoryLinkRequested"/>), which shows it when the App embeds it, and otherwise opens on GitHub at this
|
||||
/// build's source (<see cref="RepositoryLinks"/>); anything else is not followed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>The wheel (beta.21, owner request 2026-10-13: "scrolling the documents is slow").</b> WPF's scroll viewer moves a
|
||||
/// fixed 48 DIP per wheel message, whatever its delta — about two and a half lines of body text, Windows' "lines to
|
||||
/// scroll" ignored, and a precision touchpad's small deltas each jumping the whole step (measured: −1, −15, −120 and −360
|
||||
/// all moved 48). Layout costs about a millisecond a step, so the step was the problem, not drawing. The view now moves
|
||||
/// <see cref="WheelStep"/>: the delta in proportion, Windows' lines per notch at a browser's line (100/3 DIP), scaled by
|
||||
/// the zoom — and eases there over about 120 ms unless Windows' animations are off. At either end it leaves the wheel
|
||||
/// unhandled, so whatever holds the view (the update notes' dialog) scrolls instead. Ctrl+wheel stays the zoom.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>One render per page.</b> Each of the three properties rendered the whole document on its own, so a page change
|
||||
/// rendered the old text under the new path first, and the Legal Gate's three bindings rendered three times. Property
|
||||
/// changes now ask for one render, posted to the dispatcher ahead of layout; <see cref="Show"/> sets all three and renders
|
||||
/// at once; and a document this view has rendered is kept (<see cref="CacheCapacity"/>), so going back to a page costs
|
||||
/// its layout and nothing else.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class MarkdownView : FlowDocumentScrollViewer
|
||||
{
|
||||
/// <summary>A line of the wheel's step: Chromium scrolls 100 DIP for Windows' default three lines at 100%.</summary>
|
||||
internal const double WheelLineDip = 100.0 / 3.0;
|
||||
|
||||
/// <summary>How many rendered documents one view keeps (the user guide has twelve pages and Limitations).</summary>
|
||||
internal const int CacheCapacity = 16;
|
||||
|
||||
public static readonly DependencyProperty MarkdownTextProperty =
|
||||
DependencyProperty.Register(nameof(MarkdownText), typeof(string), typeof(MarkdownView), new PropertyMetadata(null, OnSourceChanged));
|
||||
|
||||
@@ -29,7 +56,18 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
|
||||
public static readonly DependencyProperty DocumentPathProperty =
|
||||
DependencyProperty.Register(nameof(DocumentPath), typeof(string), typeof(MarkdownView), new PropertyMetadata(null, OnSourceChanged));
|
||||
|
||||
private readonly Dictionary<RenderKey, RenderedMarkdown> _cache = [];
|
||||
private readonly LinkedList<RenderKey> _recent = new();
|
||||
private IReadOnlyDictionary<string, Block> _anchors = new Dictionary<string, Block>(StringComparer.Ordinal);
|
||||
private RenderKey? _shown;
|
||||
private bool _batching;
|
||||
private DispatcherOperation? _pending;
|
||||
|
||||
private ScrollViewer? _scroller;
|
||||
private double _wheelTarget = double.NaN;
|
||||
private double _lastSetOffset = double.NaN;
|
||||
private TimeSpan _lastFrame;
|
||||
private bool _easing;
|
||||
|
||||
public MarkdownView()
|
||||
{
|
||||
@@ -38,7 +76,8 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
|
||||
VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
|
||||
Focusable = true;
|
||||
AddHandler(Hyperlink.RequestNavigateEvent, new RequestNavigateEventHandler(OnRequestNavigate));
|
||||
Rebuild();
|
||||
Unloaded += (_, _) => StopEasing();
|
||||
RenderNow();
|
||||
}
|
||||
|
||||
/// <summary>A link to another file of the repository; the host shows it and sets Handled, or it opens on GitHub.</summary>
|
||||
@@ -69,31 +108,226 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
|
||||
public IUrlOpener UrlOpener { get; set; } = new ShellUrlOpener();
|
||||
|
||||
/// <summary>The headings this document can scroll to, by anchor.</summary>
|
||||
public IReadOnlyCollection<string> Anchors => [.. _anchors.Keys];
|
||||
public IReadOnlyCollection<string> Anchors
|
||||
{
|
||||
get
|
||||
{
|
||||
RenderIfPending();
|
||||
return [.. _anchors.Keys];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>How many documents this view has rendered from text — a cache hit is not one (for tests).</summary>
|
||||
internal int Renders { get; private set; }
|
||||
|
||||
/// <summary>Where the wheel is taking the view, or NaN when it is not easing it there (for tests).</summary>
|
||||
internal double ScrollTarget => _wheelTarget;
|
||||
|
||||
/// <summary>The template's scroll viewer, once the template is applied (for tests).</summary>
|
||||
internal ScrollViewer? Scroller => _scroller;
|
||||
|
||||
/// <summary>The modifier keys held, read when the wheel turns; a test gives its own rather than the real keyboard's.</summary>
|
||||
internal Func<ModifierKeys> CurrentModifiers { get; set; } = static () => Keyboard.Modifiers;
|
||||
|
||||
/// <summary>Windows' "lines to scroll" per notch (−1: a screen); a test gives its own.</summary>
|
||||
internal Func<int> WheelScrollLines { get; set; } = static () => SystemParameters.WheelScrollLines;
|
||||
|
||||
/// <summary>Whether the wheel eases to its target; off where Windows' animations are, and in tests.</summary>
|
||||
internal bool EaseWheel { get; set; } = SystemParameters.ClientAreaAnimation;
|
||||
|
||||
/// <summary>Shows a document: the three properties at once, rendered once, now.</summary>
|
||||
public void Show(string? text, bool isPlainText, string? path)
|
||||
{
|
||||
_batching = true;
|
||||
try
|
||||
{
|
||||
DocumentPath = path;
|
||||
IsPlainText = isPlainText;
|
||||
MarkdownText = text;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_batching = false;
|
||||
}
|
||||
|
||||
RenderNow();
|
||||
}
|
||||
|
||||
/// <summary>Brings the heading with <paramref name="anchor"/> into view; whether the document has it.</summary>
|
||||
public bool ScrollTo(string anchor)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(anchor);
|
||||
RenderIfPending();
|
||||
if (!_anchors.TryGetValue(anchor, out Block? block))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
StopEasing();
|
||||
block.BringIntoView();
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((MarkdownView)d).Rebuild();
|
||||
|
||||
private void Rebuild()
|
||||
/// <summary>
|
||||
/// The distance one wheel message moves the view, in DIP (positive: down). <paramref name="delta"/> in proportion (120 is a
|
||||
/// notch); <paramref name="wheelScrollLines"/> lines per notch at <see cref="WheelLineDip"/>, or a screen
|
||||
/// (<paramref name="viewportHeight"/>) when Windows says −1; scaled by <paramref name="zoomPercent"/>.
|
||||
/// </summary>
|
||||
internal static double WheelStep(int delta, int wheelScrollLines, double viewportHeight, double zoomPercent)
|
||||
{
|
||||
string text = MarkdownText ?? string.Empty;
|
||||
RenderedMarkdown rendered = IsPlainText ? MarkdownRenderer.RenderPlainText(text) : MarkdownRenderer.Render(text, DocumentPath);
|
||||
double notches = delta / 120.0;
|
||||
double perNotch = wheelScrollLines < 0 ? viewportHeight : wheelScrollLines * WheelLineDip * zoomPercent / 100.0;
|
||||
return -notches * perNotch;
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
StopEasing();
|
||||
_scroller = GetTemplateChild("PART_ContentHost") as ScrollViewer;
|
||||
}
|
||||
|
||||
protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(e);
|
||||
base.OnPreviewMouseWheel(e);
|
||||
if (e.Handled || _scroller is not { } scroller || (CurrentModifiers() & ModifierKeys.Control) != ModifierKeys.None)
|
||||
{
|
||||
return; // Ctrl+wheel is the zoom
|
||||
}
|
||||
|
||||
double step = WheelStep(e.Delta, WheelScrollLines(), scroller.ViewportHeight, Zoom);
|
||||
if (step == 0 || double.IsNaN(step))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double from = double.IsNaN(_wheelTarget) ? scroller.VerticalOffset : _wheelTarget;
|
||||
double to = Math.Clamp(from + step, 0, scroller.ScrollableHeight);
|
||||
if (Math.Abs(to - scroller.VerticalOffset) < 0.5 && double.IsNaN(_wheelTarget))
|
||||
{
|
||||
return; // at the end it would move toward: the wheel is the host's
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
if (!EaseWheel)
|
||||
{
|
||||
scroller.ScrollToVerticalOffset(to);
|
||||
return;
|
||||
}
|
||||
|
||||
_wheelTarget = to;
|
||||
if (!_easing)
|
||||
{
|
||||
_easing = true;
|
||||
_lastFrame = TimeSpan.Zero;
|
||||
_lastSetOffset = scroller.VerticalOffset;
|
||||
CompositionTarget.Rendering += OnRendering;
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((MarkdownView)d).RequestRender();
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD001:Avoid legacy thread switching APIs", Justification = "a WPF application has no JoinableTaskFactory; this posts to the view's own dispatcher from its own thread, at a priority ahead of layout, and never waits (ScrollBarHiding does the same)")]
|
||||
private void RequestRender()
|
||||
{
|
||||
if (_batching || _pending is not null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Ahead of layout, after whatever is setting the other properties has set them.
|
||||
_pending = Dispatcher.InvokeAsync(RenderIfPending, DispatcherPriority.DataBind);
|
||||
}
|
||||
|
||||
private void RenderIfPending()
|
||||
{
|
||||
if (_pending is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RenderNow();
|
||||
}
|
||||
|
||||
private void RenderNow()
|
||||
{
|
||||
if (_pending is { } pending)
|
||||
{
|
||||
_ = pending.Abort();
|
||||
_pending = null;
|
||||
}
|
||||
|
||||
var key = new RenderKey(DocumentPath, IsPlainText, MarkdownText ?? string.Empty);
|
||||
if (_shown is { } shown && shown.Equals(key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_cache.TryGetValue(key, out RenderedMarkdown? rendered))
|
||||
{
|
||||
rendered = key.IsPlainText ? MarkdownRenderer.RenderPlainText(key.Text) : MarkdownRenderer.Render(key.Text, key.Path);
|
||||
Renders++;
|
||||
_cache[key] = rendered;
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = _recent.Remove(key);
|
||||
}
|
||||
|
||||
_ = _recent.AddFirst(key);
|
||||
while (_recent.Count > CacheCapacity && _recent.Last is { } oldest)
|
||||
{
|
||||
_ = _cache.Remove(oldest.Value);
|
||||
_recent.RemoveLast();
|
||||
}
|
||||
|
||||
StopEasing();
|
||||
_anchors = rendered.Anchors;
|
||||
_shown = key;
|
||||
Document = rendered.Document;
|
||||
}
|
||||
|
||||
private void OnRendering(object? sender, EventArgs e)
|
||||
{
|
||||
if (_scroller is not { } scroller || double.IsNaN(_wheelTarget))
|
||||
{
|
||||
StopEasing();
|
||||
return;
|
||||
}
|
||||
|
||||
// Something else moved the view since the last frame (the scroll bar, the keyboard, a link): it is theirs now.
|
||||
if (Math.Abs(scroller.VerticalOffset - _lastSetOffset) > 1)
|
||||
{
|
||||
StopEasing();
|
||||
return;
|
||||
}
|
||||
|
||||
TimeSpan now = (e as RenderingEventArgs)?.RenderingTime ?? TimeSpan.Zero;
|
||||
double elapsedMs = _lastFrame == TimeSpan.Zero ? 16 : Math.Clamp((now - _lastFrame).TotalMilliseconds, 1, 100);
|
||||
_lastFrame = now;
|
||||
|
||||
// Exponential ease-out: about 95% of the way in 120 ms, however many notches have been added on the way.
|
||||
double remaining = _wheelTarget - scroller.VerticalOffset;
|
||||
double next = Math.Abs(remaining) < 0.5 ? _wheelTarget : scroller.VerticalOffset + (remaining * (1 - Math.Exp(-elapsedMs / 40.0)));
|
||||
scroller.ScrollToVerticalOffset(next);
|
||||
_lastSetOffset = next;
|
||||
if (next == _wheelTarget)
|
||||
{
|
||||
StopEasing();
|
||||
}
|
||||
}
|
||||
|
||||
private void StopEasing()
|
||||
{
|
||||
_wheelTarget = double.NaN;
|
||||
if (_easing)
|
||||
{
|
||||
_easing = false;
|
||||
CompositionTarget.Rendering -= OnRendering;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
@@ -116,4 +350,7 @@ public sealed class MarkdownView : FlowDocumentScrollViewer
|
||||
_ = ScrollTo(anchor);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>What a rendered document depends on: theme and language are not in it — its colours are resource references.</summary>
|
||||
private readonly record struct RenderKey(string? Path, bool IsPlainText, string Text);
|
||||
}
|
||||
@@ -233,7 +233,7 @@ public static class MarkdownRenderer
|
||||
int columns = Math.Max(table.ColumnDefinitions.Count, rows.Select(static r => r.Count).DefaultIfEmpty(0).Max());
|
||||
for (int i = 0; i < columns; i++)
|
||||
{
|
||||
wpf.Columns.Add(new TableColumn { Width = GridLength.Auto });
|
||||
wpf.Columns.Add(new TableColumn()); // WPF's default width is already Auto (read by reflection, beta.21)
|
||||
}
|
||||
|
||||
var group = new TableRowGroup();
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static vm:GameDetailViewModel.SupportsHeader}" />
|
||||
<ui:TextBlock Margin="0,6,0,0" Style="{StaticResource TertiaryText}" TextWrapping="Wrap"
|
||||
Text="{x:Static vm:GameDetailViewModel.SupportsEmptyText}"
|
||||
Text="{Binding ViewModel.SupportsEmptyText}"
|
||||
Visibility="{Binding ViewModel.SupportsEmpty, Converter={StaticResource BoolToVis}}" />
|
||||
<ItemsControl Margin="0,6,0,0" ItemsSource="{Binding ViewModel.Supports}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
|
||||
@@ -26,7 +26,8 @@ public static class DiagReport
|
||||
}
|
||||
|
||||
/// <summary>The report text. <paramref name="settings"/> is every registry key's effective value; <paramref name="schemaVersion"/> null when the ledger could not be opened.</summary>
|
||||
public static string Build(string appVersion, string dataDirectory, string logsDirectory, long? schemaVersion, IReadOnlyDictionary<string, string> settings, bool agentBesideApp, DateTimeOffset now, HardwareSnapshot? hardware = null)
|
||||
public static string Build(string appVersion, string dataDirectory, string logsDirectory, long? schemaVersion, IReadOnlyDictionary<string, string> settings, bool agentBesideApp, DateTimeOffset now, HardwareSnapshot? hardware = null,
|
||||
int? renderTier = null)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(settings);
|
||||
var sb = new StringBuilder();
|
||||
@@ -48,6 +49,8 @@ public static class DiagReport
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"gpu_driver: {hardware?.GpuDriver ?? "n/a"}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"ram_gb: {(hardware?.RamGb is double gb ? gb.ToString("0.#", CultureInfo.InvariantCulture) : "n/a")}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"display: {hardware?.DisplayRes ?? "n/a"}{(hardware?.DisplayHz is double hz ? " @ " + hz.ToString("0.#", CultureInfo.InvariantCulture) + " Hz" : string.Empty)}");
|
||||
// beta.21: WPF's rendering tier — 0 is software rendering, where every scroll of a document is drawn on the CPU.
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"render_tier: {(renderTier is int tier ? tier.ToString(CultureInfo.InvariantCulture) : "n/a")}");
|
||||
sb.AppendLine("settings:");
|
||||
foreach (SettingDefinition definition in SettingsRegistry.All)
|
||||
{
|
||||
|
||||
Generated
+3
@@ -488,6 +488,7 @@ public static class Strings
|
||||
nameof(GameDetail_Supports_Empty),
|
||||
nameof(GameDetail_Supports_Format),
|
||||
nameof(GameDetail_Supports_Header),
|
||||
nameof(GameDetail_Supports_None),
|
||||
nameof(GameDetail_Tab_Distribution),
|
||||
nameof(GameDetail_Tab_Frametime),
|
||||
nameof(GameDetail_Tab_Latency),
|
||||
@@ -1995,6 +1996,8 @@ public static class Strings
|
||||
|
||||
public static string GameDetail_Supports_Header => ResourceManager.GetString(nameof(GameDetail_Supports_Header), Culture) ?? nameof(GameDetail_Supports_Header);
|
||||
|
||||
public static string GameDetail_Supports_None => ResourceManager.GetString(nameof(GameDetail_Supports_None), Culture) ?? nameof(GameDetail_Supports_None);
|
||||
|
||||
public static string GameDetail_Tab_Distribution => ResourceManager.GetString(nameof(GameDetail_Tab_Distribution), Culture) ?? nameof(GameDetail_Tab_Distribution);
|
||||
|
||||
public static string GameDetail_Tab_Frametime => ResourceManager.GetString(nameof(GameDetail_Tab_Frametime), Culture) ?? nameof(GameDetail_Tab_Frametime);
|
||||
|
||||
@@ -4217,4 +4217,8 @@
|
||||
<value>{0} は FrameLedger 自身のデータ フォルダーです。--data-dir はそのコピー用で、テスト ビルドが記録先のデータベースを開かないようにするためのものです。このフォルダーを使うには --data-dir を付けずに FrameLedger を起動してください。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Supports_None" xml:space="preserve">
|
||||
<value>見つかりません — ゲームのフォルダーには、ルールが挙げるアップスケーラー、フレーム生成、Vulkan のファイルがありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -3173,4 +3173,7 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="DataDir_Profile_Format" xml:space="preserve">
|
||||
<value>{0} is FrameLedger's own data folder. --data-dir is for a copy of it, so that a test build never opens the database you record into. To use this folder, start FrameLedger without --data-dir.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Supports_None" xml:space="preserve">
|
||||
<value>None found — the game's folder holds no upscaler, frame-generation or Vulkan file the rules name.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -3168,4 +3168,7 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="DataDir_Profile_Format" xml:space="preserve">
|
||||
<value>{0} là thư mục dữ liệu của chính FrameLedger. --data-dir dành cho một bản sao của nó, để một bản thử nghiệm không bao giờ mở cơ sở dữ liệu bạn đang ghi vào. Để dùng thư mục này, hãy mở FrameLedger không kèm --data-dir.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Supports_None" xml:space="preserve">
|
||||
<value>Không tìm thấy — thư mục game không có file upscaler, frame generation hay Vulkan nào mà bộ quy tắc liệt kê.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -83,6 +83,14 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _supportsEmpty = true;
|
||||
|
||||
/// <summary>
|
||||
/// What the Supports card says when it lists nothing (beta.21): "not scanned yet" until the Agent's sweep has read the
|
||||
/// executable, then that none of the files the rules name was found. It said "not scanned yet" for every game that
|
||||
/// ships none of them — a scanned RPG Maker game's page contradicted its own Details card.
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private string _supportsEmptyText = Strings.GameDetail_Supports_Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _measuredEmptyText = string.Empty;
|
||||
|
||||
@@ -277,8 +285,6 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
|
||||
public static string SupportsHeader => Strings.GameDetail_Supports_Header;
|
||||
|
||||
public static string SupportsEmptyText => Strings.GameDetail_Supports_Empty;
|
||||
|
||||
public static string MeasuredHeader => Strings.GameDetail_Measured_Header;
|
||||
|
||||
public static string RecordingHeader => Strings.GameDetail_Recording_Header;
|
||||
@@ -1025,6 +1031,9 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
}
|
||||
|
||||
SupportsEmpty = Supports.Count == 0;
|
||||
|
||||
// The Details card's own test: a row the sweep has read carries the executable's machine.
|
||||
SupportsEmptyText = row.ExeMachine is null ? Strings.GameDetail_Supports_Empty : Strings.GameDetail_Supports_None;
|
||||
}
|
||||
|
||||
private void PresentDetails(GameDetail detail)
|
||||
|
||||
@@ -36,6 +36,9 @@ public sealed class DiagReportTests
|
||||
}
|
||||
|
||||
report.Should().Contain(" capture.min_session_s = 30", "a key with no row reports its default");
|
||||
report.Should().Contain("render_tier: n/a", "no tier given");
|
||||
DiagReport.Build("1.2.3", @"C:\data", @"C:\data\logs", 2, values, agentBesideApp: true, now, renderTier: 0)
|
||||
.Should().Contain("render_tier: 0", "beta.21: software rendering, where every scroll is drawn on the CPU, is named");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -238,6 +238,35 @@ public sealed class GameDetailViewModelTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.21: a game the sweep has read and found none of the capability files in says so — the card read "not scanned yet"
|
||||
/// for every such game, as HELLO, HELLO WORLD!'s page did beside a Details card that had been read.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheSupportsCardSaysNotScannedOnlyUntilTheSweepHasReadTheExecutable()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Plain");
|
||||
|
||||
(GameDetailViewModel unread, _, _, _, _) = await BuildAsync(s, game.Id);
|
||||
unread.SupportsEmpty.Should().BeTrue();
|
||||
unread.SupportsEmptyText.Should().Be(Strings.GameDetail_Supports_Empty, "the sweep has not read this game yet");
|
||||
|
||||
(await s.Games.ApplyDetectionAsync(game.Id, new DetectionWrite
|
||||
{
|
||||
EngineId = "rpgmaker_mv",
|
||||
CapabilityIds = [],
|
||||
RulesVersion = "2026.10.4",
|
||||
ExeSizeBytes = 1,
|
||||
ExeMtimeMs = 1,
|
||||
ExeArchitecture = ExecutableArchitecture.X64,
|
||||
}, Ct)).Should().BeTrue();
|
||||
|
||||
(GameDetailViewModel read, _, _, _, _) = await BuildAsync(s, game.Id);
|
||||
read.SupportsEmpty.Should().BeTrue("the game ships none of the files the rules name");
|
||||
read.SupportsEmptyText.Should().Be(Strings.GameDetail_Supports_None);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheHeaderTheTwoRowsAndTheSessionsTabReadFromTheLedger()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
// 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.Controls;
|
||||
using System.Windows.Input;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Controls;
|
||||
using Xunit;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// beta.21 (owner request 2026-10-13: "scrolling the documents in the app is slow"): the wheel moves a document by Windows'
|
||||
/// lines at a browser's line instead of WPF's fixed 48 DIP, in proportion to the delta, and leaves its ends to the host; a
|
||||
/// page is rendered once, and a page shown before is not rendered again.
|
||||
/// </summary>
|
||||
public sealed class MarkdownViewTests
|
||||
{
|
||||
private static readonly string _longText = string.Join("\n\n", Enumerable.Range(1, 400).Select(static i => "Paragraph " + i + ": a few words that wrap."));
|
||||
|
||||
[Fact]
|
||||
public void TheWheelStepFollowsTheDeltaWindowsLinesAndTheZoom()
|
||||
{
|
||||
MarkdownView.WheelStep(-120, 3, 600, 100).Should().BeApproximately(100, 1e-9, "three lines at a browser's line, downwards");
|
||||
MarkdownView.WheelStep(120, 3, 600, 100).Should().BeApproximately(-100, 1e-9);
|
||||
MarkdownView.WheelStep(-15, 3, 600, 100).Should().BeApproximately(12.5, 1e-9, "a touchpad's small delta moves in proportion");
|
||||
MarkdownView.WheelStep(-120, 3, 600, 200).Should().BeApproximately(200, 1e-9, "zoomed in, a line is taller");
|
||||
MarkdownView.WheelStep(-120, -1, 600, 100).Should().BeApproximately(600, 1e-9, "Windows' \"one screen at a time\"");
|
||||
MarkdownView.WheelStep(-120, 0, 600, 100).Should().Be(0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheWheelMovesTheDocumentByItsStepAndLeavesItsEndsToTheHost()
|
||||
{
|
||||
(double notch, double touch, bool atEnd, bool withCtrl) = await PagesLoadTests.OnStaAsync(static () =>
|
||||
{
|
||||
var view = new MarkdownView { EaseWheel = false, WheelScrollLines = static () => 3, CurrentModifiers = static () => ModifierKeys.None };
|
||||
view.Show(_longText, isPlainText: false, path: "LIMITATIONS.md");
|
||||
Layout(view);
|
||||
ScrollViewer scroller = view.Scroller ?? throw new InvalidOperationException("the template has no PART_ContentHost");
|
||||
scroller.ScrollableHeight.Should().BeGreaterThan(1000, "the document is longer than its view");
|
||||
|
||||
Wheel(view, -120).Should().BeTrue();
|
||||
Layout(view);
|
||||
double afterNotch = scroller.VerticalOffset;
|
||||
|
||||
Wheel(view, -15).Should().BeTrue();
|
||||
Layout(view);
|
||||
double afterTouch = scroller.VerticalOffset;
|
||||
|
||||
scroller.ScrollToVerticalOffset(scroller.ScrollableHeight);
|
||||
Layout(view);
|
||||
bool handledAtEnd = Wheel(view, -120);
|
||||
|
||||
scroller.ScrollToVerticalOffset(0);
|
||||
Layout(view);
|
||||
view.CurrentModifiers = static () => ModifierKeys.Control;
|
||||
bool handledWithCtrl = Wheel(view, -120);
|
||||
return (afterNotch, afterTouch, handledAtEnd, handledWithCtrl);
|
||||
});
|
||||
|
||||
notch.Should().BeApproximately(100, 0.5, "one notch is three lines of 100/3 DIP, not WPF's fixed 48");
|
||||
touch.Should().BeApproximately(112.5, 0.5, "a delta of 15 is an eighth of a notch");
|
||||
atEnd.Should().BeFalse("at the end the wheel is the host's — the update notes' dialog scrolls instead");
|
||||
withCtrl.Should().BeFalse("Ctrl+wheel is the zoom's, never the scroll's");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EasingAddsEveryNotchToTheTargetAndANewPageStopsIt()
|
||||
{
|
||||
(double first, double second, double afterShow) = await PagesLoadTests.OnStaAsync(static () =>
|
||||
{
|
||||
var view = new MarkdownView { EaseWheel = true, WheelScrollLines = static () => 3, CurrentModifiers = static () => ModifierKeys.None };
|
||||
view.Show(_longText, isPlainText: false, path: "LIMITATIONS.md");
|
||||
Layout(view);
|
||||
Wheel(view, -120).Should().BeTrue();
|
||||
double target1 = view.ScrollTarget;
|
||||
Wheel(view, -120).Should().BeTrue();
|
||||
double target2 = view.ScrollTarget;
|
||||
view.Show("# Another page", isPlainText: false, path: "guide/README.md");
|
||||
return (target1, target2, view.ScrollTarget);
|
||||
});
|
||||
|
||||
first.Should().BeApproximately(100, 0.5);
|
||||
second.Should().BeApproximately(200, 0.5, "a notch turned while easing adds to where the view is going, not to where it is");
|
||||
double.IsNaN(afterShow).Should().BeTrue("a new page ends the easing");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task APageIsRenderedOnceAndAPageShownBeforeIsNotRenderedAgain()
|
||||
{
|
||||
(int one, int two, int back, int evicted) = await PagesLoadTests.OnStaAsync(static () =>
|
||||
{
|
||||
var view = new MarkdownView();
|
||||
int start = view.Renders; // the constructor's empty document
|
||||
view.Show("# One\n\ntext", isPlainText: false, path: "guide/a.md");
|
||||
int afterOne = view.Renders - start;
|
||||
view.Show("# Two\n\ntext", isPlainText: false, path: "guide/b.md");
|
||||
int afterTwo = view.Renders - start;
|
||||
view.Show("# One\n\ntext", isPlainText: false, path: "guide/a.md");
|
||||
int afterBack = view.Renders - start;
|
||||
|
||||
for (int i = 0; i < MarkdownView.CacheCapacity; i++)
|
||||
{
|
||||
view.Show("# Page " + i, isPlainText: false, path: "guide/p" + i + ".md");
|
||||
}
|
||||
|
||||
int beforeEvicted = view.Renders;
|
||||
view.Show("# Two\n\ntext", isPlainText: false, path: "guide/b.md");
|
||||
return (afterOne, afterTwo, afterBack, view.Renders - beforeEvicted);
|
||||
});
|
||||
|
||||
one.Should().Be(1, "Show sets the three properties and renders once");
|
||||
two.Should().Be(2);
|
||||
back.Should().Be(2, "a page this view has rendered is kept");
|
||||
evicted.Should().Be(1, "past the cache's capacity the oldest page is rendered again");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task PropertiesSetOneByOneAreRenderedOnceAheadOfLayout()
|
||||
{
|
||||
(int beforePump, int afterPump, bool hasAnchor) = await PagesLoadTests.OnStaAsync(static () =>
|
||||
{
|
||||
var view = new MarkdownView();
|
||||
int start = view.Renders;
|
||||
view.DocumentPath = "guide/a.md";
|
||||
view.IsPlainText = false;
|
||||
view.MarkdownText = "# Heading\n\ntext";
|
||||
int before = view.Renders - start;
|
||||
Visuals.Pump();
|
||||
int after = view.Renders - start;
|
||||
return (before, after, view.Anchors.Count > 0);
|
||||
});
|
||||
|
||||
beforePump.Should().Be(0, "a binding's change asks for a render; it does not render the half-set page");
|
||||
afterPump.Should().Be(1, "three changes, one render");
|
||||
hasAnchor.Should().BeTrue();
|
||||
}
|
||||
|
||||
private static void Layout(FrameworkElement element)
|
||||
{
|
||||
element.Measure(new Size(700, 600));
|
||||
element.Arrange(new Rect(0, 0, 700, 600));
|
||||
element.UpdateLayout();
|
||||
}
|
||||
|
||||
private static bool Wheel(UIElement over, int delta)
|
||||
{
|
||||
var wheel = new MouseWheelEventArgs(Mouse.PrimaryDevice, Environment.TickCount, delta) { RoutedEvent = UIElement.PreviewMouseWheelEvent };
|
||||
over.RaiseEvent(wheel);
|
||||
return wheel.Handled;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user