Skip to content

hotfix 1.3.1: the add dialog, alone=1, and Ctrl+R in the browser - #3058

Merged
nesbox merged 3 commits into
mainfrom
fixes-1.3.1
Oct 5, 2026
Merged

nesbox merged 3 commits into
mainfrom
fixes-1.3.1

Conversation

@nesbox

@nesbox nesbox commented Oct 5, 2026

Copy link
Copy Markdown
Owner

The three reports the 1.3.0 release brought in yesterday. Two came from users on Chrome, and the owner could not reproduce one of them on macOS at all — which turned out to be the clue.

The add dialog never got the file

In the browser, add looked like a missing dialog on the site's player: the Go site's player partial had lost the #add-modal markup its Node predecessor carried. The server half is fixed in tic80-server (a41a425 player: the console's add-file popup is back, cff130f) and deploys with the site.

With the markup back, picking a file still did nothing: the popup's callback called dynCall, which emscripten no longer emits — the 1.2.0 web build declared it, the sokol web layer (#3048) does not, and everything else that used it goes through getWasmTableEntry now. The picker threw "dynCall is not defined" before onAddFile ran, so the file never reached the machine. #3018 fixed the sibling (writeArrayToMemory) but not this. That half is the first commit here.

alone=1 exported the editors anyway

A pro user: "the final game includes the editors even if you use alone=1. It creates a bigger final exe and 'breaks' one of the pro features (export without editors)."

Native export has preferred the running executable for a same-platform export since aff61f94 — and that executable is the full client. alone was honored only in the server-download path, so the flag never had a chance. It now decides before the local template is tried: alone=1 always downloads /export/<dir>/<system><lang>, the way the html export already did.

Ctrl+R reloaded the player page

A user on Chrome/Windows: "it runs for 3 seconds and resets." What he saw was the page coming back to CLICK TO PLAY: Ctrl+R is RUN in the studio, and the browser reloaded the tab instead. SDL's emscripten backend consumed Ctrl combinations (and the function keys, Tab, Backspace and the arrows) for the 1.2 web build; sokol bubbles character keys by design — the browser needs them to make text — and a Ctrl combination rides one.

The layer now consumes Ctrl on a character key, except Ctrl+C/X/V (sokol reads a paste from the page's own paste event, which Ctrl+V's default action raises) and except Ctrl+Alt, which is AltGr on the layouts that need it and a character the studio reads through its own fallback.

Verified

  • bin/release/check-export-stubs.sh against dev with a PRO client: 23 passed, 0 failed — every alone=1 path editorless and byte-equal to what the site serves, every free path still carrying the editors. Before the fix the same export printed "using local native template..." and wrote the 12.7 MB client with SPRITE EDITOR in it; after it writes the 3.5 MB served stub plus the cartridge.
  • Ctrl+R, in an isolated Chrome over CDP, before and after: 1.3.0 reports defaultPrevented=false, this branch true; Ctrl+V, Ctrl+Alt and a plain letter stay false; F5 and the arrows stay consumed by the layer itself. The machine still gets every key — F5 switched the studio to the music editor and help typed into the console in the same session.

The web artifacts (tic80-html, the per-language players) carry the keyboard fix to the site; the release is cut from main.

🤖 Generated with Claude Code

nesbox and others added 3 commits October 5, 2026 16:19
Native export has preferred the running executable since aff61f9, and that
executable is the full client: alone=1 was ignored there, so a game exported
without editors came out as the whole IDE, editors included.

The flag now decides before the local template is tried — alone=1 always
downloads /export/<dir>/<system><lang>, the way the html export already did —
and the "local native template failed" line is not printed when no attempt
was made. alone=0 is unchanged.

Verified with bin/release/check-export-stubs.sh against dev: 23 passed,
0 failed, the alone paths editorless and byte-equal to the served stubs, the
free paths still carrying the editors. Before the fix the same export printed
"using local native template..." and wrote the 12.7 MB client with SPRITE
EDITOR in it; after it writes the 3.5 MB served stub plus the cartridge.

Co-Authored-By: Claude Code <noreply@anthropic.com>
sokol bubbles character keys on purpose — the browser needs them to make
text — and consumes every other key itself. A Ctrl combination on a
character key rides that bubble: Ctrl+R is RUN in the studio, and Chrome
reloaded the tab instead of running the cart. A user met it as "the game
runs for a few seconds and resets", the page coming back to CLICK TO PLAY.

The layer now consumes Ctrl on a character key, except Ctrl+C/X/V — sokol
reads a paste from the page's own paste event, which Ctrl+V's default action
raises — and except Ctrl+Alt, which is AltGr on the layouts that need it:
the studio reads AltGr through its own fallback, and SDL consumed it too,
so the old web build typed a space there.

Verified in an isolated Chrome over CDP: 1.3.0 reported defaultPrevented
false for Ctrl+R and this build true; Ctrl+V, Ctrl+Alt and a plain letter
stay false; F5 and the arrows stay consumed by the layer itself. The machine
still gets every key — F5 switched the studio to the music editor and `help`
typed into the console in the same session.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The dialog's callback called dynCall, which emscripten no longer emits: the
1.2.0 web build declared it, the 1.3.0 one (the sokol web layer of #3048)
does not, and everything else that used it now goes through
getWasmTableEntry. Picking a file therefore threw "dynCall is not defined"
before onAddFile ran and the file never reached the machine. #3018 fixed
the sibling (writeArrayToMemory) but not this.

Why: the page's popup hands the file back through the console's EM_ASM, and
the web layer's other callbacks are exported calls (tic80_insets,
sokol_start) — tic80_add_file is the same shape.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@nesbox nesbox self-assigned this Oct 5, 2026
@nesbox
nesbox merged commit 62c24e5 into main Oct 5, 2026
11 checks passed
@nesbox
nesbox deleted the fixes-1.3.1 branch October 5, 2026 16:33
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