canPowerAllPlants() summed the fuel cost of every plant in hand, including
Australia's uranium plants (11/23/28/34/39), which are mines that never
power cities — and uranium cannot even be bought in the main market there.
That made the 'skip buying resources without enough to power all your
plants?' confirmation fire every Resources phase, no matter what.
Skip mines via the engine's isUraniumMine() helper, mirroring how the
bureaucracy move list and the hand-limit count already treat them.
* Add current-round planning and city/powering premoves
* Hide empty premove containers after cancellation
* Simplify premove review and cancellation and fix clean-checkout checks
* Run premove browser checks in CI and serve the preview favicon
* Validate premoves directly and reopen them through Plan
* Show saved premoves in Plan button and use board Undo
* Remove redundant preview label from planning controls
* Rename queue cancellation to Cancel premoves
* Use board Done control to skip simulated plant purchases
* Remove root docs and repository screenshots
* Add playable Powergrid tutorials and city income reference
* Space houses that share a city count so each one stays readable
The income row shortened the city-count cells, and the house markers were
packed to fit: 6px between columns against a 12px-wide house, and 3px
between rows. Two players on the same number — the ordinary case for most
of a game — overlapped by half and read as a single smudge; five or six at
the start of a game read as one blob.
Lay them out bottom-aligned in the cell instead, growing upward from the
income strip so the number above stays legible, a house-width between
columns and a house-height between rows. Five or six sharing go three wide
rather than three tall: a third row starts at the top of the cell and hides
the number completely, which is every game's opening position.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Lift dialogs above the status bar and complete the payment table
The status bar is sticky at z-index 10 and every modal sat at z-index 1, so
the bar painted over the top of any open dialog. Modals open 10vh down and
the bar is a fixed 40px, so on a short viewport — a phone held sideways —
the bar landed across the dialog's own header and covered the close button,
leaving no way out of the dialog at all. Put the modal above it; the bar is
then dimmed behind the overlay like the rest of the page.
The payment table counted to citiesToEndGame, which stopped one column short
of the number that ends the game, and a player can finish holding more cities
than that by building in the same phase as whoever triggered the end. Render
the whole table instead, so it agrees with the city track on the board.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: John Gold <goldjohn6@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The per-player game clock could show one player using nearly the whole
game's elapsed time. Root cause: `move.time` was the acting client's
Date.now(), and `updateClocks` banks a stretch by subtracting one
player's stamp from another's (`ts - clockStartedAt`, where the two come
from different players' moves). Browsers disagree on the wall clock, so a
player whose clock ran fast charged that skew to themselves on every
turn; over a game's many turns it accumulated toward the total elapsed
time (observed in a real game: one player at ~46s of skew reached ~86%
of the game's wall-clock duration, while the player who followed them was
under-charged, clamped to 0 by the existing Math.max guard).
Drive the clocks from a single clock instead. `wrapper.move` — the
authoritative move processor, never reached during a deterministic
replay — now stamps each turn with the server clock as `serverTime`, and
`updateClocks` prefers it over the client `time`. AI turns are already
server-stamped, so human turns now match. The client `time` is kept
untouched: it is the move's identity for reconciling the turn buffer
against the server's echo (viewer turn-buffer helpers), and it still
drives the local preview clock on the acting player's own board.
Determinism is preserved: the server stamp is written into the log and
reused on replay. Added a wrapper test that plays with absurd client
stamps and asserts the timers track the server clock, plus a replay
check; pinned Date.now across the wrapper suite so buffers replay to
byte-identical states.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
A player reported that the floating "Chat" tag hovers in the lower left and
blocks things (on a phone it covered the journal and the uranium market),
while the chat itself is always reachable below the board.
- Only show the shortcut when there is an unread message and the chat feed
is not already on screen.
- Move it bottom-right, 89px from the edge: just left of the platform's
settings gear (fixed at right:25px, 45px wide), the slot the platform's own
chat button used. Restyled as a pill with the unread count.
- protocol-smoke: the Journal-tab check now expects no shortcut without
unread chat; added checks for the count, the anchor, not covering the
game buttons, and that clicking it brings the chat into view and it hides
once read.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* Use shared BGS viewer and chat protocol
* Use the viewer TypeScript config in every build worker
* Use shared chat panel and preserve mobile journal shortcut
* Update shared chat visibility and show date separators
* Keep typing after completing a chat mention
In Step 3 the cost of a city depends on how many players are already
there, so two cities a player can reach can differ by 10 Elektro with
nothing on the board to say so. #148 asked for that number.
It did not need computing. `available-moves` already totals the
shortest-path connection cost and the slot cost for the current
occupancy (10/15/20 in the standard build, per-map `slotCosts`
otherwise) and drops every city the player cannot afford — the viewer
was throwing that total away and keeping only the names.
So the change is to stop discarding it: `getBuildableCityPrices()`
passes the per-city totals to the map, and a buildable city's tooltip
reads "Suwon — build for 17" instead of "Suwon".
A tooltip rather than a printed label, deliberately. Measured across
every recharged map at 2-6 players, a Step-3 build turn offers a median
26-52% of the cities in play and sometimes all of them, so a label on
each would bury the board it is meant to explain — and there is nowhere
to put one in portrait. Only three tooltips needed changing: the map
already draws tap-target overlays on actionable cities, and SVG
hit-testing gives the tooltip to the topmost element.
Japan's free jump quotes the same city at two prices, so both are shown.
Verified by executing 11,533 offered build moves across every recharged
map at 2-6 players and asserting the quoted price equals the money
actually deducted: zero mismatches. Free-jump quotes were only 16 of
those — correct in all 16, but thin. Live-checked in the browser on
Korea in portrait.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* docs(engine): spell out the UK & Ireland first-house cost in the map rules
The cross-island rule said "an extra 20 Elektro on top of the normal
first-house cost" without naming that cost, so the total for starting a
second network was not obvious at the table. Name it ($10) and set FIRST
apart, per Mike's read of the dialog.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Update engine/src/maps/ukireland.ts
Co-authored-by: Eliott C. <coyotte508@gmail.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Eliott C. <coyotte508@gmail.com>