Skip to content

fix(templates): stabilize 3D browser shell - #5

Merged
wh000wh000 merged 2 commits into
mainfrom
fix/threed-v1-5-browser-shell
Aug 4, 2026
Merged

fix(templates): stabilize 3D browser shell#5
wh000wh000 merged 2 commits into
mainfrom
fix/threed-v1-5-browser-shell

Conversation

@wh000wh000

Copy link
Copy Markdown
Owner

结论

Core3d now has a deterministic browser shell: repeated Escape cannot toggle pause twice, completed/failed games cannot be resumed, and favicon loading uses a real relative file instead of inline data.

Product-code evidence

Finding Generated code Template gap Runtime consequence
ESC repeat/end lock ember-skyway-relics-3d-v1-4/src/main.ts:37 core3d/src/main.ts accepted every Escape held Escape randomly toggled pause; end overlays could resume simulation
Missing path favicon v1.4 index.html:3-7 had no icon core3d had no public/favicon.* independent browser emitted a 404
Inline workaround Crystal v1.2 used href="data:," no canonical path asset hid the 404 by embedding data in editable HTML

Change

Path Change
agent-test/templates/core3d/src/main.ts Ignore event.repeat; lock Escape after completion/failure
agent-test/templates/core3d/index.html Reference ./favicon.svg
agent-test/templates/core3d/public/favicon.svg Small text SVG asset; no Base64/Data URL

The complementary non-Git smoke change adds opt-in --shell-contract: repeated Escape must preserve pause and the icon must be a non-data path returning 200. Default historical 2D/3D smoke behavior is unchanged.

Verification

Gate Result
Fresh core3d npm ci && npm run build PASS
smoke --esc-rounds 2 --shell-contract PASS: WebGL/non-black/errors0, repeat stable, favicon 200
Crystal v1.2 negative Expected FAIL under opt-in: repeat changed pause and data:, icon rejected
Crystal v1.2 default smoke PASS
Base64/Data URL scan of new template 0

Risk and rollback

The changes affect only the 3D shell. Phaser templates and default smoke semantics are untouched. Revert 4e4fdf5 for the icon path or ab0c546 for lifecycle behavior independently.

Upstream dependencies: leigest519#47-leigest519#50.

蝉息 added 2 commits August 4, 2026 20:31
A real v1.4 game showed repeated Escape events can toggle pause multiple times and end screens can resume gameplay. Ignore keyboard repeats and lock the runtime after completion or failure.
Real-browser review found the core3d shell requests an undeclared favicon. Ship a tiny standalone SVG and reference it relatively, keeping binary data out of editable HTML.
@wh000wh000
wh000wh000 merged commit 2d02ced into main Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant