From d7c8425ff2bffa4266e6a533b9ecef5c6d2e00a9 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Sat, 21 Nov 2026 20:54:10 +0000 Subject: [PATCH] Keep mobile exploration confirmation visible above scrollable placements --- web-client/scripts/mobile-map-view-smoke.mjs | 23 ++++++++++++++++++-- web-client/src/style.css | 11 ++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/web-client/scripts/mobile-map-view-smoke.mjs b/web-client/scripts/mobile-map-view-smoke.mjs index 36020a11..4eb73d23 100644 --- a/web-client/scripts/mobile-map-view-smoke.mjs +++ b/web-client/scripts/mobile-map-view-smoke.mjs @@ -203,8 +203,27 @@ try { await panel.getByRole('button', { name: 'Locate the region being explored', exact: true }).click(); await page.waitForTimeout(100); // Let the map's resize frame catch up with the tray layout. const panelBounds = await panel.boundingBox(); - const confirmBounds = await panel.getByRole('button', {name:'Confirm',exact:true}).boundingBox(); - assert(confirmBounds.y + confirmBounds.height <= panelBounds.y + panelBounds.height, 'Exploration confirmation is visible without scrolling'); + const confirmBounds = await panel.getByRole('button', { name: 'Confirm', exact: true }).boundingBox(); + assert( + confirmBounds.y >= panelBounds.y && + confirmBounds.y + confirmBounds.height <= panelBounds.y + panelBounds.height && + confirmBounds.x >= panelBounds.x && + confirmBounds.x + confirmBounds.width <= panelBounds.x + panelBounds.width, + 'Exploration confirmation is fully visible without scrolling the panel', + ); + assert(panelBounds.y >= 0 && panelBounds.y + panelBounds.height <= height); + const choices = panel.locator('.exploration-choices'); + assert.equal(await panel.evaluate((el) => el.scrollTop), 0); + assert( + await choices.evaluate((el) => getComputedStyle(el).overflowY === 'auto'), + 'Only the placement body scrolls when the mobile panel is constrained', + ); + await choices.evaluate((el) => (el.scrollTop = el.scrollHeight)); + assert.deepEqual( + await panel.getByRole('button', { name: 'Confirm', exact: true }).boundingBox(), + confirmBounds, + 'Scrolling placements leaves confirmation fixed in view', + ); const labelBounds = await page.locator('.map-exploration-label').boundingBox(); assert(labelBounds.x >= 0 && labelBounds.x + labelBounds.width <= width, 'Explored region stays on screen'); assert(labelBounds.y + labelBounds.height <= panelBounds.y || labelBounds.x >= panelBounds.x + panelBounds.width, 'Region label remains clear of the orientation panel'); diff --git a/web-client/src/style.css b/web-client/src/style.css index e9683482..0740902a 100644 --- a/web-client/src/style.css +++ b/web-client/src/style.css @@ -5340,6 +5340,17 @@ small { top: auto; bottom: calc(56px + var(--mobile-bottom)); max-height: 48%; + display: flex; + flex-direction: column; + overflow: hidden; + } + .exploration-panel > :not(.exploration-choices) { + flex-shrink: 0; + } + .exploration-panel > .exploration-choices { + /* Scroll placements, not the heading or confirmation, on short screens. */ + min-height: 0; + overflow-y: auto; } .exploration-choices { gap: 8px;