fix: omit empty zone detail rows

This commit is contained in:
Nico 2026-06-04 18:28:21 -07:00
parent 7af995f561
commit 5262e89d11
2 changed files with 10 additions and 13 deletions

View File

@ -191,19 +191,17 @@ export function SelectedZoneItemsPanel({
onSelectZoneItem,
}) {
if (selectedZoneItems.length === 0) {
if (!hasHiddenSelectedItems) return null;
return (
<div className="location-map-zone-items">
<div className="location-map-zone-empty">
{hasHiddenSelectedItems ? (
<InlineStateAction
label="Hidden"
value={hiddenSelectedItemCount}
actionLabel="Show Zone Items"
onAction={onShowSelectedZoneItems}
/>
) : (
<InlineStateAction label="Items" value="0" />
)}
</div>
</div>
);

View File

@ -3609,9 +3609,8 @@ test("viewer handles empty and many-item zone panels without default pins", asyn
await page.locator('[data-object-key="1562"]').locator("rect").first().click();
await expect(page.locator(".location-map-sheet-count")).toHaveText("0 items");
const emptyZoneState = page.locator(".location-map-zone-items .location-map-inline-state", { hasText: "Items" });
await expect(emptyZoneState).toContainText("0");
await expect(emptyZoneState.getByRole("button")).toHaveCount(0);
await expect(page.locator(".location-map-zone-items")).toHaveCount(0);
await expect(page.locator(".location-map-inline-state", { hasText: "Items" })).toHaveCount(0);
await expect(page.getByText("No items assigned to this zone yet.")).toHaveCount(0);
await page.locator('[data-object-key="1561"]').locator("rect").first().click();