From 05c9577c71435301ddc201e7bc246e8d6994bb5b Mon Sep 17 00:00:00 2001 From: Nico Date: Thu, 4 Jun 2026 20:35:38 -0700 Subject: [PATCH] fix: size map item actions for touch --- .../src/styles/pages/LocationMapManager.css | 8 ++++---- frontend/tests/location-map-manager.spec.ts | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/frontend/src/styles/pages/LocationMapManager.css b/frontend/src/styles/pages/LocationMapManager.css index efe39cc..101302f 100644 --- a/frontend/src/styles/pages/LocationMapManager.css +++ b/frontend/src/styles/pages/LocationMapManager.css @@ -798,7 +798,7 @@ } .location-map-inline-state button { - min-height: 34px; + min-height: 40px; min-width: 64px; padding: 0.35rem 0.6rem; border: 1px solid var(--color-border-light); @@ -817,7 +817,7 @@ .location-map-zone-items li, .location-map-unmapped-list li { - min-height: 34px; + min-height: 40px; display: flex; align-items: center; justify-content: space-between; @@ -837,7 +837,7 @@ .location-map-item-button { width: 100%; - min-height: 34px; + min-height: 40px; display: flex; align-items: center; justify-content: space-between; @@ -909,7 +909,7 @@ .location-map-list-more-button { width: 100%; - min-height: 34px; + min-height: 40px; padding: 0.35rem 0.55rem; border: 0; background: transparent; diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index 89af7ce..b60ce99 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -2909,6 +2909,15 @@ test("viewer shows a compact overflow cue for long unmapped lists", async ({ pag await expect(page.getByText("unmapped item 8")).toBeVisible(); await expect(page.getByText("unmapped item 9")).toHaveCount(0); await expect(page.getByRole("button", { name: "Show 3 more unmapped items" })).toHaveText("+3 more"); + const firstUnmappedButtonBox = await page.getByRole("button", { name: "Mark unmapped item 1 bought" }).boundingBox(); + const moreUnmappedButtonBox = await page.getByRole("button", { name: "Show 3 more unmapped items" }).boundingBox(); + expect(firstUnmappedButtonBox).not.toBeNull(); + expect(moreUnmappedButtonBox).not.toBeNull(); + if (!firstUnmappedButtonBox || !moreUnmappedButtonBox) { + throw new Error("Unmapped item controls were not measurable"); + } + expect(firstUnmappedButtonBox.height).toBeGreaterThanOrEqual(40); + expect(moreUnmappedButtonBox.height).toBeGreaterThanOrEqual(40); await page.getByRole("button", { name: "Show 3 more unmapped items" }).click(); @@ -3722,6 +3731,15 @@ test("viewer handles empty and many-item zone panels without default pins", asyn await expect(page.locator(".location-map-zone-items .location-map-item-row").first()).toContainText("bulk item 1"); await expect(page.getByText("bulk item 9")).toHaveCount(0); await expect(page.getByRole("button", { name: "Show 6 more zone items" })).toHaveText("+6 more"); + const firstZoneItemButtonBox = await page.getByRole("button", { name: "Mark bulk item 1 bought" }).boundingBox(); + const moreZoneItemsButtonBox = await page.getByRole("button", { name: "Show 6 more zone items" }).boundingBox(); + expect(firstZoneItemButtonBox).not.toBeNull(); + expect(moreZoneItemsButtonBox).not.toBeNull(); + if (!firstZoneItemButtonBox || !moreZoneItemsButtonBox) { + throw new Error("Zone item controls were not measurable"); + } + expect(firstZoneItemButtonBox.height).toBeGreaterThanOrEqual(40); + expect(moreZoneItemsButtonBox.height).toBeGreaterThanOrEqual(40); await page.getByRole("button", { name: "Show 6 more zone items" }).click();