iterate-ui-overlay 0.1.0 → 0.1.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.
package/dist/index.js CHANGED
@@ -1150,8 +1150,10 @@ var dark = {
1150
1150
  buttonText: "#1e1e1e"
1151
1151
  };
1152
1152
  function luminance(color) {
1153
- const m = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
1153
+ const m = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)/);
1154
1154
  if (!m) return null;
1155
+ const alpha = m[4] !== void 0 ? Number(m[4]) : 1;
1156
+ if (alpha < 0.1) return null;
1155
1157
  const [r, g, b] = [Number(m[1]) / 255, Number(m[2]) / 255, Number(m[3]) / 255];
1156
1158
  const lin = (c) => c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
1157
1159
  return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
@@ -1173,8 +1175,9 @@ function detectDark(doc) {
1173
1175
  if (bodyScheme === "dark") return true;
1174
1176
  if (bodyScheme === "light") return false;
1175
1177
  }
1176
- if (body) {
1177
- const bg = targetDoc.defaultView?.getComputedStyle(body).backgroundColor ?? "";
1178
+ for (const el of [body, html]) {
1179
+ if (!el) continue;
1180
+ const bg = targetDoc.defaultView?.getComputedStyle(el).backgroundColor ?? "";
1178
1181
  const lum = luminance(bg);
1179
1182
  if (lum !== null && lum < 0.2) return true;
1180
1183
  if (lum !== null && lum > 0.8) return false;
@@ -2669,7 +2672,8 @@ var DaemonConnection = class {
2669
2672
  ...this._iterations,
2670
2673
  [msg.payload.name]: {
2671
2674
  ...this._iterations[msg.payload.name],
2672
- status: msg.payload.status
2675
+ status: msg.payload.status,
2676
+ ...msg.payload.error ? { error: msg.payload.error } : {}
2673
2677
  }
2674
2678
  };
2675
2679
  changed = true;
@@ -3996,7 +4000,7 @@ function FloatingPanel({
3996
4000
  {
3997
4001
  active: isActive,
3998
4002
  badgeCount,
3999
- title: `${name} worktree`,
4003
+ title: info?.error ? `${name}: ${info.error}` : `${name} worktree`,
4000
4004
  onClick: () => onIterationChange?.(name),
4001
4005
  children: [
4002
4006
  /* @__PURE__ */ jsx9(