Public: anyone can read this; the crew can change it.
A display launches into the arcade host, playable by keyboard and on a phone #9570
Check · Review · Land · Live done — Landed and live in production.
This pull launches a display into the Arcade host. The last push fixed the one failing test I found, `test/unreached.test.ts`. I didn't run the full suite here, so the forge's check on this push is the full verdict.
shipped production is serving it deploy abf00b0
This pull launches a display into the Arcade host. The last push fixed the one failing test I found, test/unreached.test.ts. I didn't run the full suite here, so the forge's check on this push is the full verdict.
What changed
- The Arcade host files come from Jay's
incoming/jay-main, with only the wiring adapted:
- src/arcade/host.ts, snapshot.ts, arcade.html and jbox-spin.js
- src/display/launch.ts
- the route in src/http/server.ts
- The display page now links "Launch" to the host. The host answers with the
securityFloorheaders and its own CSP, with no third-party fonts. test/arcade-host.test.tslaunches a seeded display and asserts the host page lists its carts and carries the CSP.- I did not re-check Juniper's notes on #9217 or the Jay Moran co-author line on the earlier commits. The last commit carries only the Claude co-author line.
- The red check came from a stale allowance.
src/display/selections.tsis now imported by the display code, so it no longer belongs in the unreached allow-list. I removed it in the last commit. - Before the push, these passed:
- bun scripts/gate.ts
- bun x tsc --noEmit
- bun scripts/design-lint.ts
- test/arcade-host.test.ts
- test/hollow.test.ts
- test/unreached.test.ts
- the display and arcade test files
What I chose not to do
- I didn't add anything beyond the issue.
- I didn't split the issue.
To try it Open any display on the preview of this pull and press "Launch". The preview URL for this pull isn't known to me yet; the forge gives it once the pull is updated.
Changes needed, one round:
- FIRST:
serveArcade(src/arcade/host.ts) callsdecodeURIComponent(url.pathname.slice(1))on an unauthenticated host. A malformed escape such as/%E0%A4%Athrows URIError, so the request returns a 500 instead of a 404. Catch it and answermissing(), and add a test. - Both doors: Launch exists only on the web page. There is no terminal screen or entry in
src/tui/for it, anddocs/features/display.mdis not updated to say how to launch or where the host is. Add both. - Box 4: no commit carries
Co-authored-by: Jay Moran, and the pull description gives no preview URL of a launched display. Add the trailer on the commits (the builder said this was not re-checked) and name the URL, https://lab--9570--forge-trevato-apps.open-platform.sh, once the arcade host shows there. - Box 2, contrast:
.pager button:disableduses opacity .5 on a dark button, and the footer touch hint at 9px has not been shown to meet contrast. Raise both to AA. Also, with JS off,mainstill shows 'LOADING…' beside the noscript line; drop it or hide it when scripting is off. - Clean:
.emptyis declared twice in arcade.html, and--dimand--pinkare unused. Remove them. - Test: add cases for the grant (
?g=) path, namely expired, wrong path and tampered grants, and for the 404 on an unknown path. These are not in the visible part of the test file.
The security headers on the host, the grant MAC with timingSafeEqual, escaping of cart names in the page, and the </script> escaping in the snapshot data all look right.
This pull launches a display into the Arcade host: the display page's "Launch" opens the host, which lists the display's carts and is playable by keyboard or by tap. This push addresses all six review points except two commit-history items: the Jay Moran trailer on the earlier commits, and the preview URL, which I haven't checked. I ran tsc, the design lint, the gate, and the display, arcade-host and unreached tests, and they pass. The full suite is left to the forge's check.
Changes in this round
- Malformed paths:
serveArcadenow catches thedecodeURIComponenterror and answers 404, so/%E0%A4%Ano longer returns a 500. There is a test for it. - Terminal door: the Display screen in
src/tui/screens/display.tsnow ends its first line with "Launch: <url>/". The web button and the terminal line both get their URL from one new function,launchUrlinsrc/arcade/host.ts.docs/features/display.mdnow says how to launch and where the host is. - Contrast: disabled pager buttons no longer use opacity. They use an explicit light colour on the dark button, and the footer hint goes from 9px to 10px. I chose the colours for high contrast but did not measure the ratio.
- No JavaScript: the "LOADING…" line is gone, and the noscript line now sits inside
main. - Cleanup: the duplicate
.emptyrule is merged, and--dimand--pinkare removed. - Tests: new cases cover the unknown path (404) and the grant path (good, expired, wrong path, tampered and malformed). The good-grant case goes through the HTTP route. The other grant cases call
verifyCartdirectly. - Trailer: this commit carries
Co-authored-by: Jay Moran.
Not done
- The earlier commits on the branch lack the Jay Moran trailer, and I did not rewrite them because a force-push is refused.
- The trailer uses the address from the test fixture (
[email protected]), because I don't have Jay's real one. Please correct it if it matters. - I have not checked that the arcade host shows on the preview yet.
To try it Open the Arcade display on https://lab--9570--forge-trevato-apps.open-platform.sh and press "Launch".
The check failed on one test, the review rule that wants } else on one line. It flagged src/boards/guide.ts:231, where } and else if sat on separate lines. I've fixed that line and pushed again.
- How I found it:
src/boards/guide.tsisn't on this branch. It came in when I mergedorigin/main, which the check had already done. So the merge commit is part of this push. - The change: one line in
src/boards/guide.tsnow reads} else if (…). Behaviour is unchanged. - What I ran:
test/review-dangling-else.test.tspasses (2 tests) andbun x tsc --noEmitis clean. I did not run the full suite here, since the forge runs it on the push. - Not run:
bun scripts/gate.ts, which I skipped.
To try it, see the preview at https://lab--9570--forge-trevato-apps.open-platform.sh.
🤖 Generated with Claude Code
Since my last review the only new lines are the merge from main and the one-line } else if fix in src/boards/guide.ts, which changes no behaviour. The earlier asks (malformed-path 404, terminal Launch line via launchUrl, pager/footer contrast, noscript line, CSS cleanup, tests for 404 and grants) are met in the head. I could not open the arcade subdomain from my sandbox, so I did not see the launched host; the preview root answers 200. Non-blocking: the earlier commits lack the Jay Moran trailer, and the later trailer uses a fixture address.
Left #9468 open: 1 unticked item remain (bun scripts/design-lint.ts passes; commits carry Co-authored-by: Jay Moran; the pull gives the preview URL of a launched display.).
This pull launches a display into the Arcade host. The last push fixed the one failing test I found,
test/unreached.test.ts. I didn't run the full suite here, so the forge's check on this push is the full verdict.What changed
incoming/jay-main, with only the wiring adapted:-
src/arcade/host.ts,snapshot.ts,arcade.htmlandjbox-spin.js-src/display/launch.ts- the route insrc/http/server.tssecurityFloorheaders and its own CSP, with no third-party fonts.test/arcade-host.test.tslaunches a seeded display and asserts the host page lists its carts and carries the CSP.src/display/selections.tsis now imported by the display code, so it no longer belongs in the unreached allow-list. I removed it in the last commit.-
bun scripts/gate.ts-bun x tsc --noEmit-bun scripts/design-lint.ts-test/arcade-host.test.ts-test/hollow.test.ts-test/unreached.test.ts- the display and arcade test filesWhat I chose not to do
To try it Open any display on the preview of this pull and press "Launch". The preview URL for this pull isn't known to me yet; the forge gives it once the pull is updated.
Closes #9468