fix: clarify draft viewing status

This commit is contained in:
Nico 2026-06-04 19:52:02 -07:00
parent e5927a4811
commit 4e276797c6
3 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@ export function getMapStatus(state, options = {}) {
if (options.hasUnsavedChanges) return "Unsaved Draft";
if (!state?.draft_map && !state?.published_map) return "No Map";
if (options.mode === "edit") return "Draft";
if (options.mode === "view" && options.previewDraft && state?.draft_map) return "Draft Preview";
if (options.mode === "view" && options.previewDraft && state?.draft_map) return "Viewing Draft";
if (state?.published_map) return "Published";
if (state?.draft_map) return "Draft";
return "No Map";

View File

@ -85,7 +85,7 @@
border-color: rgba(245, 158, 11, 0.36);
}
.location-map-status-draft-preview {
.location-map-status-viewing-draft {
background: rgba(14, 165, 233, 0.2);
border-color: rgba(56, 189, 248, 0.4);
}

View File

@ -1221,7 +1221,7 @@ test("admin status follows the visible map when a saved draft exists", async ({
await expect(page.locator(".location-map-object", { hasText: "Draft Bakery" })).toBeVisible();
await page.getByRole("button", { name: "View Draft" }).click();
await expect(page.locator(".location-map-status")).toHaveText("Draft Preview");
await expect(page.locator(".location-map-status")).toHaveText("Viewing Draft");
await expect(page.locator(".location-map-object", { hasText: "Draft Bakery" })).toBeVisible();
await page.getByRole("button", { name: "View" }).click();
@ -1344,7 +1344,7 @@ test("mode switches close open map layers without resetting filters", async ({ p
await expect(page.locator(".location-map-display-panel")).toHaveCount(0);
});
test("mobile keeps draft preview status compact in the topbar", async ({ page }) => {
test("mobile keeps viewing draft status compact in the topbar", async ({ page }) => {
await page.setViewportSize({ width: 409, height: 838 });
await mockMapShell(page);
@ -1397,7 +1397,7 @@ test("mobile keeps draft preview status compact in the topbar", async ({ page })
const modeButtons = page.locator(".location-map-mode-buttons");
const historyActions = page.locator(".location-map-history-buttons");
const zoomControls = page.locator(".location-map-zoom-controls");
await expect(status).toHaveText("Draft Preview");
await expect(status).toHaveText("Viewing Draft");
const topbarBox = await topbar.boundingBox();
const backButtonBox = await backButton.boundingBox();