diff --git a/docs/admin/release-check.md b/docs/admin/release-check.md index 0f26011..469cfd6 100644 --- a/docs/admin/release-check.md +++ b/docs/admin/release-check.md @@ -1,10 +1,15 @@ # Acquire private beta — 23 October 2026 -Private BGS registration: `acquire`, version `1`. Engine `0.0.2`, viewer `0.0.12`. +Private BGS registration: `acquire`, version `1`. Engine `0.0.2`, viewer `0.0.13`. Source: . Keep `public: false`. ## Validation +- Dead hand tiles use hatching and a prohibition symbol with a readable coordinate. A compact + note explains replacement at turn end; temporary blocks use a separate pause symbol and reason. + Dead board markers use the same hatching. Browser checks cover equal tile heights, both themes, + all 17 languages and desktop/390/320-pixel widths. + - Merger disposal shows the surviving chain's price after this merger before players sell or trade. Verified the reported Festival (3) / Imperial (3) case: Imperial grows from $500 to $800 at 7 tiles, while Festival sales remain $400 each. Preview checks include connected loose tiles, diff --git a/packages/viewer/package.json b/packages/viewer/package.json index 54cc2a8..8cd1adc 100644 --- a/packages/viewer/package.json +++ b/packages/viewer/package.json @@ -1,6 +1,6 @@ { "name": "acquire-viewer", - "version": "0.0.12", + "version": "0.0.13", "private": true, "description": "Browser viewer for Acquire on boardgamers.space", "license": "AGPL-3.0-only", diff --git a/packages/viewer/src/App.svelte b/packages/viewer/src/App.svelte index e362258..4ce9658 100644 --- a/packages/viewer/src/App.svelte +++ b/packages/viewer/src/App.svelte @@ -103,6 +103,7 @@ instead of letting chat and history make one very tall sidebar. */ @media (min-width: 1200px) { .layout { + row-gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr) minmax(320px, 1fr); grid-template-areas: "board controls market" diff --git a/packages/viewer/src/lib/Board.svelte b/packages/viewer/src/lib/Board.svelte index b86c34a..1fafb4b 100644 --- a/packages/viewer/src/lib/Board.svelte +++ b/packages/viewer/src/lib/Board.svelte @@ -74,7 +74,14 @@ class="square empty" class:held={held.has(tile)} class:unavailable={legality !== undefined && legality !== "playable"} - aria-label={held.has(tile) ? `${label} — ${t("hand.yours")}` : t("board.empty", { tile: label })} + class:dead={legality === "permanentlyUnplayable"} + aria-label={legality === "permanentlyUnplayable" + ? `${label} — ${t("hand.dead")}` + : legality === "temporarilyUnplayable" + ? `${label} — ${t("hand.eighth")}` + : held.has(tile) + ? `${label} — ${t("hand.yours")}` + : t("board.empty", { tile: label })} title={legality === "permanentlyUnplayable" ? t("hand.dead") : legality === "temporarilyUnplayable" @@ -178,7 +185,14 @@ } .empty.unavailable .coord { color: var(--on-empty); - text-decoration: line-through; + background: var(--empty); + } + .empty.dead { + background-image: repeating-linear-gradient( + 135deg, + transparent 0 5px, + color-mix(in srgb, var(--on-empty) 18%, transparent) 5px 7px + ); } .empty.selected { background: var(--page); diff --git a/packages/viewer/src/lib/Hand.svelte b/packages/viewer/src/lib/Hand.svelte index 6fb5037..4775a79 100644 --- a/packages/viewer/src/lib/Hand.svelte +++ b/packages/viewer/src/lib/Hand.svelte @@ -3,6 +3,7 @@ import { ofType } from "./decisions"; import { seatName } from "./format"; import type { ViewerStore } from "./store.svelte"; + import TileStatusIcon from "./TileStatusIcon.svelte"; let { store }: { store: ViewerStore } = $props(); const t = $derived(store.lang.t); @@ -14,7 +15,7 @@ function why(tile: Tile): string { const legality = tileLegality(state.board, tile); if (legality === "permanentlyUnplayable") { - return t("hand.dead"); + return `${t("hand.dead")}. ${t("hand.deadReplacement")}.`; } if (legality === "temporarilyUnplayable") { return t("hand.eighth"); @@ -30,10 +31,14 @@ {#each store.seats as seat (seat)} {@const hand = sortTiles(state.seats[seat]!.hand.filter((tile) => tile !== HIDDEN))} + {@const dead = hand.filter((tile) => tileLegality(state.board, tile) === "permanentlyUnplayable")} + {@const paused = hand.filter((tile) => tileLegality(state.board, tile) === "temporarilyUnplayable")}

