From 2cfb5332f62d0b61e6cea66a8c8fb3d838ee1d9f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 06:54:05 -0700 Subject: [PATCH 1/2] Repeat tile placement confirmation under the hand on phones On narrow layouts the decision panel sits above the board, so confirming a tile chosen in the rack meant scrolling back up past the board. Extract the place confirmation into PlaceConfirm, used by the action panel and, below 700px, directly under the rack, where it scrolls into view when it opens. Co-Authored-By: Claude Opus 5.5 --- packages/viewer/src/App.svelte | 12 +++- packages/viewer/src/lib/ActionPanel.svelte | 31 +-------- packages/viewer/src/lib/PlaceConfirm.svelte | 72 +++++++++++++++++++++ 3 files changed, 86 insertions(+), 29 deletions(-) create mode 100644 packages/viewer/src/lib/PlaceConfirm.svelte diff --git a/packages/viewer/src/App.svelte b/packages/viewer/src/App.svelte index 4ce9658..721ad8c 100644 --- a/packages/viewer/src/App.svelte +++ b/packages/viewer/src/App.svelte @@ -5,6 +5,7 @@ import Chat from "./lib/Chat.svelte"; import Hand from "./lib/Hand.svelte"; import Log from "./lib/Log.svelte"; + import PlaceConfirm from "./lib/PlaceConfirm.svelte"; import Players from "./lib/Players.svelte"; import PriceTable from "./lib/PriceTable.svelte"; import Status from "./lib/Status.svelte"; @@ -30,7 +31,10 @@ /> {#if store.seats.length > 0 && store.replayAt === undefined} -
+
+ +
+
{/if}
@@ -70,6 +74,12 @@ .hand { grid-area: hand; } + /* Phones show the decision above the board: repeat the placement confirmation under the rack. */ + @media (min-width: 700px) { + .hand-confirm { + display: none; + } + } .market { grid-area: market; display: grid; diff --git a/packages/viewer/src/lib/ActionPanel.svelte b/packages/viewer/src/lib/ActionPanel.svelte index b21dd03..1c62946 100644 --- a/packages/viewer/src/lib/ActionPanel.svelte +++ b/packages/viewer/src/lib/ActionPanel.svelte @@ -7,22 +7,14 @@ merger, sharePrice, sharePurchaseLimit, - tileLabel, type ChainId, type Shares, } from "acquire-engine"; import ChainMark from "./ChainMark.svelte"; + import PlaceConfirm from "./PlaceConfirm.svelte"; import StockSwap from "./StockSwap.svelte"; import { mergerPreview } from "./mergerPreview"; - import { - adjustShares, - canBuy, - canDispose, - describePlacement, - disposalPresets, - nextDefunctChoices, - ofType, - } from "./decisions"; + import { adjustShares, canBuy, canDispose, disposalPresets, nextDefunctChoices, ofType } from "./decisions"; import { chainName } from "./format"; import type { ViewerStore } from "./store.svelte"; @@ -72,12 +64,6 @@ const price = (chain: ChainId) => sharePrice(chain, chainSize(game.board, chain)); const cost = $derived(Object.entries(shares).reduce((sum, [chain, n]) => sum + n * price(chain as ChainId), 0)); const total = $derived(Object.values(shares).reduce((sum, n) => sum + n, 0)); - - function placeSelected(): void { - if (store.selected !== undefined) { - store.send({ type: "place", tile: tileLabel(store.selected) }); - } - } {#if moves.length > 0 && !store.sending} @@ -115,18 +101,7 @@ {#if game.phase === "place"} {#if store.selected !== undefined} -

- {t("place.effect", { - tile: tileLabel(store.selected), - effect: describePlacement(game, store.selected, lang), - })} -

- - + {:else if legal("place")}

{t("place.choose")}

{/if} diff --git a/packages/viewer/src/lib/PlaceConfirm.svelte b/packages/viewer/src/lib/PlaceConfirm.svelte new file mode 100644 index 0000000..c13f45c --- /dev/null +++ b/packages/viewer/src/lib/PlaceConfirm.svelte @@ -0,0 +1,72 @@ + + +{#if tile !== undefined} +
+

{t("place.effect", { tile: tileLabel(tile), effect: describePlacement(store.state!, tile, store.lang) })}

+ + +
+{/if} + + From 2ffadb9ae4ea1925a59addc6d91af9c2f9a642d0 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 06:58:56 -0700 Subject: [PATCH 2/2] Stack desktop panels in independent columns The desktop grid shared rows with the board, so the decision/hand column and the chains column stretched to the board's height and left large empty areas. Group the panels into columns that stack independently: board and players; decision, hand and chains; history and chat. Tablets keep the board and players beside the decision, hand and chains, with history and chat below. Phones place the panels individually as before. Co-Authored-By: Claude Opus 5.5 --- packages/viewer/src/App.svelte | 117 +++++++++++++++++++-------------- scripts/check-browser.mjs | 35 ++++++---- 2 files changed, 92 insertions(+), 60 deletions(-) diff --git a/packages/viewer/src/App.svelte b/packages/viewer/src/App.svelte index 721ad8c..fd82c74 100644 --- a/packages/viewer/src/App.svelte +++ b/packages/viewer/src/App.svelte @@ -18,35 +18,43 @@
{#if store.state} {@const state = store.view!} +
-
- - -
-
- store.send({ type: "place", tile: tileLabel(tile) })} - /> -
- {#if store.seats.length > 0 && store.replayAt === undefined} -
- -
+
+
+ + +
+ {#if store.seats.length > 0 && store.replayAt === undefined} +
+ +
+
+ {/if} +
+ +
- {/if} -
- -
-
- +
+
+ store.send({ type: "place", tile: tileLabel(tile) })} + /> +
+
+ +
+
+
+
+ {#if !store.analysis} +
+ {/if}
- {#if !store.analysis} -
- {/if} -
{:else}

{store.lang.t("loading")}

@@ -54,7 +62,7 @@
diff --git a/scripts/check-browser.mjs b/scripts/check-browser.mjs index 1fec20f..542d6ac 100644 --- a/scripts/check-browser.mjs +++ b/scripts/check-browser.mjs @@ -668,7 +668,7 @@ try { await open(`players=4&moves=95&publicHoldings=1&theme=${theme}`); const geometry = await page.evaluate(() => { const main = document.querySelector("main"); - const column = document.querySelector(".layout > .board"); + const column = document.querySelector(".board-column > .board"); const frame = column.querySelector(".frame"); return { margin: getComputedStyle(document.body).margin, @@ -1028,17 +1028,28 @@ try { "desktop/phone undo, repeated private revisions, refresh, no undo network calls, one saved turn and one clock increment" ); - // The desktop used to stack every supporting panel in one tall sidebar. Check the rendered - // arrangement and height, not only horizontal overflow, before creating gallery images. + // The desktop used to stack every supporting panel in one tall sidebar, and later left empty + // areas beside the board. Each column now stacks its own panels; check the rendered arrangement. await page.setViewportSize({ width: 1280, height: 900 }); await open("players=4&moves=95&publicHoldings=1"); - const board = await page.locator(".layout > .board").boundingBox(); - const panels = await Promise.all( - [".players", ".history", ".conversation"].map((selector) => page.locator(`.layout > ${selector}`).boundingBox()) - ); - for (const panel of panels) { - assert.ok(panel.y >= board.y + board.height, "supporting panels sit below the board"); - assert.ok(Math.abs(panel.y - panels[0].y) < 1, "supporting panels share a desktop row"); + const box = (selector) => page.locator(`.layout ${selector}`).boundingBox(); + const columns = [ + [".board-column > .board", ".board-column > .players"], + [".turn-column > .controls", ".turn-column > .hand", ".turn-column > .market"], + [".talk-column > .history", ".talk-column > .conversation"], + ]; + let previousColumn; + for (const column of columns) { + const boxes = await Promise.all(column.map(box)); + for (const [index, panel] of boxes.entries()) { + assert.ok(Math.abs(panel.x - boxes[0].x) < 1, `${column[index]} stays in its column`); + if (index > 0) { + const gap = panel.y - (boxes[index - 1].y + boxes[index - 1].height); + assert.ok(gap >= 0 && gap < 40, `${column[index]} follows the panel above it without an empty area`); + } + } + assert.ok(!previousColumn || boxes[0].x > previousColumn.x + previousColumn.width, "desktop columns side by side"); + previousColumn = boxes[0]; } assert.ok((await page.locator("main").boundingBox()).height <= 900, "desktop game fits within 900px"); assert.equal(await page.locator(".log li").count(), 8); @@ -1046,7 +1057,7 @@ try { assert.ok((await page.locator(".log li").count()) > 100, "full history remains available"); await page.locator(".history button").click(); assert.equal(await page.locator(".log li").count(), 8); - report.scenarios.push("balanced desktop panels, compact recent history and expandable full log"); + report.scenarios.push("independent desktop columns, compact recent history and expandable full log"); for (const [name, params, width, height] of [ ["overview", "players=4&moves=95&publicHoldings=1", 1280, 900], @@ -1057,7 +1068,7 @@ try { for (const theme of ["light", "dark"]) { await open(`${params}&theme=${theme}`); const main = await page.locator("main").boundingBox(); - const hand = await page.locator(".layout > .hand").boundingBox(); + const hand = await page.locator(".turn-column > .hand").boundingBox(); // Desktop shows the whole compact layout. On phones frame the complete decision, board // and hand, without appending a long column of tables, chat and history to the image. const captureHeight = Math.ceil(width < 700 ? hand.y + hand.height + 12 : main.height);