@parallelworks/tandem-web 0.186.1 → 0.188.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 +11 -1
- package/_virtual/_virtual_i18n/es/common.js +11 -1
- package/_virtual/_virtual_i18n/ja/common.js +11 -1
- package/_virtual/_virtual_i18n/ko/common.js +11 -1
- package/_virtual/_virtual_i18n/zh/common.js +11 -1
- package/components/FavoritesNav.js +123 -81
- package/components/Graph.js +204 -134
- package/lib/projectList.js +16 -2
- package/lib/projects.js +2 -15
- package/package.json +1 -1
- package/pages/area.js +75 -69
- package/pages/projects.js +130 -119
- package/routes/_workspace/agents/_slug2.js +132 -126
- package/routes/_workspace/dashboards/_dashboardId2.js +111 -103
- package/routes/_workspace/knowledge/_term2.js +128 -123
- package/routes/_workspace/people/_username2.js +67 -58
- package/routes/_workspace/projects/_projectId_3.milestones._milestoneId.js +86 -81
package/pages/area.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
-
import { areaThreadQuery as n, areasQuery as r, countsQuery as ee, inboxQuery as
|
|
3
|
-
import { DecisionCard as
|
|
4
|
-
import { AreaLink as
|
|
5
|
-
import { AreaTile as
|
|
6
|
-
import { AreaGroup as
|
|
7
|
-
import { Editor as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
2
|
+
import { areaThreadQuery as n, areasQuery as r, countsQuery as ee, inboxQuery as i, teamsQuery as a } from "../api/queries.js";
|
|
3
|
+
import { DecisionCard as te } from "../components/AgentWork.js";
|
|
4
|
+
import { AreaLink as ne } from "../components/AreaLink.js";
|
|
5
|
+
import { AreaTile as re, AreaTiles as ie } from "../components/AreaTiles.js";
|
|
6
|
+
import { AreaGroup as o, FoldedAnswer as ae, KnowledgeRow as oe } from "../components/AreaWork.js";
|
|
7
|
+
import { Editor as se } from "../components/Editor.js";
|
|
8
|
+
import { FavoriteStar as ce } from "../components/FavoriteStar.js";
|
|
9
|
+
import { AddIcon as le, AreaIcon as s, CheckIcon as c, ChevronRightIcon as l, FileTextIcon as u, InboxIcon as d, LibraryIcon as f } from "../components/icons.js";
|
|
10
|
+
import { WorkCounts as ue } from "../components/WorkCounts.js";
|
|
11
|
+
import { docRef as de } from "../lib/docs.js";
|
|
12
|
+
import { useNewIssue as fe } from "../lib/newIssue.js";
|
|
13
|
+
import { usePageTitle as pe } from "../lib/pageTitle.js";
|
|
14
|
+
import { Link as p, useNavigate as me } from "../lib/router.js";
|
|
15
|
+
import { useShortcuts as he } from "../lib/shortcuts.js";
|
|
16
|
+
import { Button as m, EmptyState as ge, Kbd as h } from "@parallelworks/ui";
|
|
17
|
+
import { useParams as g, useSearch as _e } from "@tanstack/react-router";
|
|
18
|
+
import { useEffect as _, useState as ve } from "react";
|
|
18
19
|
import { useTranslations as v } from "use-intl";
|
|
19
20
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
20
|
-
import { useMutation as
|
|
21
|
+
import { useMutation as ye, useQuery as x, useQueryClient as be, useSuspenseQuery as S } from "@tanstack/react-query";
|
|
21
22
|
// src/pages/area.tsx
|
|
22
23
|
var C = (e) => ({ ...typeof e.decision == "string" && { decision: e.decision } });
|
|
23
24
|
function w() {
|
|
24
|
-
let { workspace: e, area: t } =
|
|
25
|
+
let { workspace: e, area: t } = g({ strict: !1 });
|
|
25
26
|
return S(n(e, t)).data;
|
|
26
27
|
}
|
|
27
28
|
function T() {
|
|
@@ -30,9 +31,9 @@ function T() {
|
|
|
30
31
|
}
|
|
31
32
|
var E = (...e) => e.filter(Boolean).join(" ");
|
|
32
33
|
function D({ thread: n }) {
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
let [V] =
|
|
34
|
+
let h = v("areaPage"), { workspace: C, area: w, key: T } = g({ strict: !1 }), { decision: D } = _e({ strict: !1 }), A = me(), j = be(), { data: M } = S(ee(C)), { data: N = [] } = x(r(C)), { data: P = [] } = x(a(C)), { data: xe = [] } = x(i(C)), Se = fe(), { area: F, open: I, answered: L, knowledge: R, siblings: z, summary: B } = n;
|
|
35
|
+
pe(F.title);
|
|
36
|
+
let [V] = ve(() => n.lastVisitedAt ? Date.parse(n.lastVisitedAt) : null), H = (e) => !!e && V !== null && Date.parse(e) > V, U = P.find((e) => e.id === F.teamId), W = (e, t) => {
|
|
36
37
|
let n = P.find((t) => t.id === e.teamId), r = t ? { decision: t } : {};
|
|
37
38
|
A(n ? {
|
|
38
39
|
to: "/$workspace/teams/$key/areas/$area",
|
|
@@ -52,9 +53,9 @@ function D({ thread: n }) {
|
|
|
52
53
|
search: r,
|
|
53
54
|
replace: !0
|
|
54
55
|
});
|
|
55
|
-
},
|
|
56
|
+
}, Ce = P.length > 0 || !F.teamId;
|
|
56
57
|
_(() => {
|
|
57
|
-
|
|
58
|
+
Ce && (w.toLowerCase() !== F.key || T !== U?.key) && W(F, D);
|
|
58
59
|
}), _(() => {
|
|
59
60
|
e.POST("/api/v1/workspaces/{workspace}/areas/{area}/visit", { params: { path: {
|
|
60
61
|
workspace: C,
|
|
@@ -65,7 +66,7 @@ function D({ thread: n }) {
|
|
|
65
66
|
_(() => {
|
|
66
67
|
K && document.getElementById(`decision-${K}`)?.scrollIntoView({ block: "center" });
|
|
67
68
|
}, [K]);
|
|
68
|
-
let q =
|
|
69
|
+
let q = ye({
|
|
69
70
|
mutationFn: async ({ decision: n, optionId: r }) => t(await e.POST("/api/v1/workspaces/{workspace}/decisions/{decisionId}/answer", {
|
|
70
71
|
params: { path: {
|
|
71
72
|
workspace: C,
|
|
@@ -78,8 +79,8 @@ function D({ thread: n }) {
|
|
|
78
79
|
C,
|
|
79
80
|
"decisions"
|
|
80
81
|
] })
|
|
81
|
-
}),
|
|
82
|
-
let t = z[
|
|
82
|
+
}), we = z.findIndex((e) => e.id === F.id), J = (e) => {
|
|
83
|
+
let t = z[we + e];
|
|
83
84
|
t && W({
|
|
84
85
|
key: t.key,
|
|
85
86
|
teamId: F.teamId
|
|
@@ -102,10 +103,10 @@ function D({ thread: n }) {
|
|
|
102
103
|
optionId: t.id
|
|
103
104
|
});
|
|
104
105
|
};
|
|
105
|
-
|
|
106
|
+
he(Y);
|
|
106
107
|
let X = [];
|
|
107
108
|
for (let e = N.find((e) => e.id === F.parentId); e; e = N.find((t) => t.id === e?.parentId)) X.unshift(e);
|
|
108
|
-
let Z = N.filter((e) => e.parentId === F.id), Q = (e) =>
|
|
109
|
+
let Z = N.filter((e) => e.parentId === F.id), Q = (e) => xe.filter((t) => t.area?.id === e).length + N.filter((t) => t.parentId === e).reduce((e, t) => e + Q(t.id), 0), Te = !F.homeDoc && Z.length === 0 && I.length === 0 && R.length === 0 && L.length === 0, $ = () => Se({
|
|
109
110
|
...U && { team: U.key },
|
|
110
111
|
area: F.key,
|
|
111
112
|
origin: { area: F.key }
|
|
@@ -116,23 +117,23 @@ function D({ thread: n }) {
|
|
|
116
117
|
/* @__PURE__ */ b("header", {
|
|
117
118
|
className: "flex h-12 shrink-0 items-center gap-1.5 border-b border-border px-4 text-sm md:px-5",
|
|
118
119
|
children: [
|
|
119
|
-
U ? /* @__PURE__ */ y(
|
|
120
|
+
U ? /* @__PURE__ */ y(p, {
|
|
120
121
|
to: "/$workspace/teams/$key/areas",
|
|
121
122
|
params: {
|
|
122
123
|
workspace: C,
|
|
123
124
|
key: U.key
|
|
124
125
|
},
|
|
125
126
|
className: "shrink-0 text-muted-foreground hover:text-foreground",
|
|
126
|
-
children:
|
|
127
|
-
}) : /* @__PURE__ */ y(
|
|
127
|
+
children: h("areas")
|
|
128
|
+
}) : /* @__PURE__ */ y(p, {
|
|
128
129
|
to: "/$workspace/areas",
|
|
129
130
|
params: { workspace: C },
|
|
130
131
|
className: "shrink-0 text-muted-foreground hover:text-foreground",
|
|
131
|
-
children:
|
|
132
|
+
children: h("areas")
|
|
132
133
|
}),
|
|
133
134
|
X.map((e) => /* @__PURE__ */ b("span", {
|
|
134
135
|
className: "flex min-w-0 items-center gap-1.5 max-sm:hidden",
|
|
135
|
-
children: [/* @__PURE__ */ y(l, { className: "size-3 shrink-0 text-muted-foreground" }), /* @__PURE__ */ y(
|
|
136
|
+
children: [/* @__PURE__ */ y(l, { className: "size-3 shrink-0 text-muted-foreground" }), /* @__PURE__ */ y(ne, {
|
|
136
137
|
workspace: C,
|
|
137
138
|
area: e,
|
|
138
139
|
className: "truncate text-muted-foreground hover:text-foreground",
|
|
@@ -144,22 +145,27 @@ function D({ thread: n }) {
|
|
|
144
145
|
className: "truncate font-semibold",
|
|
145
146
|
children: F.title
|
|
146
147
|
}),
|
|
148
|
+
/* @__PURE__ */ y(ce, {
|
|
149
|
+
workspace: C,
|
|
150
|
+
kind: "area",
|
|
151
|
+
target: F.id
|
|
152
|
+
}),
|
|
147
153
|
/* @__PURE__ */ y("span", {
|
|
148
154
|
className: "shrink-0 font-mono text-xs text-muted-foreground",
|
|
149
155
|
children: F.key
|
|
150
156
|
}),
|
|
151
|
-
/* @__PURE__ */ y(
|
|
157
|
+
/* @__PURE__ */ y(ue, {
|
|
152
158
|
counts: M.areas[F.id],
|
|
153
159
|
teamId: F.teamId,
|
|
154
160
|
className: "max-sm:hidden"
|
|
155
161
|
}),
|
|
156
|
-
/* @__PURE__ */ y(
|
|
162
|
+
/* @__PURE__ */ y(m, {
|
|
157
163
|
variant: "primary",
|
|
158
164
|
size: "sm",
|
|
159
|
-
icon: /* @__PURE__ */ y(
|
|
165
|
+
icon: /* @__PURE__ */ y(le, { className: "size-3.5" }),
|
|
160
166
|
onClick: $,
|
|
161
167
|
className: "ml-auto",
|
|
162
|
-
children:
|
|
168
|
+
children: h("newIssue")
|
|
163
169
|
})
|
|
164
170
|
]
|
|
165
171
|
}),
|
|
@@ -167,39 +173,39 @@ function D({ thread: n }) {
|
|
|
167
173
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
168
174
|
children: [
|
|
169
175
|
F.homeDoc && /* @__PURE__ */ b("section", {
|
|
170
|
-
"aria-label":
|
|
176
|
+
"aria-label": h("about"),
|
|
171
177
|
className: "border-b border-border px-4 py-3 md:px-5",
|
|
172
178
|
children: [
|
|
173
179
|
F.redirectedFrom && /* @__PURE__ */ y("p", {
|
|
174
180
|
className: "mb-2 text-xs text-muted-foreground",
|
|
175
|
-
children:
|
|
181
|
+
children: h("mergedFrom", { key: F.redirectedFrom })
|
|
176
182
|
}),
|
|
177
183
|
/* @__PURE__ */ y("div", {
|
|
178
184
|
className: "max-w-3xl",
|
|
179
|
-
children: B && /* @__PURE__ */ y(
|
|
185
|
+
children: B && /* @__PURE__ */ y(se, {
|
|
180
186
|
value: B,
|
|
181
187
|
editable: !1
|
|
182
188
|
})
|
|
183
189
|
}),
|
|
184
|
-
/* @__PURE__ */ b(
|
|
190
|
+
/* @__PURE__ */ b(p, {
|
|
185
191
|
to: "/$workspace/docs/$doc",
|
|
186
192
|
params: {
|
|
187
193
|
workspace: C,
|
|
188
|
-
doc:
|
|
194
|
+
doc: de(F.homeDoc)
|
|
189
195
|
},
|
|
190
196
|
className: "mt-1 inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",
|
|
191
|
-
children: [/* @__PURE__ */ y(
|
|
197
|
+
children: [/* @__PURE__ */ y(u, { className: "size-3.5" }), h("readDoc", { title: F.homeDoc.title })]
|
|
192
198
|
})
|
|
193
199
|
]
|
|
194
200
|
}),
|
|
195
|
-
Z.length > 0 && /* @__PURE__ */ y(
|
|
196
|
-
title:
|
|
201
|
+
Z.length > 0 && /* @__PURE__ */ y(o, {
|
|
202
|
+
title: h("inside"),
|
|
197
203
|
count: Z.length,
|
|
198
|
-
icon: /* @__PURE__ */ y(
|
|
204
|
+
icon: /* @__PURE__ */ y(s, { className: "size-4 text-muted-foreground" }),
|
|
199
205
|
bare: !0,
|
|
200
|
-
children: /* @__PURE__ */ y(
|
|
201
|
-
label:
|
|
202
|
-
children: Z.map((e) => /* @__PURE__ */ y(
|
|
206
|
+
children: /* @__PURE__ */ y(ie, {
|
|
207
|
+
label: h("inside"),
|
|
208
|
+
children: Z.map((e) => /* @__PURE__ */ y(re, {
|
|
203
209
|
workspace: C,
|
|
204
210
|
area: e,
|
|
205
211
|
inside: 0,
|
|
@@ -208,17 +214,17 @@ function D({ thread: n }) {
|
|
|
208
214
|
}, e.id))
|
|
209
215
|
})
|
|
210
216
|
}),
|
|
211
|
-
I.length > 0 && /* @__PURE__ */ y(
|
|
212
|
-
title:
|
|
217
|
+
I.length > 0 && /* @__PURE__ */ y(o, {
|
|
218
|
+
title: h("toDecide"),
|
|
213
219
|
count: I.length,
|
|
214
|
-
icon: /* @__PURE__ */ y(
|
|
220
|
+
icon: /* @__PURE__ */ y(d, { className: "size-4 text-warning" }),
|
|
215
221
|
bare: !0,
|
|
216
222
|
children: /* @__PURE__ */ y("div", {
|
|
217
223
|
className: "space-y-3 px-4 py-3 md:px-5",
|
|
218
224
|
children: I.map((e) => /* @__PURE__ */ b("div", {
|
|
219
225
|
id: `decision-${e.id}`,
|
|
220
226
|
className: E("relative max-w-3xl scroll-mt-12 rounded-lg", e.id === G?.id && "ring-2 ring-primary/50"),
|
|
221
|
-
children: [H(e.createdAt) && /* @__PURE__ */ y(O, {}), /* @__PURE__ */ y(
|
|
227
|
+
children: [H(e.createdAt) && /* @__PURE__ */ y(O, {}), /* @__PURE__ */ y(te, {
|
|
222
228
|
workspace: C,
|
|
223
229
|
decision: e,
|
|
224
230
|
showIssue: !0
|
|
@@ -226,38 +232,38 @@ function D({ thread: n }) {
|
|
|
226
232
|
}, e.id))
|
|
227
233
|
})
|
|
228
234
|
}),
|
|
229
|
-
R.length > 0 && /* @__PURE__ */ y(
|
|
230
|
-
title:
|
|
235
|
+
R.length > 0 && /* @__PURE__ */ y(o, {
|
|
236
|
+
title: h("knowledge"),
|
|
231
237
|
count: R.length,
|
|
232
|
-
icon: /* @__PURE__ */ y(
|
|
233
|
-
children: R.map((e) => /* @__PURE__ */ y(
|
|
238
|
+
icon: /* @__PURE__ */ y(f, { className: "size-4 text-muted-foreground" }),
|
|
239
|
+
children: R.map((e) => /* @__PURE__ */ y(oe, {
|
|
234
240
|
workspace: C,
|
|
235
241
|
entry: e,
|
|
236
242
|
isNew: H(e.createdAt)
|
|
237
243
|
}, e.id))
|
|
238
244
|
}),
|
|
239
|
-
L.length > 0 && /* @__PURE__ */ y(
|
|
240
|
-
title:
|
|
245
|
+
L.length > 0 && /* @__PURE__ */ y(o, {
|
|
246
|
+
title: h("decided"),
|
|
241
247
|
count: L.length,
|
|
242
|
-
icon: /* @__PURE__ */ y(
|
|
243
|
-
children: L.map((e) => /* @__PURE__ */ y(
|
|
248
|
+
icon: /* @__PURE__ */ y(c, { className: "size-4 text-muted-foreground" }),
|
|
249
|
+
children: L.map((e) => /* @__PURE__ */ y(ae, {
|
|
244
250
|
workspace: C,
|
|
245
251
|
decision: e,
|
|
246
252
|
isNew: H(e.answer?.at),
|
|
247
253
|
notInDocs: n.notInDocs.includes(e.id)
|
|
248
254
|
}, e.id))
|
|
249
255
|
}),
|
|
250
|
-
|
|
256
|
+
Te && /* @__PURE__ */ y("div", {
|
|
251
257
|
className: "p-6",
|
|
252
|
-
children: /* @__PURE__ */ y(
|
|
253
|
-
icon: /* @__PURE__ */ y(
|
|
254
|
-
title:
|
|
255
|
-
description:
|
|
256
|
-
action: /* @__PURE__ */ y(
|
|
258
|
+
children: /* @__PURE__ */ y(ge, {
|
|
259
|
+
icon: /* @__PURE__ */ y(s, {}),
|
|
260
|
+
title: h("empty"),
|
|
261
|
+
description: h("emptyDescription"),
|
|
262
|
+
action: /* @__PURE__ */ y(m, {
|
|
257
263
|
variant: "primary",
|
|
258
264
|
size: "sm",
|
|
259
265
|
onClick: $,
|
|
260
|
-
children:
|
|
266
|
+
children: h("newIssue")
|
|
261
267
|
})
|
|
262
268
|
})
|
|
263
269
|
})
|
|
@@ -284,7 +290,7 @@ function k({ deciding: e }) {
|
|
|
284
290
|
className: "flex shrink-0 items-center gap-4 border-t border-border px-4 py-1.5 text-xs text-muted-foreground max-md:hidden md:px-5",
|
|
285
291
|
children: n.map(([e, t]) => /* @__PURE__ */ b("span", {
|
|
286
292
|
className: "flex items-center gap-1.5",
|
|
287
|
-
children: [/* @__PURE__ */ y(
|
|
293
|
+
children: [/* @__PURE__ */ y(h, { keys: e }), t]
|
|
288
294
|
}, t))
|
|
289
295
|
});
|
|
290
296
|
}
|