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 @@
/>
+
+
!c.moved)
.map((c) => ({ ...c.piece, price: c.price }));
}
+ get bankBidZones() {
+ if (!this.bankCashOffer) return [];
+ const eligible = new Set(this.bankBidCargo.map((c) => c.id));
+ const p = this.G!.players[this.player!];
+ return [
+ { district: 'factory', cargo: p.containersOnFactoryStore, y: 158, width: 188 },
+ { district: 'warehouse', cargo: p.containersOnWarehouseStore, y: 248, width: 236 },
+ ].filter((zone) => zone.cargo.some((c) => eligible.has(c.piece.id)));
+ }
get bankContainerHighlights() {
return this.bankCashOffer ? this.bankBidCargo.map((c) => c.id) : [];
}
diff --git a/viewer/src/components/pieces/Container.vue b/viewer/src/components/pieces/Container.vue
index 44ceaa5..aab4383 100644
--- a/viewer/src/components/pieces/Container.vue
+++ b/viewer/src/components/pieces/Container.vue
@@ -58,10 +58,6 @@ export default class Container extends Mixins(Piece) {
.bid-eligible {
cursor: pointer;
}
-.bid-eligible > rect {
- stroke: blue;
- stroke-width: 1.5;
-}
.bid-selected > rect {
stroke: #ffe154;
stroke-width: 2.5;
diff --git a/viewer/tests/unit/offshore-bank.spec.ts b/viewer/tests/unit/offshore-bank.spec.ts
index 06f2554..e07ea7a 100644
--- a/viewer/tests/unit/offshore-bank.spec.ts
+++ b/viewer/tests/unit/offshore-bank.spec.ts
@@ -281,6 +281,35 @@ describe('Offshore bank viewer', () => {
wrapper.destroy();
});
+ it('highlights only own storage zones containing eligible bid cargo', async () => {
+ const { wrapper, state, player, own } = gameFixture();
+ const normalOutlines = wrapper.findAll('rect[stroke="blue"]').length;
+ const bank = wrapper.findComponent(OffshoreBank);
+ bank.vm.$emit('choose-offer', { type: 'cash', lot: 1 });
+ await wrapper.vm.$nextTick();
+ const zones = () => wrapper.findAll('.bank-bid-storage-zone');
+ expect(zones().wrappers.map((z) => z.attributes('data-district'))).toEqual(['factory', 'warehouse']);
+ expect(zones().wrappers.every((z) => z.attributes('data-owner') === String(player))).toBe(true);
+ expect(zones().wrappers.every((z) => z.attributes('pointer-events') === 'none')).toBe(true);
+ expect(wrapper.findAll('rect[stroke="blue"]').length).toBe(2);
+ own.containersOnFactoryStore.forEach((c) => (c.moved = true));
+ await wrapper.setProps({ state: JSON.parse(JSON.stringify(state)) });
+ bank.vm.$emit('choose-offer', { type: 'cash', lot: 1 });
+ await wrapper.vm.$nextTick();
+ expect(zones().wrappers.map((z) => z.attributes('data-district'))).toEqual(['warehouse']);
+ own.containersOnWarehouseStore = [];
+ await wrapper.setProps({ state: JSON.parse(JSON.stringify(state)) });
+ bank.vm.$emit('choose-offer', { type: 'cash', lot: 1 });
+ await wrapper.vm.$nextTick();
+ expect(zones().length).toBe(0);
+ bank.vm.$emit('cancel-draft');
+ await wrapper.vm.$nextTick();
+ expect(zones().length).toBe(0);
+ expect(normalOutlines).toBeGreaterThan(0);
+ expect(wrapper.findAll('rect[stroke="blue"]').length).toBeGreaterThan(0);
+ wrapper.destroy();
+ });
+
it('requires explicit confirmation for multiple cargo pieces and supports cancel', async () => {
const { wrapper, submitted, factory, warehouse } = gameFixture();
wrapper.findComponent(OffshoreBank).vm.$emit('choose-offer', { type: 'cash', lot: 1 });