@parallelworks/tandem-web 0.150.3 → 0.152.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.
Files changed (110) hide show
  1. package/_virtual/_virtual_i18n/en/common.js +36 -4
  2. package/_virtual/_virtual_i18n/es/common.js +36 -4
  3. package/_virtual/_virtual_i18n/ja/common.js +36 -4
  4. package/_virtual/_virtual_i18n/ko/common.js +36 -4
  5. package/_virtual/_virtual_i18n/zh/common.js +36 -4
  6. package/api/queries.js +88 -77
  7. package/components/AccessGrants.js +6 -6
  8. package/components/ActivityTimeline.js +4 -4
  9. package/components/AgentWork.js +111 -111
  10. package/components/AreaLink.js +32 -0
  11. package/components/AreaTiles.js +10 -13
  12. package/components/AreaWork.js +25 -1
  13. package/components/BugRotation.js +3 -3
  14. package/components/CodeHostSettings.js +30 -30
  15. package/components/CommandPalette.js +53 -53
  16. package/components/CustomFields.js +116 -116
  17. package/components/DateChip.js +11 -11
  18. package/components/DocButton.js +6 -6
  19. package/components/DocHistory.js +4 -4
  20. package/components/DocLinkPicker.js +8 -8
  21. package/components/DocProperties.js +15 -15
  22. package/components/DocTable.js +15 -15
  23. package/components/DocsTree.js +80 -80
  24. package/components/Editor.js +35 -35
  25. package/components/FavoritesNav.js +53 -53
  26. package/components/GitHub.js +18 -18
  27. package/components/Graph.js +15 -15
  28. package/components/HostActions.js +21 -21
  29. package/components/HostPanel.js +6 -6
  30. package/components/HoverCards.js +38 -38
  31. package/components/IssueBoard.js +4 -4
  32. package/components/IssueCode.js +14 -14
  33. package/components/IssueEvent.js +3 -3
  34. package/components/IssueFilters.js +71 -71
  35. package/components/IssueListBlock.js +32 -32
  36. package/components/IssueRow.js +21 -21
  37. package/components/IssueTemplates.js +118 -118
  38. package/components/IssueTypes.js +40 -40
  39. package/components/NewIssueDialog.js +76 -76
  40. package/components/NewProjectDialog.js +145 -145
  41. package/components/PersonActivity.js +4 -4
  42. package/components/SharedViewer.js +5 -5
  43. package/components/SlashMenu.js +29 -29
  44. package/components/TeamRepositories.js +51 -51
  45. package/components/TeamWorkflow.js +6 -6
  46. package/components/UnlinkedMentions.js +20 -20
  47. package/components/Updates.js +3 -3
  48. package/components/Widgets.js +20 -20
  49. package/components/columns.js +17 -17
  50. package/components/editorPlugins.js +80 -80
  51. package/components/mathDiagrams.js +17 -17
  52. package/lib/boardMove.js +5 -5
  53. package/lib/issueList.js +58 -58
  54. package/lib/issueMenu.js +27 -27
  55. package/lib/knowledge.js +106 -106
  56. package/lib/views.js +9 -9
  57. package/package.json +1 -1
  58. package/pages/area.js +291 -0
  59. package/pages/areas.js +258 -287
  60. package/pages/decisions.js +21 -21
  61. package/pages/issues.js +52 -52
  62. package/pages/projects.js +125 -125
  63. package/pages/triage.js +12 -12
  64. package/routeTree.gen.js +186 -180
  65. package/routes/_workspace/agents/_slug2.js +11 -11
  66. package/routes/_workspace/agents/index2.js +10 -10
  67. package/routes/_workspace/areas/_area.js +7 -8
  68. package/routes/_workspace/areas/_area2.js +3 -290
  69. package/routes/_workspace/areas/_area3.js +7 -8
  70. package/routes/_workspace/docs/_doc2.js +230 -230
  71. package/routes/_workspace/docs/space2._space.js +27 -27
  72. package/routes/_workspace/issues/_identifier2.js +222 -224
  73. package/routes/_workspace/knowledge/_term2.js +43 -43
  74. package/routes/_workspace/knowledge/index.js +6 -6
  75. package/routes/_workspace/knowledge/index2.js +15 -15
  76. package/routes/_workspace/measures3.js +70 -72
  77. package/routes/_workspace/notifications2.js +150 -150
  78. package/routes/_workspace/people/_username2.js +10 -10
  79. package/routes/_workspace/projects/_projectId3.js +276 -276
  80. package/routes/_workspace/settings/audit-log3.js +136 -138
  81. package/routes/_workspace/settings/fields2.js +11 -11
  82. package/routes/_workspace/settings/github2.js +6 -6
  83. package/routes/_workspace/settings/groups2.js +26 -26
  84. package/routes/_workspace/settings/import2.js +414 -151
  85. package/routes/_workspace/settings/import3.js +7 -3
  86. package/routes/_workspace/settings/index2.js +6 -6
  87. package/routes/_workspace/settings/labels2.js +21 -21
  88. package/routes/_workspace/settings/members2.js +27 -27
  89. package/routes/_workspace/settings/notifications2.js +8 -8
  90. package/routes/_workspace/settings/parallelworks2.js +32 -32
  91. package/routes/_workspace/settings/roles2.js +24 -24
  92. package/routes/_workspace/settings/runners2.js +15 -15
  93. package/routes/_workspace/settings/sessions2.js +17 -17
  94. package/routes/_workspace/settings/slack2.js +7 -7
  95. package/routes/_workspace/settings/sso2.js +31 -31
  96. package/routes/_workspace/settings/teams2.js +25 -25
  97. package/routes/_workspace/settings/tokens2.js +12 -12
  98. package/routes/_workspace/settings/webhooks2.js +13 -13
  99. package/routes/_workspace/teams/_key/areas/_area.js +8 -0
  100. package/routes/_workspace/teams/_key/areas/_area2.js +4 -0
  101. package/routes/_workspace/teams/_key/areas/_area3.js +9 -0
  102. package/routes/_workspace/teams/_key/areas/index.js +6 -0
  103. package/routes/_workspace/teams/_key/areas/index2.js +4 -0
  104. package/routes/_workspace/teams/_key/{areas3.js → areas/index3.js} +2 -2
  105. package/routes/_workspace/teams/_key/cycles/_number2.js +27 -27
  106. package/routes/_workspace/teams/_key/cycles/index2.js +24 -24
  107. package/routes/_workspace/teams/_key/settings2.js +29 -29
  108. package/routes/_workspace2.js +368 -368
  109. package/routes/_workspace/teams/_key/areas.js +0 -6
  110. package/routes/_workspace/teams/_key/areas2.js +0 -4
