@parallelworks/tandem-web 0.179.1 → 0.180.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 +49 -23
- package/_virtual/_virtual_i18n/es/common.js +49 -23
- package/_virtual/_virtual_i18n/ja/common.js +49 -23
- package/_virtual/_virtual_i18n/ko/common.js +49 -23
- package/_virtual/_virtual_i18n/zh/common.js +49 -23
- package/components/AgentWork.js +419 -382
- package/components/DocOutline.js +38 -35
- package/components/DocSeries.js +92 -88
- package/components/DocTable.js +100 -93
- package/components/HoverCards.js +139 -124
- package/components/SharedViewer.js +1 -0
- package/components/SubPages.js +101 -44
- package/components/SubpageViews.js +475 -0
- package/lib/docs.js +76 -65
- package/lib/glossary.js +11 -7
- package/lib/subpageViews.js +85 -0
- package/package.json +1 -1
- package/pages/decisions.js +90 -168
- package/routes/_workspace/docs/_doc2.js +279 -235
- package/routes/_workspace/docs/space2._space.js +113 -172
- package/routes/_workspace/issues/_identifier2.js +1 -1
- package/routes/_workspace/teams/_key/settings2.js +96 -24
- package/routes/_workspace2.js +9 -9
- package/styles.css +12 -0
- package/components/DocCalendar.js +0 -245
package/pages/decisions.js
CHANGED
|
@@ -1,193 +1,115 @@
|
|
|
1
|
-
import { allDecisionsQuery as e, inboxQuery as t, myAllDecisionsQuery as n, myDecisionsQuery as r, teamsQuery as i } from "../api/queries.js";
|
|
2
|
-
import { AnsweredDecision as
|
|
3
|
-
import { FavoriteStar as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useTranslations as T } from "use-intl";
|
|
14
|
-
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
15
|
-
import { useSuspenseQuery as O } from "@tanstack/react-query";
|
|
1
|
+
import { allDecisionsQuery as e, inboxQuery as t, myAllDecisionsQuery as n, myDecisionsQuery as r, teamsQuery as i, workspaceRunsQuery as a } from "../api/queries.js";
|
|
2
|
+
import { AnsweredDecision as o, DecisionCard as s } from "../components/AgentWork.js";
|
|
3
|
+
import { FavoriteStar as c } from "../components/FavoriteStar.js";
|
|
4
|
+
import { InboxIcon as l } from "../components/icons.js";
|
|
5
|
+
import { recentlyAnswered as u, saveScope as d, savedScope as f } from "../lib/decisionScope.js";
|
|
6
|
+
import { usePageTitle as p } from "../lib/pageTitle.js";
|
|
7
|
+
import { EmptyState as m, SegmentedControl as h, useOpenMenu as g } from "@parallelworks/ui";
|
|
8
|
+
import { useParams as _, useSearch as v } from "@tanstack/react-router";
|
|
9
|
+
import { useState as y } from "react";
|
|
10
|
+
import { useTranslations as b } from "use-intl";
|
|
11
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
12
|
+
import { useQuery as C, useSuspenseQuery as w } from "@tanstack/react-query";
|
|
16
13
|
// src/pages/decisions.tsx
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ E("button", {
|
|
32
|
-
type: "button",
|
|
33
|
-
onClick: r,
|
|
34
|
-
"aria-expanded": n,
|
|
35
|
-
"aria-label": o(n ? "hideDecisions" : "showDecisions", { issue: e.identifier }),
|
|
36
|
-
className: "-ml-1 shrink-0 rounded p-0.5 hover:bg-muted hover:text-foreground",
|
|
37
|
-
children: /* @__PURE__ */ E(c, { className: n ? "size-3.5 rotate-90" : "size-3.5" })
|
|
38
|
-
}),
|
|
39
|
-
/* @__PURE__ */ D(v, {
|
|
40
|
-
to: "/$workspace/issues/$identifier",
|
|
41
|
-
params: {
|
|
42
|
-
workspace: e.workspace,
|
|
43
|
-
identifier: e.identifier
|
|
44
|
-
},
|
|
45
|
-
onContextMenu: (t) => f(t, [...s(d(e.workspace, e.identifier)), h(o("copyId"), e.identifier)]),
|
|
46
|
-
className: "flex min-w-0 items-center gap-2 hover:text-foreground",
|
|
47
|
-
children: [
|
|
48
|
-
i && /* @__PURE__ */ E("span", {
|
|
49
|
-
className: "max-w-[40%] shrink-0 truncate rounded bg-muted px-1.5 py-0.5 font-medium text-foreground",
|
|
50
|
-
children: e.workspaceName
|
|
51
|
-
}),
|
|
52
|
-
/* @__PURE__ */ E(b, {
|
|
53
|
-
content: p[e.issuePriority],
|
|
54
|
-
children: /* @__PURE__ */ D("span", {
|
|
55
|
-
className: "flex",
|
|
56
|
-
children: [/* @__PURE__ */ E(l, { priority: e.issuePriority }), /* @__PURE__ */ E("span", {
|
|
57
|
-
className: "sr-only",
|
|
58
|
-
children: p[e.issuePriority]
|
|
59
|
-
})]
|
|
60
|
-
})
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ E("span", {
|
|
63
|
-
className: "shrink-0 font-medium",
|
|
64
|
-
children: e.identifier
|
|
65
|
-
}),
|
|
66
|
-
/* @__PURE__ */ E("span", {
|
|
67
|
-
className: "truncate",
|
|
68
|
-
children: e.issueTitle
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ E("span", {
|
|
73
|
-
className: "ml-1 shrink-0",
|
|
74
|
-
children: t
|
|
75
|
-
})
|
|
76
|
-
]
|
|
77
|
-
}), n && /* @__PURE__ */ E("div", {
|
|
78
|
-
className: "space-y-3",
|
|
79
|
-
children: a
|
|
80
|
-
})] });
|
|
81
|
-
}
|
|
82
|
-
function M() {
|
|
83
|
-
let { workspace: l, key: u } = S({ strict: !1 }), d = T("decisions"), h = x(), { team: g = u } = C({ strict: !1 }), { data: v } = O(i(l)), b = v.find((e) => e.key === g);
|
|
84
|
-
_(d("title"), b?.name);
|
|
85
|
-
let [M, N] = w(m), P = b ? "workspace" : M, F = P === "all", I = (e) => b ? e.filter((e) => e.identifier.startsWith(`${b.key}-`)) : e, L = (e) => {
|
|
86
|
-
N(e), p(e);
|
|
87
|
-
}, { data: R } = O(F ? r : t(l)), { data: z } = O(F ? n : e(l)), B = I(R), V = f(I(z)), [H, U] = w(/* @__PURE__ */ new Set()), [W, G] = w(!1), K = (e) => U((t) => {
|
|
88
|
-
let n = new Set(t);
|
|
89
|
-
return n.delete(e) || n.add(e), n;
|
|
90
|
-
}), q = () => k.map((e) => ({
|
|
91
|
-
label: d(`scopes.${e}`),
|
|
92
|
-
checked: e === P,
|
|
93
|
-
onClick: () => L(e)
|
|
14
|
+
var T = ["workspace", "all"];
|
|
15
|
+
function E() {
|
|
16
|
+
let { workspace: E, key: D } = _({ strict: !1 }), O = b("decisions"), k = g(), { team: A = D } = v({ strict: !1 }), { data: j } = w(i(E)), M = j.find((e) => e.key === A);
|
|
17
|
+
p(O("title"), M?.name);
|
|
18
|
+
let [N, P] = y(f), F = M ? "workspace" : N, I = F === "all", L = (e) => M ? e.filter((e) => e.identifier.startsWith(`${M.key}-`)) : e, R = (e) => {
|
|
19
|
+
P(e), d(e);
|
|
20
|
+
}, { data: z } = w(I ? r : t(E)), { data: B } = w(I ? n : e(E)), V = L(z), H = u(L(B)), { data: U = [] } = C(a(E, {
|
|
21
|
+
live: !0,
|
|
22
|
+
limit: 200
|
|
23
|
+
})), W = new Map(U.map((e) => [e.id, e])), G = () => T.map((e) => ({
|
|
24
|
+
label: O(`scopes.${e}`),
|
|
25
|
+
checked: e === F,
|
|
26
|
+
onClick: () => R(e)
|
|
94
27
|
}));
|
|
95
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ S("div", {
|
|
96
29
|
className: "flex h-full flex-col",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ S("header", {
|
|
98
31
|
className: "flex min-h-12 shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-2 md:px-5",
|
|
99
32
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ x("h1", {
|
|
101
34
|
className: "text-sm font-semibold",
|
|
102
|
-
children:
|
|
35
|
+
children: M ? O("teamTitle", { team: M.name }) : O("title")
|
|
103
36
|
}),
|
|
104
|
-
!
|
|
105
|
-
workspace:
|
|
37
|
+
!M && /* @__PURE__ */ x(c, {
|
|
38
|
+
workspace: E,
|
|
106
39
|
kind: "page",
|
|
107
40
|
target: "decisions"
|
|
108
41
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ x("span", {
|
|
110
43
|
className: "text-xs text-muted-foreground",
|
|
111
|
-
children:
|
|
44
|
+
children: O("openCount", { count: V.length })
|
|
112
45
|
}),
|
|
113
|
-
!
|
|
46
|
+
!M && /* @__PURE__ */ x("div", {
|
|
114
47
|
className: "ml-auto",
|
|
115
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ x(h, {
|
|
116
49
|
size: "sm",
|
|
117
|
-
label:
|
|
118
|
-
options:
|
|
50
|
+
label: O("scope"),
|
|
51
|
+
options: T.map((e) => ({
|
|
119
52
|
value: e,
|
|
120
|
-
label:
|
|
53
|
+
label: O(`scopes.${e}`)
|
|
121
54
|
})),
|
|
122
|
-
value:
|
|
123
|
-
onValueChange:
|
|
124
|
-
onContextMenu: (e) =>
|
|
55
|
+
value: F,
|
|
56
|
+
onValueChange: R,
|
|
57
|
+
onContextMenu: (e) => k(e, G())
|
|
125
58
|
})
|
|
126
59
|
})
|
|
127
60
|
]
|
|
128
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ x("div", {
|
|
129
62
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
130
|
-
children: /* @__PURE__ */
|
|
131
|
-
className: "w-full space-y-
|
|
132
|
-
children: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
63
|
+
children: /* @__PURE__ */ S("div", {
|
|
64
|
+
className: "mx-auto w-full max-w-reading space-y-10 px-4 py-6 md:px-8",
|
|
65
|
+
children: [V.length === 0 ? /* @__PURE__ */ x(m, {
|
|
66
|
+
icon: /* @__PURE__ */ x(l, {}),
|
|
67
|
+
title: O("emptyTitle"),
|
|
68
|
+
description: O(I ? "emptyDescriptionAll" : "emptyDescription"),
|
|
69
|
+
variant: "plain"
|
|
70
|
+
}) : /* @__PURE__ */ S("section", {
|
|
71
|
+
"aria-labelledby": "decisions-open",
|
|
72
|
+
className: "space-y-3",
|
|
73
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
74
|
+
id: "decisions-open",
|
|
75
|
+
className: "text-sm font-semibold",
|
|
76
|
+
children: O("waitingOnYou")
|
|
77
|
+
}), V.map((e) => {
|
|
78
|
+
let t = e.workspace === E ? W.get(e.runId) : void 0;
|
|
79
|
+
return /* @__PURE__ */ x(s, {
|
|
80
|
+
workspace: e.workspace,
|
|
81
|
+
decision: e,
|
|
82
|
+
showIssue: !0,
|
|
83
|
+
showWorkspace: I,
|
|
84
|
+
runner: t?.lastRunnerName ? {
|
|
85
|
+
name: t.lastRunnerName,
|
|
86
|
+
kind: t.runnerKind
|
|
87
|
+
} : void 0
|
|
88
|
+
}, e.id);
|
|
89
|
+
})]
|
|
90
|
+
}), H.length > 0 && /* @__PURE__ */ S("section", {
|
|
91
|
+
"aria-labelledby": "decisions-answered",
|
|
92
|
+
className: "space-y-3",
|
|
93
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
94
|
+
id: "decisions-answered",
|
|
95
|
+
className: "text-sm font-semibold",
|
|
96
|
+
children: O("recentlyAnswered")
|
|
97
|
+
}), /* @__PURE__ */ x("ul", {
|
|
98
|
+
className: "divide-y divide-border rounded-xl border border-border bg-card",
|
|
99
|
+
children: H.map((e) => /* @__PURE__ */ x("li", {
|
|
100
|
+
className: "px-3 py-2.5",
|
|
101
|
+
children: /* @__PURE__ */ x(o, {
|
|
142
102
|
workspace: e.workspace,
|
|
143
|
-
decision: e
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
children: d("emptyTitle")
|
|
152
|
-
}), /* @__PURE__ */ E("p", {
|
|
153
|
-
className: "mt-1 text-sm text-muted-foreground",
|
|
154
|
-
children: d(F ? "emptyDescriptionAll" : "emptyDescription")
|
|
155
|
-
})]
|
|
156
|
-
}),
|
|
157
|
-
V.length > 0 && /* @__PURE__ */ D("section", {
|
|
158
|
-
className: "space-y-3 pt-6",
|
|
159
|
-
"aria-label": d("recentlyAnswered"),
|
|
160
|
-
children: [/* @__PURE__ */ E("h2", { children: /* @__PURE__ */ D("button", {
|
|
161
|
-
type: "button",
|
|
162
|
-
onClick: () => G((e) => !e),
|
|
163
|
-
"aria-expanded": W,
|
|
164
|
-
className: "-ml-1 flex items-center gap-1 rounded px-1 text-base font-semibold hover:bg-muted",
|
|
165
|
-
children: [
|
|
166
|
-
/* @__PURE__ */ E(c, { className: W ? "size-4 rotate-90" : "size-4" }),
|
|
167
|
-
d("recentlyAnswered"),
|
|
168
|
-
/* @__PURE__ */ E("span", {
|
|
169
|
-
className: "ml-1 text-xs font-normal text-muted-foreground",
|
|
170
|
-
children: V.length
|
|
171
|
-
})
|
|
172
|
-
]
|
|
173
|
-
}) }), W && A(V).map((e) => {
|
|
174
|
-
let [t] = e, n = `answered:${t.workspace}/${t.identifier}`;
|
|
175
|
-
return /* @__PURE__ */ E(j, {
|
|
176
|
-
first: t,
|
|
177
|
-
count: d("answeredCount", { count: e.length }),
|
|
178
|
-
open: H.has(n),
|
|
179
|
-
onToggle: () => K(n),
|
|
180
|
-
showWorkspace: F,
|
|
181
|
-
children: e.map((e) => /* @__PURE__ */ E(a, {
|
|
182
|
-
workspace: e.workspace,
|
|
183
|
-
decision: e
|
|
184
|
-
}, e.id))
|
|
185
|
-
}, n);
|
|
186
|
-
})]
|
|
187
|
-
})
|
|
188
|
-
]
|
|
103
|
+
decision: e,
|
|
104
|
+
showIssue: !0,
|
|
105
|
+
showWorkspace: I,
|
|
106
|
+
bare: !0
|
|
107
|
+
})
|
|
108
|
+
}, e.id))
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
189
111
|
})
|
|
190
112
|
})]
|
|
191
113
|
});
|
|
192
114
|
}
|
|
193
|
-
export {
|
|
115
|
+
export { E as Inbox };
|