From e99b9ccc66f41d5f0faadc18cb374f1d00144a9c Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 18 Nov 2026 23:47:01 +0000 Subject: [PATCH] Highlight eligible storage zones during bank container bidding --- viewer/scripts/offshore-smoke.mjs | 22 ++++++++++++++-- viewer/src/components/Game.vue | 26 +++++++++++++++++++ viewer/src/components/pieces/Container.vue | 4 --- viewer/tests/unit/offshore-bank.spec.ts | 29 ++++++++++++++++++++++ 4 files changed, 75 insertions(+), 6 deletions(-) diff --git a/viewer/scripts/offshore-smoke.mjs b/viewer/scripts/offshore-smoke.mjs index 796430b..bfc9e63 100644 --- a/viewer/scripts/offshore-smoke.mjs +++ b/viewer/scripts/offshore-smoke.mjs @@ -163,6 +163,22 @@ try { state.players[player].containersOnWarehouseStore.push({ piece: second, price: 3, moved: false }); await push(); await page.locator('.offshore-lot[data-type="cash"][data-lot="1"]').click(); + assert.deepEqual( + await page + .locator('.bank-bid-storage-zone') + .evaluateAll((els) => els.map((el) => [el.dataset.district, el.dataset.owner])), + [ + ['factory', String(player)], + ['warehouse', String(player)], + ] + ); + assert.equal( + await page + .locator(`.piece.bid-eligible[data-piece-id="${offered.id}"] > rect`) + .evaluate((el) => getComputedStyle(el).stroke), + 'rgb(33, 52, 59)', + 'eligible cargo retains its normal border' + ); await page.locator(`.piece.bid-eligible[data-piece-id="${offered.id}"]`).click(); await checkDraft('cash', 1); assert.equal(await page.locator('.bank-lot-draft [data-piece-id]').count(), 1); @@ -173,8 +189,8 @@ try { assert.equal(await page.locator('.piece.bid-selected').count(), 2); assert.equal( await page.locator('rect[stroke="blue"]').count(), - 0, - 'no sidebar frame or ordinary action outlines' + 2, + 'only the two eligible own storage zones have action outlines' ); const selectedPiece = page.locator(`.piece[data-piece-id="${second.id}"]`); await selectedPiece.focus(); @@ -190,6 +206,8 @@ try { assert.equal(await page.locator('.bank-lot-draft [data-piece-id]').count(), 0); await page.getByRole('button', { name: 'Cancel', exact: true }).click(); assert.equal(await page.locator('.bid-eligible, .bid-selected, .bank-draft').count(), 0); + assert.equal(await page.locator('.bank-bid-storage-zone').count(), 0); + assert.ok((await page.locator('rect[stroke="blue"]').count()) > 0, 'cancel restores normal action outlines'); assert.ok((await page.locator('.piece.canDrag').count()) > 0, 'cancel restores ordinary actions'); assert.equal(await page.evaluate(() => moves.length), 0); await page.locator('.offshore-lot[data-type="cash"][data-lot="1"]').click(); diff --git a/viewer/src/components/Game.vue b/viewer/src/components/Game.vue index 801c1bf..a8f59e5 100644 --- a/viewer/src/components/Game.vue +++ b/viewer/src/components/Game.vue @@ -439,6 +439,23 @@ /> + +