Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

the picker above the game needs to be better for all the games we have now #100

Merged opened this in answer to

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

Merged

The game menu above each game now stays usable with all 35 games. It's pushed, but I didn't see a full green run. playtest.test.mjs and serve.test.mjs hit my 120-second timeout and I moved on without checking their result.

Notes

shipped production is serving it deploy ab54f53

opened this

The game menu above each game now stays usable with all 35 games. It's pushed, but I didn't see a full green run. playtest.test.mjs and serve.test.mjs hit my 120-second timeout and I moved on without checking their result. bun test shell.test.mjs passes (7 tests, including a new one). I only ran bun x tsc --noEmit and it printed nothing but a help link, so I can't call it a pass; the repo has no tsconfig.json or package.json. I didn't open the menu in a browser.

What changed (shell.js)

  • Grouping: games are listed under their kind (Throwing, Timing, Catching and so on), in the order the kinds first appear in GAMES. Games marked soon still sit in a "Soon" group at the end, unlinked.
  • Scrolling: the list used to run off the screen. It now caps at about 70% of the viewport height (at most 480px) and scrolls on its own.
  • Find box: a "Find a game" search box at the top filters the list as you type, using the same word matching as the home page's filterGames. Kind headings with no match hide, and "No game matches" shows when nothing is left.
  • Current game: opening the menu scrolls the game you're on into view.

What I chose not to do: no keyboard arrow navigation inside the list, and no per-game accent colours or blurbs in the menu. The links, Tab order and Escape-to-close are unchanged.

To try it: open any game, e.g. /balote/, and tap the title at the top centre.

New test: the menu holds the search box, every kind heading, and every playable game.

🤖 Generated with Claude Code

Closes #98

4 earlier comments · 2 events
commented

The game menu above each game now stays usable with all 35 games. It's pushed, but I didn't see a full green run. playtest.test.mjs and serve.test.mjs hit my 120-second timeout and I moved on without checking their result. bun test shell.test.mjs passes (7 tests, including a new one). I only ran bun x tsc --noEmit and it printed nothing but a help link, so I can't call it a pass; the repo has no tsconfig.json or package.json. I didn't open the menu in a browser.

What changed (shell.js)

  • Grouping: games are listed under their kind (Throwing, Timing, Catching and so on), in the order the kinds first appear in GAMES. Games marked soon still sit in a "Soon" group at the end, unlinked.
  • Scrolling: the list used to run off the screen. It now caps at about 70% of the viewport height (at most 480px) and scrolls on its own.
  • Find box: a "Find a game" search box at the top filters the list as you type, using the same word matching as the home page's filterGames. Kind headings with no match hide, and "No game matches" shows when nothing is left.
  • Current game: opening the menu scrolls the game you're on into view.

What I chose not to do: no keyboard arrow navigation inside the list, and no per-game accent colours or blurbs in the menu. The links, Tab order and Escape-to-close are unchanged.

To try it: open any game, e.g. /balote/, and tap the title at the top centre.

New test: the menu holds the search box, every kind heading, and every playable game.

🤖 Generated with Claude Code

commented

The ten failures are fixed and pushed. The cause was four games (Espresso Bar, Firefly Jar, Signal Box, Soapbox Derby) that landed without the test scaffolding, not the game-menu change in #98. I ran playtest.test.mjs for the scripted rounds, the Signal Box, Soapbox Derby, Firefly Jar and Espresso Bar game tests plus shell.test.mjs, and the one serve.test.mjs no-select check. Each passed. I did not run the full suite; the forge runs it on this push. This repo has no package.json, tsconfig.json or scripts/gate.ts, so there was no type check or gate to run.

  • Missing scripted rounds: I added a round to rounds.mjs for each of the four games, so "every game has a scripted round" passes again. Each script plays the game properly and reaches an outcome that an untouched game doesn't:

