@the-portland-company/shell 0.73.0 → 0.73.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1613,7 +1613,10 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1613
1613
  for (let i = 0; i < 45; i++) {
1614
1614
  await new Promise((r) => setTimeout(r, 3e3));
1615
1615
  if (run !== captureRun.current) return;
1616
- if (!accessRef.current?.allowed) return;
1616
+ if (!accessRef.current?.allowed) {
1617
+ setCapture({ state: "idle" });
1618
+ return;
1619
+ }
1617
1620
  const next = await specOverlayFetchJson(specOverlayStatusPath()).catch(() => null);
1618
1621
  if (next && next.matched && next.live_source === "viewer" && next.finished_at !== before) {
1619
1622
  setStatus(next);
@@ -1635,8 +1638,9 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1635
1638
  };
1636
1639
  }, [open, status && status.matched ? status.target_id : null]);
1637
1640
  if (automated || !access?.allowed) return null;
1638
- const badgeLabel = status && status.matched ? `${Math.round(status.mismatch_pct)}%` : status ? "\u2014" : void 0;
1639
- const badgeTone = status && status.matched ? status.passed ? "default" : "danger" : "default";
1641
+ const hasScore = status && status.matched && typeof status.mismatch_pct === "number";
1642
+ const badgeLabel = hasScore ? `${Math.round(status.mismatch_pct)}%` : status ? "\u2014" : void 0;
1643
+ const badgeTone = hasScore ? status && status.matched && status.passed ? "default" : "danger" : "default";
1640
1644
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1641
1645
  /* @__PURE__ */ jsxRuntime.jsxs(
1642
1646
  "button",
@@ -1653,7 +1657,7 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1653
1657
  {
1654
1658
  className: [
1655
1659
  "absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-normal leading-none text-[#FFFFFF]",
1656
- status && status.matched ? status.passed ? "bg-[color:var(--chrome-success,#2f855a)]" : "bg-[color:var(--chrome-danger)]" : "bg-[color:var(--muted)]"
1660
+ hasScore ? status && status.matched && status.passed ? "bg-[color:var(--chrome-success,#2f855a)]" : "bg-[color:var(--chrome-danger)]" : "bg-[color:var(--muted)]"
1657
1661
  ].join(" "),
1658
1662
  children: badgeLabel
1659
1663
  }