@parallelworks/tandem-web 0.171.3 → 0.172.0
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/components/TriageButtons.js +33 -0
- package/lib/triage.js +20 -1
- package/package.json +1 -1
- package/pages/triage.js +135 -165
- package/routes/_workspace/notifications2.js +95 -82
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCanTriage as e } from "../lib/roles.js";
|
|
2
|
+
import { useTriageDecision as t } from "../lib/triage.js";
|
|
3
|
+
import { Button as n } from "@parallelworks/ui";
|
|
4
|
+
import { useErrorMessage as r } from "@parallelworks/problem/react";
|
|
5
|
+
import { useTranslations as i } from "use-intl";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
// src/components/TriageButtons.tsx
|
|
8
|
+
function c({ workspace: r, issue: c, onDecided: u }) {
|
|
9
|
+
let d = i("triage"), f = e(r, c.teamId), p = t(r, c, u);
|
|
10
|
+
if (!f || !c.triage) return null;
|
|
11
|
+
let m = (e) => /* @__PURE__ */ o(n, {
|
|
12
|
+
variant: e === "accept" ? "primary" : "outline",
|
|
13
|
+
size: "sm",
|
|
14
|
+
title: d(e === "accept" ? "acceptHelp" : "declineHelp"),
|
|
15
|
+
loading: p.isPending && p.variables === e,
|
|
16
|
+
disabled: p.isPending,
|
|
17
|
+
onClick: () => p.mutate(e),
|
|
18
|
+
children: d(e)
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
21
|
+
m("accept"),
|
|
22
|
+
m("decline"),
|
|
23
|
+
p.error && /* @__PURE__ */ o(l, { error: p.error })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
function l({ error: e }) {
|
|
27
|
+
let t = r();
|
|
28
|
+
return /* @__PURE__ */ o("p", {
|
|
29
|
+
className: "basis-full text-xs text-danger",
|
|
30
|
+
children: t(e)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { c as TriageButtons };
|
package/lib/triage.js
CHANGED
|
@@ -19,4 +19,23 @@ function c(n) {
|
|
|
19
19
|
onSettled: () => o.invalidateQueries({ queryKey: s })
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
function l(n, r, o) {
|
|
23
|
+
let s = a();
|
|
24
|
+
return i({
|
|
25
|
+
mutationFn: async (i) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
|
|
26
|
+
params: { path: {
|
|
27
|
+
workspace: n,
|
|
28
|
+
identifier: r.identifier
|
|
29
|
+
} },
|
|
30
|
+
body: { decision: i }
|
|
31
|
+
})),
|
|
32
|
+
onSuccess: () => {
|
|
33
|
+
o?.(r), s.invalidateQueries({ queryKey: [
|
|
34
|
+
"workspace",
|
|
35
|
+
n,
|
|
36
|
+
"issues"
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export { o as triageQuery, s as triageSearch, l as useTriageDecision, c as useVisitTriage };
|
package/package.json
CHANGED
package/pages/triage.js
CHANGED
|
@@ -4,30 +4,31 @@ import { ActorAvatar as a } from "../components/ActorAvatar.js";
|
|
|
4
4
|
import { Editor as o } from "../components/Editor.js";
|
|
5
5
|
import { EntityIcon as s } from "../components/EntityIcon.js";
|
|
6
6
|
import { PriorityIcon as c, StatusIcon as l, TriageIcon as u, usePriorityNames as d } from "../components/icons.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
7
|
+
import { TriageButtons as f } from "../components/TriageButtons.js";
|
|
8
|
+
import { actorAvatar as p } from "../lib/avatar.js";
|
|
9
|
+
import { usePageTitle as m } from "../lib/pageTitle.js";
|
|
10
|
+
import { usePeople as h } from "../lib/people.js";
|
|
11
|
+
import { useCanTriage as g } from "../lib/roles.js";
|
|
12
|
+
import { Link as _, useNavigate as v } from "../lib/router.js";
|
|
13
|
+
import { useShortcuts as y } from "../lib/shortcuts.js";
|
|
14
|
+
import { useTime as b } from "../lib/time.js";
|
|
15
|
+
import { triageQuery as x, useVisitTriage as S } from "../lib/triage.js";
|
|
16
|
+
import { hasOpened as C } from "../lib/triageSeen.js";
|
|
17
|
+
import { Avatar as w, Button as T, EmptyState as E, RelativeTime as D, Tooltip as O, buttonClasses as k, toast as A } from "@parallelworks/ui";
|
|
18
|
+
import { useParams as j, useSearch as M } from "@tanstack/react-router";
|
|
19
|
+
import { useCallback as N, useEffect as P, useRef as F, useState as I } from "react";
|
|
20
|
+
import { useErrorMessage as L } from "@parallelworks/problem/react";
|
|
21
|
+
import { useTranslations as R } from "use-intl";
|
|
22
|
+
import { jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
23
|
+
import { useMutation as ee, useQuery as V, useQueryClient as te, useSuspenseQuery as H } from "@tanstack/react-query";
|
|
23
24
|
// src/pages/triage.tsx
|
|
24
25
|
function U() {
|
|
25
|
-
let n =
|
|
26
|
-
|
|
27
|
-
let c = s.issues, l =
|
|
28
|
-
|
|
29
|
-
}, []),
|
|
30
|
-
|
|
26
|
+
let n = R("triage"), { workspace: r, key: a } = j({ strict: !1 }), { issue: o } = M({ strict: !1 }), { data: s } = H(x(r, a));
|
|
27
|
+
m(n("title"));
|
|
28
|
+
let c = s.issues, l = L(), d = te(), [f, p] = I(/* @__PURE__ */ new Set()), [h, g] = I(/* @__PURE__ */ new Set()), _ = N((e, t) => {
|
|
29
|
+
p((n) => n.has(e) === t ? n : t ? new Set(n).add(e) : G(n, e));
|
|
30
|
+
}, []), b = c.filter((e) => f.has(e.id)), w = b.filter((e) => h.has(e.id)), D = v(), O = c.findIndex((e) => e.identifier === o?.toUpperCase()), k = F(null), U = c[O], { data: K } = V(i(r)), { mutate: q } = S(r), J = F(/* @__PURE__ */ new Set());
|
|
31
|
+
P(() => {
|
|
31
32
|
U && K && !K.includes(U.id) && !J.current.has(U.id) && (J.current.add(U.id), q({
|
|
32
33
|
id: U.id,
|
|
33
34
|
identifier: U.identifier
|
|
@@ -37,7 +38,7 @@ function U() {
|
|
|
37
38
|
K,
|
|
38
39
|
q
|
|
39
40
|
]);
|
|
40
|
-
let Y = (e) =>
|
|
41
|
+
let Y = (e) => D({
|
|
41
42
|
to: ".",
|
|
42
43
|
search: e ? { issue: e.identifier.toLowerCase() } : {},
|
|
43
44
|
replace: !0
|
|
@@ -48,16 +49,16 @@ function U() {
|
|
|
48
49
|
g(new Set(c.slice(n, r + 1).filter((e) => f.has(e.id)).map((e) => e.id)));
|
|
49
50
|
}, ie = (e, t) => {
|
|
50
51
|
let n = c[t];
|
|
51
|
-
n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), X(n),
|
|
52
|
+
n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), X(n), k.current = t) : e.shiftKey && (e.preventDefault(), Z(k.current ?? (O >= 0 ? O : t), t)));
|
|
52
53
|
}, Q = (e, t) => {
|
|
53
54
|
if (c.length === 0) return;
|
|
54
|
-
let n =
|
|
55
|
-
t && ((
|
|
55
|
+
let n = O < 0 ? 0 : Math.min(Math.max(O + e, 0), c.length - 1);
|
|
56
|
+
t && ((k.current === null || h.size === 0) && (k.current = Math.max(O, 0)), Z(k.current, n)), Y(c[n]);
|
|
56
57
|
}, ae = (e) => {
|
|
57
58
|
let t = c.findIndex((t) => t.id === e.id);
|
|
58
59
|
e.id === U?.id && Y(c[t + 1] ?? c[t - 1]);
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
y({
|
|
61
62
|
j: () => Q(1, !1),
|
|
62
63
|
k: () => Q(-1, !1),
|
|
63
64
|
J: () => Q(1, !0),
|
|
@@ -65,9 +66,9 @@ function U() {
|
|
|
65
66
|
ArrowDown: (e) => Q(1, e.shiftKey),
|
|
66
67
|
ArrowUp: (e) => Q(-1, e.shiftKey),
|
|
67
68
|
x: () => {
|
|
68
|
-
U && (X(U),
|
|
69
|
+
U && (X(U), k.current = O);
|
|
69
70
|
},
|
|
70
|
-
Enter: () => U &&
|
|
71
|
+
Enter: () => U && D({
|
|
71
72
|
to: "/$workspace/issues/$identifier",
|
|
72
73
|
params: {
|
|
73
74
|
workspace: r,
|
|
@@ -77,12 +78,12 @@ function U() {
|
|
|
77
78
|
"Mod+a": () => g(new Set(c.map((e) => e.id))),
|
|
78
79
|
"Shift+Mod+a": () => g(/* @__PURE__ */ new Set()),
|
|
79
80
|
Escape: () => h.size > 0 ? g(/* @__PURE__ */ new Set()) : Y(void 0)
|
|
80
|
-
}),
|
|
81
|
+
}), P(() => {
|
|
81
82
|
let e = U && document.getElementById(`triage-${U.id}`);
|
|
82
83
|
e && (e.scrollIntoView({ block: "nearest" }), e.parentElement?.contains(document.activeElement) && e.querySelector("a")?.focus({ preventScroll: !0 }));
|
|
83
84
|
}, [U]);
|
|
84
|
-
let $ =
|
|
85
|
-
mutationFn: async (n) => (await Promise.allSettled(
|
|
85
|
+
let $ = ee({
|
|
86
|
+
mutationFn: async (n) => (await Promise.allSettled(w.map(async (i) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
|
|
86
87
|
params: { path: {
|
|
87
88
|
workspace: r,
|
|
88
89
|
identifier: i.identifier
|
|
@@ -92,11 +93,11 @@ function U() {
|
|
|
92
93
|
onSuccess: (e) => {
|
|
93
94
|
if (U && h.has(U.id)) {
|
|
94
95
|
let e = (e) => !h.has(e.id);
|
|
95
|
-
Y(c.slice(
|
|
96
|
+
Y(c.slice(O + 1).find(e) ?? c.slice(0, O).findLast(e));
|
|
96
97
|
}
|
|
97
98
|
g(/* @__PURE__ */ new Set());
|
|
98
99
|
let t = e[0];
|
|
99
|
-
t &&
|
|
100
|
+
t && A.error(n("bulkFailed", {
|
|
100
101
|
count: e.length,
|
|
101
102
|
reason: l(t.reason)
|
|
102
103
|
}));
|
|
@@ -107,90 +108,90 @@ function U() {
|
|
|
107
108
|
"issues"
|
|
108
109
|
] })
|
|
109
110
|
});
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ B("div", {
|
|
111
112
|
className: "flex h-full flex-col",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ B("header", {
|
|
113
114
|
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
|
|
114
115
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ z("h1", {
|
|
116
117
|
className: "text-sm font-semibold",
|
|
117
118
|
children: n("title")
|
|
118
119
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ z("span", {
|
|
120
121
|
className: "text-xs text-muted-foreground tabular-nums",
|
|
121
122
|
children: c.length
|
|
122
123
|
}),
|
|
123
|
-
|
|
124
|
+
w.length > 0 && /* @__PURE__ */ B("div", {
|
|
124
125
|
className: "ml-auto flex items-center gap-2",
|
|
125
126
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ z("span", {
|
|
127
128
|
className: "text-xs font-medium text-human",
|
|
128
|
-
children: n("selected", { count:
|
|
129
|
+
children: n("selected", { count: w.length })
|
|
129
130
|
}),
|
|
130
|
-
|
|
131
|
+
w.length < b.length && /* @__PURE__ */ z("button", {
|
|
131
132
|
type: "button",
|
|
132
|
-
onClick: () => g(new Set(
|
|
133
|
+
onClick: () => g(new Set(b.map((e) => e.id))),
|
|
133
134
|
className: "text-xs hover:underline",
|
|
134
135
|
children: n("selectAll")
|
|
135
136
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ z("button", {
|
|
137
138
|
type: "button",
|
|
138
139
|
onClick: () => g(/* @__PURE__ */ new Set()),
|
|
139
140
|
className: "text-xs hover:underline",
|
|
140
141
|
children: n("clear")
|
|
141
142
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ z(T, {
|
|
143
144
|
variant: "outline",
|
|
144
145
|
size: "sm",
|
|
145
146
|
title: n("declineHelp"),
|
|
146
147
|
loading: $.isPending && $.variables === "decline",
|
|
147
148
|
disabled: $.isPending,
|
|
148
149
|
onClick: () => $.mutate("decline"),
|
|
149
|
-
children: n("declineCount", { count:
|
|
150
|
+
children: n("declineCount", { count: w.length })
|
|
150
151
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ z(T, {
|
|
152
153
|
variant: "primary",
|
|
153
154
|
size: "sm",
|
|
154
155
|
title: n("acceptHelp"),
|
|
155
156
|
loading: $.isPending && $.variables === "accept",
|
|
156
157
|
disabled: $.isPending,
|
|
157
158
|
onClick: () => $.mutate("accept"),
|
|
158
|
-
children: n("acceptCount", { count:
|
|
159
|
+
children: n("acceptCount", { count: w.length })
|
|
159
160
|
})
|
|
160
161
|
]
|
|
161
162
|
})
|
|
162
163
|
]
|
|
163
|
-
}), c.length === 0 ? /* @__PURE__ */
|
|
164
|
+
}), c.length === 0 ? /* @__PURE__ */ z("div", {
|
|
164
165
|
className: "min-h-0 flex-1 overflow-y-auto p-6",
|
|
165
|
-
children: /* @__PURE__ */
|
|
166
|
-
icon: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ z(E, {
|
|
167
|
+
icon: /* @__PURE__ */ z(u, {}),
|
|
167
168
|
title: n("empty"),
|
|
168
169
|
description: n("emptyDescription")
|
|
169
170
|
})
|
|
170
|
-
}) : /* @__PURE__ */
|
|
171
|
+
}) : /* @__PURE__ */ B("div", {
|
|
171
172
|
className: "flex min-h-0 flex-1",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ z("ul", {
|
|
173
174
|
"aria-label": n("title"),
|
|
174
175
|
className: W("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", U ? "hidden" : "flex"),
|
|
175
|
-
children: c.map((e, t) => /* @__PURE__ */
|
|
176
|
+
children: c.map((e, t) => /* @__PURE__ */ z(ne, {
|
|
176
177
|
workspace: r,
|
|
177
178
|
issue: e,
|
|
178
|
-
onEligible:
|
|
179
|
+
onEligible: _,
|
|
179
180
|
picked: h.has(e.id) && f.has(e.id),
|
|
180
|
-
current: t ===
|
|
181
|
-
opened:
|
|
181
|
+
current: t === O,
|
|
182
|
+
opened: C(e.id, { data: K }),
|
|
182
183
|
onClick: (e) => ie(e, t)
|
|
183
184
|
}, e.id))
|
|
184
|
-
}), /* @__PURE__ */
|
|
185
|
+
}), /* @__PURE__ */ z("div", {
|
|
185
186
|
className: W("min-w-0 flex-1 overflow-y-auto md:block", U ? "block" : "hidden"),
|
|
186
|
-
children: U ? /* @__PURE__ */
|
|
187
|
+
children: U ? /* @__PURE__ */ z(re, {
|
|
187
188
|
workspace: r,
|
|
188
189
|
issue: U,
|
|
189
190
|
onBack: () => Y(void 0),
|
|
190
191
|
onDecided: ae
|
|
191
|
-
}, U.id) : /* @__PURE__ */
|
|
192
|
+
}, U.id) : /* @__PURE__ */ z("div", {
|
|
192
193
|
className: "px-6 py-24",
|
|
193
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ z(E, {
|
|
194
195
|
title: n("noneSelected"),
|
|
195
196
|
description: n("shortcuts")
|
|
196
197
|
})
|
|
@@ -205,17 +206,17 @@ function G(e, t) {
|
|
|
205
206
|
return n.delete(t), n;
|
|
206
207
|
}
|
|
207
208
|
function ne({ workspace: e, issue: t, onEligible: n, picked: r, current: i, opened: o, onClick: s }) {
|
|
208
|
-
let c =
|
|
209
|
-
|
|
209
|
+
let c = R("triage"), { actorName: u, avatarOf: d } = h(e), f = g(e, t.teamId);
|
|
210
|
+
P(() => n(t.id, f), [
|
|
210
211
|
n,
|
|
211
212
|
t.id,
|
|
212
213
|
f
|
|
213
214
|
]);
|
|
214
215
|
let p = t.creator;
|
|
215
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ z("li", {
|
|
216
217
|
id: `triage-${t.id}`,
|
|
217
218
|
"data-picked": r || void 0,
|
|
218
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ B(_, {
|
|
219
220
|
to: ".",
|
|
220
221
|
search: { issue: t.identifier.toLowerCase() },
|
|
221
222
|
replace: !0,
|
|
@@ -223,42 +224,42 @@ function ne({ workspace: e, issue: t, onEligible: n, picked: r, current: i, open
|
|
|
223
224
|
"aria-current": i || void 0,
|
|
224
225
|
className: W("flex gap-3 px-2 py-2.5 select-none", r ? "bg-human-soft" : W("rounded-md", i ? "bg-muted" : "hover:bg-muted")),
|
|
225
226
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ z("span", {
|
|
227
228
|
className: W("h-fit shrink-0 rounded-full", r && "ring-1 ring-human/40"),
|
|
228
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ z(a, {
|
|
229
230
|
actor: p,
|
|
230
231
|
name: u(p),
|
|
231
232
|
src: d(p.kind, p.handle)
|
|
232
233
|
})
|
|
233
234
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ B("span", {
|
|
235
236
|
className: "min-w-0 flex-1",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ B("span", {
|
|
237
238
|
className: "flex items-baseline gap-2 text-sm",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ z("span", {
|
|
239
240
|
className: W("shrink-0 text-xs tabular-nums", o ? "text-muted-foreground" : "font-medium text-foreground"),
|
|
240
241
|
children: t.identifier
|
|
241
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ z("span", {
|
|
242
243
|
className: W("min-w-0 flex-1 truncate", o ? "text-muted-foreground" : "font-medium text-foreground"),
|
|
243
244
|
children: t.title
|
|
244
245
|
})]
|
|
245
|
-
}), /* @__PURE__ */
|
|
246
|
+
}), /* @__PURE__ */ z("span", {
|
|
246
247
|
className: "mt-0.5 block truncate text-xs text-muted-foreground",
|
|
247
248
|
children: c("from", { name: u(p) })
|
|
248
249
|
})]
|
|
249
250
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ B("span", {
|
|
251
252
|
className: "flex shrink-0 flex-col items-end gap-1 pt-0.5",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ B("span", {
|
|
253
254
|
className: "flex h-4 items-center",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ z(l, {
|
|
255
256
|
category: t.status.category,
|
|
256
257
|
step: t.status.step
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ z("span", {
|
|
258
259
|
className: "sr-only",
|
|
259
260
|
children: t.status.name
|
|
260
261
|
})]
|
|
261
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ z(D, {
|
|
262
263
|
value: t.createdAt,
|
|
263
264
|
format: "compact",
|
|
264
265
|
exact: "medium",
|
|
@@ -269,154 +270,123 @@ function ne({ workspace: e, issue: t, onEligible: n, picked: r, current: i, open
|
|
|
269
270
|
})
|
|
270
271
|
});
|
|
271
272
|
}
|
|
272
|
-
function re({ workspace:
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
params: { path: {
|
|
276
|
-
workspace: i,
|
|
277
|
-
identifier: O.identifier
|
|
278
|
-
} },
|
|
279
|
-
body: { decision: n }
|
|
280
|
-
})),
|
|
281
|
-
onSuccess: () => {
|
|
282
|
-
p(a), ee.invalidateQueries({ queryKey: [
|
|
283
|
-
"workspace",
|
|
284
|
-
i,
|
|
285
|
-
"issues"
|
|
286
|
-
] });
|
|
287
|
-
}
|
|
288
|
-
}), P = O.creator;
|
|
289
|
-
return /* @__PURE__ */ z("article", {
|
|
273
|
+
function re({ workspace: e, issue: t, onBack: i, onDecided: a }) {
|
|
274
|
+
let u = R("triage"), m = b(), g = d(), { data: v } = H(r(e)), { data: y } = V(n(e, t.identifier)), x = y ?? t, { actorName: S, avatarOf: C } = h(e), T = v.find((e) => e.id === x.teamId), E = x.creator;
|
|
275
|
+
return /* @__PURE__ */ B("article", {
|
|
290
276
|
className: "mx-auto w-full max-w-3xl px-4 py-5 md:px-8",
|
|
291
277
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ z("button", {
|
|
293
279
|
type: "button",
|
|
294
|
-
onClick:
|
|
280
|
+
onClick: i,
|
|
295
281
|
className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
|
|
296
|
-
children:
|
|
282
|
+
children: u("back")
|
|
297
283
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ B("p", {
|
|
299
285
|
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
300
286
|
children: [
|
|
301
|
-
|
|
302
|
-
icon:
|
|
303
|
-
name:
|
|
287
|
+
T && /* @__PURE__ */ z(s, {
|
|
288
|
+
icon: T.icon,
|
|
289
|
+
name: T.name,
|
|
304
290
|
className: "size-3.5"
|
|
305
291
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ z("span", {
|
|
307
293
|
className: "tabular-nums",
|
|
308
|
-
children:
|
|
294
|
+
children: x.identifier
|
|
309
295
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ z("span", {
|
|
311
297
|
"aria-hidden": "true",
|
|
312
298
|
children: "·"
|
|
313
299
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
...
|
|
316
|
-
name:
|
|
317
|
-
src:
|
|
300
|
+
/* @__PURE__ */ z(w, {
|
|
301
|
+
...p(E.kind),
|
|
302
|
+
name: S(E),
|
|
303
|
+
src: C(E.kind, E.handle),
|
|
318
304
|
size: "xs"
|
|
319
305
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ z("span", {
|
|
321
307
|
className: "truncate",
|
|
322
|
-
children:
|
|
308
|
+
children: u("from", { name: S(E) })
|
|
323
309
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ z("span", {
|
|
325
311
|
"aria-hidden": "true",
|
|
326
312
|
children: "·"
|
|
327
313
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
content:
|
|
330
|
-
children: /* @__PURE__ */
|
|
331
|
-
dateTime:
|
|
332
|
-
children:
|
|
314
|
+
/* @__PURE__ */ z(O, {
|
|
315
|
+
content: m.full(x.createdAt),
|
|
316
|
+
children: /* @__PURE__ */ z("time", {
|
|
317
|
+
dateTime: x.createdAt,
|
|
318
|
+
children: m.relative(x.createdAt)
|
|
333
319
|
})
|
|
334
320
|
})
|
|
335
321
|
]
|
|
336
322
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ z("h2", {
|
|
338
324
|
className: "mt-1 text-xl font-semibold text-balance",
|
|
339
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ z(_, {
|
|
340
326
|
to: "/$workspace/issues/$identifier",
|
|
341
327
|
params: {
|
|
342
|
-
workspace:
|
|
343
|
-
identifier:
|
|
328
|
+
workspace: e,
|
|
329
|
+
identifier: x.identifier
|
|
344
330
|
},
|
|
345
331
|
className: "hover:underline",
|
|
346
|
-
children:
|
|
332
|
+
children: x.title
|
|
347
333
|
})
|
|
348
334
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ B("div", {
|
|
350
336
|
className: "mt-4 flex flex-wrap items-center gap-2",
|
|
351
|
-
children: [
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
disabled: N.isPending,
|
|
357
|
-
onClick: () => N.mutate("accept"),
|
|
358
|
-
children: _("accept")
|
|
359
|
-
}), /* @__PURE__ */ R(C, {
|
|
360
|
-
variant: "outline",
|
|
361
|
-
size: "sm",
|
|
362
|
-
title: _("declineHelp"),
|
|
363
|
-
loading: N.isPending && N.variables === "decline",
|
|
364
|
-
disabled: N.isPending,
|
|
365
|
-
onClick: () => N.mutate("decline"),
|
|
366
|
-
children: _("decline")
|
|
367
|
-
})] }), /* @__PURE__ */ R(g, {
|
|
337
|
+
children: [/* @__PURE__ */ z(f, {
|
|
338
|
+
workspace: e,
|
|
339
|
+
issue: x,
|
|
340
|
+
onDecided: () => a(t)
|
|
341
|
+
}), /* @__PURE__ */ z(_, {
|
|
368
342
|
to: "/$workspace/issues/$identifier",
|
|
369
343
|
params: {
|
|
370
|
-
workspace:
|
|
371
|
-
identifier:
|
|
344
|
+
workspace: e,
|
|
345
|
+
identifier: x.identifier
|
|
372
346
|
},
|
|
373
|
-
className:
|
|
347
|
+
className: k({
|
|
374
348
|
size: "sm",
|
|
375
349
|
variant: "ghost"
|
|
376
350
|
}),
|
|
377
|
-
children:
|
|
351
|
+
children: u("openIssue")
|
|
378
352
|
})]
|
|
379
353
|
}),
|
|
380
|
-
|
|
381
|
-
className: "mt-2 text-xs text-danger",
|
|
382
|
-
children: b(N.error)
|
|
383
|
-
}),
|
|
384
|
-
/* @__PURE__ */ R("p", {
|
|
354
|
+
/* @__PURE__ */ z("p", {
|
|
385
355
|
className: "mt-3 text-xs text-muted-foreground",
|
|
386
|
-
children:
|
|
356
|
+
children: u("duplicateHint")
|
|
387
357
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ B("div", {
|
|
389
359
|
className: "mt-5 flex flex-wrap items-center gap-x-4 gap-y-1 border-y border-border py-2.5 text-xs text-muted-foreground",
|
|
390
360
|
children: [
|
|
391
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ B("span", {
|
|
392
362
|
className: "inline-flex items-center gap-1.5",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
394
|
-
category:
|
|
395
|
-
step:
|
|
396
|
-
}),
|
|
363
|
+
children: [/* @__PURE__ */ z(l, {
|
|
364
|
+
category: x.status.category,
|
|
365
|
+
step: x.status.step
|
|
366
|
+
}), x.status.name]
|
|
397
367
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ B("span", {
|
|
399
369
|
className: "inline-flex items-center gap-1.5",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ z(c, { priority: x.priority }), g[x.priority]]
|
|
401
371
|
}),
|
|
402
|
-
|
|
372
|
+
x.labels.map((e) => /* @__PURE__ */ B("span", {
|
|
403
373
|
className: "inline-flex items-center gap-1.5",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ z("span", {
|
|
405
375
|
className: "size-2 rounded-full",
|
|
406
376
|
style: { background: e.color }
|
|
407
377
|
}), e.name]
|
|
408
378
|
}, e.id))
|
|
409
379
|
]
|
|
410
380
|
}),
|
|
411
|
-
|
|
381
|
+
x.body.trim() ? /* @__PURE__ */ z("div", {
|
|
412
382
|
className: "mt-5 text-sm",
|
|
413
|
-
children: /* @__PURE__ */
|
|
414
|
-
value:
|
|
383
|
+
children: /* @__PURE__ */ z(o, {
|
|
384
|
+
value: x.body,
|
|
415
385
|
editable: !1
|
|
416
386
|
})
|
|
417
|
-
}) : /* @__PURE__ */
|
|
387
|
+
}) : /* @__PURE__ */ z("p", {
|
|
418
388
|
className: "mt-5 text-sm text-muted-foreground",
|
|
419
|
-
children:
|
|
389
|
+
children: u("noDescription")
|
|
420
390
|
})
|
|
421
391
|
]
|
|
422
392
|
});
|
|
@@ -4,24 +4,25 @@ import { DecisionCard as a } from "../../components/AgentWork.js";
|
|
|
4
4
|
import { Editor as o } from "../../components/Editor.js";
|
|
5
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
6
|
import { PersonHoverCard as v } from "../../components/PersonHoverCard.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { TriageButtons as y } from "../../components/TriageButtons.js";
|
|
8
|
+
import { parseApproval as b } from "../../lib/approval.js";
|
|
9
|
+
import { copyItem as x, useLinkItems as S } from "../../lib/menus.js";
|
|
10
|
+
import { useArchiveNotifications as ee, useReadNotifications as te, useUnreadNotifications as C } from "../../lib/notifications.js";
|
|
11
|
+
import { usePageTitle as ne } from "../../lib/pageTitle.js";
|
|
11
12
|
import { usePeople as w } from "../../lib/people.js";
|
|
12
13
|
import { plainText as T } from "../../lib/plainText.js";
|
|
13
|
-
import { Link as E, useNavigate as
|
|
14
|
-
import { useShortcuts as
|
|
14
|
+
import { Link as E, useNavigate as re } from "../../lib/router.js";
|
|
15
|
+
import { useShortcuts as ie } from "../../lib/shortcuts.js";
|
|
15
16
|
import { Route as D } from "./notifications.js";
|
|
16
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";
|
|
17
|
-
import { useEffect as
|
|
18
|
+
import { useEffect as ae, useMemo as L, useRef as oe, useState as se } from "react";
|
|
18
19
|
import { useTranslations as R } from "use-intl";
|
|
19
20
|
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
20
|
-
import { useQuery as H,
|
|
21
|
-
import { ListFilterMenu as
|
|
21
|
+
import { useQuery as H, useQueryClient as U, useSuspenseQuery as ce } from "@tanstack/react-query";
|
|
22
|
+
import { ListFilterMenu as le, useListView as W } from "@parallelworks/ui/list";
|
|
22
23
|
// src/routes/$workspace/notifications.tsx?tsr-split=component
|
|
23
24
|
var G = (...e) => e.filter(Boolean).join(" ");
|
|
24
|
-
function
|
|
25
|
+
function ue(e, t) {
|
|
25
26
|
let n = /* @__PURE__ */ new Map();
|
|
26
27
|
for (let r of t) {
|
|
27
28
|
let t = r.projectId ? "project" : r.documentId ? "doc" : "issue", i = r.projectId ? `project:${r.projectId}` : r.documentId ? `doc:${r.documentId}` : r.identifier, a = n.get(i);
|
|
@@ -51,7 +52,7 @@ var K = {
|
|
|
51
52
|
reminders: ["reminder"],
|
|
52
53
|
mentions: ["mentioned"]
|
|
53
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
|
-
function
|
|
55
|
+
function de(e, t) {
|
|
55
56
|
let n = R("notifications"), r = L(() => {
|
|
56
57
|
let e = [{
|
|
57
58
|
key: "state",
|
|
@@ -87,11 +88,11 @@ function le(e, t) {
|
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
function Y() {
|
|
90
|
-
let { workspace: e } = D.useParams(), { issue: t } = D.useSearch(), i = R("notifications"), a =
|
|
91
|
-
|
|
92
|
-
let u =
|
|
91
|
+
let { workspace: e } = D.useParams(), { issue: t } = D.useSearch(), i = R("notifications"), a = re(), { data: { notifications: o, unread: c } } = ce(n(e));
|
|
92
|
+
ne(c > 0 ? `${i("title")} (${c})` : i("title"));
|
|
93
|
+
let u = te(e), d = C(e), p = ee(e), { data: m = [] } = H(r(e)), h = de(e, m), g = h.activeFilterCount > 0, _ = (h.filters.state ?? []).includes("unread"), v = h.filters.kind ?? [], y = h.filters.team ?? [], b = L(() => {
|
|
93
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
|
-
return
|
|
95
|
+
return ue(e, n).filter((e) => !_ || e.unread.length > 0 || e.key === t);
|
|
95
96
|
}, [
|
|
96
97
|
e,
|
|
97
98
|
o,
|
|
@@ -99,58 +100,58 @@ function Y() {
|
|
|
99
100
|
v,
|
|
100
101
|
y,
|
|
101
102
|
t
|
|
102
|
-
]), x = b.findIndex((e) => e.key === t),
|
|
103
|
+
]), x = b.findIndex((e) => e.key === t), S = x >= 0 ? b[x] : void 0, [w, T] = se(/* @__PURE__ */ new Set()), E = oe(null), O = L(() => b.filter((e) => w.has(e.key)), [b, w]), A = (t) => {
|
|
103
104
|
a({
|
|
104
105
|
to: "/$workspace/notifications",
|
|
105
106
|
params: { workspace: e },
|
|
106
107
|
search: t ? { issue: t.key } : {},
|
|
107
108
|
replace: !0
|
|
108
109
|
}), t && t.unread.length > 0 && u.mutate(t.unread);
|
|
109
|
-
},
|
|
110
|
+
}, N = (e) => {
|
|
110
111
|
let t = e.flatMap((e) => e.unread);
|
|
111
112
|
t.length > 0 ? u.mutate(t) : d.mutate(e.flatMap((e) => e.items.map((e) => e.id)));
|
|
112
|
-
},
|
|
113
|
-
if (p.mutate(e.flatMap((e) => e.items.map((e) => e.id))),
|
|
113
|
+
}, P = (e) => {
|
|
114
|
+
if (p.mutate(e.flatMap((e) => e.items.map((e) => e.id))), T(/* @__PURE__ */ new Set()), S && e.includes(S)) {
|
|
114
115
|
let t = b.filter((t) => !e.includes(t));
|
|
115
|
-
|
|
116
|
+
A(t[t.findIndex((e) => b.indexOf(e) > x)] ?? t.at(-1));
|
|
116
117
|
}
|
|
117
|
-
},
|
|
118
|
+
}, F = (e) => a({ to: e.href }), I = O.length > 0 ? O : S ? [S] : [], U = (e) => T((t) => {
|
|
118
119
|
let n = new Set(t);
|
|
119
120
|
return n.has(e.key) ? n.delete(e.key) : n.add(e.key), n;
|
|
120
|
-
}),
|
|
121
|
+
}), W = (e, t) => {
|
|
121
122
|
let [n, r] = e < t ? [e, t] : [t, e];
|
|
122
|
-
|
|
123
|
-
},
|
|
123
|
+
T(new Set(b.slice(n, r + 1).map((e) => e.key)));
|
|
124
|
+
}, q = (e, t) => {
|
|
124
125
|
let n = b.indexOf(t);
|
|
125
|
-
e.metaKey || e.ctrlKey ? (
|
|
126
|
-
},
|
|
126
|
+
e.metaKey || e.ctrlKey ? (U(t), E.current = n) : e.shiftKey ? W(E.current ?? (x >= 0 ? x : n), n) : (T(/* @__PURE__ */ new Set()), E.current = n, A(t));
|
|
127
|
+
}, Y = (e, t) => {
|
|
127
128
|
let n = Math.min(Math.max(x + e, 0), b.length - 1);
|
|
128
|
-
t && ((
|
|
129
|
+
t && ((E.current === null || w.size === 0) && (E.current = Math.max(x, 0)), W(E.current, n)), A(b[n]);
|
|
129
130
|
};
|
|
130
|
-
|
|
131
|
-
j: () =>
|
|
132
|
-
k: () =>
|
|
133
|
-
J: () =>
|
|
134
|
-
K: () =>
|
|
135
|
-
ArrowDown: (e) =>
|
|
136
|
-
ArrowUp: (e) =>
|
|
131
|
+
ie({
|
|
132
|
+
j: () => Y(1, !1),
|
|
133
|
+
k: () => Y(-1, !1),
|
|
134
|
+
J: () => Y(1, !0),
|
|
135
|
+
K: () => Y(-1, !0),
|
|
136
|
+
ArrowDown: (e) => Y(1, e.shiftKey),
|
|
137
|
+
ArrowUp: (e) => Y(-1, e.shiftKey),
|
|
137
138
|
x: () => {
|
|
138
|
-
|
|
139
|
+
S && (U(S), E.current = x);
|
|
139
140
|
},
|
|
140
|
-
Enter: () =>
|
|
141
|
-
e: () =>
|
|
142
|
-
u: () =>
|
|
143
|
-
Escape: () =>
|
|
144
|
-
}),
|
|
145
|
-
document.getElementById(`inbox-${
|
|
146
|
-
}, [
|
|
147
|
-
let
|
|
148
|
-
select:
|
|
149
|
-
toggleRead:
|
|
150
|
-
archiveGroups:
|
|
151
|
-
openIssue:
|
|
152
|
-
clickRow:
|
|
153
|
-
targetsOf: (e) =>
|
|
141
|
+
Enter: () => S && F(S),
|
|
142
|
+
e: () => I.length > 0 && P(I),
|
|
143
|
+
u: () => I.length > 0 && N(I),
|
|
144
|
+
Escape: () => w.size > 0 ? T(/* @__PURE__ */ new Set()) : A(void 0)
|
|
145
|
+
}), ae(() => {
|
|
146
|
+
document.getElementById(`inbox-${S?.key}`)?.scrollIntoView({ block: "nearest" });
|
|
147
|
+
}, [S]);
|
|
148
|
+
let X = {
|
|
149
|
+
select: A,
|
|
150
|
+
toggleRead: N,
|
|
151
|
+
archiveGroups: P,
|
|
152
|
+
openIssue: F,
|
|
153
|
+
clickRow: q,
|
|
154
|
+
targetsOf: (e) => w.has(e.key) ? O : (T(/* @__PURE__ */ new Set()), [e])
|
|
154
155
|
};
|
|
155
156
|
return /* @__PURE__ */ V("div", {
|
|
156
157
|
className: "flex h-full flex-col",
|
|
@@ -166,7 +167,7 @@ function Y() {
|
|
|
166
167
|
className: "min-w-0 flex-1 truncate text-xs text-muted-foreground",
|
|
167
168
|
children: i("unreadCount", { count: c })
|
|
168
169
|
}),
|
|
169
|
-
/* @__PURE__ */ B(
|
|
170
|
+
/* @__PURE__ */ B(le, { view: h }),
|
|
170
171
|
c > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
|
|
171
172
|
type: "button",
|
|
172
173
|
size: "sm",
|
|
@@ -199,16 +200,16 @@ function Y() {
|
|
|
199
200
|
})] })
|
|
200
201
|
]
|
|
201
202
|
}),
|
|
202
|
-
|
|
203
|
+
O.length > 0 && /* @__PURE__ */ V("div", {
|
|
203
204
|
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",
|
|
204
205
|
children: [
|
|
205
206
|
/* @__PURE__ */ B("span", {
|
|
206
207
|
className: "font-medium text-human",
|
|
207
|
-
children: i("selected", { count:
|
|
208
|
+
children: i("selected", { count: O.length })
|
|
208
209
|
}),
|
|
209
|
-
|
|
210
|
+
O.length < b.length && /* @__PURE__ */ B("button", {
|
|
210
211
|
type: "button",
|
|
211
|
-
onClick: () =>
|
|
212
|
+
onClick: () => T(new Set(b.map((e) => e.key))),
|
|
212
213
|
className: "hover:underline",
|
|
213
214
|
children: i("selectAll", { count: b.length })
|
|
214
215
|
}),
|
|
@@ -218,25 +219,25 @@ function Y() {
|
|
|
218
219
|
/* @__PURE__ */ B(k, {
|
|
219
220
|
type: "button",
|
|
220
221
|
size: "sm",
|
|
221
|
-
onClick: () => u.mutate(
|
|
222
|
-
disabled:
|
|
222
|
+
onClick: () => u.mutate(O.flatMap((e) => e.unread)),
|
|
223
|
+
disabled: O.every((e) => e.unread.length === 0),
|
|
223
224
|
children: i("markRead")
|
|
224
225
|
}),
|
|
225
226
|
/* @__PURE__ */ B(k, {
|
|
226
227
|
type: "button",
|
|
227
228
|
size: "sm",
|
|
228
|
-
onClick: () => d.mutate(
|
|
229
|
+
onClick: () => d.mutate(O.flatMap((e) => e.items.map((e) => e.id))),
|
|
229
230
|
children: i("markUnread")
|
|
230
231
|
}),
|
|
231
232
|
/* @__PURE__ */ B(k, {
|
|
232
233
|
type: "button",
|
|
233
234
|
size: "sm",
|
|
234
|
-
onClick: () =>
|
|
235
|
+
onClick: () => P(O),
|
|
235
236
|
children: i("archive")
|
|
236
237
|
}),
|
|
237
238
|
/* @__PURE__ */ B("button", {
|
|
238
239
|
type: "button",
|
|
239
|
-
onClick: () =>
|
|
240
|
+
onClick: () => T(/* @__PURE__ */ new Set()),
|
|
240
241
|
className: "shrink-0 px-1 hover:underline",
|
|
241
242
|
children: i("clear")
|
|
242
243
|
})
|
|
@@ -264,20 +265,20 @@ function Y() {
|
|
|
264
265
|
className: "flex min-h-0 flex-1",
|
|
265
266
|
children: [/* @__PURE__ */ B("ul", {
|
|
266
267
|
"aria-label": i("title"),
|
|
267
|
-
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",
|
|
268
|
-
children: b.map((t) => /* @__PURE__ */ B(
|
|
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(fe, {
|
|
269
270
|
workspace: e,
|
|
270
271
|
group: t,
|
|
271
|
-
selected: t ===
|
|
272
|
-
picked:
|
|
273
|
-
actions:
|
|
272
|
+
selected: t === S,
|
|
273
|
+
picked: w.has(t.key),
|
|
274
|
+
actions: X
|
|
274
275
|
}, t.key))
|
|
275
276
|
}), /* @__PURE__ */ B("div", {
|
|
276
|
-
className: G("min-w-0 flex-1 overflow-y-auto md:block",
|
|
277
|
-
children:
|
|
277
|
+
className: G("min-w-0 flex-1 overflow-y-auto md:block", S ? "block" : "hidden"),
|
|
278
|
+
children: S ? /* @__PURE__ */ B(he, {
|
|
278
279
|
workspace: e,
|
|
279
|
-
group:
|
|
280
|
-
actions:
|
|
280
|
+
group: S,
|
|
281
|
+
actions: X
|
|
281
282
|
}) : /* @__PURE__ */ B("div", {
|
|
282
283
|
className: "px-6 py-24",
|
|
283
284
|
children: /* @__PURE__ */ B(j, {
|
|
@@ -291,7 +292,7 @@ function Y() {
|
|
|
291
292
|
});
|
|
292
293
|
}
|
|
293
294
|
function X(e) {
|
|
294
|
-
let t = R("notifications"), n =
|
|
295
|
+
let t = R("notifications"), n = S();
|
|
295
296
|
return (r) => {
|
|
296
297
|
let [i] = r;
|
|
297
298
|
return [
|
|
@@ -308,7 +309,7 @@ function X(e) {
|
|
|
308
309
|
...r.length === 1 && i ? [
|
|
309
310
|
F,
|
|
310
311
|
...n(i.href),
|
|
311
|
-
...i.identifier ? [
|
|
312
|
+
...i.identifier ? [x(t("copyId"), i.identifier)] : []
|
|
312
313
|
] : []
|
|
313
314
|
];
|
|
314
315
|
};
|
|
@@ -317,7 +318,7 @@ function Z(e) {
|
|
|
317
318
|
let { actorName: t } = w(e);
|
|
318
319
|
return (e) => e.actor.kind === "agent" && e.agentName ? e.agentName : t(e.actor);
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
+
function fe({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
|
|
321
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;
|
|
322
323
|
return /* @__PURE__ */ B("li", {
|
|
323
324
|
id: `inbox-${t.key}`,
|
|
@@ -376,7 +377,7 @@ function ue({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
|
|
|
376
377
|
actor: f,
|
|
377
378
|
agent: d.agentName ?? f,
|
|
378
379
|
date: q(d)
|
|
379
|
-
}), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(
|
|
380
|
+
}), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(_e, { text: d.excerpt })] })]
|
|
380
381
|
}), t.items.length > 1 && /* @__PURE__ */ B("span", {
|
|
381
382
|
className: "shrink-0",
|
|
382
383
|
children: o("more", { count: t.items.length - 1 })
|
|
@@ -414,7 +415,7 @@ function Q(e) {
|
|
|
414
415
|
default: return null;
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
+
function pe({ workspace: e, identifier: n }) {
|
|
418
419
|
let { data: r } = H(t(e, n)), i = _(), { nameOf: a, avatarOf: s } = w(e);
|
|
419
420
|
return r ? /* @__PURE__ */ V("section", {
|
|
420
421
|
className: "mt-5 rounded-lg border border-border px-4 py-3",
|
|
@@ -451,7 +452,15 @@ function de({ workspace: e, identifier: n }) {
|
|
|
451
452
|
})]
|
|
452
453
|
}) : null;
|
|
453
454
|
}
|
|
454
|
-
function
|
|
455
|
+
function me({ workspace: e, identifier: r }) {
|
|
456
|
+
let i = U(), { data: a } = H(t(e, r));
|
|
457
|
+
return a ? /* @__PURE__ */ B(y, {
|
|
458
|
+
workspace: e,
|
|
459
|
+
issue: a,
|
|
460
|
+
onDecided: () => i.invalidateQueries({ queryKey: n(e).queryKey })
|
|
461
|
+
}) : null;
|
|
462
|
+
}
|
|
463
|
+
function he({ workspace: e, group: t, actions: n }) {
|
|
455
464
|
let r = R("notifications"), { avatarOf: i } = w(e), a = Z(e), o = I(), s = X(n);
|
|
456
465
|
return /* @__PURE__ */ V("article", {
|
|
457
466
|
className: "w-full px-4 py-5 md:px-8",
|
|
@@ -497,13 +506,17 @@ function fe({ workspace: e, group: t, actions: n }) {
|
|
|
497
506
|
size: "sm",
|
|
498
507
|
onClick: () => n.archiveGroups([t]),
|
|
499
508
|
children: r("archive")
|
|
509
|
+
}),
|
|
510
|
+
t.identifier && /* @__PURE__ */ B(me, {
|
|
511
|
+
workspace: e,
|
|
512
|
+
identifier: t.identifier
|
|
500
513
|
})
|
|
501
514
|
]
|
|
502
515
|
}),
|
|
503
|
-
t.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(
|
|
516
|
+
t.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(pe, {
|
|
504
517
|
workspace: e,
|
|
505
518
|
identifier: t.identifier
|
|
506
|
-
}), /* @__PURE__ */ B(
|
|
519
|
+
}), /* @__PURE__ */ B(ve, {
|
|
507
520
|
workspace: e,
|
|
508
521
|
identifier: t.identifier
|
|
509
522
|
})] }),
|
|
@@ -545,7 +558,7 @@ function fe({ workspace: e, group: t, actions: n }) {
|
|
|
545
558
|
exact: "medium",
|
|
546
559
|
className: "text-xs text-muted-foreground"
|
|
547
560
|
})]
|
|
548
|
-
}), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(
|
|
561
|
+
}), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(ge, { text: t.excerpt })]
|
|
549
562
|
})]
|
|
550
563
|
}, t.id);
|
|
551
564
|
})
|
|
@@ -553,8 +566,8 @@ function fe({ workspace: e, group: t, actions: n }) {
|
|
|
553
566
|
]
|
|
554
567
|
});
|
|
555
568
|
}
|
|
556
|
-
function
|
|
557
|
-
let t = R("agentWork"), n =
|
|
569
|
+
function ge({ text: e }) {
|
|
570
|
+
let t = R("agentWork"), n = b(e);
|
|
558
571
|
return n ? /* @__PURE__ */ V("div", {
|
|
559
572
|
className: "mt-1 min-w-0 text-sm text-muted-foreground",
|
|
560
573
|
children: [
|
|
@@ -576,14 +589,14 @@ function pe({ text: e }) {
|
|
|
576
589
|
})
|
|
577
590
|
});
|
|
578
591
|
}
|
|
579
|
-
function
|
|
580
|
-
let t =
|
|
592
|
+
function _e({ text: e }) {
|
|
593
|
+
let t = b(e);
|
|
581
594
|
return t ? /* @__PURE__ */ B("code", {
|
|
582
595
|
className: "font-mono",
|
|
583
596
|
children: t.command
|
|
584
597
|
}) : T(e);
|
|
585
598
|
}
|
|
586
|
-
function
|
|
599
|
+
function ve({ workspace: t, identifier: n }) {
|
|
587
600
|
let r = R("notifications"), { data: i = [] } = H(e(t, n)), o = i.filter((e) => !e.answer && !e.canceled);
|
|
588
601
|
return o.length === 0 ? null : /* @__PURE__ */ V("section", {
|
|
589
602
|
"aria-label": r("waitingOnYou"),
|