Release viewer 2.3.22 with remaining-card count on the draw pile

This commit is contained in:
coyotte508 2026-11-02 20:32:15 +00:00
commit 8e3e41587b
5 changed files with 44 additions and 1 deletions

View file

@ -0,0 +1,17 @@
{
"game": "powergrid",
"gameVersion": 13,
"publishedAt": "2026-11-02T20:32:15.157Z",
"viewer": {
"version": "2.3.22",
"url": "https://s3.fr-par.scw.cloud/bgs-assets/games/powergrid/13/viewer/split-a67471a7fc981e399c4d/powergrid-viewer.umd.min.js",
"stylesheets": [
"https://s3.fr-par.scw.cloud/bgs-assets/games/powergrid/13/viewer/split-a67471a7fc981e399c4d/powergrid-viewer.css"
],
"scriptBytes": 1223203,
"sha256": "a26f0dc636069fa269a49600c9bb561735754341528ef21eddab1ee2df951128",
"bundle": "split-a67471a7fc981e399c4d",
"files": 42
},
"verified": true
}

View file

@ -40,6 +40,9 @@ available. Button pictograms stay black on light hover backgrounds. Clickable
plants use their own border for the white hover cue, retaining the original
4-unit highlighted and 3-unit activated border widths and original blue.
Viewer 2.3.22 adds the remaining-card count centered on the draw pile's top card.
It uses the public deck count and remains stable during resource purchases and undo.
After packaging, run `node viewer/scripts/action-controls-smoke.mjs` to check
normal/only-pass states, hover/focus styling against the board-option buttons,
resource/building/powering transitions, and plant borders.

View file

@ -1,6 +1,6 @@
{
"name": "powergrid-viewer",
"version": "2.3.21",
"version": "2.3.22",
"repository": {
"type": "git",
"url": "git+https://github.com/boardgamers/powergrid.git",

View file

@ -95,6 +95,16 @@ try {
await page.goto(`http://127.0.0.1:${server.address().port}/?mode=resources`);
const phaseButton = page.locator('[data-board-control="pass"]');
await phaseButton.waitFor();
const cardsLeft = await page.evaluate(() => document.querySelector('.game').__vue__.G.cardsLeft);
assert.equal((await page.locator('[data-deck-count]').textContent()).trim(), String(cardsLeft));
const countIsCentered = await page.locator('[data-deck-count]').evaluate((label) => {
const card = label.previousElementSibling;
return (
Number(label.getAttribute('x')) === Number(card.getAttribute('x')) + 30 &&
Number(label.getAttribute('y')) === Number(card.getAttribute('y')) + 20
);
});
assert(countIsCentered, 'remaining count is centered on the top card');
assert(await phaseButton.evaluate((e) => e.classList.contains('skip-action')));
await page.evaluate(() => {
const deck = document.querySelector('[data-board-slot="powerPlantDeck"]');

View file

@ -157,6 +157,19 @@
{{ G.cardsLeft }} cards left{{ G.nextCardWeak ? ', next is an initial plant' : '' }}
</title>
</rect>
<text
data-deck-count
:x="65 + G.cardsLeft / 5"
:y="58 - G.cardsLeft / 10"
text-anchor="middle"
dominant-baseline="central"
font-size="20"
font-weight="700"
fill="black"
pointer-events="none"
>
{{ G.cardsLeft }}
</text>
</template>
</g>