From 1580a03be64f3a2e0ebb891f59010f63b98f60ee Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 18 Nov 2026 23:15:57 +0000 Subject: [PATCH] Restore open bank berths with player-colored borders and cargo inside --- docs/offshore-island.md | 6 ++- viewer/scripts/offshore-smoke.mjs | 8 +++- viewer/src/components/Game.vue | 32 ++++++++-------- viewer/src/components/OffshoreBank.vue | 49 ++++++++++++------------- viewer/src/components/OffshoreCargo.vue | 19 ++++++++-- viewer/tests/unit/offshore-bank.spec.ts | 27 ++++++++++---- 6 files changed, 83 insertions(+), 58 deletions(-) diff --git a/docs/offshore-island.md b/docs/offshore-island.md index 9ee3f80..1ad11f3 100644 --- a/docs/offshore-island.md +++ b/docs/offshore-island.md @@ -78,8 +78,10 @@ lot to offer cash or select stored cargo, then confirm the offer. During payment click a container below the lots; a connecting line and highlighted lot show its fixed destination. Repricing and default choices appear beside the bank. -Each player's colored bank harbor row contains separate ship and waiting-cargo -spaces. Won containers remain in that row until clicked to load on arrival. +Each player's open-water berth has solid player-colored piers; shared piers split +evenly between adjacent colors. Won containers wait directly in the berth, without +a separate holding box or harbor token, until clicked to load on arrival. Cargo +moves beside a docked ship within the same unpartitioned berth. Empty harbor rows stay visible, and large cargo lists are paginated. There is no separate expansion banner or collapsible card panel. diff --git a/viewer/scripts/offshore-smoke.mjs b/viewer/scripts/offshore-smoke.mjs index 8aa3c40..a9a4418 100644 --- a/viewer/scripts/offshore-smoke.mjs +++ b/viewer/scripts/offshore-smoke.mjs @@ -262,9 +262,9 @@ try { .boundingBox(); assert.ok(shipBounds.x + shipBounds.width < holdingBounds.x, 'ship never overlaps waiting cargo'); assert.equal(await page.locator('.bank-berth').count(), 3); - assert.equal(await ownBerth.locator('[data-piece-id]').count(), 5); + assert.equal(await ownBerth.locator('[data-piece-id]').count(), 2); await ownBerth.getByRole('button', { name: 'Next cargo page' }).click(); - assert.equal(await ownBerth.locator('[data-piece-id]').count(), 3); + assert.equal(await ownBerth.locator('[data-piece-id]').count(), 2); await ownBerth.getByRole('button', { name: 'Previous cargo page' }).click(); await page.screenshot({ path: `/tmp/container-offshore-harbor-${width}.png`, fullPage: true }); // Arrival-only pickup still uses the displayed holding cargo. @@ -375,6 +375,8 @@ try { await push(); await page.waitForTimeout(1200); assert.equal(await page.locator('.bank-berth').count(), 5); + assert.equal(await page.locator('.bank-berth .player-token, .bank-berth [fill-opacity]').count(), 0); + assert.equal(await page.locator('.bank-berth-border[fill="none"][stroke-width="2"]').count(), 5); for (let i = 0; i < 5; i++) { const berth = page.locator(`.bank-berth[data-owner="${i}"]`); const cargo = await berth.locator('.bank-holding').boundingBox(); @@ -384,6 +386,8 @@ try { .boundingBox(); const bounds = await berth.boundingBox(); assert.ok(ship.x + ship.width < cargo.x); + assert.ok(cargo.x >= bounds.x && cargo.x + cargo.width <= bounds.x + bounds.width + 1); + assert.ok(cargo.y >= bounds.y && cargo.y + cargo.height <= bounds.y + bounds.height); assert.ok( ship.y >= bounds.y - 2 && ship.y + ship.height <= bounds.y + bounds.height + 2, JSON.stringify({ i, ship, bounds }) diff --git a/viewer/src/components/Game.vue b/viewer/src/components/Game.vue index 26a6163..25b2e95 100644 --- a/viewer/src/components/Game.vue +++ b/viewer/src/components/Game.vue @@ -193,6 +193,21 @@ :data="{ type: 'islandHarbor' }" /> + - diff --git a/viewer/src/components/OffshoreBank.vue b/viewer/src/components/OffshoreBank.vue index d81f9fd..ee730f2 100644 --- a/viewer/src/components/OffshoreBank.vue +++ b/viewer/src/components/OffshoreBank.vue @@ -116,6 +116,7 @@ + - + - - + + + {{ owner(i) }}: waiting cargo - - {{ decisionTitle }}