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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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 securityFloor headers and its own CSP, with no third-party fonts.
  • test/arcade-host.test.ts launches 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.ts is 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.

Closes #9468

commented

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 securityFloor headers and its own CSP, with no third-party fonts.
  • test/arcade-host.test.ts launches 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.ts is 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 requested — before the latest push

Changes needed, one round:

  1. FIRST: serveArcade (src/arcade/host.ts) calls decodeURIComponent(url.pathname.slice(1)) on an unauthenticated host. A malformed escape such as /%E0%A4%A throws URIError, so the request returns a 500 instead of a 404. Catch it and answer missing(), and add a test.
  2. Both doors: Launch exists only on the web page. There is no terminal screen or entry in src/tui/ for it, and docs/features/display.md is not updated to say how to launch or where the host is. Add both.
  3. 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.
  4. Box 2, contrast: .pager button:disabled uses 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, main still shows 'LOADING…' beside the noscript line; drop it or hide it when scripting is off.
  5. Clean: .empty is declared twice in arcade.html, and --dim and --pink are unused. Remove them.
  6. 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.

commented

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: serveArcade now catches the decodeURIComponent error and answers 404, so /%E0%A4%A no longer returns a 500. There is a test for it.
  • Terminal door: the Display screen in src/tui/screens/display.ts now ends its first line with "Launch: <url>/". The web button and the terminal line both get their URL from one new function, launchUrl in src/arcade/host.ts. docs/features/display.md now 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 .empty rule is merged, and --dim and --pink are 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 verifyCart directly.
  • 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".

commented

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.ts isn't on this branch. It came in when I merged origin/main, which the check had already done. So the merge commit is part of this push.
  • The change: one line in src/boards/guide.ts now reads } else if (…). Behaviour is unchanged.
  • What I ran: test/review-dangling-else.test.ts passes (2 tests) and bun x tsc --noEmit is 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

Approved

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.

commented

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.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs