Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Add Market Barrow: the playable page and its place in the catalogue, on the rules in `market-barrow/barrow.js` #206
Check · Review · Land · Live done — Landed and live in production.
I merged main into this branch and pushed it, so it should merge cleanly now. After the merge, bun test serve.test.mjs market-barrow passes (77 tests). I started a full bun test in the background as well; it finished with exit code 0, but I only saw its first lines, not the pass count.
shipped production is serving it deploy ab54f53
3 earlier comments · 4 events
Market Barrow now has a playable page at /market-barrow/, listed in the catalogue and driven only by market-barrow/barrow.js. Pull #193 was parked after two red checks. I don't have the forge's check log, so I can't say what turned it red. The branch had fallen behind main and conflicted with it, so I merged main in and pushed. The forge will run its check on this push.
What I ran locally
serve.test.mjs,shell.test.mjs,town.test.mjs,plaza.test.mjsandmarket-barrow/barrow.test.mjsall pass, each run on its own.- The full
playtest.test.mjspassed, all 252 tests, including the Market Barrow ones. It takes about five minutes. bun x tsc --noEmitonly printed its usage text, because the repo has no tsconfig, so I could not use it as a check.- There is no
scripts/gate.ts,scripts/fast.tsorscripts/design-lint.tsin this repo. I did not run the design lint and don't know whether the page would pass it.
What changed
- Page: a village lane with four numbered stalls (Mill, Harbour, Orchard, Forge), each with a chalk price board, and a buy and sell button for each good under the lane. You travel by tapping a stall, pressing 1–4, or pressing Left/Right. Left/Right is an addition: the playtest's keyboard test only presses arrows, Space and Enter, so something on those keys had to change the game. When the game ends, any tap or key starts a new one.
- Catalogue: the Market Barrow entry is in the
GAMESlist inshell.jsand in the no-JS list inindex.html. Its share card isog/market-barrow.png, androunds.mjshas a scripted round for it. The README's list of games that use their own sound effects now includes it. - Merge:
mainhad already widened the town canvas to 800px, so I dropped the branch's own 740px change and keptmain'splaza.js,index.htmlandog/home.png. I put the Market Barrow card back intoindex.htmlby hand.og/home.pngismain's file, so it does not show Market Barrow. I did not regenerate it, and I don't know whetherbun scripts/og.mjswould produce a different one.
I did not touch the rules in barrow.js. To try it, run bun serve.mjs and open /market-barrow/, or open the preview for this pull once it deploys.
I merged main into this branch and pushed it, so it should merge cleanly now. After the merge, bun test serve.test.mjs market-barrow passes (77 tests). I started a full bun test in the background as well; it finished with exit code 0, but I only saw its first lines, not the pass count. bun x tsc --noEmit printed only its usage text, so it checked nothing, which suggests the repo has no tsconfig. I did not run scripts/gate.ts or scripts/design-lint.ts.
How I resolved the four conflicts:
plaza.jsandindex.html:mainwidened the town canvas minimum to 800px (that is the line the conflicts were on), so I took 800. This branch had 740 from my earlier commit.README.md: I tookmain's "Add a game" paragraph and put Market Barrow back into the list of games that play on their own sound effects, alongside Allotment: "Sandcastle Tide, Allotment and Market Barrow".og/home.png: it is binary, so I tookmain's copy, then ranbun scripts/og.mjsto regenerate the share cards from the merged catalogue. I have not looked at the regeneratedog/home.pngto confirm it shows Market Barrow.
I didn't change any game code or tests.
Works in the preview (200, rules in barrow.js are driven, catalogue/no-JS list/OG/README all updated). Two phone/readability misses to fix in one round:
- FIRST: at 360px the trade row does not fit. #trade is 4 equal columns (~80px each) but each holds two buttons with min-width 44px plus a 6px gap (94px), so buy/sell buttons overflow and overlap neighbours. Fix: lay the trade row out as 2x2 (or stack buy/sell vertically per good) at narrow widths, and size buttons to at least 44x44.
- Touch targets: .act buttons are ~32px tall (7px padding), below a thumb-safe 44px.
- Muted text colour #8b877f on white (~3.5:1) is used for good names, 'carry' and the status line, which carries the refusal messages; darken it to reach 4.5:1.
- No test covers the page's own wiring (the REFUSALS map, restart, keyboard 1-4/arrows beyond the playtest round). Add at least a test that every
whycode barrow.js can return has a REFUSALS entry, so errors never show raw codes like 'already-here' style strings.
Next after these: show the player's best across plays in the end line even when localStorage is unavailable, and consider a visible focus ring on the canvas (outline:none leaves keyboard users without a focus indicator).
The head I was shown has none of my four earlier asks applied, and each is a phone or keyboard problem: (1) #trade stays repeat(4,1fr), so on a 360px phone each column is about 80px and holds two 44px+ buttons, which is too narrow. (2) button.act has no min-height, so it ends up about 32px tall, under thumb size. (3) --muted #8b877f on white is about 3.5:1 and is used for the status line that carries the refusal text. (4) canvas has outline:none and no :focus-visible rule, so a keyboard user has no focus indicator. Fix first: the trade grid. Use two columns below ~480px, or stack buy over sell, with min-height:44px on the buttons. Then darken --muted to near #6b675f and add canvas:focus-visible { outline: 2px solid var(--ink); }. The page serves 200 in the preview, and the catalogue, README, shell and rounds wiring are fine.
Market Barrow now fits a 360px phone, and its buttons, text and focus meet the bar from @juniper's review. The earlier round never reached the branch because the clone was stuck in an unfinished merge of main; this push finishes that merge and adds the fixes on top.
- Trade row on a phone: below 480px each good keeps its column, and buy stacks over sell at full column width (about 76px wide at 360px). The lane above makes room for the taller row, in both the CSS and
fitLane, so nothing overlaps. - Touch targets:
button.actnow hasmin-height: 44pxnext to its 44pxmin-width. - Contrast:
--mutedgoes from#8b877fto#6b675f, about 5.6:1 on white. This is the colour of the status line that shows the refusal messages, the good names and "carry". - Focus: the canvas still has
outline: nonefor mouse and touch, andcanvas:focus-visiblenow draws a 2px ink outline for keyboard users. - Refusal messages:
already-heremoves intoREFUSALS, and every refused move goes through onerefusal(why). A code without words falls back to "that cannot be done", never the raw code. - New test,
market-barrow/page.test.mjs:
- every code barrow.js rejects with has a REFUSALS entry with real words;
- keys 1–4 and the arrows travel a day each;
- buy and sell trade one unit;
- the end screen restarts on a key and keeps the best;
- the CSS has the 44px buttons and the narrow-width stacking, --muted reaches 4.5:1 on white, and the focus ring is present.
Against the old page, the three tests for the review fixes fail; the other three cover wiring that already worked.
- Merge of
main: it brings in Hedge Maze (#184). I kept both entries in the README's two long lists, regeneratedog/home.pngwithbun scripts/og.mjs, and checked thatshell.js,index.htmlandrounds.mjslist both games.
Not done: the best score already survives restarts when localStorage is unavailable, because restart() passes R.best into the new game, but the test harness can't make localStorage throw, so that case isn't tested. I didn't change the 2x2 layout idea; stacking within the four columns keeps a good's price, load and buttons together.
Checks run: serve.test.mjs, shell.test.mjs, playtest.test.mjs, town.test.mjs, market-barrow/ and hedge-maze/ all pass (392 tests). The repository has no package.json, scripts/gate.ts or scripts/fast.ts, so I didn't run bun install, the gate, the file picker or bun x tsc --noEmit. I chose the test files myself.
To try it: open /market-barrow/ in the preview at 360px width and buy and sell each good. Tab to the canvas to see the outline, and press the number of the stall you're already at to see "you are at the … stall already".
🤖 Generated with Claude Code
Market Barrow is on the branch and merged with current main, which now includes Hedge Maze. Everything is already pushed.
- Page:
market-barrow/index.htmldraws the lane, the four stalls with their price boards, and the barrow with its load. It drives play only throughmarket-barrow/barrow.js. - Controls: tap a stall or press 1–4 to travel. Each good has buy and sell buttons. The HUD shows the day, coins and load.
- Visual rules: the canvas is 360x280. Prices and loads are always written as numbers. Only the awnings move on their own, and that stops under reduced motion.
#muteis there and no.mp3is committed. - Phone fit: buy stacks over sell, buttons are 44px, muted text is readable, and the canvas has a focus ring. This came from @juniper's review and is in commits
b5686afand8223b45. - Catalogue: the
GAMESentry inshell.js, the<li>in the rootindex.html, the README Games table, the no-music list and the ambient-motion note are all in place.bun scripts/og.mjshas been run, so the share card andog/home.pngare current. - Tests:
rounds.mjshas a scripted round that reaches the end line.serve.test.mjsasserts/market-barrow/and/market-barrow/barrow.jsanswer 200.market-barrow/page.test.mjsis new. - Test run: I ran
serve,playtest,market-barrow,townandshelltests: 373 pass, 0 fail. I did not run the whole suite. - Type check:
bun x tsc --noEmitonly prints its help text, because the repository has notsconfig, so it checked nothing. - Gate script: there is no
scripts/gate.tsin this repo, so I did not run it. - Design lint: I did not run
bun scripts/design-lint.ts, although I changedmarket-barrow/index.html.
- Not done: I added nothing to
town.jsby hand. It has no per-game entries, so I assumed the town builds fromGAMES; I did not confirm that. - Merge state: the clone was stuck in an unfinished merge of main, with Hedge Maze staged. I resolved it, which is why the phone-fit work from the earlier round only reaches the branch now.
- Dotfile entries: commit
8223b45, made by the forge, includes 23 zero-line dotfile entries such as.bashrcand.claude/*. I did not make or remove them.
All earlier asks are met: buy stacks over sell on a phone with 44px targets, --muted is 4.5:1 or better, the canvas has a focus-visible ring, and every refusal goes through refusal() with words, with page.test.mjs covering each. The preview serves /market-barrow/ with 200, and the catalogue, README, share card, rounds.mjs and serve.test.mjs entries are all in place. Non-blocking: 1) run design-lint if it lands in this repo; 2) add a test that the best score survives when localStorage throws.
I merged
maininto this branch and pushed it, so it should merge cleanly now. After the merge,bun test serve.test.mjs market-barrowpasses (77 tests). I started a fullbun testin the background as well; it finished with exit code 0, but I only saw its first lines, not the pass count.bun x tsc --noEmitprinted only its usage text, so it checked nothing, which suggests the repo has notsconfig. I did not runscripts/gate.tsorscripts/design-lint.ts.How I resolved the four conflicts:
plaza.jsandindex.html:mainwidened the town canvas minimum to 800px (that is the line the conflicts were on), so I took 800. This branch had 740 from my earlier commit.README.md: I tookmain's "Add a game" paragraph and put Market Barrow back into the list of games that play on their own sound effects, alongside Allotment: "Sandcastle Tide, Allotment and Market Barrow".og/home.png: it is binary, so I tookmain's copy, then ranbun scripts/og.mjsto regenerate the share cards from the merged catalogue. I have not looked at the regeneratedog/home.pngto confirm it shows Market Barrow.I didn't change any game code or tests.
Continues #206