package/pages/area.js ADDED
@@ -0,0 +1,291 @@
1
+ import { api as e, unwrap as t } from "../api/client.js";
2
+ import { usePageTitle as n } from "../lib/pageTitle.js";
3
+ import { Link as r, useNavigate as ee } from "../lib/router.js";
4
+ import { areaThreadQuery as i, areasQuery as te, countsQuery as a, inboxQuery as ne, teamsQuery as re } from "../api/queries.js";
5
+ import { docRef as ie } from "../lib/docs.js";
6
+ import { AddIcon as ae, AreaIcon as o, CheckIcon as s, ChevronRightIcon as c, FileTextIcon as l, InboxIcon as oe, LibraryIcon as se } from "../components/icons.js";
7
+ import { useNewIssue as ce } from "../lib/newIssue.js";
8
+ import { Editor as le } from "../components/Editor.js";
9
+ import { DecisionCard as ue } from "../components/AgentWork.js";
10
+ import { AreaLink as de } from "../components/AreaLink.js";
11
+ import { AreaTile as fe, AreaTiles as pe } from "../components/AreaTiles.js";
12
+ import { AreaGroup as u, FoldedAnswer as me, KnowledgeRow as he } from "../components/AreaWork.js";
13
+ import { WorkCounts as d } from "../components/WorkCounts.js";
14
+ import { useShortcuts as ge } from "../lib/shortcuts.js";
15
+ import { Button as f, EmptyState as _e, Kbd as p } from "@parallelworks/ui";
16
+ import { useParams as m, useSearch as h } from "@tanstack/react-router";
17
+ import { useEffect as g, useState as _ } from "react";
18
+ import { useTranslations as v } from "use-intl";
19
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
20
+ import { useMutation as ve, useQuery as x, useQueryClient as ye, useSuspenseQuery as S } from "@tanstack/react-query";
21
+ // src/pages/area.tsx
22
+ var C = (e) => ({ ...typeof e.decision == "string" && { decision: e.decision } });
23
+ function w() {
24
+ let { workspace: e, area: t } = m({ strict: !1 });
25
+ return S(i(e, t)).data;
26
+ }
27
+ function T() {
28
+ let e = w();
29
+ return /* @__PURE__ */ y(D, { thread: e }, e.area.id);
30
+ }
31
+ var E = (...e) => e.filter(Boolean).join(" ");
32
+ function D({ thread: i }) {
33
+ let p = v("areaPage"), { workspace: C, area: w, key: T } = m({ strict: !1 }), { decision: D } = h({ strict: !1 }), A = ee(), j = ye(), { data: M } = S(a(C)), { data: N = [] } = x(te(C)), { data: P = [] } = x(re(C)), { data: be = [] } = x(ne(C)), xe = ce(), { area: F, open: I, answered: L, knowledge: R, siblings: z, summary: B } = i;
34
+ n(F.title);
35
+ let [V] = _(() => i.lastVisitedAt ? Date.parse(i.lastVisitedAt) : null), H = (e) => !!e && V !== null && Date.parse(e) > V, U = P.find((e) => e.id === F.teamId), W = (e, t) => {
36
+ let n = P.find((t) => t.id === e.teamId), r = t ? { decision: t } : {};
37
+ A(n ? {
38
+ to: "/$workspace/teams/$key/areas/$area",
39
+ params: {
40
+ workspace: C,
41
+ key: n.key,
42
+ area: e.key
43
+ },
44
+ search: r,
45
+ replace: !0
46
+ } : {
47
+ to: "/$workspace/areas/$area",
48
+ params: {
49
+ workspace: C,
50
+ area: e.key
51
+ },
52
+ search: r,
53
+ replace: !0
54
+ });
55
+ }, Se = P.length > 0 || !F.teamId;
56
+ g(() => {
57
+ Se && (w.toLowerCase() !== F.key || T !== U?.key) && W(F, D);
58
+ }), g(() => {
59
+ e.POST("/api/v1/workspaces/{workspace}/areas/{area}/visit", { params: { path: {
60
+ workspace: C,
61
+ area: F.key
62
+ } } });
63
+ }, [C, F.key]);
64
+ let G = I.find((e) => e.identifier.toLowerCase() === D?.toLowerCase() || e.id === D), K = G?.id;
65
+ g(() => {
66
+ K && document.getElementById(`decision-${K}`)?.scrollIntoView({ block: "center" });
67
+ }, [K]);
68
+ let q = ve({
69
+ mutationFn: async ({ decision: n, optionId: r }) => t(await e.POST("/api/v1/workspaces/{workspace}/decisions/{decisionId}/answer", {
70
+ params: { path: {
71
+ workspace: C,
72
+ decisionId: n.id
73
+ } },
74
+ body: { optionId: r }
75
+ })),
76
+ onSettled: () => j.invalidateQueries({ queryKey: [
77
+ "workspace",
78
+ C,
79
+ "decisions"
80
+ ] })
81
+ }), Ce = z.findIndex((e) => e.id === F.id), J = (e) => {
82
+ let t = z[Ce + e];
83
+ t && W({
84
+ key: t.key,
85
+ teamId: F.teamId
86
+ });
87
+ }, Y = {
88
+ "[": () => J(-1),
89
+ "]": () => J(1),
90
+ n: () => {
91
+ let e = G ? I.indexOf(G) : -1, t = I[(e + 1) % I.length];
92
+ W(F, t?.identifier.toLowerCase());
93
+ },
94
+ e: () => {
95
+ (document.getElementById(`decision-${G?.id}`)?.querySelector(".ProseMirror"))?.focus();
96
+ }
97
+ };
98
+ for (let e = 1; e <= 9; e++) Y[String(e)] = () => {
99
+ let t = G?.options[e - 1];
100
+ G && t && !q.isPending && q.mutate({
101
+ decision: G,
102
+ optionId: t.id
103
+ });
104
+ };
105
+ ge(Y);
106
+ let X = [];
107
+ 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) => be.filter((t) => t.area?.id === e).length + N.filter((t) => t.parentId === e).reduce((e, t) => e + Q(t.id), 0), we = !F.homeDoc && Z.length === 0 && I.length === 0 && R.length === 0 && L.length === 0, $ = () => xe({
109
+ ...U && { team: U.key },
110
+ area: F.key,
111
+ origin: { area: F.key }
112
+ });
113
+ return /* @__PURE__ */ b("div", {
114
+ className: "flex h-full flex-col",
115
+ children: [
116
+ /* @__PURE__ */ b("header", {
117
+ className: "flex h-12 shrink-0 items-center gap-1.5 border-b border-border px-4 text-sm md:px-5",
118
+ children: [
119
+ U ? /* @__PURE__ */ y(r, {
120
+ to: "/$workspace/teams/$key/areas",
121
+ params: {
122
+ workspace: C,
123
+ key: U.key
124
+ },
125
+ className: "shrink-0 text-muted-foreground hover:text-foreground",
126
+ children: p("areas")
127
+ }) : /* @__PURE__ */ y(r, {
128
+ to: "/$workspace/areas",
129
+ params: { workspace: C },
130
+ className: "shrink-0 text-muted-foreground hover:text-foreground",
131
+ children: p("areas")
132
+ }),
133
+ X.map((e) => /* @__PURE__ */ b("span", {
134
+ className: "flex min-w-0 items-center gap-1.5 max-sm:hidden",
135
+ children: [/* @__PURE__ */ y(c, { className: "size-3 shrink-0 text-muted-foreground" }), /* @__PURE__ */ y(de, {
136
+ workspace: C,
137
+ area: e,
138
+ className: "truncate text-muted-foreground hover:text-foreground",
139
+ children: e.title
140
+ })]
141
+ }, e.key)),
142
+ /* @__PURE__ */ y(c, { className: "size-3 shrink-0 text-muted-foreground" }),
143
+ /* @__PURE__ */ y("h1", {
144
+ className: "truncate font-semibold",
145
+ children: F.title
146
+ }),
147
+ /* @__PURE__ */ y("span", {
148
+ className: "shrink-0 font-mono text-xs text-muted-foreground",
149
+ children: F.key
150
+ }),
151
+ /* @__PURE__ */ y(d, {
152
+ counts: M.areas[F.id],
153
+ teamId: F.teamId,
154
+ className: "max-sm:hidden"
155
+ }),
156
+ /* @__PURE__ */ y(f, {
157
+ variant: "primary",
158
+ size: "sm",
159
+ icon: /* @__PURE__ */ y(ae, { className: "size-3.5" }),
160
+ onClick: $,
161
+ className: "ml-auto",
162
+ children: p("newIssue")
163
+ })
164
+ ]
165
+ }),
166
+ /* @__PURE__ */ b("div", {
167
+ className: "min-h-0 flex-1 overflow-y-auto",
168
+ children: [
169
+ F.homeDoc && /* @__PURE__ */ b("section", {
170
+ "aria-label": p("about"),
171
+ className: "border-b border-border px-4 py-3 md:px-5",
172
+ children: [
173
+ F.redirectedFrom && /* @__PURE__ */ y("p", {
174
+ className: "mb-2 text-xs text-muted-foreground",
175
+ children: p("mergedFrom", { key: F.redirectedFrom })
176
+ }),
177
+ /* @__PURE__ */ y("div", {
178
+ className: "max-w-3xl",
179
+ children: B && /* @__PURE__ */ y(le, {
180
+ value: B,
181
+ editable: !1
182
+ })
183
+ }),
184
+ /* @__PURE__ */ b(r, {
185
+ to: "/$workspace/docs/$doc",
186
+ params: {
187
+ workspace: C,
188
+ doc: ie(F.homeDoc)
189
+ },
190
+ className: "mt-1 inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",
191
+ children: [/* @__PURE__ */ y(l, { className: "size-3.5" }), p("readDoc", { title: F.homeDoc.title })]
192
+ })
193
+ ]
194
+ }),
195
+ Z.length > 0 && /* @__PURE__ */ y(u, {
196
+ title: p("inside"),
197
+ count: Z.length,
198
+ icon: /* @__PURE__ */ y(o, { className: "size-4 text-muted-foreground" }),
199
+ bare: !0,
200
+ children: /* @__PURE__ */ y(pe, {
201
+ label: p("inside"),
202
+ children: Z.map((e) => /* @__PURE__ */ y(fe, {
203
+ workspace: C,
204
+ area: e,
205
+ inside: 0,
206
+ decisions: Q(e.id),
207
+ onOpen: (e) => W(e)
208
+ }, e.id))
209
+ })
210
+ }),
211
+ I.length > 0 && /* @__PURE__ */ y(u, {
212
+ title: p("toDecide"),
213
+ count: I.length,
214
+ icon: /* @__PURE__ */ y(oe, { className: "size-4 text-warning" }),
215
+ bare: !0,
216
+ children: /* @__PURE__ */ y("div", {
217
+ className: "space-y-3 px-4 py-3 md:px-5",
218
+ children: I.map((e) => /* @__PURE__ */ b("div", {
219
+ id: `decision-${e.id}`,
220
+ 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(ue, {
222
+ workspace: C,
223
+ decision: e,
224
+ showIssue: !0
225
+ })]
226
+ }, e.id))
227
+ })
228
+ }),
229
+ R.length > 0 && /* @__PURE__ */ y(u, {
230
+ title: p("knowledge"),
231
+ count: R.length,
232
+ icon: /* @__PURE__ */ y(se, { className: "size-4 text-muted-foreground" }),
233
+ children: R.map((e) => /* @__PURE__ */ y(he, {
234
+ workspace: C,
235
+ entry: e,
236
+ isNew: H(e.createdAt)
237
+ }, e.id))
238
+ }),
239
+ L.length > 0 && /* @__PURE__ */ y(u, {
240
+ title: p("decided"),
241
+ count: L.length,
242
+ icon: /* @__PURE__ */ y(s, { className: "size-4 text-muted-foreground" }),
243
+ children: L.map((e) => /* @__PURE__ */ y(me, {
244
+ workspace: C,
245
+ decision: e,
246
+ isNew: H(e.answer?.at),
247
+ notInDocs: i.notInDocs.includes(e.id)
248
+ }, e.id))
249
+ }),
250
+ we && /* @__PURE__ */ y("div", {
251
+ className: "p-6",
252
+ children: /* @__PURE__ */ y(_e, {
253
+ icon: /* @__PURE__ */ y(o, {}),
254
+ title: p("empty"),
255
+ description: p("emptyDescription"),
256
+ action: /* @__PURE__ */ y(f, {
257
+ variant: "primary",
258
+ size: "sm",
259
+ onClick: $,
260
+ children: p("newIssue")
261
+ })
262
+ })
263
+ })
264
+ ]
265
+ }),
266
+ /* @__PURE__ */ y(k, { deciding: I.length > 0 })
267
+ ]
268
+ });
269
+ }
270
+ function O() {
271
+ let e = v("areaPage");
272
+ return /* @__PURE__ */ y("span", {
273
+ className: "absolute -top-2 right-3 z-10 rounded bg-primary px-1.5 py-0.5 text-[10px] font-medium text-primary-foreground",
274
+ children: e("new")
275
+ });
276
+ }
277
+ function k({ deciding: e }) {
278
+ let t = v("areaPage"), n = [[["[", "]"], t("keys.move")], ...e ? [
279
+ [["N"], t("keys.next")],
280
+ [["1–9"], t("keys.choose")],
281
+ [["E"], t("keys.note")]
282
+ ] : []];
283
+ return /* @__PURE__ */ y("footer", {
284
+ 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
+ children: n.map(([e, t]) => /* @__PURE__ */ b("span", {
286
+ className: "flex items-center gap-1.5",
287
+ children: [/* @__PURE__ */ y(p, { keys: e }), t]
288
+ }, t))
289
+ });
290
+ }
291
+ export { T as AreaPage, C as validateAreaSearch };