@parallelworks/tandem-web 0.178.0 → 0.178.1

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.
@@ -21,7 +21,7 @@ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
21
21
  import { useQuery as H, useQueryClient as U, useSuspenseQuery as le } from "@tanstack/react-query";
22
22
  import { ListFilterMenu as ue, useListView as W } from "@parallelworks/ui/list";
23
23
  // src/routes/$workspace/notifications.tsx?tsr-split=component
24
- var G = (...e) => e.filter(Boolean).join(" ");
24
+ var G = (...e) => e.filter(Boolean).join(" "), K = (e) => e.runnerName && e.reason === "run_finished" ? "run_finished_on" : e.runnerName && e.reason === "run_stopped" ? "run_stopped_on" : e.reason;
25
25
  function de(e, t) {
26
26
  let n = /* @__PURE__ */ new Map();
27
27
  for (let r of t) {
@@ -42,7 +42,7 @@ function de(e, t) {
42
42
  }
43
43
  return [...n.values()];
44
44
  }
45
- var K = {
45
+ var q = {
46
46
  decisions: ["decision_requested"],
47
47
  assigned: ["assigned"],
48
48
  comments: ["commented"],
@@ -51,7 +51,7 @@ var K = {
51
51
  updates: ["update_posted"],
52
52
  reminders: ["reminder"],
53
53
  mentions: ["mentioned"]
54
- }, q = (e) => e.reason === "reminder" && e.excerpt ? /* @__PURE__ */ new Date(`${e.excerpt}T00:00:00`) : /* @__PURE__ */ new Date(0), J = (e) => e.slice(0, e.lastIndexOf("-"));
54
+ }, J = (e) => e.reason === "reminder" && e.excerpt ? /* @__PURE__ */ new Date(`${e.excerpt}T00:00:00`) : /* @__PURE__ */ new Date(0), Y = (e) => e.slice(0, e.lastIndexOf("-"));
55
55
  function fe(e, t) {
56
56
  let n = R("notifications"), r = L(() => {
57
57
  let e = [{
@@ -65,11 +65,11 @@ function fe(e, t) {
65
65
  }, {
66
66
  key: "kind",
67
67
  label: n("kind"),
68
- options: Object.keys(K).map((e) => ({
68
+ options: Object.keys(q).map((e) => ({
69
69
  value: e,
70
70
  label: n(`kinds.${e}`)
71
71
  })),
72
- matches: (e, t) => t.some((t) => K[t].includes(e.reason))
72
+ matches: (e, t) => t.some((t) => q[t].includes(e.reason))
73
73
  }], r = t.filter((e) => !e.archivedAt);
74
74
  return r.length > 1 && e.push({
75
75
  key: "team",
@@ -78,7 +78,7 @@ function fe(e, t) {
78
78
  value: e.key,
79
79
  label: e.name
80
80
  })),
81
- matches: (e, t) => !!e.identifier && t.includes(J(e.identifier))
81
+ matches: (e, t) => !!e.identifier && t.includes(Y(e.identifier))
82
82
  }), e;
83
83
  }, [n, t]);
84
84
  return W({
@@ -87,11 +87,11 @@ function fe(e, t) {
87
87
  facets: r
88
88
  });
89
89
  }
90
- function Y() {
90
+ function pe() {
91
91
  let { workspace: e } = D.useParams(), { issue: t } = D.useSearch(), i = R("notifications"), a = ie(), { data: { notifications: o, unread: c } } = le(n(e));
92
92
  re(c > 0 ? `${i("title")} (${c})` : i("title"));
93
93
  let u = te(e), d = ne(e), p = ee(e), { data: m = [] } = H(r(e)), h = fe(e, m), g = h.activeFilterCount > 0, _ = (h.filters.state ?? []).includes("unread"), v = h.filters.kind ?? [], y = h.filters.team ?? [], b = L(() => {
94
- let n = o.filter((e) => (v.length === 0 || v.some((t) => K[t]?.includes(e.reason))) && (y.length === 0 || !!e.identifier && y.includes(J(e.identifier))));
94
+ let n = o.filter((e) => (v.length === 0 || v.some((t) => q[t]?.includes(e.reason))) && (y.length === 0 || !!e.identifier && y.includes(Y(e.identifier))));
95
95
  return de(e, n).filter((e) => !_ || e.unread.length > 0 || e.key === t);
96
96
  }, [
97
97
  e,
@@ -124,17 +124,17 @@ function Y() {
124
124
  }, W = (e, t) => {
125
125
  let n = b.indexOf(t);
126
126
  e.metaKey || e.ctrlKey ? (I(t), T.current = n) : e.shiftKey ? U(T.current ?? (x >= 0 ? x : n), n) : (w(/* @__PURE__ */ new Set()), T.current = n, O(t));
127
- }, q = (e, t) => {
127
+ }, K = (e, t) => {
128
128
  let n = Math.min(Math.max(x + e, 0), b.length - 1);
129
129
  t && ((T.current === null || C.size === 0) && (T.current = Math.max(x, 0)), U(T.current, n)), O(b[n]);
130
130
  };
131
131
  ae({
132
- j: () => q(1, !1),
133
- k: () => q(-1, !1),
134
- J: () => q(1, !0),
135
- K: () => q(-1, !0),
136
- ArrowDown: (e) => q(1, e.shiftKey),
137
- ArrowUp: (e) => q(-1, e.shiftKey),
132
+ j: () => K(1, !1),
133
+ k: () => K(-1, !1),
134
+ J: () => K(1, !0),
135
+ K: () => K(-1, !0),
136
+ ArrowDown: (e) => K(1, e.shiftKey),
137
+ ArrowUp: (e) => K(-1, e.shiftKey),
138
138
  x: () => {
139
139
  S && (I(S), T.current = x);
140
140
  },
@@ -145,7 +145,7 @@ function Y() {
145
145
  }), oe(() => {
146
146
  document.getElementById(`inbox-${S?.key}`)?.scrollIntoView({ block: "nearest" });
147
147
  }, [S]);
148
- let Y = {
148
+ let J = {
149
149
  select: O,
150
150
  toggleRead: A,
151
151
  archiveGroups: N,
@@ -271,14 +271,14 @@ function Y() {
271
271
  group: t,
272
272
  selected: t === S,
273
273
  picked: C.has(t.key),
274
- actions: Y
274
+ actions: J
275
275
  }, t.key))
276
276
  }), /* @__PURE__ */ B("div", {
277
277
  className: G("min-w-0 flex-1 overflow-y-auto md:block", S ? "block" : "hidden"),
278
- children: S ? /* @__PURE__ */ B(ge, {
278
+ children: S ? /* @__PURE__ */ B(_e, {
279
279
  workspace: e,
280
280
  group: S,
281
- actions: Y
281
+ actions: J
282
282
  }) : /* @__PURE__ */ B("div", {
283
283
  className: "px-6 py-24",
284
284
  children: /* @__PURE__ */ B(j, {
@@ -355,7 +355,7 @@ function Q({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
355
355
  actor: d.actor,
356
356
  name: f,
357
357
  src: s(d.actor.kind, d.actor.handle),
358
- badge: pe(d)
358
+ badge: me(d)
359
359
  })
360
360
  }),
361
361
  /* @__PURE__ */ V("span", {
@@ -373,11 +373,12 @@ function Q({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
373
373
  className: "mt-0.5 flex gap-2 text-xs text-muted-foreground",
374
374
  children: [/* @__PURE__ */ V("span", {
375
375
  className: "flex-1 truncate",
376
- children: [o(d.reason, {
376
+ children: [o(K(d), {
377
377
  actor: f,
378
378
  agent: d.agentName ?? f,
379
- date: q(d)
380
- }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(ve, { text: d.excerpt })] })]
379
+ runner: d.runnerName ?? "",
380
+ date: J(d)
381
+ }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(ye, { text: d.excerpt })] })]
381
382
  }), t.items.length > 1 && /* @__PURE__ */ B("span", {
382
383
  className: "shrink-0",
383
384
  children: o("more", { count: t.items.length - 1 })
@@ -407,7 +408,7 @@ function Q({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
407
408
  })
408
409
  });
409
410
  }
410
- function pe(e) {
411
+ function me(e) {
411
412
  switch (e.reason) {
412
413
  case "assigned": return /* @__PURE__ */ B(g, {});
413
414
  case "commented":
@@ -416,7 +417,7 @@ function pe(e) {
416
417
  default: return null;
417
418
  }
418
419
  }
419
- function me({ workspace: e, identifier: n }) {
420
+ function he({ workspace: e, identifier: n }) {
420
421
  let { data: r } = H(t(e, n)), i = _(), { nameOf: a, avatarOf: s } = w(e);
421
422
  return r ? /* @__PURE__ */ V("section", {
422
423
  className: "mt-5 rounded-lg border border-border px-4 py-3",
@@ -454,7 +455,7 @@ function me({ workspace: e, identifier: n }) {
454
455
  })]
455
456
  }) : null;
456
457
  }
457
- function he({ workspace: e, identifier: r }) {
458
+ function ge({ workspace: e, identifier: r }) {
458
459
  let i = U(), { data: a } = H(t(e, r));
459
460
  return a ? /* @__PURE__ */ B(y, {
460
461
  workspace: e,
@@ -462,7 +463,7 @@ function he({ workspace: e, identifier: r }) {
462
463
  onDecided: () => i.invalidateQueries({ queryKey: n(e).queryKey })
463
464
  }) : null;
464
465
  }
465
- function ge({ workspace: e, group: n, actions: r }) {
466
+ function _e({ workspace: e, group: n, actions: r }) {
466
467
  let i = R("notifications"), { avatarOf: a } = w(e), o = Z(e), s = I(), c = X(r), { data: l } = H({
467
468
  ...t(e, n.identifier ?? ""),
468
469
  enabled: !!n.identifier
@@ -512,16 +513,16 @@ function ge({ workspace: e, group: n, actions: r }) {
512
513
  onClick: () => r.archiveGroups([n]),
513
514
  children: i("archive")
514
515
  }),
515
- n.identifier && /* @__PURE__ */ B(he, {
516
+ n.identifier && /* @__PURE__ */ B(ge, {
516
517
  workspace: e,
517
518
  identifier: n.identifier
518
519
  })
519
520
  ]
520
521
  }),
521
- n.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(me, {
522
+ n.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(he, {
522
523
  workspace: e,
523
524
  identifier: n.identifier
524
- }), /* @__PURE__ */ B(ye, {
525
+ }), /* @__PURE__ */ B(be, {
525
526
  workspace: e,
526
527
  identifier: n.identifier
527
528
  })] }),
@@ -552,10 +553,11 @@ function ge({ workspace: e, group: n, actions: r }) {
552
553
  className: "flex items-baseline gap-2 text-sm",
553
554
  children: [/* @__PURE__ */ B("span", {
554
555
  className: G("flex-1", !t.readAt && "font-medium"),
555
- children: i(t.reason, {
556
+ children: i(K(t), {
556
557
  actor: n,
557
558
  agent: t.agentName ?? n,
558
- date: q(t)
559
+ runner: t.runnerName ?? "",
560
+ date: J(t)
559
561
  })
560
562
  }), /* @__PURE__ */ B(N, {
561
563
  value: t.createdAt,
@@ -563,7 +565,7 @@ function ge({ workspace: e, group: n, actions: r }) {
563
565
  exact: "medium",
564
566
  className: "text-xs text-muted-foreground"
565
567
  })]
566
- }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(_e, { text: t.excerpt })]
568
+ }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(ve, { text: t.excerpt })]
567
569
  })]
568
570
  }, t.id);
569
571
  })
@@ -571,7 +573,7 @@ function ge({ workspace: e, group: n, actions: r }) {
571
573
  ]
572
574
  });
573
575
  }
574
- function _e({ text: e }) {
576
+ function ve({ text: e }) {
575
577
  let t = R("agentWork"), n = x(e);
576
578
  return n ? /* @__PURE__ */ V("div", {
577
579
  className: "mt-1 min-w-0 text-sm text-muted-foreground",
@@ -594,14 +596,14 @@ function _e({ text: e }) {
594
596
  })
595
597
  });
596
598
  }
597
- function ve({ text: e }) {
599
+ function ye({ text: e }) {
598
600
  let t = x(e);
599
601
  return t ? /* @__PURE__ */ B("code", {
600
602
  className: "font-mono",
601
603
  children: t.command
602
604
  }) : T(e);
603
605
  }
604
- function ye({ workspace: t, identifier: n }) {
606
+ function be({ workspace: t, identifier: n }) {
605
607
  let r = R("notifications"), { data: i = [] } = H(e(t, n)), o = i.filter((e) => !e.answer && !e.canceled);
606
608
  return o.length === 0 ? null : /* @__PURE__ */ V("section", {
607
609
  "aria-label": r("waitingOnYou"),
@@ -625,4 +627,4 @@ function $({ group: e, strong: t = !1 }) {
625
627
  children: [e.kind === "doc" ? /* @__PURE__ */ B(d, { className: "size-3" }) : /* @__PURE__ */ B(m, { className: "size-3" }), n(e.kind === "doc" ? "aboutDoc" : "aboutProject")]
626
628
  });
627
629
  }
628
- export { Y as component };
630
+ export { pe as component };