- Espresso Bar: pours to the painted line and finishes all twenty cups. - Firefly Jar: taps the glowing fireflies, so the jar ends with a nonzero count. - Soapbox Derby: steers through the middle of each gate gap and reaches the banner. - Signal Box: routes two trains correctly, then pulls wrong levers until the third train is lost. A correct run never ends on its own, so the script has to end in a loss line.

  • Page tests: the Soapbox Derby and Signal Box page tests read the game's state through the old vm.runInContext, which can no longer see the page's variables. They now use g.read(...), which is the only change to those tests and fixes their four failures.
  • Firefly Jar: its page lacked the rule that turns off text selection and the iOS touch callout, so I added it. This fixes the "every game page turns off text selection" failure.

The #98 menu change is untouched.

Sheepdog (#93) is on main but not on this branch. If it lacks a scripted round, it will fail the same check after the merge.

commented

I merged main into the branch and pushed; the only conflict was firefly-jar/index.html.

  • Conflict: main had already made the same fix to the Firefly Jar page, merging the no-select rule into its html, body line. I took main's version.
  • Rounds: main had also added scripted rounds for Espresso Bar, Firefly Jar, Signal Box and Soapbox Derby. Mine would have duplicated those entries, so I dropped them and rounds.mjs now matches main.
  • Left in the branch: the page-test fixes for Soapbox Derby and Signal Box, and the game menu change from #98. The pull now differs from main only in shell.js and shell.test.mjs.
  • Tests: I re-ran shell.test.mjs and the Soapbox Derby, Signal Box and Firefly Jar tests, and all passed. I did not re-run the full suite or the other tests; the forge runs it on this push.
Changes requested — before the latest push

The grouped, scrolling menu with a find box fits the issue, and the served page loads shell.js. Nothing here touches identity, writes or the terminal, so the security items do not apply. Three things to fix in one round:

  1. Screen readers lose the grouping (shell.js:118). The kind headings are aria-hidden, so a screen-reader user hears one flat list of 30+ links. The "Soon" heading is not hidden, so the two are also inconsistent. Fix: make each group a real group, either a nested ul with role=group and aria-label=kind, or heading rows with role=presentation removed and aria-hidden dropped.
  1. The new test does not cover the new behaviour (shell.test.mjs). It checks that the search box exists and that titles appear. It would still pass if typing in the box did nothing. Add tests that set find.value, dispatch input, and assert: non-matching items and empty kind headings are hidden, "No game matches" shows for a nonsense query, and clearing the query restores everything. Also assert the Soon games are not links, and that opening the menu marks the current game with aria-current.
  1. It was never run in a browser. The pull says the menu was not opened, and on a 360px phone the on-screen keyboard shrinks the viewport, which is the main risk for the 70dvh cap and the search box. Run it at 360px width (with the keyboard up if you can), confirm the box and the first results stay visible, and say so in the description. Typing in the box must not close the menu on pointerdown.

Smaller: the list.querySelector?. and scrollIntoView?. guards exist only to satisfy the test stub. Make the stub provide those methods rather than shaping production code around it.

commented

I fixed all three review points except the browser run, which I couldn't do. I changed shell.js and shell.test.mjs, and shell.test.mjs now passes (11 tests, including the new menu ones).

  • Grouping for screen readers (shell.js):

- Each kind is now its own ul with role="group" and aria-label set to the kind. - The visible heading stays aria-hidden because the group label already announces it. - "Soon" is built the same way, so the two are consistent.

  • Tests (shell.test.mjs):

- The test stub now keeps a small element tree, with querySelector, contains, scrollIntoView and event dispatch. That replaced the ?. guards in production code (list.querySelector?. and scrollIntoView?.). - New tests set find.value and dispatch input, then check: - Non-matching items and kinds left empty are hidden. - A nonsense query shows "No game matches", and clearing it restores everything. - Soon games are spans, not links. - Opening the menu marks the current game with aria-current and scrolls it into view. - A pointerdown on the find box doesn't close the menu; one outside it does.

  • 360px phone:

- Not run. Chromium exists here but aborts at startup in this sandbox, because it can't create its socket and its profile directory is read-only. I did not open the menu in a browser, so I can't confirm the box and first results stay visible with the keyboard up. - Pinned find box: the find row is now position: sticky; top: 0, so it can't scroll out of the list. - Input font size: the input is at least 16px, so iOS doesn't zoom when it's focused. - Please check: a person with a phone should open the menu on the preview at 360px.

The scripts in scripts/ don't include design-lint.ts in this clone, so I did not run it.

Changes requested — before the latest push

The grouped, scrolling menu with a find box fits the issue, and the security items do not apply (no identity, writes or terminal here). One thing to fix first, plus two smaller ones.

  1. Typing in the find box reaches the game. 34 game pages listen for keydown on document or window, and the find input does not stop its key events from bubbling. So letters, Space and arrow keys typed to search also steer or act on the running game. A game that calls preventDefault on Space or the arrows will also swallow a space in a query such as "Soapbox Derby". Fix: add a keydown listener on #pp-find that calls e.stopPropagation(), except for Escape, which must still reach the menu's close handler at shell.js:116. Add a test: dispatch a keydown on find and assert a document-level listener does not see it, while Escape still closes the menu.
  1. The README (line 67) says shell.js provides the game menu but does not mention the find box or the kind groups. Add one line on how to use them.
  1. Nobody has opened this in a browser. The 360px width with the keyboard up is still unchecked. This is not blocking, but say so in the description.
commented

The game menu (the picker above every game) now lists the games under their kind, scrolls within the screen, and has a find box. Keys typed in the box no longer reach the running game.

What changed:

  • Find box: stops keydown, keyup and keypress from reaching the page, so letters, Space and the arrows don't steer or act on the game, and a game that calls preventDefault on Space can't swallow the space in "Soapbox Derby". Escape still reaches the menu's close handler.
  • Menu structure: each kind is a nested ul with role="group" and aria-label set to the kind, so screen readers announce the grouping. Games not made yet sit last under "Soon", as plain labels rather than links.
  • Search: typing hides games that don't match and kinds left empty. A query that matches nothing shows "No game matches", and clearing it restores the whole list.
  • Opening the menu scrolls the current game (marked aria-current="page") into view.
  • Phone layout: the find row stays pinned at the top of the list, and the input is at least 16px so iOS doesn't zoom on focus.
  • README: the shell.js line now says how to use the kind groups and the find box.

Tests: in shell.test.mjs, the stub DOM now keeps a real element tree with querySelector, contains, scrollIntoView and bubbling events. That let me drop the ?. guards production code had only for the stub. New tests cover:

  • the labelled groups
  • hiding as you type
  • the empty state and restoring on clear
  • Soon games not being links
  • aria-current and the scroll on open
  • a pointerdown on the find box not closing the menu, and one outside closing it
  • keys typed in the box not reaching a listener on the document, while Escape still closes the menu (this test fails without the fix)

All 12 tests in shell.test.mjs pass.

Not run:

  • Browser check: nobody has opened this in a browser yet. Chromium is installed in my sandbox but aborts at startup there, so the 360px-wide check with the on-screen keyboard up is still open. It needs a look on the preview from a real phone.
  • Design lint: scripts/design-lint.ts doesn't exist in this repository, so I didn't run it.

To try it: open any game on the preview, tap the menu, type "tr" in the find box and check the game stays still, then press Escape.

🤖 Generated with Claude Code

Approved

Earlier asks: (1) keys typed in the find box reaching the game — met: keydown/keyup/keypress stop at #pp-find except Escape, with a test that a document listener sees nothing and Escape still closes the menu. (2) README line on groups and find box — met. (3) say the browser check is open — met in the description. The preview serves the new shell.js and /balote/ answers 200. Next, two things: Non-blocking: have someone open the menu on a real 360px phone with the keyboard up and confirm the find row and first results stay visible. Non-blocking: add arrow-key movement from the find box into the list, so keyboard users do not have to Tab past it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs