From 8f6815f414cc371867feb2beab97778220ce52b0 Mon Sep 17 00:00:00 2001 From: Malte Langkabel Date: Thu, 6 Aug 2026 08:19:46 +0200 Subject: [PATCH] add the ASCII-only source rule and the visual-verification note to CLAUDE.md Two things learned the hard way while moving the build buttons. A shift glyph written as a literal would have been mangled by MSVC 2017, which does not read the sources as UTF-8 by default, and a PowerShell Get-Content/Set-Content round-trip re-encoded a source file with a BOM and double-encoded em-dashes. Screen-capturing the app window returns a blank client area because the capture cannot read the QOpenGLWidget surface, which is easy to misread as a broken UI; visual checks belong to the user. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01JcReq7hVk4KUPhTDKWAG7K --- .claude/CLAUDE.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 99a5100..4cc05bf 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -60,6 +60,13 @@ keep the citation accurate. * don't use abbreviations, except very common ones ("s" for seconds, "min", "max", etc.) * if a variable holds a value that has a unit or if a function returns a value that has a unit, append that unit to the name (e.g. "m_shipVelocity_mps", "getAcceleration_mpss()") * always enclose scopes in braces +* keep source files ASCII-only. A non-ASCII character needed at runtime (a glyph in a + UI string, a symbol drawn on a widget) is written as its code point with a comment + naming it (`const QChar shiftGlyph(0x21E7); // U+21E7 UPWARDS WHITE ARROW`), never + as a literal character: MSVC 2017 does not read the sources as UTF-8 by default and + silently mangles them. Never round-trip a source file through + `Get-Content`/`Set-Content` either: Windows PowerShell reads it as ANSI and writes + it back double-encoded with a BOM. Use the Edit/Write tools. ## Build @@ -96,6 +103,15 @@ output directories and copies the Qt DLLs. Run the app: `build/DotaFactory/Debug/app/DotaFactory.exe`, optionally `--replay ` for view-only playback of a recorded run. +**Visual verification is the user's job.** Screen-capturing the app window does not +work here: `CopyFromScreen` and `PrintWindow` both return a blank white client area +even while the app is running and rendering normally, because the capture cannot read +the composited surface of the `QOpenGLWidget`-backed window. A blank capture therefore +says nothing about whether the UI works, so do not read one as a regression and do not +try to work around it. To check a UI change: build, run the tests, launch the app, and +ask the user to look at it. Redirecting the process's stdout/stderr to a file does +work and is worth checking for Qt warnings. + ## Tests Catch2, single executable, links `lib` only — no QApplication, no display.