@parallelworks/tandem-web 0.185.0 → 0.186.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.
@@ -2,26 +2,27 @@ import { issueDecisionsQuery as e, issueQuery as t, notificationsQuery as n, tea
2
2
  import { ActorAvatar as i } from "../../components/ActorAvatar.js";
3
3
  import { DecisionCard as a } from "../../components/AgentWork.js";
4
4
  import { Editor as o } from "../../components/Editor.js";
5
- import { ArchiveIcon as s, ArrowRightIcon as c, CheckIcon as l, CommentIcon as u, FileTextIcon as d, InboxIcon as f, PriorityIcon as p, ProjectIcon as m, StatusIcon as h, UserIcon as g, usePriorityNames as _ } from "../../components/icons.js";
6
- import { PersonHoverCard as v } from "../../components/PersonHoverCard.js";
7
- import { TriageButtons as y, useCanDecideTriage as b } from "../../components/TriageButtons.js";
8
- import { parseApproval as x } from "../../lib/approval.js";
9
- import { copyItem as S, useLinkItems as C } from "../../lib/menus.js";
5
+ import { FavoriteStar as s } from "../../components/FavoriteStar.js";
6
+ import { ArchiveIcon as c, ArrowRightIcon as l, CheckIcon as u, CommentIcon as d, FileTextIcon as f, InboxIcon as p, PriorityIcon as m, ProjectIcon as h, StatusIcon as g, UserIcon as _, usePriorityNames as v } from "../../components/icons.js";
7
+ import { PersonHoverCard as y } from "../../components/PersonHoverCard.js";
8
+ import { TriageButtons as b, useCanDecideTriage as x } from "../../components/TriageButtons.js";
9
+ import { parseApproval as S } from "../../lib/approval.js";
10
+ import { copyItem as C, useLinkItems as w } from "../../lib/menus.js";
10
11
  import { useArchiveNotifications as ee, useReadNotifications as te, useUnreadNotifications as ne } from "../../lib/notifications.js";
11
12
  import { usePageTitle as re } from "../../lib/pageTitle.js";
12
- import { usePeople as w } from "../../lib/people.js";
13
- import { plainText as T } from "../../lib/plainText.js";
14
- import { Link as E, useNavigate as ie } from "../../lib/router.js";
13
+ import { usePeople as T } from "../../lib/people.js";
14
+ import { plainText as E } from "../../lib/plainText.js";
15
+ import { Link as D, useNavigate as ie } from "../../lib/router.js";
15
16
  import { useShortcuts as ae } from "../../lib/shortcuts.js";
16
- import { Route as D } from "./notifications.js";
17
- import { Avatar as O, Button as k, Card as A, EmptyState as j, IconButton as M, RelativeTime as N, buttonClasses as P, menuDivider as F, useOpenMenu as I } from "@parallelworks/ui";
18
- import { useEffect as oe, useMemo as L, useRef as se, useState as ce } from "react";
19
- import { useTranslations as R } from "use-intl";
20
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
21
- import { useQuery as H, useQueryClient as U, useSuspenseQuery as le } from "@tanstack/react-query";
22
- import { ListFilterMenu as ue, useListView as W } from "@parallelworks/ui/list";
17
+ import { Route as O } from "./notifications.js";
18
+ import { Avatar as k, Button as A, Card as j, EmptyState as M, IconButton as N, RelativeTime as P, buttonClasses as F, menuDivider as I, useOpenMenu as L } from "@parallelworks/ui";
19
+ import { useEffect as oe, useMemo as R, useRef as se, useState as ce } from "react";
20
+ import { useTranslations as z } from "use-intl";
21
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
22
+ import { useQuery as U, useQueryClient as W, useSuspenseQuery as le } from "@tanstack/react-query";
23
+ import { ListFilterMenu as ue, useListView as G } from "@parallelworks/ui/list";
23
24
  // src/routes/$workspace/notifications.tsx?tsr-split=component
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
+ var K = (...e) => e.filter(Boolean).join(" "), q = (e) => e.runnerName && e.reason === "run_finished" ? "run_finished_on" : e.runnerName && e.reason === "run_stopped" ? "run_stopped_on" : e.reason;
25
26
  function de(e, t) {
26
27
  let n = /* @__PURE__ */ new Map();
27
28
  for (let r of t) {
@@ -42,7 +43,7 @@ function de(e, t) {
42
43
  }
43
44
  return [...n.values()];
44
45
  }
45
- var q = {
46
+ var J = {
46
47
  decisions: ["decision_requested"],
47
48
  assigned: ["assigned"],
48
49
  comments: ["commented"],
@@ -51,9 +52,9 @@ var q = {
51
52
  updates: ["update_posted"],
52
53
  reminders: ["reminder"],
53
54
  mentions: ["mentioned"]
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
+ }, Y = (e) => e.reason === "reminder" && e.excerpt ? /* @__PURE__ */ new Date(`${e.excerpt}T00:00:00`) : /* @__PURE__ */ new Date(0), X = (e) => e.slice(0, e.lastIndexOf("-"));
55
56
  function fe(e, t) {
56
- let n = R("notifications"), r = L(() => {
57
+ let n = z("notifications"), r = R(() => {
57
58
  let e = [{
58
59
  key: "state",
59
60
  label: n("show"),
@@ -65,11 +66,11 @@ function fe(e, t) {
65
66
  }, {
66
67
  key: "kind",
67
68
  label: n("kind"),
68
- options: Object.keys(q).map((e) => ({
69
+ options: Object.keys(J).map((e) => ({
69
70
  value: e,
70
71
  label: n(`kinds.${e}`)
71
72
  })),
72
- matches: (e, t) => t.some((t) => q[t].includes(e.reason))
73
+ matches: (e, t) => t.some((t) => J[t].includes(e.reason))
73
74
  }], r = t.filter((e) => !e.archivedAt);
74
75
  return r.length > 1 && e.push({
75
76
  key: "team",
@@ -78,166 +79,171 @@ function fe(e, t) {
78
79
  value: e.key,
79
80
  label: e.name
80
81
  })),
81
- matches: (e, t) => !!e.identifier && t.includes(Y(e.identifier))
82
+ matches: (e, t) => !!e.identifier && t.includes(X(e.identifier))
82
83
  }), e;
83
84
  }, [n, t]);
84
- return W({
85
+ return G({
85
86
  storageKey: `notifications:${e}`,
86
87
  columns: [],
87
88
  facets: r
88
89
  });
89
90
  }
90
91
  function pe() {
91
- let { workspace: e } = D.useParams(), { issue: t } = D.useSearch(), i = R("notifications"), a = ie(), { data: { notifications: o, unread: c } } = le(n(e));
92
- re(c > 0 ? `${i("title")} (${c})` : i("title"));
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) => q[t]?.includes(e.reason))) && (y.length === 0 || !!e.identifier && y.includes(Y(e.identifier))));
95
- return de(e, n).filter((e) => !_ || e.unread.length > 0 || e.key === t);
92
+ let { workspace: e } = O.useParams(), { issue: t } = O.useSearch(), i = z("notifications"), a = ie(), { data: { notifications: o, unread: l } } = le(n(e));
93
+ re(l > 0 ? `${i("title")} (${l})` : i("title"));
94
+ let d = te(e), f = ne(e), m = ee(e), { data: h = [] } = U(r(e)), g = fe(e, h), _ = g.activeFilterCount > 0, v = (g.filters.state ?? []).includes("unread"), y = g.filters.kind ?? [], b = g.filters.team ?? [], x = R(() => {
95
+ let n = o.filter((e) => (y.length === 0 || y.some((t) => J[t]?.includes(e.reason))) && (b.length === 0 || !!e.identifier && b.includes(X(e.identifier))));
96
+ return de(e, n).filter((e) => !v || e.unread.length > 0 || e.key === t);
96
97
  }, [
97
98
  e,
98
99
  o,
99
- _,
100
100
  v,
101
101
  y,
102
+ b,
102
103
  t
103
- ]), x = b.findIndex((e) => e.key === t), S = x >= 0 ? b[x] : void 0, [C, w] = ce(/* @__PURE__ */ new Set()), T = se(null), E = L(() => b.filter((e) => C.has(e.key)), [b, C]), O = (t) => {
104
+ ]), S = x.findIndex((e) => e.key === t), C = S >= 0 ? x[S] : void 0, [w, T] = ce(/* @__PURE__ */ new Set()), E = se(null), D = R(() => x.filter((e) => w.has(e.key)), [x, w]), k = (t) => {
104
105
  a({
105
106
  to: "/$workspace/notifications",
106
107
  params: { workspace: e },
107
108
  search: t ? { issue: t.key } : {},
108
109
  replace: !0
109
- }), t && t.unread.length > 0 && u.mutate(t.unread);
110
- }, A = (e) => {
110
+ }), t && t.unread.length > 0 && d.mutate(t.unread);
111
+ }, j = (e) => {
111
112
  let t = e.flatMap((e) => e.unread);
112
- t.length > 0 ? u.mutate(t) : d.mutate(e.flatMap((e) => e.items.map((e) => e.id)));
113
- }, N = (e) => {
114
- if (p.mutate(e.flatMap((e) => e.items.map((e) => e.id))), w(/* @__PURE__ */ new Set()), S && e.includes(S)) {
115
- let t = b.filter((t) => !e.includes(t));
116
- O(t[t.findIndex((e) => b.indexOf(e) > x)] ?? t.at(-1));
113
+ t.length > 0 ? d.mutate(t) : f.mutate(e.flatMap((e) => e.items.map((e) => e.id)));
114
+ }, P = (e) => {
115
+ if (m.mutate(e.flatMap((e) => e.items.map((e) => e.id))), T(/* @__PURE__ */ new Set()), C && e.includes(C)) {
116
+ let t = x.filter((t) => !e.includes(t));
117
+ k(t[t.findIndex((e) => x.indexOf(e) > S)] ?? t.at(-1));
117
118
  }
118
- }, P = (e) => a({ to: e.href }), F = E.length > 0 ? E : S ? [S] : [], I = (e) => w((t) => {
119
+ }, F = (e) => a({ to: e.href }), I = D.length > 0 ? D : C ? [C] : [], L = (e) => T((t) => {
119
120
  let n = new Set(t);
120
121
  return n.has(e.key) ? n.delete(e.key) : n.add(e.key), n;
121
- }), U = (e, t) => {
122
+ }), W = (e, t) => {
122
123
  let [n, r] = e < t ? [e, t] : [t, e];
123
- w(new Set(b.slice(n, r + 1).map((e) => e.key)));
124
- }, W = (e, t) => {
125
- let n = b.indexOf(t);
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
- }, K = (e, t) => {
128
- let n = Math.min(Math.max(x + e, 0), b.length - 1);
129
- t && ((T.current === null || C.size === 0) && (T.current = Math.max(x, 0)), U(T.current, n)), O(b[n]);
124
+ T(new Set(x.slice(n, r + 1).map((e) => e.key)));
125
+ }, G = (e, t) => {
126
+ let n = x.indexOf(t);
127
+ e.metaKey || e.ctrlKey ? (L(t), E.current = n) : e.shiftKey ? W(E.current ?? (S >= 0 ? S : n), n) : (T(/* @__PURE__ */ new Set()), E.current = n, k(t));
128
+ }, q = (e, t) => {
129
+ let n = Math.min(Math.max(S + e, 0), x.length - 1);
130
+ t && ((E.current === null || w.size === 0) && (E.current = Math.max(S, 0)), W(E.current, n)), k(x[n]);
130
131
  };
131
132
  ae({
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),
133
+ j: () => q(1, !1),
134
+ k: () => q(-1, !1),
135
+ J: () => q(1, !0),
136
+ K: () => q(-1, !0),
137
+ ArrowDown: (e) => q(1, e.shiftKey),
138
+ ArrowUp: (e) => q(-1, e.shiftKey),
138
139
  x: () => {
139
- S && (I(S), T.current = x);
140
+ C && (L(C), E.current = S);
140
141
  },
141
- Enter: () => S && P(S),
142
- e: () => F.length > 0 && N(F),
143
- u: () => F.length > 0 && A(F),
144
- Escape: () => C.size > 0 ? w(/* @__PURE__ */ new Set()) : O(void 0)
142
+ Enter: () => C && F(C),
143
+ e: () => I.length > 0 && P(I),
144
+ u: () => I.length > 0 && j(I),
145
+ Escape: () => w.size > 0 ? T(/* @__PURE__ */ new Set()) : k(void 0)
145
146
  }), oe(() => {
146
- document.getElementById(`inbox-${S?.key}`)?.scrollIntoView({ block: "nearest" });
147
- }, [S]);
148
- let J = {
149
- select: O,
150
- toggleRead: A,
151
- archiveGroups: N,
152
- openIssue: P,
153
- clickRow: W,
154
- targetsOf: (e) => C.has(e.key) ? E : (w(/* @__PURE__ */ new Set()), [e])
147
+ document.getElementById(`inbox-${C?.key}`)?.scrollIntoView({ block: "nearest" });
148
+ }, [C]);
149
+ let Y = {
150
+ select: k,
151
+ toggleRead: j,
152
+ archiveGroups: P,
153
+ openIssue: F,
154
+ clickRow: G,
155
+ targetsOf: (e) => w.has(e.key) ? D : (T(/* @__PURE__ */ new Set()), [e])
155
156
  };
156
- return /* @__PURE__ */ V("div", {
157
+ return /* @__PURE__ */ H("div", {
157
158
  className: "flex h-full flex-col",
158
159
  children: [
159
- /* @__PURE__ */ V("header", {
160
+ /* @__PURE__ */ H("header", {
160
161
  className: "@container flex min-h-12 shrink-0 flex-wrap items-center gap-2 border-b border-border px-4 py-2 md:px-5",
161
162
  children: [
162
- /* @__PURE__ */ B("h1", {
163
+ /* @__PURE__ */ V("h1", {
163
164
  className: "text-sm font-semibold",
164
165
  children: i("title")
165
166
  }),
166
- /* @__PURE__ */ B("span", {
167
+ /* @__PURE__ */ V(s, {
168
+ workspace: e,
169
+ kind: "page",
170
+ target: "notifications"
171
+ }),
172
+ /* @__PURE__ */ V("span", {
167
173
  className: "min-w-0 flex-1 truncate text-xs text-muted-foreground",
168
- children: i("unreadCount", { count: c })
174
+ children: i("unreadCount", { count: l })
169
175
  }),
170
- /* @__PURE__ */ B(ue, { view: h }),
171
- c > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
176
+ /* @__PURE__ */ V(ue, { view: g }),
177
+ l > 0 && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(A, {
172
178
  type: "button",
173
179
  size: "sm",
174
- loading: u.isPending,
175
- onClick: () => u.mutate(void 0),
180
+ loading: d.isPending,
181
+ onClick: () => d.mutate(void 0),
176
182
  className: "@max-3xl:hidden",
177
183
  children: i("markAllRead")
178
- }), /* @__PURE__ */ B(M, {
179
- icon: /* @__PURE__ */ B(l, {}),
184
+ }), /* @__PURE__ */ V(N, {
185
+ icon: /* @__PURE__ */ V(u, {}),
180
186
  label: i("markAllRead"),
181
187
  size: "sm",
182
- disabled: u.isPending,
183
- onClick: () => u.mutate(void 0),
188
+ disabled: d.isPending,
189
+ onClick: () => d.mutate(void 0),
184
190
  className: "@3xl:hidden"
185
191
  })] }),
186
- b.some((e) => e.unread.length === 0) && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
192
+ x.some((e) => e.unread.length === 0) && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(A, {
187
193
  type: "button",
188
194
  size: "sm",
189
- loading: p.isPending,
190
- onClick: () => p.mutate(void 0),
195
+ loading: m.isPending,
196
+ onClick: () => m.mutate(void 0),
191
197
  className: "@max-3xl:hidden",
192
198
  children: i("archiveRead")
193
- }), /* @__PURE__ */ B(M, {
194
- icon: /* @__PURE__ */ B(s, {}),
199
+ }), /* @__PURE__ */ V(N, {
200
+ icon: /* @__PURE__ */ V(c, {}),
195
201
  label: i("archiveRead"),
196
202
  size: "sm",
197
- disabled: p.isPending,
198
- onClick: () => p.mutate(void 0),
203
+ disabled: m.isPending,
204
+ onClick: () => m.mutate(void 0),
199
205
  className: "@3xl:hidden"
200
206
  })] })
201
207
  ]
202
208
  }),
203
- E.length > 0 && /* @__PURE__ */ V("div", {
209
+ D.length > 0 && /* @__PURE__ */ H("div", {
204
210
  className: "flex min-h-9 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-human-soft px-4 py-1 text-xs md:px-5",
205
211
  children: [
206
- /* @__PURE__ */ B("span", {
212
+ /* @__PURE__ */ V("span", {
207
213
  className: "font-medium text-human",
208
- children: i("selected", { count: E.length })
214
+ children: i("selected", { count: D.length })
209
215
  }),
210
- E.length < b.length && /* @__PURE__ */ B("button", {
216
+ D.length < x.length && /* @__PURE__ */ V("button", {
211
217
  type: "button",
212
- onClick: () => w(new Set(b.map((e) => e.key))),
218
+ onClick: () => T(new Set(x.map((e) => e.key))),
213
219
  className: "hover:underline",
214
- children: i("selectAll", { count: b.length })
220
+ children: i("selectAll", { count: x.length })
215
221
  }),
216
- /* @__PURE__ */ V("div", {
222
+ /* @__PURE__ */ H("div", {
217
223
  className: "ml-auto flex items-center gap-1.5",
218
224
  children: [
219
- /* @__PURE__ */ B(k, {
225
+ /* @__PURE__ */ V(A, {
220
226
  type: "button",
221
227
  size: "sm",
222
- onClick: () => u.mutate(E.flatMap((e) => e.unread)),
223
- disabled: E.every((e) => e.unread.length === 0),
228
+ onClick: () => d.mutate(D.flatMap((e) => e.unread)),
229
+ disabled: D.every((e) => e.unread.length === 0),
224
230
  children: i("markRead")
225
231
  }),
226
- /* @__PURE__ */ B(k, {
232
+ /* @__PURE__ */ V(A, {
227
233
  type: "button",
228
234
  size: "sm",
229
- onClick: () => d.mutate(E.flatMap((e) => e.items.map((e) => e.id))),
235
+ onClick: () => f.mutate(D.flatMap((e) => e.items.map((e) => e.id))),
230
236
  children: i("markUnread")
231
237
  }),
232
- /* @__PURE__ */ B(k, {
238
+ /* @__PURE__ */ V(A, {
233
239
  type: "button",
234
240
  size: "sm",
235
- onClick: () => N(E),
241
+ onClick: () => P(D),
236
242
  children: i("archive")
237
243
  }),
238
- /* @__PURE__ */ B("button", {
244
+ /* @__PURE__ */ V("button", {
239
245
  type: "button",
240
- onClick: () => w(/* @__PURE__ */ new Set()),
246
+ onClick: () => T(/* @__PURE__ */ new Set()),
241
247
  className: "shrink-0 px-1 hover:underline",
242
248
  children: i("clear")
243
249
  })
@@ -245,43 +251,43 @@ function pe() {
245
251
  })
246
252
  ]
247
253
  }),
248
- b.length === 0 ? /* @__PURE__ */ B("div", {
254
+ x.length === 0 ? /* @__PURE__ */ V("div", {
249
255
  className: "min-h-0 flex-1 overflow-y-auto p-6",
250
- children: g ? /* @__PURE__ */ B(j, {
251
- icon: /* @__PURE__ */ B(f, {}),
256
+ children: _ ? /* @__PURE__ */ V(M, {
257
+ icon: /* @__PURE__ */ V(p, {}),
252
258
  title: i("noneMatch"),
253
- action: /* @__PURE__ */ B(k, {
259
+ action: /* @__PURE__ */ V(A, {
254
260
  type: "button",
255
261
  size: "sm",
256
- onClick: h.clearFilters,
262
+ onClick: g.clearFilters,
257
263
  children: i("showEverything")
258
264
  })
259
- }) : /* @__PURE__ */ B(j, {
260
- icon: /* @__PURE__ */ B(f, {}),
265
+ }) : /* @__PURE__ */ V(M, {
266
+ icon: /* @__PURE__ */ V(p, {}),
261
267
  title: i("emptyTitle"),
262
268
  description: i("emptyDescription")
263
269
  })
264
- }) : /* @__PURE__ */ V("div", {
270
+ }) : /* @__PURE__ */ H("div", {
265
271
  className: "flex min-h-0 flex-1",
266
- children: [/* @__PURE__ */ B("ul", {
272
+ children: [/* @__PURE__ */ V("ul", {
267
273
  "aria-label": i("title"),
268
- className: G("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", S ? "hidden" : "flex"),
269
- children: b.map((t) => /* @__PURE__ */ B(Q, {
274
+ className: K("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", C ? "hidden" : "flex"),
275
+ children: x.map((t) => /* @__PURE__ */ V(me, {
270
276
  workspace: e,
271
277
  group: t,
272
- selected: t === S,
273
- picked: C.has(t.key),
274
- actions: J
278
+ selected: t === C,
279
+ picked: w.has(t.key),
280
+ actions: Y
275
281
  }, t.key))
276
- }), /* @__PURE__ */ B("div", {
277
- className: G("min-w-0 flex-1 overflow-y-auto md:block", S ? "block" : "hidden"),
278
- children: S ? /* @__PURE__ */ B(_e, {
282
+ }), /* @__PURE__ */ V("div", {
283
+ className: K("min-w-0 flex-1 overflow-y-auto md:block", C ? "block" : "hidden"),
284
+ children: C ? /* @__PURE__ */ V(ve, {
279
285
  workspace: e,
280
- group: S,
281
- actions: J
282
- }) : /* @__PURE__ */ B("div", {
286
+ group: C,
287
+ actions: Y
288
+ }) : /* @__PURE__ */ V("div", {
283
289
  className: "px-6 py-24",
284
- children: /* @__PURE__ */ B(j, {
290
+ children: /* @__PURE__ */ V(M, {
285
291
  title: i("noneSelected"),
286
292
  description: i("shortcuts")
287
293
  })
@@ -291,8 +297,8 @@ function pe() {
291
297
  ]
292
298
  });
293
299
  }
294
- function X(e) {
295
- let t = R("notifications"), n = C();
300
+ function Z(e) {
301
+ let t = z("notifications"), n = w();
296
302
  return (r) => {
297
303
  let [i] = r;
298
304
  return [
@@ -307,22 +313,22 @@ function X(e) {
307
313
  onClick: () => e.archiveGroups(r)
308
314
  },
309
315
  ...r.length === 1 && i ? [
310
- F,
316
+ I,
311
317
  ...n(i.href),
312
- ...i.identifier ? [S(t("copyId"), i.identifier)] : []
318
+ ...i.identifier ? [C(t("copyId"), i.identifier)] : []
313
319
  ] : []
314
320
  ];
315
321
  };
316
322
  }
317
- function Z(e) {
318
- let { actorName: t } = w(e);
323
+ function Q(e) {
324
+ let { actorName: t } = T(e);
319
325
  return (e) => e.actor.kind === "agent" && e.agentName ? e.agentName : t(e.actor);
320
326
  }
321
- function Q({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
322
- let o = R("notifications"), { avatarOf: s } = w(e), c = Z(e), l = I(), u = X(a), d = t.items[0], f = c(d), p = t.unread.length > 0;
323
- return /* @__PURE__ */ B("li", {
327
+ function me({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
328
+ let o = z("notifications"), { avatarOf: s } = T(e), c = Q(e), l = L(), u = Z(a), d = t.items[0], f = c(d), p = t.unread.length > 0;
329
+ return /* @__PURE__ */ V("li", {
324
330
  id: `inbox-${t.key}`,
325
- children: /* @__PURE__ */ V(E, {
331
+ children: /* @__PURE__ */ H(D, {
326
332
  to: "/$workspace/notifications",
327
333
  params: { workspace: e },
328
334
  search: { issue: t.key },
@@ -332,72 +338,72 @@ function Q({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
332
338
  },
333
339
  onContextMenu: (e) => l(e, u(a.targetsOf(t))),
334
340
  "aria-current": n || void 0,
335
- className: G("relative flex gap-3 px-2 py-2.5 select-none", r ? "bg-human-soft" : G("rounded-md hover:bg-muted", n && "bg-muted")),
341
+ className: K("relative flex gap-3 px-2 py-2.5 select-none", r ? "bg-human-soft" : K("rounded-md hover:bg-muted", n && "bg-muted")),
336
342
  children: [
337
- r && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
343
+ r && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
338
344
  className: "absolute inset-y-0 left-0 w-0.5 bg-human",
339
345
  "aria-hidden": !0
340
- }), /* @__PURE__ */ B("span", {
346
+ }), /* @__PURE__ */ V("span", {
341
347
  className: "sr-only",
342
348
  children: o("picked")
343
349
  })] }),
344
- /* @__PURE__ */ B("span", {
350
+ /* @__PURE__ */ V("span", {
345
351
  className: "flex w-2 shrink-0 justify-center pt-2.5",
346
- children: p && /* @__PURE__ */ B("span", {
352
+ children: p && /* @__PURE__ */ V("span", {
347
353
  role: "img",
348
354
  "aria-label": o("unread"),
349
355
  className: "size-2 rounded-full bg-primary"
350
356
  })
351
357
  }),
352
- /* @__PURE__ */ B("span", {
353
- className: G("h-fit shrink-0 rounded-full", r && "ring-1 ring-human/40"),
354
- children: /* @__PURE__ */ B(i, {
358
+ /* @__PURE__ */ V("span", {
359
+ className: K("h-fit shrink-0 rounded-full", r && "ring-1 ring-human/40"),
360
+ children: /* @__PURE__ */ V(i, {
355
361
  actor: d.actor,
356
362
  name: f,
357
363
  src: s(d.actor.kind, d.actor.handle),
358
- badge: me(d)
364
+ badge: he(d)
359
365
  })
360
366
  }),
361
- /* @__PURE__ */ V("span", {
367
+ /* @__PURE__ */ H("span", {
362
368
  className: "min-w-0 flex-1",
363
- children: [/* @__PURE__ */ V("span", {
369
+ children: [/* @__PURE__ */ H("span", {
364
370
  className: "flex items-baseline gap-2 text-sm",
365
- children: [/* @__PURE__ */ B($, {
371
+ children: [/* @__PURE__ */ V($, {
366
372
  group: t,
367
373
  strong: p
368
- }), /* @__PURE__ */ B("span", {
369
- className: G("flex-1 truncate", p ? "font-medium text-foreground" : "text-muted-foreground"),
374
+ }), /* @__PURE__ */ V("span", {
375
+ className: K("flex-1 truncate", p ? "font-medium text-foreground" : "text-muted-foreground"),
370
376
  children: t.issueTitle
371
377
  })]
372
- }), /* @__PURE__ */ V("span", {
378
+ }), /* @__PURE__ */ H("span", {
373
379
  className: "mt-0.5 flex gap-2 text-xs text-muted-foreground",
374
- children: [/* @__PURE__ */ V("span", {
380
+ children: [/* @__PURE__ */ H("span", {
375
381
  className: "flex-1 truncate",
376
- children: [o(K(d), {
382
+ children: [o(q(d), {
377
383
  actor: f,
378
384
  agent: d.agentName ?? f,
379
385
  runner: d.runnerName ?? "",
380
- date: J(d)
381
- }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(ye, { text: d.excerpt })] })]
382
- }), t.items.length > 1 && /* @__PURE__ */ B("span", {
386
+ date: Y(d)
387
+ }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ H(B, { children: [": ", /* @__PURE__ */ V(be, { text: d.excerpt })] })]
388
+ }), t.items.length > 1 && /* @__PURE__ */ V("span", {
383
389
  className: "shrink-0",
384
390
  children: o("more", { count: t.items.length - 1 })
385
391
  })]
386
392
  })]
387
393
  }),
388
- /* @__PURE__ */ V("span", {
394
+ /* @__PURE__ */ H("span", {
389
395
  className: "flex shrink-0 flex-col items-end gap-1 pt-0.5",
390
- children: [d.status && /* @__PURE__ */ V("span", {
396
+ children: [d.status && /* @__PURE__ */ H("span", {
391
397
  className: "flex h-4 items-center",
392
- children: [/* @__PURE__ */ B(h, {
398
+ children: [/* @__PURE__ */ V(g, {
393
399
  category: d.status.category,
394
400
  review: d.status.review,
395
401
  step: d.status.step
396
- }), /* @__PURE__ */ B("span", {
402
+ }), /* @__PURE__ */ V("span", {
397
403
  className: "sr-only",
398
404
  children: d.status.name
399
405
  })]
400
- }), /* @__PURE__ */ B(N, {
406
+ }), /* @__PURE__ */ V(P, {
401
407
  value: d.createdAt,
402
408
  format: "compact",
403
409
  exact: "medium",
@@ -408,37 +414,37 @@ function Q({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
408
414
  })
409
415
  });
410
416
  }
411
- function me(e) {
417
+ function he(e) {
412
418
  switch (e.reason) {
413
- case "assigned": return /* @__PURE__ */ B(g, {});
419
+ case "assigned": return /* @__PURE__ */ V(_, {});
414
420
  case "commented":
415
- case "mentioned": return /* @__PURE__ */ B(u, {});
416
- case "status_changed": return e.status?.category === "completed" && e.excerpt === e.status.name ? /* @__PURE__ */ B(l, { className: "text-status-completed" }) : /* @__PURE__ */ B(c, {});
421
+ case "mentioned": return /* @__PURE__ */ V(d, {});
422
+ case "status_changed": return e.status?.category === "completed" && e.excerpt === e.status.name ? /* @__PURE__ */ V(u, { className: "text-status-completed" }) : /* @__PURE__ */ V(l, {});
417
423
  default: return null;
418
424
  }
419
425
  }
420
- function he({ workspace: e, identifier: n }) {
421
- let { data: r } = H(t(e, n)), i = _(), { nameOf: a, avatarOf: s } = w(e);
422
- return r ? /* @__PURE__ */ V("section", {
426
+ function ge({ workspace: e, identifier: n }) {
427
+ let { data: r } = U(t(e, n)), i = v(), { nameOf: a, avatarOf: s } = T(e);
428
+ return r ? /* @__PURE__ */ H("section", {
423
429
  className: "mt-5 rounded-lg border border-border px-4 py-3",
424
- children: [/* @__PURE__ */ V("div", {
430
+ children: [/* @__PURE__ */ H("div", {
425
431
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",
426
432
  children: [
427
- /* @__PURE__ */ V("span", {
433
+ /* @__PURE__ */ H("span", {
428
434
  className: "inline-flex items-center gap-1.5",
429
- children: [/* @__PURE__ */ B(h, {
435
+ children: [/* @__PURE__ */ V(g, {
430
436
  category: r.status.category,
431
437
  review: r.status.review,
432
438
  step: r.status.step
433
439
  }), r.status.name]
434
440
  }),
435
- r.priority > 0 && /* @__PURE__ */ V("span", {
441
+ r.priority > 0 && /* @__PURE__ */ H("span", {
436
442
  className: "inline-flex items-center gap-1.5",
437
- children: [/* @__PURE__ */ B(p, { priority: r.priority }), i[r.priority]]
443
+ children: [/* @__PURE__ */ V(m, { priority: r.priority }), i[r.priority]]
438
444
  }),
439
- r.assignees.map((e) => /* @__PURE__ */ V("span", {
445
+ r.assignees.map((e) => /* @__PURE__ */ H("span", {
440
446
  className: "inline-flex items-center gap-1.5",
441
- children: [/* @__PURE__ */ B(O, {
447
+ children: [/* @__PURE__ */ V(k, {
442
448
  name: a(e.kind, e.handle),
443
449
  src: s(e.kind, e.handle),
444
450
  size: "xs",
@@ -446,126 +452,126 @@ function he({ workspace: e, identifier: n }) {
446
452
  }), a(e.kind, e.handle)]
447
453
  }, `${e.kind}:${e.handle}`))
448
454
  ]
449
- }), r.body.trim() && /* @__PURE__ */ B("div", {
455
+ }), r.body.trim() && /* @__PURE__ */ V("div", {
450
456
  className: "mt-3 max-h-72 overflow-y-auto text-sm",
451
- children: /* @__PURE__ */ B(o, {
457
+ children: /* @__PURE__ */ V(o, {
452
458
  value: r.body,
453
459
  editable: !1
454
460
  })
455
461
  })]
456
462
  }) : null;
457
463
  }
458
- function ge({ workspace: e, identifier: r }) {
459
- let i = U(), { data: a } = H(t(e, r));
460
- return a ? /* @__PURE__ */ B(y, {
464
+ function _e({ workspace: e, identifier: r }) {
465
+ let i = W(), { data: a } = U(t(e, r));
466
+ return a ? /* @__PURE__ */ V(b, {
461
467
  workspace: e,
462
468
  issue: a,
463
469
  onDecided: () => i.invalidateQueries({ queryKey: n(e).queryKey })
464
470
  }) : null;
465
471
  }
466
- function _e({ workspace: e, group: n, actions: r }) {
467
- let i = R("notifications"), { avatarOf: a } = w(e), o = Z(e), s = I(), c = X(r), { data: l } = H({
472
+ function ve({ workspace: e, group: n, actions: r }) {
473
+ let i = z("notifications"), { avatarOf: a } = T(e), o = Q(e), s = L(), c = Z(r), { data: l } = U({
468
474
  ...t(e, n.identifier ?? ""),
469
475
  enabled: !!n.identifier
470
- }), u = b(e, n.identifier ? l : void 0);
471
- return /* @__PURE__ */ V("article", {
476
+ }), u = x(e, n.identifier ? l : void 0);
477
+ return /* @__PURE__ */ H("article", {
472
478
  className: "w-full px-4 py-5 md:px-8",
473
479
  onContextMenu: (e) => s(e, c([n])),
474
480
  children: [
475
- /* @__PURE__ */ B("button", {
481
+ /* @__PURE__ */ V("button", {
476
482
  type: "button",
477
483
  onClick: () => r.select(void 0),
478
484
  className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
479
485
  children: i("back")
480
486
  }),
481
- /* @__PURE__ */ B("p", {
487
+ /* @__PURE__ */ V("p", {
482
488
  className: "text-xs text-muted-foreground",
483
- children: /* @__PURE__ */ B($, { group: n })
489
+ children: /* @__PURE__ */ V($, { group: n })
484
490
  }),
485
- /* @__PURE__ */ B("h2", {
491
+ /* @__PURE__ */ V("h2", {
486
492
  className: "mt-0.5 text-sm font-semibold",
487
- children: /* @__PURE__ */ B(E, {
493
+ children: /* @__PURE__ */ V(D, {
488
494
  to: n.href,
489
495
  className: "hover:underline",
490
496
  children: n.issueTitle
491
497
  })
492
498
  }),
493
- /* @__PURE__ */ V("div", {
499
+ /* @__PURE__ */ H("div", {
494
500
  className: "mt-3 flex flex-wrap gap-2",
495
501
  children: [
496
- /* @__PURE__ */ B(E, {
502
+ /* @__PURE__ */ V(D, {
497
503
  to: n.href,
498
- className: P({
504
+ className: F({
499
505
  variant: u ? "secondary" : "primary",
500
506
  size: "sm"
501
507
  }),
502
508
  children: i(n.kind === "project" ? "openProject" : n.kind === "doc" ? "openDoc" : "openIssue")
503
509
  }),
504
- /* @__PURE__ */ B(k, {
510
+ /* @__PURE__ */ V(A, {
505
511
  type: "button",
506
512
  size: "sm",
507
513
  onClick: () => r.toggleRead([n]),
508
514
  children: n.unread.length > 0 ? i("markRead") : i("markUnread")
509
515
  }),
510
- /* @__PURE__ */ B(k, {
516
+ /* @__PURE__ */ V(A, {
511
517
  type: "button",
512
518
  size: "sm",
513
519
  onClick: () => r.archiveGroups([n]),
514
520
  children: i("archive")
515
521
  }),
516
- n.identifier && /* @__PURE__ */ B(ge, {
522
+ n.identifier && /* @__PURE__ */ V(_e, {
517
523
  workspace: e,
518
524
  identifier: n.identifier
519
525
  })
520
526
  ]
521
527
  }),
522
- n.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(he, {
528
+ n.identifier && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(ge, {
523
529
  workspace: e,
524
530
  identifier: n.identifier
525
- }), /* @__PURE__ */ B(be, {
531
+ }), /* @__PURE__ */ V(xe, {
526
532
  workspace: e,
527
533
  identifier: n.identifier
528
534
  })] }),
529
- /* @__PURE__ */ B(A, {
535
+ /* @__PURE__ */ V(j, {
530
536
  size: "fill",
531
537
  padding: "none",
532
538
  divided: !0,
533
539
  interactive: !1,
534
- render: /* @__PURE__ */ B("ol", {}),
540
+ render: /* @__PURE__ */ V("ol", {}),
535
541
  className: "mt-5 overflow-hidden",
536
542
  children: n.items.map((t) => {
537
543
  let n = o(t);
538
- return /* @__PURE__ */ V("li", {
544
+ return /* @__PURE__ */ H("li", {
539
545
  className: "flex gap-3 px-3 py-3",
540
- children: [/* @__PURE__ */ B(v, {
546
+ children: [/* @__PURE__ */ V(y, {
541
547
  workspace: e,
542
548
  kind: t.actor.kind,
543
549
  handle: t.actor.handle,
544
550
  className: "inline-flex shrink-0 self-start",
545
- children: /* @__PURE__ */ B(O, {
551
+ children: /* @__PURE__ */ V(k, {
546
552
  name: n,
547
553
  src: a(t.actor.kind, t.actor.handle),
548
554
  size: "sm"
549
555
  })
550
- }), /* @__PURE__ */ V("div", {
556
+ }), /* @__PURE__ */ H("div", {
551
557
  className: "min-w-0 flex-1",
552
- children: [/* @__PURE__ */ V("p", {
558
+ children: [/* @__PURE__ */ H("p", {
553
559
  className: "flex items-baseline gap-2 text-sm",
554
- children: [/* @__PURE__ */ B("span", {
555
- className: G("flex-1", !t.readAt && "font-medium"),
556
- children: i(K(t), {
560
+ children: [/* @__PURE__ */ V("span", {
561
+ className: K("flex-1", !t.readAt && "font-medium"),
562
+ children: i(q(t), {
557
563
  actor: n,
558
564
  agent: t.agentName ?? n,
559
565
  runner: t.runnerName ?? "",
560
- date: J(t)
566
+ date: Y(t)
561
567
  })
562
- }), /* @__PURE__ */ B(N, {
568
+ }), /* @__PURE__ */ V(P, {
563
569
  value: t.createdAt,
564
570
  format: "compact",
565
571
  exact: "medium",
566
572
  className: "text-xs text-muted-foreground"
567
573
  })]
568
- }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(ve, { text: t.excerpt })]
574
+ }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ V(ye, { text: t.excerpt })]
569
575
  })]
570
576
  }, t.id);
571
577
  })
@@ -573,58 +579,58 @@ function _e({ workspace: e, group: n, actions: r }) {
573
579
  ]
574
580
  });
575
581
  }
576
- function ve({ text: e }) {
577
- let t = R("agentWork"), n = x(e);
578
- return n ? /* @__PURE__ */ V("div", {
582
+ function ye({ text: e }) {
583
+ let t = z("agentWork"), n = S(e);
584
+ return n ? /* @__PURE__ */ H("div", {
579
585
  className: "mt-1 min-w-0 text-sm text-muted-foreground",
580
586
  children: [
581
- /* @__PURE__ */ B("p", { children: n.agent ? t("approveCommandFor", { agent: n.agent }) : t("approveCommand") }),
582
- /* @__PURE__ */ B("code", {
587
+ /* @__PURE__ */ V("p", { children: n.agent ? t("approveCommandFor", { agent: n.agent }) : t("approveCommand") }),
588
+ /* @__PURE__ */ V("code", {
583
589
  className: "mt-1 block rounded-md bg-muted px-2 py-1 font-mono text-xs break-all whitespace-pre-wrap text-foreground",
584
590
  children: n.command
585
591
  }),
586
- n.reason && /* @__PURE__ */ B("p", {
592
+ n.reason && /* @__PURE__ */ V("p", {
587
593
  className: "mt-1",
588
594
  children: n.reason
589
595
  })
590
596
  ]
591
- }) : /* @__PURE__ */ B("div", {
597
+ }) : /* @__PURE__ */ V("div", {
592
598
  className: "mt-1 min-w-0 text-sm text-muted-foreground",
593
- children: /* @__PURE__ */ B(o, {
599
+ children: /* @__PURE__ */ V(o, {
594
600
  value: e.replace(/<!--[\s\S]*?(-->|$)/g, "").trim(),
595
601
  editable: !1
596
602
  })
597
603
  });
598
604
  }
599
- function ye({ text: e }) {
600
- let t = x(e);
601
- return t ? /* @__PURE__ */ B("code", {
605
+ function be({ text: e }) {
606
+ let t = S(e);
607
+ return t ? /* @__PURE__ */ V("code", {
602
608
  className: "font-mono",
603
609
  children: t.command
604
- }) : T(e);
610
+ }) : E(e);
605
611
  }
606
- function be({ workspace: t, identifier: n }) {
607
- let r = R("notifications"), { data: i = [] } = H(e(t, n)), o = i.filter((e) => !e.answer && !e.canceled);
608
- return o.length === 0 ? null : /* @__PURE__ */ V("section", {
612
+ function xe({ workspace: t, identifier: n }) {
613
+ let r = z("notifications"), { data: i = [] } = U(e(t, n)), o = i.filter((e) => !e.answer && !e.canceled);
614
+ return o.length === 0 ? null : /* @__PURE__ */ H("section", {
609
615
  "aria-label": r("waitingOnYou"),
610
616
  className: "mt-5 space-y-3",
611
- children: [/* @__PURE__ */ B("h3", {
617
+ children: [/* @__PURE__ */ V("h3", {
612
618
  className: "text-xs font-medium text-muted-foreground",
613
619
  children: r("waitingOnYou")
614
- }), o.map((e) => /* @__PURE__ */ B(a, {
620
+ }), o.map((e) => /* @__PURE__ */ V(a, {
615
621
  workspace: t,
616
622
  decision: e
617
623
  }, e.id))]
618
624
  });
619
625
  }
620
626
  function $({ group: e, strong: t = !1 }) {
621
- let n = R("notifications"), r = t ? "font-medium text-foreground" : "text-muted-foreground";
622
- return e.identifier ? /* @__PURE__ */ B("span", {
623
- className: G("shrink-0 text-xs", r),
627
+ let n = z("notifications"), r = t ? "font-medium text-foreground" : "text-muted-foreground";
628
+ return e.identifier ? /* @__PURE__ */ V("span", {
629
+ className: K("shrink-0 text-xs", r),
624
630
  children: e.identifier
625
- }) : /* @__PURE__ */ V("span", {
626
- className: G("inline-flex shrink-0 items-center gap-1 text-xs", r),
627
- children: [e.kind === "doc" ? /* @__PURE__ */ B(d, { className: "size-3" }) : /* @__PURE__ */ B(m, { className: "size-3" }), n(e.kind === "doc" ? "aboutDoc" : "aboutProject")]
631
+ }) : /* @__PURE__ */ H("span", {
632
+ className: K("inline-flex shrink-0 items-center gap-1 text-xs", r),
633
+ children: [e.kind === "doc" ? /* @__PURE__ */ V(f, { className: "size-3" }) : /* @__PURE__ */ V(h, { className: "size-3" }), n(e.kind === "doc" ? "aboutDoc" : "aboutProject")]
628
634
  });
629
635
  }
630
636
  export { pe as component };