{store.seats.length > 1 ? t("hand.seat", { seat: seat + 1 }) : t("hand.yours")}

{#each hand as tile, index (index)} + {@const permanent = dead.includes(tile)} + {@const blocked = permanent || paused.includes(tile)} {#if playable.has(tile)} {:else} - - {tileLabel(tile)} - {#if why(tile)}{why(tile)}{/if} + + {tileLabel(tile)} + {#if blocked}{/if} {/if} {:else} {t("hand.none")} {/each}
+ {#if dead.length || paused.length} + + {/if}
{/each} @@ -61,6 +89,9 @@ .hand { margin: 12px 0 0; } + .hand:first-child { + margin-top: 0; + } /* Six tiles fit on one row; the 12px gaps leave room for outlines drawn outside the tiles. */ .tiles { display: grid; @@ -97,13 +128,42 @@ .tile.actionable.selected { outline: 4px solid var(--accent); } - .tile small { - font-size: 9px; - font-weight: 400; - line-height: 1.1; - text-align: center; - padding: 0 2px; - color: var(--on-loose); + .tile.dead, + .tile.paused { + gap: 3px; + color: color-mix(in srgb, var(--on-loose) 76%, var(--loose)); + } + .tile.dead { + background-image: repeating-linear-gradient(135deg, transparent 0 5px, #ffffff14 5px 7px); + } + .dead .coordinate { + background: var(--loose); + padding: 0 3px; + } + .tile-status { + display: flex; + background: var(--loose); + } + .tile-notes { + list-style: none; + margin: 4px 0 0; + padding: 0; + max-width: 388px; + font-size: 12px; + color: var(--ink-muted); + } + .tile-notes li { + display: flex; + align-items: start; + gap: 6px; + margin-top: 4px; + } + .tile-notes :global(svg) { + flex: 0 0 auto; + } + .tile-notes bdi { + font-weight: 600; + color: var(--ink); } .none { color: var(--ink-muted); diff --git a/packages/viewer/src/lib/TileStatusIcon.svelte b/packages/viewer/src/lib/TileStatusIcon.svelte new file mode 100644 index 0000000..4ad7edf --- /dev/null +++ b/packages/viewer/src/lib/TileStatusIcon.svelte @@ -0,0 +1,20 @@ + + + diff --git a/packages/viewer/src/lib/locales/da.ts b/packages/viewer/src/lib/locales/da.ts index 08c718a..262f082 100644 --- a/packages/viewer/src/lib/locales/da.ts +++ b/packages/viewer/src/lib/locales/da.ts @@ -70,6 +70,7 @@ export const da: Catalog = { "hand.of": "{name}s brikker", "hand.none": "Ingen brikker", "hand.dead": "død: ville fusionere sikre kæder", + "hand.deadReplacement": "Udskiftes ved slutningen af din tur", "hand.eighth": "kan ikke grundlægge en 8. kæde", "chains.label": "Hotelkæder", "chains.title": "Kæder", diff --git a/packages/viewer/src/lib/locales/de.ts b/packages/viewer/src/lib/locales/de.ts index 86c5791..98557d8 100644 --- a/packages/viewer/src/lib/locales/de.ts +++ b/packages/viewer/src/lib/locales/de.ts @@ -70,6 +70,7 @@ export const de: Catalog = { "hand.of": "Plättchen von {name}", "hand.none": "Keine Plättchen", "hand.dead": "tot: würde sichere Ketten fusionieren", + "hand.deadReplacement": "Werden am Ende deines Zuges ersetzt", "hand.eighth": "keine 8. Kette möglich", "chains.label": "Hotelketten", "chains.title": "Ketten", diff --git a/packages/viewer/src/lib/locales/el.ts b/packages/viewer/src/lib/locales/el.ts index fc76fe3..8fc2fd0 100644 --- a/packages/viewer/src/lib/locales/el.ts +++ b/packages/viewer/src/lib/locales/el.ts @@ -70,6 +70,7 @@ export const el: Catalog = { "hand.of": "Πλακίδια του/της {name}", "hand.none": "Κανένα πλακίδιο", "hand.dead": "νεκρό: θα συγχώνευε ασφαλείς αλυσίδες", + "hand.deadReplacement": "Αντικατάσταση στο τέλος του γύρου σου", "hand.eighth": "δεν ιδρύεται 8η αλυσίδα", "chains.label": "Αλυσίδες ξενοδοχείων", "chains.title": "Αλυσίδες", diff --git a/packages/viewer/src/lib/locales/en.ts b/packages/viewer/src/lib/locales/en.ts index ae427e3..f03328a 100644 --- a/packages/viewer/src/lib/locales/en.ts +++ b/packages/viewer/src/lib/locales/en.ts @@ -77,6 +77,7 @@ export const en = { "hand.of": "Tiles of {name}", "hand.none": "No tiles", "hand.dead": "dead: would merge safe chains", + "hand.deadReplacement": "Replaced at the end of your turn", "hand.eighth": "can't found an 8th chain", // Chain and price tables diff --git a/packages/viewer/src/lib/locales/fa.ts b/packages/viewer/src/lib/locales/fa.ts index adfedb6..98fcc4a 100644 --- a/packages/viewer/src/lib/locales/fa.ts +++ b/packages/viewer/src/lib/locales/fa.ts @@ -70,6 +70,7 @@ export const fa: Catalog = { "hand.of": "کاشی‌های {name}", "hand.none": "بدون کاشی", "hand.dead": "مرده: زنجیره‌های امن را ادغام می‌کند", + "hand.deadReplacement": "در پایان نوبت شما جایگزین می‌شوند", "hand.eighth": "زنجیره‌ی هشتم ممکن نیست", "chains.label": "زنجیره‌های هتل", "chains.title": "زنجیره‌ها", diff --git a/packages/viewer/src/lib/locales/fr.ts b/packages/viewer/src/lib/locales/fr.ts index 37ddd8e..5fb0275 100644 --- a/packages/viewer/src/lib/locales/fr.ts +++ b/packages/viewer/src/lib/locales/fr.ts @@ -74,6 +74,7 @@ export const fr: Catalog = { "hand.of": "Tuiles de {name}", "hand.none": "Aucune tuile", "hand.dead": "morte : fusionnerait des chaînes sûres", + "hand.deadReplacement": "Remplacement à la fin de votre tour", "hand.eighth": "impossible de fonder une 8e chaîne", "chains.label": "Chaînes d’hôtels", "chains.title": "Chaînes", diff --git a/packages/viewer/src/lib/locales/hi.ts b/packages/viewer/src/lib/locales/hi.ts index 8f94602..6c2da9c 100644 --- a/packages/viewer/src/lib/locales/hi.ts +++ b/packages/viewer/src/lib/locales/hi.ts @@ -69,6 +69,7 @@ export const hi: Catalog = { "hand.of": "{name} की टाइलें", "hand.none": "कोई टाइल नहीं", "hand.dead": "बेकार: सुरक्षित श्रृंखलाओं का विलय कर देगी", + "hand.deadReplacement": "आपकी बारी के अंत में बदल दी जाएँगी", "hand.eighth": "8वीं श्रृंखला स्थापित नहीं हो सकती", "chains.label": "होटल श्रृंखलाएँ", "chains.title": "श्रृंखलाएँ", diff --git a/packages/viewer/src/lib/locales/it.ts b/packages/viewer/src/lib/locales/it.ts index 1dec8a1..b57e836 100644 --- a/packages/viewer/src/lib/locales/it.ts +++ b/packages/viewer/src/lib/locales/it.ts @@ -74,6 +74,7 @@ export const it: Catalog = { "hand.of": "Tessere di {name}", "hand.none": "Nessuna tessera", "hand.dead": "morta: fonderebbe catene sicure", + "hand.deadReplacement": "Sostituite alla fine del tuo turno", "hand.eighth": "non si può fondare un'8ª catena", "chains.label": "Catene alberghiere", "chains.title": "Catene", diff --git a/packages/viewer/src/lib/locales/ko.ts b/packages/viewer/src/lib/locales/ko.ts index 657b053..91cba5a 100644 --- a/packages/viewer/src/lib/locales/ko.ts +++ b/packages/viewer/src/lib/locales/ko.ts @@ -70,6 +70,7 @@ export const ko: Catalog = { "hand.of": "{name}의 타일", "hand.none": "타일 없음", "hand.dead": "죽은 타일: 안전한 체인끼리 합병하게 됨", + "hand.deadReplacement": "내 차례가 끝나면 교체됩니다", "hand.eighth": "8번째 체인은 세울 수 없음", "chains.label": "호텔 체인", "chains.title": "체인", diff --git a/packages/viewer/src/lib/locales/nl.ts b/packages/viewer/src/lib/locales/nl.ts index 6b635c7..e2dee47 100644 --- a/packages/viewer/src/lib/locales/nl.ts +++ b/packages/viewer/src/lib/locales/nl.ts @@ -70,6 +70,7 @@ export const nl: Catalog = { "hand.of": "Tegels van {name}", "hand.none": "Geen tegels", "hand.dead": "dood: zou veilige ketens fuseren", + "hand.deadReplacement": "Worden aan het einde van je beurt vervangen", "hand.eighth": "kan geen 8e keten stichten", "chains.label": "Hotelketens", "chains.title": "Ketens", diff --git a/packages/viewer/src/lib/locales/pl.ts b/packages/viewer/src/lib/locales/pl.ts index 51aa69b..a2aa2ca 100644 --- a/packages/viewer/src/lib/locales/pl.ts +++ b/packages/viewer/src/lib/locales/pl.ts @@ -75,6 +75,7 @@ export const pl: Catalog = { "hand.of": "Płytki gracza {name}", "hand.none": "Brak płytek", "hand.dead": "martwa: połączyłaby bezpieczne sieci", + "hand.deadReplacement": "Wymiana na koniec twojej tury", "hand.eighth": "nie można założyć 8. sieci", "chains.label": "Sieci hoteli", "chains.title": "Sieci", diff --git a/packages/viewer/src/lib/locales/pt-BR.ts b/packages/viewer/src/lib/locales/pt-BR.ts index 142d946..069f23d 100644 --- a/packages/viewer/src/lib/locales/pt-BR.ts +++ b/packages/viewer/src/lib/locales/pt-BR.ts @@ -74,6 +74,7 @@ export const ptBR: Catalog = { "hand.of": "Peças de {name}", "hand.none": "Nenhuma peça", "hand.dead": "morta: fundiria redes seguras", + "hand.deadReplacement": "Substituição no fim do seu turno", "hand.eighth": "não dá para fundar uma 8ª rede", "chains.label": "Redes de hotéis", "chains.title": "Redes", diff --git a/packages/viewer/src/lib/locales/ro.ts b/packages/viewer/src/lib/locales/ro.ts index 8feba67..401591f 100644 --- a/packages/viewer/src/lib/locales/ro.ts +++ b/packages/viewer/src/lib/locales/ro.ts @@ -74,6 +74,7 @@ export const ro: Catalog = { "hand.of": "Piesele lui {name}", "hand.none": "Nicio piesă", "hand.dead": "moartă: ar uni lanțuri sigure", + "hand.deadReplacement": "Înlocuire la sfârșitul turei tale", "hand.eighth": "nu se poate înființa un al 8-lea lanț", "chains.label": "Lanțuri hoteliere", "chains.title": "Lanțuri", diff --git a/packages/viewer/src/lib/locales/ru.ts b/packages/viewer/src/lib/locales/ru.ts index 0497a6b..83510f5 100644 --- a/packages/viewer/src/lib/locales/ru.ts +++ b/packages/viewer/src/lib/locales/ru.ts @@ -75,6 +75,7 @@ export const ru: Catalog = { "hand.of": "Фишки игрока {name}", "hand.none": "Нет фишек", "hand.dead": "мёртвая: слила бы защищённые сети", + "hand.deadReplacement": "Заменяются в конце вашего хода", "hand.eighth": "нельзя основать 8-ю сеть", "chains.label": "Гостиничные сети", "chains.title": "Сети", diff --git a/packages/viewer/src/lib/locales/vi.ts b/packages/viewer/src/lib/locales/vi.ts index 94c792d..c2c7637 100644 --- a/packages/viewer/src/lib/locales/vi.ts +++ b/packages/viewer/src/lib/locales/vi.ts @@ -70,6 +70,7 @@ export const vi: Catalog = { "hand.of": "Ô của {name}", "hand.none": "Không có ô", "hand.dead": "ô chết: sẽ sáp nhập các chuỗi an toàn", + "hand.deadReplacement": "Được thay khi kết thúc lượt của bạn", "hand.eighth": "không thể lập chuỗi thứ 8", "chains.label": "Chuỗi khách sạn", "chains.title": "Chuỗi", diff --git a/packages/viewer/src/lib/locales/zh-CN.ts b/packages/viewer/src/lib/locales/zh-CN.ts index fee2d89..0944b7d 100644 --- a/packages/viewer/src/lib/locales/zh-CN.ts +++ b/packages/viewer/src/lib/locales/zh-CN.ts @@ -69,6 +69,7 @@ export const zhCN: Catalog = { "hand.of": "{name} 的板块", "hand.none": "没有板块", "hand.dead": "死板块:会合并安全连锁", + "hand.deadReplacement": "在你的回合结束时更换", "hand.eighth": "无法创立第 8 个连锁", "chains.label": "酒店连锁", "chains.title": "连锁", diff --git a/packages/viewer/src/lib/locales/zh-TW.ts b/packages/viewer/src/lib/locales/zh-TW.ts index 7b3a89b..54f433b 100644 --- a/packages/viewer/src/lib/locales/zh-TW.ts +++ b/packages/viewer/src/lib/locales/zh-TW.ts @@ -69,6 +69,7 @@ export const zhTW: Catalog = { "hand.of": "{name} 的板塊", "hand.none": "沒有板塊", "hand.dead": "死板塊:會合併安全連鎖", + "hand.deadReplacement": "在你的回合結束時更換", "hand.eighth": "無法創立第 8 個連鎖", "chains.label": "飯店連鎖", "chains.title": "連鎖", diff --git a/scripts/check-browser.mjs b/scripts/check-browser.mjs index 603eb18..9ce2daa 100644 --- a/scripts/check-browser.mjs +++ b/scripts/check-browser.mjs @@ -145,6 +145,70 @@ try { "post-merger price visible before trading; original sale price unchanged; all 17 locales at desktop, phone and 320px" ); + for (const width of [1280, 390, 320]) { + await page.setViewportSize({ width, height: 900 }); + await open("players=3&theme=dark"); + await page.evaluate((state) => { + const { parseTile, allTiles } = window.acquireDev.rules; + state.board.fill(null); + const fill = (chain, labels) => labels.forEach((label) => (state.board[parseTile(label)] = chain)); + fill("tower", [...Array.from({ length: 9 }, (_, i) => `${i + 1}C`), "4B", "5B"]); + fill( + "luxor", + Array.from({ length: 11 }, (_, i) => `${i + 1}E`) + ); + fill("worldwide", ["1G", "2G"]); + fill("american", ["4G", "5G"]); + fill("festival", ["7G", "8G"]); + fill("imperial", ["10G", "11G"]); + fill("continental", ["1I", "2I"]); + fill("loose", ["12H"]); + state.seats[0].hand = ["2B", "3B", "5D", "6I", "10D", "12I"].map(parseTile); + const remaining = allTiles().filter((tile) => state.board[tile] === null && !state.seats[0].hand.includes(tile)); + for (const seat of state.seats.slice(1)) { + seat.hand = remaining.splice(0, 6); + } + state.pool = remaining; + window.acquireDev.load(state); + }, preparedPosition("mergers")); + await page.waitForSelector(".hand .tile.dead"); + assert.equal(await page.locator(".hand .tile.dead .coordinate").innerText(), "5D"); + assert.equal(await page.locator(".hand .tile.paused .coordinate").innerText(), "12I"); + assert.equal(await page.locator(".hand .tile small").count(), 0); + assert.match(await page.locator(".dead-note").innerText(), /5D.*Replaced at the end of your turn/); + assert.match(await page.locator(".paused-note").innerText(), /12I.*can't found an 8th chain/); + assert.match(await page.locator(".square.dead").getAttribute("aria-label"), /5D.*would merge safe chains/); + assert.equal(await page.locator("button.tile.dead, button.tile.paused, button.square.dead").count(), 0); + for (const theme of ["dark", "light"]) { + await page.evaluate((theme) => window.acquireDev.emitter.emit("theme", { dark: theme === "dark" }), theme); + for (const locale of locales) { + await preferences({ locale }); + assert.ok( + await page.evaluate(() => { + const tiles = [...document.querySelectorAll(".hand .tile")]; + const height = tiles[0].getBoundingClientRect().height; + return ( + document.documentElement.scrollWidth <= innerWidth + 1 && + tiles.every( + (tile) => + Math.abs(tile.getBoundingClientRect().height - height) < 1 && + tile.scrollHeight <= tile.clientHeight + 1 + ) + ); + }), + `dead/temporary tile ${locale} ${theme} ${width}px` + ); + } + await preferences({ locale: "en" }); + await page + .locator("section.hand") + .screenshot({ path: new URL(`dead-tiles-${theme}-${width}.png`, output).pathname }); + } + } + report.scenarios.push( + "dead tiles and temporary blocks: distinct symbols, readable coordinates and notes, equal tile heights, all locales in both themes" + ); + for (const theme of ["light", "dark"]) { await page.setViewportSize({ width: 1920, height: 1280 }); await open(`players=4&moves=95&publicHoldings=1&theme=${theme}`);