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

Merged opened this

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

Merged

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.

Notes

shipped production is serving it deploy ab54f53

opened this

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.js and index.html: main widened 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 took main'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 took main's copy, then ran bun scripts/og.mjs to regenerate the share cards from the merged catalogue. I have not looked at the regenerated og/home.png to confirm it shows Market Barrow.

I didn't change any game code or tests.

Continues #206

3 earlier comments · 4 events
the crew's run was interrupted: clone, resumes on the next pass — checkout failed: error: could not lock config file .git/config: File exists error: unable to write upstream branch configuration hint: hint: After fixing the error cause you may try to fix up hint: the remote tracking
commented

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.mjs and market-barrow/barrow.test.mjs all pass, each run on its own.
  • The full playtest.test.mjs passed, all 252 tests, including the Market Barrow ones. It takes about five minutes.
  • bun x tsc --noEmit only 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.ts or scripts/design-lint.ts in 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 GAMES list in shell.js and in the no-JS list in index.html. Its share card is og/market-barrow.png, and rounds.mjs has a scripted round for it. The README's list of games that use their own sound effects now includes it.
  • Merge: main had already widened the town canvas to 800px, so I dropped the branch's own 740px change and kept main's plaza.js, index.html and og/home.png. I put the Market Barrow card back into index.html by hand. og/home.png is main's file, so it does not show Market Barrow. I did not regenerate it, and I don't know whether bun scripts/og.mjs would 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.

commented

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.js and index.html: main widened 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 took main'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 took main's copy, then ran bun scripts/og.mjs to regenerate the share cards from the merged catalogue. I have not looked at the regenerated og/home.png to confirm it shows Market Barrow.

I didn't change any game code or tests.

Changes requested — before the latest push

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:

  1. 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.
  2. Touch targets: .act buttons are ~32px tall (7px padding), below a thumb-safe 44px.
  3. 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.
  4. 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 why code 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 crew's run was interrupted: restart, resumes on the next pass — cancelled
Changes requested — before the latest push

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.

commented

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.act now has min-height: 44px next to its 44px min-width.
  • Contrast: --muted goes from #8b877f to #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: none for mouse and touch, and canvas:focus-visible now draws a 2px ink outline for keyboard users.
  • Refusal messages: already-here moves into REFUSALS, and every refused move goes through one refusal(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, regenerated og/home.png with bun scripts/og.mjs, and checked that shell.js, index.html and rounds.mjs list 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

commented

Market Barrow is on the branch and merged with current main, which now includes Hedge Maze. Everything is already pushed.

  • Page: market-barrow/index.html draws the lane, the four stalls with their price boards, and the barrow with its load. It drives play only through market-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. #mute is there and no .mp3 is 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 b5686af and 8223b45.
  • Catalogue: the GAMES entry in shell.js, the <li> in the root index.html, the README Games table, the no-music list and the ambient-motion note are all in place. bun scripts/og.mjs has been run, so the share card and og/home.png are current.
  • Tests: rounds.mjs has a scripted round that reaches the end line. serve.test.mjs asserts /market-barrow/ and /market-barrow/barrow.js answer 200. market-barrow/page.test.mjs is new.
  • Test run: I ran serve, playtest, market-barrow, town and shell tests: 373 pass, 0 fail. I did not run the whole suite.
  • Type check: bun x tsc --noEmit only prints its help text, because the repository has no tsconfig, so it checked nothing.
  • Gate script: there is no scripts/gate.ts in this repo, so I did not run it.
  • Design lint: I did not run bun scripts/design-lint.ts, although I changed market-barrow/index.html.
  • Not done: I added nothing to town.js by hand. It has no per-game entries, so I assumed the town builds from GAMES; 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 .bashrc and .claude/*. I did not make or remove them.
Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs