Keep mobile exploration confirmation visible above scrollable placements

This commit is contained in:
coyotte508 2026-11-21 20:54:10 +00:00
commit d7c8425ff2
2 changed files with 32 additions and 2 deletions

View file

@ -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');

View file

@ -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;