@parallelworks/tandem-web 0.171.2 → 0.171.3

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.
@@ -1,70 +1,70 @@
1
1
  import { externalUrl as e } from "../lib/externalUrl.js";
2
2
  import { Link as t } from "../lib/router.js";
3
3
  import { CheckIcon as n, FileTextIcon as r, PullRequestIcon as i } from "./icons.js";
4
- import { ProgressBar as a, Table as o } from "@parallelworks/ui";
5
- import { useFormatter as s, useLocale as c, useTranslations as l } from "use-intl";
6
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
4
+ import { ProgressBar as a, Table as o, Tooltip as s } from "@parallelworks/ui";
5
+ import { useFormatter as c, useLocale as l, useTranslations as u } from "use-intl";
6
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
7
  // src/components/Widgets.tsx
8
- var f = (...e) => e.filter(Boolean).join(" ");
9
- function p({ workspace: e, widgets: t }) {
10
- return t.length === 0 ? null : /* @__PURE__ */ u("div", {
8
+ var p = (...e) => e.filter(Boolean).join(" ");
9
+ function m({ workspace: e, widgets: t }) {
10
+ return t.length === 0 ? null : /* @__PURE__ */ d("div", {
11
11
  className: "mt-2 space-y-3",
12
- children: t.map((t, n) => /* @__PURE__ */ d("figure", {
12
+ children: t.map((t, n) => /* @__PURE__ */ f("figure", {
13
13
  className: "min-w-0",
14
- children: [t.title && /* @__PURE__ */ u("figcaption", {
14
+ children: [t.title && /* @__PURE__ */ d("figcaption", {
15
15
  className: "mb-1 text-xs font-medium text-muted-foreground",
16
16
  children: t.title
17
- }), /* @__PURE__ */ u(m, {
17
+ }), /* @__PURE__ */ d(h, {
18
18
  workspace: e,
19
19
  widget: t
20
20
  })]
21
21
  }, n))
22
22
  });
23
23
  }
24
- function m({ workspace: e, widget: t }) {
24
+ function h({ workspace: e, widget: t }) {
25
25
  switch (t.type) {
26
- case "table": return /* @__PURE__ */ u(h, {
26
+ case "table": return /* @__PURE__ */ d(g, {
27
27
  columns: t.columns ?? [],
28
28
  rows: (t.rows ?? []).map((e) => e ?? [])
29
29
  });
30
- case "chart": return /* @__PURE__ */ u(_, {
30
+ case "chart": return /* @__PURE__ */ d(v, {
31
31
  kind: t.chart === "line" ? "line" : "bar",
32
32
  labels: t.labels ?? [],
33
33
  series: t.series ?? []
34
34
  });
35
- case "diff": return /* @__PURE__ */ u(v, {
35
+ case "diff": return /* @__PURE__ */ d(y, {
36
36
  path: t.path ?? "",
37
37
  patch: t.patch ?? ""
38
38
  });
39
- case "files": return /* @__PURE__ */ u(y, { files: t.files ?? [] });
40
- case "tests": return /* @__PURE__ */ u(b, { widget: t });
41
- case "checklist": return /* @__PURE__ */ u(x, { checks: t.checks ?? [] });
42
- case "progress": return /* @__PURE__ */ u(S, {
39
+ case "files": return /* @__PURE__ */ d(b, { files: t.files ?? [] });
40
+ case "tests": return /* @__PURE__ */ d(x, { widget: t });
41
+ case "checklist": return /* @__PURE__ */ d(S, { checks: t.checks ?? [] });
42
+ case "progress": return /* @__PURE__ */ d(C, {
43
43
  value: t.value ?? 0,
44
44
  max: t.max ?? 1,
45
45
  title: t.title
46
46
  });
47
- case "links": return /* @__PURE__ */ u(C, {
47
+ case "links": return /* @__PURE__ */ d(w, {
48
48
  workspace: e,
49
49
  links: t.links ?? []
50
50
  });
51
51
  default: return null;
52
52
  }
53
53
  }
54
- function h({ columns: e, rows: t }) {
55
- return /* @__PURE__ */ d(o, {
54
+ function g({ columns: e, rows: t }) {
55
+ return /* @__PURE__ */ f(o, {
56
56
  density: "compact",
57
57
  borderless: !0,
58
58
  panel: !1,
59
59
  tbodyClassName: "divide-y divide-border",
60
60
  wrapperClassName: "rounded-md border border-border",
61
- children: [e.map((e, t) => /* @__PURE__ */ u(o.Header, {
61
+ children: [e.map((e, t) => /* @__PURE__ */ d(o.Header, {
62
62
  caps: !1,
63
63
  children: e
64
- }, t)), t.map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u(o.Item, { children: e }, t)) }, t))]
64
+ }, t)), t.map((e, t) => /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d(o.Item, { children: e }, t)) }, t))]
65
65
  });
66
66
  }
67
- var g = [
67
+ var _ = [
68
68
  "text-primary",
69
69
  "text-agent",
70
70
  "text-success",
@@ -72,107 +72,109 @@ var g = [
72
72
  "text-danger",
73
73
  "text-muted-foreground"
74
74
  ];
75
- function _({ kind: e, labels: t, series: n }) {
76
- let r = s(), i = l("widgets"), a = n.flatMap((e) => e.values ?? []), o = Math.max(0, ...a), c = Math.min(0, ...a), p = o - c || 1, m = 600 / t.length, h = (e) => 160 - (e - c) / p * 160, _ = m * .7 / n.length;
77
- return /* @__PURE__ */ d("div", {
75
+ function v({ kind: e, labels: t, series: n }) {
76
+ let r = c(), i = u("widgets"), a = n.flatMap((e) => e.values ?? []), o = Math.max(0, ...a), l = Math.min(0, ...a), m = o - l || 1, h = 600 / t.length, g = (e) => 160 - (e - l) / m * 160, v = h * .7 / n.length;
77
+ return /* @__PURE__ */ f("div", {
78
78
  className: "rounded-md border border-border p-3",
79
79
  children: [
80
- /* @__PURE__ */ d("svg", {
80
+ /* @__PURE__ */ f("svg", {
81
81
  viewBox: "0 0 600 160",
82
82
  className: "h-40 w-full",
83
83
  preserveAspectRatio: "none",
84
84
  role: "img",
85
85
  "aria-label": i("chart", { series: n.map((e) => e.name).join(", ") }),
86
- children: [/* @__PURE__ */ u("line", {
86
+ children: [/* @__PURE__ */ d("line", {
87
87
  x1: 0,
88
88
  x2: 600,
89
- y1: h(0),
90
- y2: h(0),
89
+ y1: g(0),
90
+ y2: g(0),
91
91
  className: "stroke-border",
92
92
  strokeWidth: 1
93
- }), n.map((n, i) => /* @__PURE__ */ u("g", {
94
- className: g[i % g.length],
95
- children: e === "bar" ? (n.values ?? []).map((e, a) => /* @__PURE__ */ u("rect", {
96
- x: a * m + m * .15 + i * _,
97
- y: Math.min(h(e), h(0)),
98
- width: _,
99
- height: Math.abs(h(e) - h(0)),
100
- fill: "currentColor",
101
- children: /* @__PURE__ */ u("title", { children: `${n.name}, ${t[a]}: ${r.number(e)}` })
102
- }, a)) : /* @__PURE__ */ u("polyline", {
93
+ }), n.map((n, i) => /* @__PURE__ */ d("g", {
94
+ className: _[i % _.length],
95
+ children: e === "bar" ? (n.values ?? []).map((e, a) => /* @__PURE__ */ d(s, {
96
+ content: `${n.name}, ${t[a]}: ${r.number(e)}`,
97
+ children: /* @__PURE__ */ d("rect", {
98
+ x: a * h + h * .15 + i * v,
99
+ y: Math.min(g(e), g(0)),
100
+ width: v,
101
+ height: Math.abs(g(e) - g(0)),
102
+ fill: "currentColor"
103
+ })
104
+ }, a)) : /* @__PURE__ */ d("polyline", {
103
105
  fill: "none",
104
106
  stroke: "currentColor",
105
107
  strokeWidth: 2,
106
108
  vectorEffect: "non-scaling-stroke",
107
- points: (n.values ?? []).map((e, t) => `${t * m + m / 2},${h(e)}`).join(" ")
109
+ points: (n.values ?? []).map((e, t) => `${t * h + h / 2},${g(e)}`).join(" ")
108
110
  })
109
111
  }, n.name))]
110
112
  }),
111
- /* @__PURE__ */ u("div", {
113
+ /* @__PURE__ */ d("div", {
112
114
  className: "mt-1 flex justify-between gap-1 text-[11px] text-muted-foreground",
113
- children: t.map((e, t) => /* @__PURE__ */ u("span", {
115
+ children: t.map((e, t) => /* @__PURE__ */ d("span", {
114
116
  className: "min-w-0 flex-1 truncate text-center",
115
117
  children: e
116
118
  }, t))
117
119
  }),
118
- n.length > 1 && /* @__PURE__ */ u("ul", {
120
+ n.length > 1 && /* @__PURE__ */ d("ul", {
119
121
  className: "mt-2 flex flex-wrap gap-3 text-xs",
120
- children: n.map((e, t) => /* @__PURE__ */ d("li", {
122
+ children: n.map((e, t) => /* @__PURE__ */ f("li", {
121
123
  className: "flex items-center gap-1.5",
122
- children: [/* @__PURE__ */ u("span", { className: f("size-2 rounded-sm bg-current", g[t % g.length]) }), e.name]
124
+ children: [/* @__PURE__ */ d("span", { className: p("size-2 rounded-sm bg-current", _[t % _.length]) }), e.name]
123
125
  }, e.name))
124
126
  })
125
127
  ]
126
128
  });
127
129
  }
128
- function v({ path: e, patch: t }) {
130
+ function y({ path: e, patch: t }) {
129
131
  let n = t.replace(/\n$/, "").split("\n");
130
- return /* @__PURE__ */ d("div", {
132
+ return /* @__PURE__ */ f("div", {
131
133
  className: "overflow-hidden rounded-md border border-border",
132
- children: [e && /* @__PURE__ */ d("div", {
134
+ children: [e && /* @__PURE__ */ f("div", {
133
135
  className: "flex items-center gap-1.5 border-b border-border bg-muted px-3 py-1.5 font-mono text-xs",
134
- children: [/* @__PURE__ */ u(r, { className: "size-3.5 text-muted-foreground" }), e]
135
- }), /* @__PURE__ */ u("pre", {
136
+ children: [/* @__PURE__ */ d(r, { className: "size-3.5 text-muted-foreground" }), e]
137
+ }), /* @__PURE__ */ d("pre", {
136
138
  className: "max-h-96 overflow-auto py-1 font-mono text-xs leading-5",
137
- children: n.map((e, t) => /* @__PURE__ */ u("div", {
138
- className: f("px-3 whitespace-pre", e.startsWith("+") && "bg-success/10 text-success", e.startsWith("-") && "bg-danger/10 text-danger", e.startsWith("@@") && "text-muted-foreground"),
139
+ children: n.map((e, t) => /* @__PURE__ */ d("div", {
140
+ className: p("px-3 whitespace-pre", e.startsWith("+") && "bg-success/10 text-success", e.startsWith("-") && "bg-danger/10 text-danger", e.startsWith("@@") && "text-muted-foreground"),
139
141
  children: e || " "
140
142
  }, t))
141
143
  })]
142
144
  });
143
145
  }
144
- function y({ files: e }) {
145
- let t = l("widgets"), n = [...e].sort((e, t) => e.path.localeCompare(t.path));
146
- return /* @__PURE__ */ u("ul", {
146
+ function b({ files: e }) {
147
+ let t = u("widgets"), n = [...e].sort((e, t) => e.path.localeCompare(t.path));
148
+ return /* @__PURE__ */ d("ul", {
147
149
  className: "rounded-md border border-border py-1 font-mono text-xs",
148
150
  children: n.map((e) => {
149
151
  let n = e.path.split("/");
150
- return /* @__PURE__ */ d("li", {
152
+ return /* @__PURE__ */ f("li", {
151
153
  className: "flex items-center gap-2 px-3 py-0.5",
152
- children: [/* @__PURE__ */ d("span", {
154
+ children: [/* @__PURE__ */ f("span", {
153
155
  style: { paddingLeft: `${(n.length - 1) * 12}px` },
154
156
  className: "min-w-0 truncate",
155
157
  children: [
156
- /* @__PURE__ */ u("span", {
158
+ /* @__PURE__ */ d("span", {
157
159
  className: "text-muted-foreground",
158
160
  children: n.slice(0, -1).join("/")
159
161
  }),
160
- n.length > 1 && /* @__PURE__ */ u("span", {
162
+ n.length > 1 && /* @__PURE__ */ d("span", {
161
163
  className: "text-muted-foreground",
162
164
  children: "/"
163
165
  }),
164
166
  n.at(-1)
165
167
  ]
166
- }), e.change && /* @__PURE__ */ u("span", {
167
- className: f("ml-auto shrink-0 font-sans text-[11px]", e.change === "added" && "text-success", e.change === "removed" && "text-danger", e.change === "changed" && "text-warning"),
168
+ }), e.change && /* @__PURE__ */ d("span", {
169
+ className: p("ml-auto shrink-0 font-sans text-[11px]", e.change === "added" && "text-success", e.change === "removed" && "text-danger", e.change === "changed" && "text-warning"),
168
170
  children: t(`change.${e.change}`)
169
171
  })]
170
172
  }, e.path);
171
173
  })
172
174
  });
173
175
  }
174
- function b({ widget: e }) {
175
- let t = l("widgets"), n = [
176
+ function x({ widget: e }) {
177
+ let t = u("widgets"), n = [
176
178
  {
177
179
  key: "passed",
178
180
  n: e.passed,
@@ -189,51 +191,51 @@ function b({ widget: e }) {
189
191
  tone: "text-muted-foreground"
190
192
  }
191
193
  ];
192
- return /* @__PURE__ */ d("div", {
194
+ return /* @__PURE__ */ f("div", {
193
195
  className: "rounded-md border border-border px-3 py-2",
194
- children: [/* @__PURE__ */ u("p", {
196
+ children: [/* @__PURE__ */ d("p", {
195
197
  className: "flex flex-wrap gap-4 text-sm",
196
- children: n.map((e) => e.n !== void 0 && /* @__PURE__ */ u("span", {
198
+ children: n.map((e) => e.n !== void 0 && /* @__PURE__ */ d("span", {
197
199
  className: e.tone,
198
200
  children: t(`tests.${e.key}`, { count: e.n })
199
201
  }, e.key))
200
- }), (e.failures ?? []).length > 0 && /* @__PURE__ */ u("ul", {
202
+ }), (e.failures ?? []).length > 0 && /* @__PURE__ */ d("ul", {
201
203
  className: "mt-2 space-y-1 text-xs",
202
- children: (e.failures ?? []).map((e) => /* @__PURE__ */ d("li", { children: [/* @__PURE__ */ u("span", {
204
+ children: (e.failures ?? []).map((e) => /* @__PURE__ */ f("li", { children: [/* @__PURE__ */ d("span", {
203
205
  className: "font-mono text-danger",
204
206
  children: e.name
205
- }), e.output && /* @__PURE__ */ u("pre", {
207
+ }), e.output && /* @__PURE__ */ d("pre", {
206
208
  className: "mt-0.5 whitespace-pre-wrap text-muted-foreground",
207
209
  children: e.output
208
210
  })] }, e.name))
209
211
  })]
210
212
  });
211
213
  }
212
- function x({ checks: e }) {
213
- let t = l("widgets"), r = e.filter((e) => e.done).length;
214
- return /* @__PURE__ */ d("div", {
214
+ function S({ checks: e }) {
215
+ let t = u("widgets"), r = e.filter((e) => e.done).length;
216
+ return /* @__PURE__ */ f("div", {
215
217
  className: "rounded-md border border-border px-3 py-2",
216
- children: [/* @__PURE__ */ u("p", {
218
+ children: [/* @__PURE__ */ d("p", {
217
219
  className: "mb-1 text-xs text-muted-foreground",
218
220
  children: t("checked", {
219
221
  done: r,
220
222
  count: e.length
221
223
  })
222
- }), /* @__PURE__ */ u("ul", {
224
+ }), /* @__PURE__ */ d("ul", {
223
225
  className: "space-y-1 text-sm",
224
- children: e.map((e, r) => /* @__PURE__ */ d("li", {
226
+ children: e.map((e, r) => /* @__PURE__ */ f("li", {
225
227
  className: "flex items-start gap-2",
226
228
  children: [
227
- /* @__PURE__ */ u("span", {
228
- className: f("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border", e.done ? "border-success bg-success text-background" : "border-border"),
229
+ /* @__PURE__ */ d("span", {
230
+ className: p("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border", e.done ? "border-success bg-success text-background" : "border-border"),
229
231
  "aria-hidden": "true",
230
- children: e.done && /* @__PURE__ */ u(n, { className: "size-3" })
232
+ children: e.done && /* @__PURE__ */ d(n, { className: "size-3" })
231
233
  }),
232
- /* @__PURE__ */ u("span", {
233
- className: f(e.done && "text-muted-foreground line-through"),
234
+ /* @__PURE__ */ d("span", {
235
+ className: p(e.done && "text-muted-foreground line-through"),
234
236
  children: e.text
235
237
  }),
236
- /* @__PURE__ */ u("span", {
238
+ /* @__PURE__ */ d("span", {
237
239
  className: "sr-only",
238
240
  children: e.done ? t("done") : t("notDone")
239
241
  })
@@ -242,9 +244,9 @@ function x({ checks: e }) {
242
244
  })]
243
245
  });
244
246
  }
245
- function S({ value: e, max: t, title: n }) {
246
- let r = l("widgets"), i = c();
247
- return /* @__PURE__ */ u(a, {
247
+ function C({ value: e, max: t, title: n }) {
248
+ let r = u("widgets"), i = l();
249
+ return /* @__PURE__ */ d(a, {
248
250
  value: Math.min(Math.max(e, 0), t),
249
251
  max: t,
250
252
  size: "lg",
@@ -253,31 +255,31 @@ function S({ value: e, max: t, title: n }) {
253
255
  "aria-label": n || r("progress")
254
256
  });
255
257
  }
256
- function C({ workspace: n, links: r }) {
257
- let a = l("widgets"), o = "inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs hover:bg-muted";
258
- return /* @__PURE__ */ u("ul", {
258
+ function w({ workspace: n, links: r }) {
259
+ let a = u("widgets"), o = "inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs hover:bg-muted";
260
+ return /* @__PURE__ */ d("ul", {
259
261
  className: "flex flex-wrap gap-1.5",
260
- children: r.map((r) => /* @__PURE__ */ u("li", { children: r.kind === "issue" ? /* @__PURE__ */ d(t, {
262
+ children: r.map((r) => /* @__PURE__ */ d("li", { children: r.kind === "issue" ? /* @__PURE__ */ f(t, {
261
263
  to: "/$workspace/issues/$identifier",
262
264
  params: {
263
265
  workspace: n,
264
266
  identifier: r.ref
265
267
  },
266
268
  className: o,
267
- children: [/* @__PURE__ */ u("span", {
269
+ children: [/* @__PURE__ */ d("span", {
268
270
  className: "text-muted-foreground",
269
271
  children: r.ref
270
272
  }), r.label]
271
- }) : r.kind === "pullRequest" ? /* @__PURE__ */ d("a", {
273
+ }) : r.kind === "pullRequest" ? /* @__PURE__ */ f("a", {
272
274
  href: e(r.ref),
273
275
  target: "_blank",
274
276
  rel: "noopener noreferrer",
275
277
  className: o,
276
- children: [/* @__PURE__ */ u(i, { className: "size-3.5 text-muted-foreground" }), r.label || a("pullRequest")]
277
- }) : /* @__PURE__ */ u("span", {
278
+ children: [/* @__PURE__ */ d(i, { className: "size-3.5 text-muted-foreground" }), r.label || a("pullRequest")]
279
+ }) : /* @__PURE__ */ d("span", {
278
280
  className: o,
279
281
  children: r.label || a("run")
280
282
  }) }, `${r.kind}:${r.ref}`))
281
283
  });
282
284
  }
283
- export { p as Widgets };
285
+ export { m as Widgets };
package/lib/triageSeen.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/lib/triageSeen.ts
2
2
  function e(e, t) {
3
- return t.failed ? !0 : t.data !== void 0 && !t.data.includes(e);
3
+ return t.data?.includes(e) ?? !1;
4
4
  }
5
- export { e as unseen };
5
+ export { e as hasOpened };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.171.2",
3
+ "version": "0.171.3",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",