fix: compact map load error state

This commit is contained in:
Nico 2026-06-04 15:37:15 -07:00
parent b96cb65d6f
commit 1a01c788f6
3 changed files with 17 additions and 2 deletions

View File

@ -22,7 +22,16 @@ export function LocationMapLoadErrorState({ location, loadError, onBack, onRetry
<main className="location-map-workspace">
<section className="location-map-setup location-map-load-error" role="alert" aria-live="polite">
<h2>Map Unavailable</h2>
<p>{loadError}</p>
<div className="location-map-setup-rows" role="group" aria-label="Map load status">
<div className="location-map-setup-row">
<span>Status</span>
<strong>Load failed</strong>
</div>
<div className="location-map-setup-row">
<span>Detail</span>
<strong>{loadError}</strong>
</div>
</div>
<div className="location-map-setup-actions">
<button type="button" className="btn-primary" onClick={onRetry}>
Retry

View File

@ -923,8 +923,11 @@
}
.location-map-setup-row strong {
min-width: 0;
color: #f8fafc;
font-weight: 900;
text-align: right;
overflow-wrap: anywhere;
}
.location-map-setup-actions {

View File

@ -477,7 +477,10 @@ test("load failure shows retryable error instead of no-map setup", async ({ page
const errorCard = page.locator(".location-map-load-error");
await expect(errorCard.getByRole("heading", { name: "Map Unavailable" })).toBeVisible();
await expect(errorCard.getByText("Map service unavailable")).toBeVisible();
const loadStatus = errorCard.getByRole("group", { name: "Map load status" });
await expect(loadStatus.locator(".location-map-setup-row", { hasText: "Status" })).toContainText("Load failed");
await expect(loadStatus.locator(".location-map-setup-row", { hasText: "Detail" })).toContainText("Map service unavailable");
await expect(errorCard.locator("p")).toHaveCount(0);
await expect(page.getByText("Load Error")).toBeVisible();
await expect(page.getByRole("heading", { name: "No Map" })).toHaveCount(0);
await expect(page.getByRole("button", { name: /Create From/ })).toHaveCount(0);