Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

refactor(theme): the spacing grid has one author, the token that declares it

esenginec19f2307057e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a0eeb8f6..985d2f3d7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@ published separately; it ships inside the editor.
### Added
+- **The build's size bar stopped borrowing Play's green.** Within budget was drawn in the transport's running-green, which reads as a state the build is in rather than as a measurement — and a green bar invites "fine, keep going" where the honest message is that there is nothing to report yet. It is now the panel's own neutral, and goes amber then red, which is the whole vocabulary it needs. The two progress bars in that panel were also 6px and 8px side by side; they are one shape now.
+
- **A Play session that times out now says whether it ever started.** The realm announces itself when its page runs, before a line of the engine is read — previously its only signal was the host module's last statement, so a machine still parsing the SDK and a frame that never ran gave the same ninety seconds of silence, and both were reported as the editor being broken. The two now read differently, and only one of them is the machine's.
- **When a 分包 will not come down, the package says which one and why.** The generated entry logged the vendor's error object, which reaches a device's console as `[object Object]` — the one place you get to look. It is stringified now, and the headless launcher can be told to refuse a named 分包 (`--fail-subpackage`) so the path a bad network takes is something a build can be run against rather than waited for.
diff --git a/desktop b/desktop
index 7db54063c..1e7c516d6 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 7db54063c680d63af262c1c86d571e0c448a3fd7
+Subproject commit 1e7c516d60eb67283368e6726b265b71ec154153
diff --git a/tools/check-theme.mjs b/tools/check-theme.mjs
index 103ef8a0e..ff713ee65 100644
--- a/tools/check-theme.mjs
+++ b/tools/check-theme.mjs
@@ -192,7 +192,17 @@ for (const file of everyFile(SRC_DIR)) {
*/
const THEME_DIR = path.join(ROOT, 'desktop', 'src', 'theme');
const BASELINE = path.join(ROOT, 'tools', 'baselines', 'theme-drift.json');
-const GRID = 4;
+
+/**
+ * The spacing grid, read off the token that declares it rather than repeated
+ * here: `--u` had no other reader, so the theme's own statement of its grid and
+ * the rule that enforces it could have disagreed with nothing to notice.
+ */
+const GRID = (() => {
+ const px = /--u:\s*(\d+)px/.exec(readFileSync(path.join(THEME_DIR, 'tokens.css'), 'utf8'))?.[1];
+ if (!px) throw new Error('desktop/src/theme/tokens.css declares no --u: the spacing grid has no author');
+ return Number(px);
+})();
const offGridByFile = () => {
const out = {};
diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjs
index e61a26752..93762c599 100644
--- a/tools/releaseNotes.mjs
+++ b/tools/releaseNotes.mjs
@@ -700,6 +700,10 @@ export const NOTED = {
{ internal: "the editor's preview page names the same subpaths it always did" },
'fix(settings): the module page reads the same asset table the build installs from':
{ note: 'The Engine Modules page no longer calls a module unused that the build then carries.' },
+ 'fix(theme): the size bar reads as a measurement, not as a running state':
+ { note: "The build's size bar stopped borrowing Play's green." },
+ 'refactor(theme): the spacing grid has one author, the token that declares it':
+ { internal: 'the gate repeated the 4px grid the theme already declared; no visible change' },
'fix(play): a realm says its page ran before it reads the engine':
{ note: 'A Play session that times out now says whether it ever started.' },
'fix(export): a 分包 that did not load says which one and why':