Place Acquire tiles with one board click
This commit is contained in:
parent
07f046374a
commit
22b4aded9a
5 changed files with 29 additions and 25 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Acquire private beta — 22 October 2026
|
||||
|
||||
Private BGS registration: `acquire`, version `1`. Engine `0.0.1`, viewer `0.0.7`.
|
||||
Private BGS registration: `acquire`, version `1`. Engine `0.0.1`, viewer `0.0.8`.
|
||||
Source: <https://github.com/boardgamers/mergers-game>. Keep `public: false`.
|
||||
|
||||
## Validation
|
||||
|
|
@ -31,7 +31,8 @@ Source: <https://github.com/boardgamers/mergers-game>. Keep `public: false`.
|
|||
cash retains its currency symbol with emphasized, tabular digits. Checks cover both themes,
|
||||
contrast, translated word order and player names that match chain names.
|
||||
- Hand markers remain visible between turns, but only legal moves are clickable. Browser checks
|
||||
cover selecting and confirming from the board, spectator privacy, and hiding markers in replay.
|
||||
cover immediate placement from a single board click on desktop and phone, spectator privacy,
|
||||
and hiding markers in replay. Selecting from the hand still offers a placement preview.
|
||||
|
||||
## Fixes made for beta
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "acquire-viewer",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"private": true,
|
||||
"description": "Browser viewer for Acquire on boardgamers.space",
|
||||
"license": "AGPL-3.0-only",
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
<Board
|
||||
{state}
|
||||
selected={store.selected}
|
||||
onselect={(tile) => (store.selected = tile)}
|
||||
onconfirm={() =>
|
||||
store.selected !== undefined && store.send({ type: "place", tile: tileLabel(store.selected) })}
|
||||
onplace={(tile) => store.send({ type: "place", tile: tileLabel(tile) })}
|
||||
/>
|
||||
</div>
|
||||
{#if store.seats.length > 0 && store.replayAt === undefined}
|
||||
|
|
|
|||
|
|
@ -17,14 +17,12 @@
|
|||
let {
|
||||
state,
|
||||
selected,
|
||||
onselect,
|
||||
onconfirm,
|
||||
onplace,
|
||||
}: {
|
||||
state: GameState;
|
||||
/** A tile selected in the hand: its square is highlighted and clicking it places the tile. */
|
||||
selected?: Tile;
|
||||
onselect?: (tile: Tile) => void;
|
||||
onconfirm?: () => void;
|
||||
onplace: (tile: Tile) => void;
|
||||
} = $props();
|
||||
|
||||
// Rows A-I down, columns 1-12 across, like the printed board. Tile index = (column - 1) * 9 + row.
|
||||
|
|
@ -65,10 +63,9 @@
|
|||
type="button"
|
||||
class="square empty held playable actionable"
|
||||
class:selected={tile === selected}
|
||||
aria-label={tile === selected ? t("board.place", { tile: label }) : label}
|
||||
aria-pressed={tile === selected}
|
||||
aria-label={t("board.place", { tile: label })}
|
||||
disabled={store.sending}
|
||||
onclick={() => (tile === selected ? onconfirm?.() : onselect?.(tile))}
|
||||
onclick={() => onplace(tile)}
|
||||
>
|
||||
<span class="coord">{label}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -170,17 +170,25 @@ try {
|
|||
assert.equal(await page.locator(".square.playable").count(), 0, "waiting players cannot submit a tile");
|
||||
await inspectHand("spectator");
|
||||
await inspectHand("acting");
|
||||
await open("players=4&theme=dark");
|
||||
const beforeBoardMove = await page.evaluate(() => window.acquireDev.state.log.length);
|
||||
await page.locator(".square.playable").first().click();
|
||||
assert.equal(
|
||||
await page.evaluate(() => window.acquireDev.state.log.length),
|
||||
beforeBoardMove,
|
||||
"first click previews the move"
|
||||
);
|
||||
assert.equal(await page.locator(".square.selected").count(), 1);
|
||||
await page.locator(".square.selected").click();
|
||||
await page.waitForFunction((length) => window.acquireDev.state.log.length > length, beforeBoardMove);
|
||||
for (const width of [1280, 390]) {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
await open("players=4&theme=dark");
|
||||
const beforeBoardMove = await page.evaluate(() => window.acquireDev.state.log.length);
|
||||
const square = page.locator(".square.playable").first();
|
||||
const tile = await square.locator(".coord").innerText();
|
||||
await square.click();
|
||||
await page.waitForFunction((length) => window.acquireDev.state.log.length > length, beforeBoardMove);
|
||||
const placements = await page.evaluate(
|
||||
(index) =>
|
||||
window.acquireDev.state.log
|
||||
.slice(index)
|
||||
.filter((entry) => entry.type === "move" && entry.move.type === "place")
|
||||
.map((entry) => entry.move.tile),
|
||||
beforeBoardMove
|
||||
);
|
||||
assert.deepEqual(placements, [tile], "one click places the chosen board tile exactly once");
|
||||
assert.equal(await page.locator(".square.selected").count(), 0, "no placement confirmation remains");
|
||||
}
|
||||
await page.evaluate(() => window.acquireDev.emitter.emit("replay:start"));
|
||||
await settle();
|
||||
assert.equal(
|
||||
|
|
@ -189,7 +197,7 @@ try {
|
|||
"replay does not project the current hand onto old boards"
|
||||
);
|
||||
report.scenarios.push(
|
||||
"own hand visible while waiting, spectator privacy, board selection/confirmation and replay isolation"
|
||||
"own hand visible while waiting, spectator privacy, one-click board placement on desktop/phone and replay isolation"
|
||||
);
|
||||
|
||||
await open("players=4&moves=95&theme=light");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue