Consolidate duplicated editor code, trim comments, refresh README
Split GraphCanvas (1076 -> 831 lines) into EdgeLayer and graphMenus; the port and marker menus were the same list and are now one function. Value specs of the inspector and the list tab share valueSpecs.ts, and the remaining copies (compound commands, type glyphs, typed asset lookup, name rule, play/editor world setup, marquee) are merged. Four copies had already drifted apart; merging them fixes: - "Disconnect N links" in the port menu is one undo step, not N - "+ Add collider" is hidden on a placed container instance, as in the hierarchy menu, instead of always failing - a bool property coerced from the text "false" becomes false - a port command on an unknown node type reports instead of crashing Comment-only edits leave the bundle byte-identical. README corrected in 35 places (step limit, jump-run clock, suite duration, 409 body, ...). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9212e61c4c
commit
8f92a06c84
96 files changed
+999
-1261
No files matched your search
+7
-18
@@ -1,13 +1,6 @@
|
||||
/**
|
||||
* Where the headless browser for a check run lives.
|
||||
*
|
||||
* Local by default. Set `GM_REMOTE=user@host` to run it on another machine instead: an SSH
|
||||
* session forwards the CDP port back to 127.0.0.1, so everything downstream – waitForChrome,
|
||||
* /json/new, the WebSocket – stays unchanged. The checks load the public base URL, so the
|
||||
* remote side needs nothing but a browser and internet.
|
||||
*
|
||||
* Why bother: even with the GPU in use an idle editor page keeps rendering frames that never
|
||||
* change, and this machine has 8 GB with most of the swap already gone.
|
||||
* Launches the check browser locally, or with `GM_REMOTE=user@host` on another machine with the CDP port
|
||||
* forwarded over SSH, since this 8 GB host has little memory to spare.
|
||||
*/
|
||||
import { spawn, execFileSync } from 'node:child_process';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
@@ -21,10 +14,8 @@ const FLAGS = [
|
||||
'--headless',
|
||||
'--hide-scrollbars',
|
||||
/**
|
||||
* Measured on this host (idle editor page, 20 s): software WebGL costs 373% of a core at 8 fps,
|
||||
* the Intel HD 630 via ANGLE/Vulkan costs 69% at 56 fps. There is deliberately no software
|
||||
* fallback — a host without a usable GPU should fail loudly rather than melt down. `--use-angle=gl`
|
||||
* and `--use-gl=egl` look even cheaper but get no WebGL context at all — do not use them.
|
||||
* Measured (idle editor, 20 s): software WebGL 373% of a core at 8 fps, HD 630 via ANGLE/Vulkan 69% at
|
||||
* 56 fps; no software fallback on purpose. `--use-angle=gl` and `--use-gl=egl` get no WebGL context at all.
|
||||
*/
|
||||
'--use-angle=vulkan',
|
||||
'--ignore-gpu-blocklist',
|
||||
@@ -81,7 +72,7 @@ export function launchBrowser({ port, width, height }) {
|
||||
}
|
||||
|
||||
const key = process.env.GM_REMOTE_KEY ?? join(homedir(), '.ssh', 'gm-win.key');
|
||||
// Copied every run: a stale launcher on the remote is a debugging session nobody enjoys.
|
||||
// Copied every run so the remote never runs a stale launcher.
|
||||
execFileSync('scp', [...sshArgs(key), LAUNCHER, `${remote}:gm-browser.ps1`], { stdio: 'pipe' });
|
||||
|
||||
const proc = spawn(
|
||||
@@ -101,10 +92,8 @@ export function launchBrowser({ port, width, height }) {
|
||||
return {
|
||||
proc,
|
||||
/**
|
||||
* The launcher notices a finished run on its own, but only after its idle window – a browser
|
||||
* lingering a minute on someone else's desktop is rude, so end it now and let that window be
|
||||
* the net for runs that die without reaching here. Only this run's pid: the host is somebody's
|
||||
* desktop, and killing by name would close the browser they are reading this in.
|
||||
* Ends the browser now rather than after the launcher's idle window. Kill only this pid: the host is
|
||||
* someone's desktop, and killing by name would close their browser.
|
||||
*/
|
||||
stop: () => {
|
||||
const pidFile = `$env:TEMP\\gm-browser-${port}.pid`;
|
||||
|
||||
Reference in new issue
Block a user