Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
better game browser. right now the list is kinda lame. i would love to see mo… #47
Check · Review · Land · Live done — Landed and live in production.
The home page now shows the games as a card grid with a search box and kind filter chips, instead of the plain list. I ran only serve.test.mjs and shell.test.mjs, and they pass. I haven't opened the page in a browser, so the look and the filter UI are unchecked.
shipped production is serving it deploy ab54f53
2 earlier comments · 2 events
The home page now shows the games as a card grid with a search box and kind filter chips, instead of the plain list. I ran only serve.test.mjs and shell.test.mjs, and they pass. I haven't opened the page in a browser, so the look and the filter UI are unchecked. bun x tsc --noEmit only printed its usage text, because the repo has no tsconfig, so it didn't type-check anything. I didn't run scripts/design-lint.ts or scripts/fast.ts.
Issue #44 has no body and its title is cut off ("i would love to see mo…"). I guessed it meant a richer, more visual browser and built that. If it meant something else, say so.
What changed
- Card metadata: each
GAMESentry inshell.jsnow has akind(Sport, Throwing, Timing, Catching, Precision or Racing), aninput(Tap, Hold or Drag) and anaccentcolour. I assigned all 19 myself, so check they suit you. - Cards: each card has a top bar in its game's accent colour. It also shows a "KIND · INPUT" line, the title and the blurb. The whole card is the link, and there is a visible focus outline.
- Search and filters: the search matches every word against title, blurb, kind and input. The chips filter by kind, and there is a "No game matches." message when nothing fits.
- No-JS fallback: the static list in
index.htmlcarries the same cards. The search and chips only appear when scripts run. - Tests:
serve.test.mjschecks every game has valid metadata that matches the static list, and coversfilterGames. - Docs: the README's "Add a game" section says to set the new fields.
Not done
- Thumbnails: the colour bar stands in for them. Games render on a canvas and the repo ships no image assets, so real thumbnails would need either a screenshot step or a canvas preview.
- Search persistence: the search and filter aren't kept in the URL.
To try it: run node serve.mjs and open http://127.0.0.1:5300/.
I also had to stage files by name, because git add -A choked on a .bash_profile in the clone.
🤖 Generated with Claude Code
The card grid fits the issue. The no-JS fallback is kept, the forged-by-crew notes and the footer credits are still there, and serve.test.mjs + shell.test.mjs pass on the preview's files (24/24). The static home page has no writes, sessions or terminal, so the security and tty checks don't apply. Please fix these in one round:
- Fix first: the layout shifts on every load. The
.toolsrow isdisplay:noneuntilhtml.jsis set, and that only happens in the script at the end of<body>. So the browser paints the static grid first. Then the search box and chips appear and push every card down by about 100px. Set the class from a one-line inline script in<head>(<script>document.documentElement.classList.add('js')</script>). Also give#kindsamin-heightso the chips filling in later don't move anything. - Free Throw is tagged with the wrong input. It is tagged
Tap, but its own blurb says "hold to crouch and build power, release to jump", and the page uses pointerdown/pointerup. It should beHold. Fix it inshell.jsand in the static<li>. - Searches and filters can't be shared or bookmarked. Keep
qandkindin the URL: readlocation.searchon load andhistory.replaceStateon change. Then a link like/?kind=Precisionreproduces the view. Make the.toolsa<form method=get>so the URL format is the same with or without scripts. Add a test thatfilterGamesgets the parsed params, or factor out a tinyparseBrowse(search)and test that. - Screen readers hear the whole list on every keystroke.
aria-live="polite"on<ul id="games">re-reads every card each time you type. Remove it. Add one<p role="status">instead that says "7 games" or "No game matches." (that can replace#none). - The test doesn't catch a mistyped kind. It checks
kindwithtoBeTruthy(), so a typo like'Precison'would pass and add a stray one-game chip. Check it against the fixed list theGAMEScomment names (Sport, Throwing, Timing, Catching, Precision, Racing), the same wayinputis checked.
All five points are addressed on the branch and pushed. serve.test.mjs and shell.test.mjs pass (26/26), but I haven't opened the page in a browser to check the layout shift is gone.
- Layout shift: the
jsclass is now set by an inline script in<head>, so the search and chips are laid out before the grid paints.#kindshas amin-height, and the status line reserves its height too. - Free Throw: its input is now
Holdinshell.jsand in the static<li>, including the tags line. - Shareable URL:
- .tools is now a <form method="get"> with name="q", and each chip is a submit button named kind.
- parseBrowse(search) reads q and kind on load. An unknown kind is dropped and the query is trimmed to 80 characters.
- browseUrl() builds the address, and history.replaceState updates it on every change. /?kind=Precision reproduces the view.
- Tests cover parseBrowse, including a mistyped kind, and that its result feeds filterGames.
- Screen readers: I removed
aria-livefrom the list. A single<p role="status">now says "N games", "1 game" or "No game matches.", and replaces#none. - Kind check: the test now checks
kindagainst Sport, Throwing, Timing, Catching, Precision and Racing, so a typo fails it.
The static server doesn't filter, so without JavaScript the form just reloads the full list. I left the search row hidden without JS, since a control that does nothing there would mislead.
🤖 Generated with Claude Code
All five asks from the last round are met. I checked each one on the preview at this head.
- Layout shift: met.
<head>now holdsdocument.documentElement.classList.add('js'), so.toolsgets laid out before the grid paints.#kindsand#statusreserve their height, and a test pins the head script. - Free Throw input: met. It is
Holdinshell.js, on the static<li>and on its tags line. - Shareable URL: met.
.toolsis a<form method=get>.parseBrowsedrops a kind it doesn't know and trimsqto 80 characters, andhistory.replaceStatekeeps the address current./?kind=Precisionand/?q=appleboth answer 200 on the preview. Tests cover a mistyped kind, a long query, and the parsed view feedingfilterGames. - Screen readers: met.
aria-liveis gone from the list. One<p role="status">says N games, 1 game or "No game matches.", and a test asserts it. - Mistyped kind: met.
kindis now checked against the fixed list of six.
The page has no writes, sessions or terminal (forge.json declares no tty), so the security and terminal checks don't apply. Output goes through textContent, and the accents come from constants in GAMES. The footer credits and the forged-by-crew notes are intact.
Non-blocking:
- The chips are
type=button, so thekindsclick listener'spreventDefaultdoes nothing and could go. #statusis declared in two separate rules that could be one.- The branch was cut before #46. When I ran this head's
shell.jsagainst main'sshell.test.mjs, the two metrics tests failed becausetrack()isn't in it. The textual merge looks clean, but rebase onto main before landing so the forge's check runs on the combined file.
I merged main into the branch, resolved the two conflicts, and pushed. bun test serve.test.mjs passes (31 tests, 0 failures); I didn't run the rest of the suite here, since the forge runs the full check on the push. scripts/fast.ts doesn't exist in this clone, so I ran that one file directly. bun x tsc --noEmit printed only its usage text and no type errors, which means the type check didn't actually run (there is probably no tsconfig.json). I didn't run bun scripts/design-lint.ts either.
README.md: the "Add a game" paragraph keeps the card grid, search and kind-filter wording from this branch. It also keepsmain's step to runbun scripts/og.mjsfor the share card and tags.serve.test.mjs: I tookmain's file and appended this branch's tests unchanged. These are the kind/input/accent checks,filterGames,parseBrowseand the home-page form checks.
The only change since 9161d89 is c75faf1, a merge of main (#46 metrics, #48 share cards). The merge is clean: git diff ecaabdf c75faf1 is exactly this pull's four files and nothing else. The README paragraph keeps the card, search and filter wording and gains main's bun scripts/og.mjs step. index.html keeps the og:begin/og:end block and the footer's "Most played" link. shell.js keeps track(id) beside the new filterGames/parseBrowse/browseUrl/kindsOf. The new tests are appended after main's in serve.test.mjs.
Earlier asks:
- Round 1, items 1–5 (layout shift, Free Throw
Hold, shareable URL, one status line, kind checked against the six): still met, and the code is unchanged since I approved it. - Round 2, non-blocking rebase onto main: met. On this head,
bun test serve.test.mjs shell.test.mjs stats.test.mjs limits.test.mjspasses 45/0, including the metrics tests that failed against the old head and the og staleness check.
On the preview: /, /?kind=Precision, /?q=apple, /stats/, /api/stats, /og/home.png and /orchard/ all answer 200. The home page carries all 19 data-kind cards and the og image tag, and the served shell.js has both parseBrowse and track. The page has no writes, sessions or terminal, so the security and tty items don't apply.
Non-blocking, carried over and not reopened: the no-op preventDefault click listener on #kinds, and the two separate #status rules.
The home page now shows the games as a card grid with a search box and kind filter chips, instead of the plain list. I ran only
serve.test.mjsandshell.test.mjs, and they pass. I haven't opened the page in a browser, so the look and the filter UI are unchecked.bun x tsc --noEmitonly printed its usage text, because the repo has no tsconfig, so it didn't type-check anything. I didn't runscripts/design-lint.tsorscripts/fast.ts.Issue #44 has no body and its title is cut off ("i would love to see mo…"). I guessed it meant a richer, more visual browser and built that. If it meant something else, say so.
What changed
GAMESentry inshell.jsnow has akind(Sport, Throwing, Timing, Catching, Precision or Racing), aninput(Tap, Hold or Drag) and anaccentcolour. I assigned all 19 myself, so check they suit you.index.htmlcarries the same cards. The search and chips only appear when scripts run.serve.test.mjschecks every game has valid metadata that matches the static list, and coversfilterGames.Not done
To try it: run
node serve.mjsand open http://127.0.0.1:5300/.I also had to stage files by name, because
git add -Achoked on a.bash_profilein the clone.🤖 Generated with Claude Code
Closes #44