From 0c499579ade6dcae470f1644ffc1becfa696b66a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 07:25:08 +0000 Subject: [PATCH 1/2] Phones: recipe badges no longer push crafting cards wider; steadier phone checks CI failed the two new phone checks: - 'Crafting panel fits' was 3px too wide on CI, which has a wider fallback font. The cause: each recipe's 'Craft anywhere' / 'Needs Crafting Table' badge never wraps and sat beside the name, so cards overflowed at 360px (a common Android width) even with the normal font. On narrow screens the badge now goes under the ingredients; nothing overflows at 320, 360 or 375px with either font. The check now runs at 360px - 'Upright pauses' waited a fixed 300ms after rotating, too short for CI's slow software rendering. It now waits for the change itself Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012T3WxfAesenfyvWRXYdNKy --- style.css | 5 +++++ tests/smoke.mjs | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/style.css b/style.css index c4e9dc8..865dba3 100644 --- a/style.css +++ b/style.css @@ -429,7 +429,12 @@ body.touch #quest-tracker .q-card ~ .q-card ~ .q-card { display: none; } @media (max-width: 860px) and (min-height: 521px) { #craft-done { position: sticky; bottom: -1px; z-index: 2; box-shadow: 0 -10px 14px 6px rgba(20, 24, 34, .95); } } +/* Recipe cards: the station badge goes under the ingredients, so long names never push the card wider. */ +.recipe { min-width: 0; grid-template-columns: 44px minmax(0, 1fr) auto; } @media (max-width: 480px) { + .recipe { grid-template-columns: 40px minmax(0, 1fr); row-gap: 4px; } + .recipe img.out { width: 36px; height: 36px; } + .recipe .badge { grid-column: 2; justify-self: start; } .slot-grid { gap: 3px; } #craft .slot-grid .slot .count { font-size: 11px; right: 2px; bottom: 0; } } diff --git a/tests/smoke.mjs b/tests/smoke.mjs index c9f3c87..c6d2bb2 100644 --- a/tests/smoke.mjs +++ b/tests/smoke.mjs @@ -257,16 +257,16 @@ try { }); ok(touch, 'touch controls appear in touch mode'); // Phones: turning the phone upright pauses and asks for sideways; turning it back carries on. - const shown = (id) => t.page.evaluate((i) => !document.getElementById(i).classList.contains('hidden'), id); + // (Waits for the change itself: CI runners render slowly, so a fixed pause isn't enough.) + const settle = (fn) => t.page.waitForFunction(fn, null, { timeout: 15000 }).then(() => true).catch(() => false); await t.page.setViewportSize({ width: 390, height: 844 }); - await t.page.waitForTimeout(300); - const askedUpright = (await shown('rotate')) && !(await shown('hud')); + const askedUpright = await settle(() => !document.getElementById('rotate').classList.contains('hidden') && document.getElementById('hud').classList.contains('hidden')); await t.page.setViewportSize({ width: 844, height: 390 }); - await t.page.waitForTimeout(300); - const resumed = !(await shown('rotate')) && (await shown('hud')); + const resumed = await settle(() => document.getElementById('rotate').classList.contains('hidden') && !document.getElementById('hud').classList.contains('hidden')); ok(askedUpright && resumed, 'phones: upright pauses and asks to turn sideways, sideways carries on'); - // Phones: the survival crafting panel fits an upright phone (its 9-slot rows used to push it sideways). - await t.page.setViewportSize({ width: 375, height: 667 }); + // Phones: the survival crafting panel fits an upright phone (its 9-slot rows used to push it + // sideways). 360px is a common Android width, and the narrowest that matters. + await t.page.setViewportSize({ width: 360, height: 740 }); const craftOverflow = await t.page.evaluate(async () => { const m = window.minicrafter; m.setMode('survival'); m.forcePlay(); m.openOverlay(); await new Promise((r) => setTimeout(r, 300)); From d6595fea09c0507613c5aadaf8a5ec149e2eca10 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 07:29:13 +0000 Subject: [PATCH 2/2] sw.js v23 so phones pick up the recipe-card fix (and the menu shows a new version) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012T3WxfAesenfyvWRXYdNKy --- sw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw.js b/sw.js index d33d721..e39b47b 100644 --- a/sw.js +++ b/sw.js @@ -1,6 +1,6 @@ // Service worker: caches the whole game so it works offline once loaded. // Bump VERSION whenever files change so players get the update. -const VERSION = 'minicrafter-v22'; +const VERSION = 'minicrafter-v23'; const CORE = [ './', './index.html', './style.css', './manifest.webmanifest', './site-config.json', './icons/icon-192.png', './icons/icon-512.png', './icons/icon-maskable-512.png', './icons/apple-touch-icon.png', './icons/favicon-32.png',