@parallelworks/tandem-web 0.178.0 → 0.179.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/_virtual/_virtual_i18n/en/common.js +45 -16
- package/_virtual/_virtual_i18n/es/common.js +45 -16
- package/_virtual/_virtual_i18n/ja/common.js +45 -16
- package/_virtual/_virtual_i18n/ko/common.js +45 -16
- package/_virtual/_virtual_i18n/zh/common.js +45 -16
- package/components/AgentWork.js +313 -308
- package/components/AreaWork.js +38 -43
- package/components/DocCalendar.js +115 -83
- package/components/DocSeries.js +277 -0
- package/components/Graph.js +1 -1
- package/components/HoverCards.js +88 -111
- package/lib/docSeries.js +80 -0
- package/lib/knowledge.js +0 -6
- package/lib/notifications.js +2 -0
- package/lib/permissionModes.js +7 -1
- package/package.json +1 -1
- package/routes/_workspace/agents/_slug2.js +202 -194
- package/routes/_workspace/docs/space2._space.js +162 -153
- package/routes/_workspace/graph.js +1 -5
- package/routes/_workspace/graph2.js +16 -17
- package/routes/_workspace/graph3.js +70 -82
- package/routes/_workspace/knowledge/_term2.js +126 -130
- package/routes/_workspace/knowledge/index2.js +125 -130
- package/routes/_workspace/notifications2.js +39 -37
|
@@ -1,236 +1,231 @@
|
|
|
1
1
|
import { areasQuery as e, knowledgeQuery as t } from "../../../api/queries.js";
|
|
2
2
|
import { FavoriteStar as n } from "../../../components/FavoriteStar.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { useQuery as M, useSuspenseQuery as N } from "@tanstack/react-query";
|
|
3
|
+
import { AddIcon as r, LibraryIcon as i } from "../../../components/icons.js";
|
|
4
|
+
import { EntryDialog as a, useKnowledgeMenu as o } from "../../../lib/knowledge.js";
|
|
5
|
+
import { kinds as s, termRef as c } from "../../../lib/knowledgeKinds.js";
|
|
6
|
+
import { usePageTitle as l } from "../../../lib/pageTitle.js";
|
|
7
|
+
import { Link as u, useNavigate as d } from "../../../lib/router.js";
|
|
8
|
+
import { useTime as f } from "../../../lib/time.js";
|
|
9
|
+
import { Route as p } from "./index.js";
|
|
10
|
+
import { Button as m, EmptyState as h, SearchInput as g, SegmentedControl as _, Tooltip as v, buttonClasses as y, useOpenMenu as b } from "@parallelworks/ui";
|
|
11
|
+
import { Suspense as x, useCallback as S, useEffect as C, useMemo as w, useState as T } from "react";
|
|
12
|
+
import { useLocale as E, useTranslations as D } from "use-intl";
|
|
13
|
+
import { Fragment as ee, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
14
|
+
import { useQuery as A, useSuspenseQuery as j } from "@tanstack/react-query";
|
|
16
15
|
// src/routes/$workspace/knowledge/index.tsx?tsr-split=component
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
let { workspace:
|
|
20
|
-
|
|
21
|
-
let I =
|
|
22
|
-
|
|
23
|
-
let e = setTimeout(() =>
|
|
16
|
+
var M = 5, N = 8;
|
|
17
|
+
function P() {
|
|
18
|
+
let { workspace: o } = p.useParams(), { archived: f, kind: v = "all" } = p.useSearch(), b = D("knowledge"), P = E();
|
|
19
|
+
l(b("title"));
|
|
20
|
+
let I = d(), [L, R] = T(""), [z, B] = T(""), [V, H] = T(null);
|
|
21
|
+
C(() => {
|
|
22
|
+
let e = setTimeout(() => B(L.trim()), 200);
|
|
24
23
|
return () => clearTimeout(e);
|
|
25
|
-
}, [
|
|
26
|
-
let { data:
|
|
27
|
-
...
|
|
28
|
-
...
|
|
29
|
-
}, { data:
|
|
30
|
-
...t(
|
|
31
|
-
enabled: !!
|
|
32
|
-
}),
|
|
24
|
+
}, [L]);
|
|
25
|
+
let { data: U } = j(t(o)), { data: W = [] } = A(e(o)), G = {
|
|
26
|
+
...z && { q: z },
|
|
27
|
+
...f && { archived: !0 }
|
|
28
|
+
}, { data: K } = A({
|
|
29
|
+
...t(o, G),
|
|
30
|
+
enabled: !!z || !!f
|
|
31
|
+
}), q = !!z || !!f, J = q ? K ?? [] : U, Y = v === "all" ? J : J.filter((e) => e.kind === v), X = S((e) => H(e), []), Z = w(() => {
|
|
33
32
|
let e = /* @__PURE__ */ new Map();
|
|
34
|
-
for (let t of
|
|
33
|
+
for (let t of J) e.set(t.kind, (e.get(t.kind) ?? 0) + 1);
|
|
35
34
|
return e;
|
|
36
|
-
}, [
|
|
37
|
-
let e = new Intl.Collator(
|
|
38
|
-
for (let e of
|
|
39
|
-
let n =
|
|
35
|
+
}, [J]), Q = w(() => [...Y].sort((e, t) => t.updatedAt.localeCompare(e.updatedAt)).slice(0, M), [Y]), te = w(() => {
|
|
36
|
+
let e = new Intl.Collator(P, { sensitivity: "base" }), t = /* @__PURE__ */ new Map();
|
|
37
|
+
for (let e of Y) {
|
|
38
|
+
let n = W.some((t) => t.id === e.areaId) ? e.areaId : "";
|
|
40
39
|
t.set(n, [...t.get(n) ?? [], e]);
|
|
41
40
|
}
|
|
42
41
|
return [...t].map(([t, n]) => ({
|
|
43
42
|
id: t,
|
|
44
|
-
title:
|
|
43
|
+
title: W.find((e) => e.id === t)?.title ?? b("general"),
|
|
45
44
|
entries: n.sort((t, n) => e.compare(t.name, n.name))
|
|
46
45
|
})).sort((t, n) => t.id ? n.id ? e.compare(t.title, n.title) : -1 : 1);
|
|
47
46
|
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
Y,
|
|
48
|
+
W,
|
|
49
|
+
P,
|
|
50
|
+
b
|
|
52
51
|
]), ne = (e) => I({
|
|
53
52
|
to: "/$workspace/knowledge",
|
|
54
|
-
params: { workspace:
|
|
53
|
+
params: { workspace: o },
|
|
55
54
|
search: {
|
|
56
|
-
...
|
|
55
|
+
...f && { archived: f },
|
|
57
56
|
...e !== "all" && { kind: e }
|
|
58
57
|
},
|
|
59
58
|
replace: !0
|
|
60
|
-
}), $ =
|
|
61
|
-
return /* @__PURE__ */
|
|
59
|
+
}), $ = s.filter((e) => Z.has(e) || e === v);
|
|
60
|
+
return /* @__PURE__ */ k("div", {
|
|
62
61
|
className: "flex h-full flex-col",
|
|
63
62
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ k("header", {
|
|
65
64
|
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
|
|
66
65
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ O("h1", {
|
|
68
67
|
className: "min-w-0 truncate text-sm font-semibold",
|
|
69
|
-
children:
|
|
68
|
+
children: b("title")
|
|
70
69
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
workspace:
|
|
70
|
+
/* @__PURE__ */ O(n, {
|
|
71
|
+
workspace: o,
|
|
73
72
|
kind: "page",
|
|
74
73
|
target: "knowledge"
|
|
75
74
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ O("span", {
|
|
77
76
|
className: "whitespace-nowrap text-xs text-muted-foreground tabular-nums",
|
|
78
|
-
children:
|
|
77
|
+
children: b("count", { count: U.length })
|
|
79
78
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ O(u, {
|
|
81
80
|
to: "/$workspace/graph",
|
|
82
|
-
params: { workspace:
|
|
83
|
-
className: `${
|
|
84
|
-
children:
|
|
81
|
+
params: { workspace: o },
|
|
82
|
+
className: `${y({ size: "sm" })} ml-auto`,
|
|
83
|
+
children: b("graph")
|
|
85
84
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ k(m, {
|
|
87
86
|
type: "button",
|
|
88
87
|
variant: "primary",
|
|
89
88
|
size: "sm",
|
|
90
|
-
onClick: () =>
|
|
91
|
-
children: [/* @__PURE__ */
|
|
89
|
+
onClick: () => X({ kind: "create" }),
|
|
90
|
+
children: [/* @__PURE__ */ O(r, { className: "size-3.5" }), /* @__PURE__ */ O("span", {
|
|
92
91
|
className: "max-md:sr-only",
|
|
93
|
-
children:
|
|
92
|
+
children: b("new")
|
|
94
93
|
})]
|
|
95
94
|
})
|
|
96
95
|
]
|
|
97
96
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ O("div", {
|
|
99
98
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
100
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ k("div", {
|
|
101
100
|
className: "mx-auto w-full max-w-3xl px-4 pt-8 pb-16 md:px-8",
|
|
102
101
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
value:
|
|
105
|
-
onValueChange:
|
|
106
|
-
label:
|
|
102
|
+
/* @__PURE__ */ O(g, {
|
|
103
|
+
value: L,
|
|
104
|
+
onValueChange: R,
|
|
105
|
+
label: b("search"),
|
|
107
106
|
size: "lg",
|
|
108
107
|
className: "w-full"
|
|
109
108
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ k("div", {
|
|
111
110
|
className: "mt-4 flex flex-wrap items-center gap-2",
|
|
112
|
-
children: [$.length > 1 && /* @__PURE__ */
|
|
113
|
-
label:
|
|
111
|
+
children: [$.length > 1 && /* @__PURE__ */ O(_, {
|
|
112
|
+
label: b("kindLabel"),
|
|
114
113
|
size: "sm",
|
|
115
|
-
value:
|
|
114
|
+
value: v,
|
|
116
115
|
onValueChange: ne,
|
|
117
116
|
options: [{
|
|
118
117
|
value: "all",
|
|
119
|
-
label:
|
|
120
|
-
count:
|
|
118
|
+
label: b("allKinds"),
|
|
119
|
+
count: J.length
|
|
121
120
|
}, ...$.map((e) => ({
|
|
122
121
|
value: e,
|
|
123
|
-
label:
|
|
124
|
-
count:
|
|
122
|
+
label: b(`kinds.${e}`),
|
|
123
|
+
count: Z.get(e) ?? 0
|
|
125
124
|
}))]
|
|
126
|
-
}), /* @__PURE__ */
|
|
125
|
+
}), /* @__PURE__ */ O(u, {
|
|
127
126
|
to: "/$workspace/knowledge",
|
|
128
|
-
params: { workspace:
|
|
127
|
+
params: { workspace: o },
|
|
129
128
|
search: {
|
|
130
|
-
...!
|
|
131
|
-
...
|
|
129
|
+
...!f && { archived: !0 },
|
|
130
|
+
...v !== "all" && { kind: v }
|
|
132
131
|
},
|
|
133
|
-
"aria-current":
|
|
134
|
-
className: `${
|
|
132
|
+
"aria-current": f || void 0,
|
|
133
|
+
className: `${y({
|
|
135
134
|
size: "sm",
|
|
136
|
-
variant:
|
|
135
|
+
variant: f ? "secondary" : "ghost"
|
|
137
136
|
})} ml-auto`,
|
|
138
|
-
children:
|
|
137
|
+
children: b("archived")
|
|
139
138
|
})]
|
|
140
139
|
}),
|
|
141
|
-
|
|
142
|
-
icon: /* @__PURE__ */
|
|
143
|
-
title:
|
|
144
|
-
description:
|
|
145
|
-
action: !
|
|
140
|
+
Y.length === 0 ? /* @__PURE__ */ O(h, {
|
|
141
|
+
icon: /* @__PURE__ */ O(i, {}),
|
|
142
|
+
title: b(q || v !== "all" ? "noMatches" : "emptyTitle"),
|
|
143
|
+
description: q || v !== "all" ? void 0 : b("empty"),
|
|
144
|
+
action: !q && v === "all" ? /* @__PURE__ */ O(m, {
|
|
146
145
|
type: "button",
|
|
147
146
|
variant: "primary",
|
|
148
|
-
onClick: () =>
|
|
149
|
-
children:
|
|
147
|
+
onClick: () => X({ kind: "create" }),
|
|
148
|
+
children: b("new")
|
|
150
149
|
}) : void 0,
|
|
151
150
|
className: "mt-16"
|
|
152
|
-
}) :
|
|
153
|
-
workspace:
|
|
154
|
-
title:
|
|
155
|
-
entries:
|
|
156
|
-
onOpen:
|
|
157
|
-
}) : /* @__PURE__ */
|
|
158
|
-
workspace:
|
|
159
|
-
title:
|
|
160
|
-
entries:
|
|
161
|
-
onOpen:
|
|
151
|
+
}) : q ? /* @__PURE__ */ O(F, {
|
|
152
|
+
workspace: o,
|
|
153
|
+
title: b("results"),
|
|
154
|
+
entries: Y,
|
|
155
|
+
onOpen: X
|
|
156
|
+
}) : /* @__PURE__ */ k(ee, { children: [Y.length >= N && /* @__PURE__ */ O(F, {
|
|
157
|
+
workspace: o,
|
|
158
|
+
title: b("recent"),
|
|
159
|
+
entries: Q,
|
|
160
|
+
onOpen: X,
|
|
162
161
|
showTime: !0
|
|
163
|
-
}), te.map((e) => /* @__PURE__ */
|
|
164
|
-
workspace:
|
|
162
|
+
}), te.map((e) => /* @__PURE__ */ O(F, {
|
|
163
|
+
workspace: o,
|
|
165
164
|
title: e.title,
|
|
166
165
|
entries: e.entries,
|
|
167
|
-
onOpen:
|
|
166
|
+
onOpen: X
|
|
168
167
|
}, e.id || "general"))] })
|
|
169
168
|
]
|
|
170
169
|
})
|
|
171
170
|
}),
|
|
172
|
-
|
|
173
|
-
workspace:
|
|
174
|
-
mode:
|
|
175
|
-
onClose: () =>
|
|
171
|
+
V && /* @__PURE__ */ O(x, { children: /* @__PURE__ */ O(a, {
|
|
172
|
+
workspace: o,
|
|
173
|
+
mode: V,
|
|
174
|
+
onClose: () => H(null),
|
|
176
175
|
onSaved: (e) => I({
|
|
177
176
|
to: "/$workspace/knowledge/$term",
|
|
178
177
|
params: {
|
|
179
|
-
workspace:
|
|
180
|
-
term:
|
|
178
|
+
workspace: o,
|
|
179
|
+
term: c(e)
|
|
181
180
|
}
|
|
182
181
|
})
|
|
183
182
|
}) })
|
|
184
183
|
]
|
|
185
184
|
});
|
|
186
185
|
}
|
|
187
|
-
function
|
|
188
|
-
let
|
|
189
|
-
return /* @__PURE__ */
|
|
186
|
+
function F({ workspace: e, title: t, entries: n, onOpen: r, showTime: i = !1 }) {
|
|
187
|
+
let a = D("knowledge"), s = b(), l = o(e, r), d = f();
|
|
188
|
+
return /* @__PURE__ */ k("section", {
|
|
190
189
|
"aria-label": t,
|
|
191
190
|
className: "mt-10",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ k("h2", {
|
|
193
192
|
className: "flex items-baseline gap-2 text-base font-semibold",
|
|
194
|
-
children: [t, /* @__PURE__ */
|
|
193
|
+
children: [t, /* @__PURE__ */ O("span", {
|
|
195
194
|
className: "text-xs font-normal text-muted-foreground tabular-nums",
|
|
196
195
|
children: n.length
|
|
197
196
|
})]
|
|
198
|
-
}), /* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ O("ul", {
|
|
199
198
|
className: "mt-3 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card",
|
|
200
|
-
children: n.map((t) => /* @__PURE__ */
|
|
199
|
+
children: n.map((t) => /* @__PURE__ */ O("li", { children: /* @__PURE__ */ k(u, {
|
|
201
200
|
to: "/$workspace/knowledge/$term",
|
|
202
201
|
params: {
|
|
203
202
|
workspace: e,
|
|
204
|
-
term:
|
|
203
|
+
term: c(t)
|
|
205
204
|
},
|
|
206
|
-
onContextMenu: (e) =>
|
|
205
|
+
onContextMenu: (e) => s(e, l(t)),
|
|
207
206
|
className: "group flex flex-col gap-1 px-4 py-3 sm:flex-row sm:items-start sm:gap-3 transition-colors duration-150 hover:bg-muted focus-visible:outline-offset-[-2px]",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ k("span", {
|
|
209
208
|
className: "min-w-0 flex-1",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ O("span", {
|
|
211
210
|
className: `block truncate text-sm font-medium ${t.status === "superseded" ? "text-muted-foreground line-through" : ""}`,
|
|
212
211
|
children: t.name
|
|
213
|
-
}), /* @__PURE__ */
|
|
212
|
+
}), /* @__PURE__ */ O("span", {
|
|
214
213
|
className: "mt-0.5 line-clamp-2 text-xs leading-5 text-muted-foreground",
|
|
215
214
|
children: t.definition
|
|
216
215
|
})]
|
|
217
|
-
}), (t.kind !== "term" ||
|
|
216
|
+
}), (t.kind !== "term" || i) && /* @__PURE__ */ k("span", {
|
|
218
217
|
className: "flex items-center gap-2 text-xs text-muted-foreground sm:shrink-0 sm:pt-0.5",
|
|
219
|
-
children: [
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
children:
|
|
225
|
-
dateTime: t.updatedAt,
|
|
226
|
-
className: "tabular-nums",
|
|
227
|
-
children: f.relative(t.updatedAt)
|
|
228
|
-
})
|
|
218
|
+
children: [t.kind !== "term" && /* @__PURE__ */ O("span", { children: a(`kind.${t.kind}`) }), i && /* @__PURE__ */ O(v, {
|
|
219
|
+
content: d.full(t.updatedAt),
|
|
220
|
+
children: /* @__PURE__ */ O("time", {
|
|
221
|
+
dateTime: t.updatedAt,
|
|
222
|
+
className: "tabular-nums",
|
|
223
|
+
children: d.relative(t.updatedAt)
|
|
229
224
|
})
|
|
230
|
-
]
|
|
225
|
+
})]
|
|
231
226
|
})]
|
|
232
227
|
}) }, t.id))
|
|
233
228
|
})]
|
|
234
229
|
});
|
|
235
230
|
}
|
|
236
|
-
export {
|
|
231
|
+
export { P as component };
|
|
@@ -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
|
|
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
|
-
},
|
|
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(
|
|
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) =>
|
|
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(
|
|
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
|
|
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) =>
|
|
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
|
-
},
|
|
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: () =>
|
|
133
|
-
k: () =>
|
|
134
|
-
J: () =>
|
|
135
|
-
K: () =>
|
|
136
|
-
ArrowDown: (e) =>
|
|
137
|
-
ArrowUp: (e) =>
|
|
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
|
|
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:
|
|
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(
|
|
278
|
+
children: S ? /* @__PURE__ */ B(_e, {
|
|
279
279
|
workspace: e,
|
|
280
280
|
group: S,
|
|
281
|
-
actions:
|
|
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:
|
|
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
|
|
376
|
+
children: [o(K(d), {
|
|
377
377
|
actor: f,
|
|
378
378
|
agent: d.agentName ?? f,
|
|
379
|
-
|
|
380
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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(
|
|
522
|
+
n.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(he, {
|
|
522
523
|
workspace: e,
|
|
523
524
|
identifier: n.identifier
|
|
524
|
-
}), /* @__PURE__ */ B(
|
|
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
|
|
556
|
+
children: i(K(t), {
|
|
556
557
|
actor: n,
|
|
557
558
|
agent: t.agentName ?? n,
|
|
558
|
-
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
630
|
+
export { pe as component };
|