@burdenoff/microfe-planmagnet 2026.930.16 → 2026.930.18
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/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +278 -271
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/comments/CommentThread.d.ts +44 -0
- package/dist/planmagnet/comments/CommentThread.d.ts.map +1 -0
- package/dist/planmagnet/comments/CommentThread.js +513 -0
- package/dist/planmagnet/comments/CommentThread.js.map +1 -0
- package/dist/planmagnet/comments/MentionComposer.d.ts +25 -0
- package/dist/planmagnet/comments/MentionComposer.d.ts.map +1 -0
- package/dist/planmagnet/comments/MentionComposer.js +148 -0
- package/dist/planmagnet/comments/MentionComposer.js.map +1 -0
- package/dist/planmagnet/comments/TargetComments.d.ts +7 -0
- package/dist/planmagnet/comments/TargetComments.d.ts.map +1 -0
- package/dist/planmagnet/comments/TargetComments.js +207 -0
- package/dist/planmagnet/comments/TargetComments.js.map +1 -0
- package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -1
- package/dist/planmagnet/comments/WorkItemComments.js +68 -216
- package/dist/planmagnet/comments/WorkItemComments.js.map +1 -1
- package/dist/planmagnet/controls/LiveStatus.d.ts +7 -0
- package/dist/planmagnet/controls/LiveStatus.d.ts.map +1 -0
- package/dist/planmagnet/controls/LiveStatus.js +31 -0
- package/dist/planmagnet/controls/LiveStatus.js.map +1 -0
- package/dist/planmagnet/hooks/useLiveRefresh.d.ts +76 -0
- package/dist/planmagnet/hooks/useLiveRefresh.d.ts.map +1 -0
- package/dist/planmagnet/hooks/useLiveRefresh.js +143 -0
- package/dist/planmagnet/hooks/useLiveRefresh.js.map +1 -0
- package/dist/planmagnet/pages/DashboardDashboardPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js +138 -125
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.js +54 -39
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.js +52 -37
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js +93 -68
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js +62 -47
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js +74 -72
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +140 -125
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +213 -195
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { PersonName as t, usePersonProfile as n } from "../people/People.js";
|
|
3
|
+
import { throwOnError as r } from "../utils/mutationResult.js";
|
|
4
|
+
import { ConfirmButton as i, ErrorLine as a } from "../controls/ConfirmButton.js";
|
|
5
|
+
import { isForbidden as o, mutationErrorMessage as s } from "../utils/graphqlErrors.js";
|
|
6
|
+
import { MentionComposer as c, MentionText as l } from "./MentionComposer.js";
|
|
7
|
+
import { useEffect as u, useState as d } from "react";
|
|
8
|
+
import { CheckCircle2 as f, ChevronDown as p, ChevronRight as m, Reply as h, RotateCcw as g, Trash2 as _ } from "lucide-react";
|
|
9
|
+
import { useMutation as v, useQuery as y } from "@apollo/client/react";
|
|
10
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
11
|
+
import { Button as C } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
//#region src/planmagnet/comments/CommentThread.tsx
|
|
13
|
+
var w = 30, T = 1e4, E = (e) => new Date(e).toLocaleString();
|
|
14
|
+
function D({ targetNoun: t, idPrefix: n, query: i, add: l, edit: f, remove: p, resolve: m, refetchQueries: h, onTotalCount: g }) {
|
|
15
|
+
let { currentUser: _, workspaceId: b, authToken: E, apiGatewayUrl: D } = e(), [k, A] = d(""), [j, M] = d(null), [N, P] = d(!1), [F, I] = d("ALL"), L = {
|
|
16
|
+
refetchQueries: h,
|
|
17
|
+
awaitRefetchQueries: !0
|
|
18
|
+
}, { data: R, loading: z, error: B, fetchMore: ee } = y(i.document, {
|
|
19
|
+
variables: {
|
|
20
|
+
...i.variables,
|
|
21
|
+
pagination: { first: w }
|
|
22
|
+
},
|
|
23
|
+
skip: i.skip
|
|
24
|
+
}), [V, H] = v(l.document, L), U = R?.[i.dataKey], W = U?.items ?? [], G = F === "ALL" ? W : W.filter((e) => e.status === F), K = W.filter((e) => e.status === "OPEN").length, q = W.length - K, J = k.trim(), Y = J.length > T;
|
|
25
|
+
u(() => {
|
|
26
|
+
U && g?.(U.totalCount);
|
|
27
|
+
}, [U, g]);
|
|
28
|
+
let X = async (e, t) => {
|
|
29
|
+
M(null);
|
|
30
|
+
try {
|
|
31
|
+
return await r(V({ variables: l.buildVariables(e, t) })), !0;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return M(o(e) ? "Your role can read but not comment." : s(e, "The comment could not be posted.")), !1;
|
|
34
|
+
}
|
|
35
|
+
}, Z = async () => {
|
|
36
|
+
await X(J, null) && A("");
|
|
37
|
+
}, te = async () => {
|
|
38
|
+
let e = U?.pageInfo.endCursor;
|
|
39
|
+
if (e) {
|
|
40
|
+
P(!0);
|
|
41
|
+
try {
|
|
42
|
+
await ee({
|
|
43
|
+
variables: {
|
|
44
|
+
...i.variables,
|
|
45
|
+
pagination: {
|
|
46
|
+
first: w,
|
|
47
|
+
after: e
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
updateQuery: (e, { fetchMoreResult: t }) => ({ [i.dataKey]: {
|
|
51
|
+
...t[i.dataKey],
|
|
52
|
+
items: [...e[i.dataKey].items, ...t[i.dataKey].items]
|
|
53
|
+
} })
|
|
54
|
+
});
|
|
55
|
+
} finally {
|
|
56
|
+
P(!1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ S("div", {
|
|
61
|
+
className: "space-y-4",
|
|
62
|
+
"data-testid": "comment-thread",
|
|
63
|
+
children: [
|
|
64
|
+
j && /* @__PURE__ */ x(a, { message: j }),
|
|
65
|
+
z && !R && /* @__PURE__ */ x("p", {
|
|
66
|
+
className: "text-sm text-muted-foreground",
|
|
67
|
+
children: "Loading comments…"
|
|
68
|
+
}),
|
|
69
|
+
B && /* @__PURE__ */ x(a, { message: `Comments could not be loaded: ${B.message}` }),
|
|
70
|
+
U && W.length > 0 && /* @__PURE__ */ x("div", {
|
|
71
|
+
role: "group",
|
|
72
|
+
"aria-label": "Filter comments by resolution",
|
|
73
|
+
"data-testid": "comment-filter",
|
|
74
|
+
className: "flex flex-wrap gap-1",
|
|
75
|
+
children: [
|
|
76
|
+
["OPEN", `Open (${K})`],
|
|
77
|
+
["RESOLVED", `Resolved (${q})`],
|
|
78
|
+
["ALL", `All (${W.length})`]
|
|
79
|
+
].map(([e, t]) => /* @__PURE__ */ x(C, {
|
|
80
|
+
type: "button",
|
|
81
|
+
size: "sm",
|
|
82
|
+
variant: F === e ? "default" : "outline",
|
|
83
|
+
"aria-pressed": F === e,
|
|
84
|
+
className: "h-7 px-2.5 text-xs",
|
|
85
|
+
onClick: () => I(e),
|
|
86
|
+
children: t
|
|
87
|
+
}, e))
|
|
88
|
+
}),
|
|
89
|
+
U && G.length === 0 && /* @__PURE__ */ x("p", {
|
|
90
|
+
className: "text-sm text-muted-foreground",
|
|
91
|
+
children: W.length === 0 ? "No comments yet." : "No comments match this filter."
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ x("ol", {
|
|
94
|
+
className: "space-y-3",
|
|
95
|
+
children: G.map((e) => /* @__PURE__ */ x(O, {
|
|
96
|
+
comment: e,
|
|
97
|
+
currentUserId: _?.id,
|
|
98
|
+
editMutation: f,
|
|
99
|
+
removeMutation: p,
|
|
100
|
+
resolveMutation: m,
|
|
101
|
+
addMutation: l.document,
|
|
102
|
+
buildReplyVariables: (t) => l.buildVariables(t, e.id),
|
|
103
|
+
mutationRefetch: L,
|
|
104
|
+
onError: M,
|
|
105
|
+
idPrefix: n,
|
|
106
|
+
workspaceId: b,
|
|
107
|
+
authToken: E,
|
|
108
|
+
apiGatewayUrl: D
|
|
109
|
+
}, e.id))
|
|
110
|
+
}),
|
|
111
|
+
U?.pageInfo.hasNextPage && /* @__PURE__ */ x(C, {
|
|
112
|
+
size: "sm",
|
|
113
|
+
variant: "outline",
|
|
114
|
+
onClick: () => void te(),
|
|
115
|
+
disabled: N,
|
|
116
|
+
children: N ? "Loading…" : `Show more (${W.length} of ${U.totalCount})`
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ S("div", {
|
|
119
|
+
className: "space-y-2 border-t border-border-default pt-4",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ x("label", {
|
|
122
|
+
htmlFor: `${n}-add`,
|
|
123
|
+
className: "sr-only",
|
|
124
|
+
children: "Add a comment"
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ x(c, {
|
|
127
|
+
id: `${n}-add`,
|
|
128
|
+
ariaLabel: `Add a comment on this ${t}`,
|
|
129
|
+
placeholder: "Add a comment…",
|
|
130
|
+
className: "min-h-[72px]",
|
|
131
|
+
value: k,
|
|
132
|
+
onChange: A,
|
|
133
|
+
workspaceId: b,
|
|
134
|
+
authToken: E,
|
|
135
|
+
apiGatewayUrl: D
|
|
136
|
+
}),
|
|
137
|
+
Y && /* @__PURE__ */ x(a, { message: `A comment can be at most ${T} characters.` }),
|
|
138
|
+
/* @__PURE__ */ x("div", {
|
|
139
|
+
className: "flex justify-end",
|
|
140
|
+
children: /* @__PURE__ */ x(C, {
|
|
141
|
+
size: "sm",
|
|
142
|
+
onClick: () => void Z(),
|
|
143
|
+
disabled: !J || Y || H.loading,
|
|
144
|
+
"data-testid": "comment-post",
|
|
145
|
+
children: H.loading ? "Posting…" : "Comment"
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function O({ comment: e, currentUserId: u, editMutation: y, removeMutation: w, resolveMutation: D, addMutation: O, buildReplyVariables: A, mutationRefetch: j, onError: M, idPrefix: N, workspaceId: P, authToken: F, apiGatewayUrl: I }) {
|
|
154
|
+
let [L, R] = d(!1), [z, B] = d(e.body), [ee, V] = d(e.status !== "RESOLVED"), [H, U] = d(!1), [W, G] = d(""), [K, q] = d(null), J = n(e.authorId), [Y, X] = v(y, j), [Z, te] = v(w, j), [ne, re] = v(D, j), [ie, ae] = v(O, j), oe = e.authorId === u, Q = e.status === "RESOLVED", se = z.trim().length > T, ce = W.trim().length > T, le = async () => {
|
|
155
|
+
M(null);
|
|
156
|
+
try {
|
|
157
|
+
await r(Y({ variables: {
|
|
158
|
+
id: e.id,
|
|
159
|
+
body: z.trim()
|
|
160
|
+
} })), R(!1);
|
|
161
|
+
} catch (e) {
|
|
162
|
+
M(s(e, "The comment could not be saved."));
|
|
163
|
+
}
|
|
164
|
+
}, ue = async () => {
|
|
165
|
+
M(null);
|
|
166
|
+
try {
|
|
167
|
+
await r(Z({ variables: { id: e.id } }));
|
|
168
|
+
} catch (e) {
|
|
169
|
+
M(s(e, "The comment could not be deleted."));
|
|
170
|
+
}
|
|
171
|
+
}, de = async () => {
|
|
172
|
+
M(null);
|
|
173
|
+
try {
|
|
174
|
+
await r(ne({ variables: {
|
|
175
|
+
id: e.id,
|
|
176
|
+
resolved: !Q
|
|
177
|
+
} }));
|
|
178
|
+
} catch (e) {
|
|
179
|
+
M(o(e) ? "Your role can read but not resolve comments." : s(e, "The resolution could not be changed."));
|
|
180
|
+
}
|
|
181
|
+
}, fe = (e, t, n) => {
|
|
182
|
+
q(e), G(t && n ? `@[${n}](${t}) ` : ""), U(!0), V(!0);
|
|
183
|
+
}, pe = async () => {
|
|
184
|
+
let e = W.trim();
|
|
185
|
+
if (e) {
|
|
186
|
+
M(null);
|
|
187
|
+
try {
|
|
188
|
+
await r(ie({ variables: A(e) })), G(""), U(!1), q(null);
|
|
189
|
+
} catch (e) {
|
|
190
|
+
M(o(e) ? "Your role can read but not comment." : s(e, "The reply could not be posted."));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}, $ = `${N}-comment-${e.id}`;
|
|
194
|
+
return /* @__PURE__ */ x("li", {
|
|
195
|
+
className: "rounded-md border border-border-default p-3 space-y-2",
|
|
196
|
+
"data-testid": "comment-thread-item",
|
|
197
|
+
children: Q && !ee ? /* @__PURE__ */ S("div", {
|
|
198
|
+
className: "flex items-center justify-between gap-2",
|
|
199
|
+
children: [/* @__PURE__ */ S("p", {
|
|
200
|
+
className: "min-w-0 truncate text-sm text-muted-foreground",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ x(f, {
|
|
203
|
+
className: "mr-1 inline h-3.5 w-3.5 text-status-success-text",
|
|
204
|
+
"aria-hidden": "true"
|
|
205
|
+
}),
|
|
206
|
+
"Resolved by ",
|
|
207
|
+
/* @__PURE__ */ x(t, { id: e.resolvedBy }),
|
|
208
|
+
e.resolvedAt ? ` · ${E(e.resolvedAt)}` : "",
|
|
209
|
+
e.replies.length > 0 ? ` · ${e.replies.length} repl${e.replies.length === 1 ? "y" : "ies"}` : ""
|
|
210
|
+
]
|
|
211
|
+
}), /* @__PURE__ */ S(C, {
|
|
212
|
+
size: "sm",
|
|
213
|
+
variant: "ghost",
|
|
214
|
+
className: "h-6 shrink-0 px-2 text-xs",
|
|
215
|
+
"aria-expanded": !1,
|
|
216
|
+
"aria-controls": $,
|
|
217
|
+
onClick: () => V(!0),
|
|
218
|
+
children: [/* @__PURE__ */ x(m, {
|
|
219
|
+
className: "mr-1 h-3.5 w-3.5",
|
|
220
|
+
"aria-hidden": "true"
|
|
221
|
+
}), "Expand"]
|
|
222
|
+
})]
|
|
223
|
+
}) : /* @__PURE__ */ S("div", {
|
|
224
|
+
id: $,
|
|
225
|
+
className: "space-y-2",
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ S("div", {
|
|
228
|
+
className: "flex items-start justify-between gap-2 text-xs text-muted-foreground",
|
|
229
|
+
children: [/* @__PURE__ */ S("span", { children: [
|
|
230
|
+
/* @__PURE__ */ x("span", {
|
|
231
|
+
className: "font-medium text-foreground",
|
|
232
|
+
children: /* @__PURE__ */ x(t, { id: e.authorId })
|
|
233
|
+
}),
|
|
234
|
+
" ",
|
|
235
|
+
"· ",
|
|
236
|
+
E(e.createdAt),
|
|
237
|
+
e.editedAt && /* @__PURE__ */ x("span", {
|
|
238
|
+
title: `Edited ${E(e.editedAt)}`,
|
|
239
|
+
children: " · edited"
|
|
240
|
+
}),
|
|
241
|
+
Q && /* @__PURE__ */ S("span", {
|
|
242
|
+
className: "ml-1 inline-flex items-center gap-1 text-status-success-text",
|
|
243
|
+
children: [/* @__PURE__ */ x(f, {
|
|
244
|
+
className: "h-3.5 w-3.5",
|
|
245
|
+
"aria-hidden": "true"
|
|
246
|
+
}), "Resolved"]
|
|
247
|
+
})
|
|
248
|
+
] }), /* @__PURE__ */ S("span", {
|
|
249
|
+
className: "flex shrink-0 items-center gap-1",
|
|
250
|
+
children: [
|
|
251
|
+
oe && !L && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(C, {
|
|
252
|
+
size: "sm",
|
|
253
|
+
variant: "ghost",
|
|
254
|
+
className: "h-6 px-2 text-xs",
|
|
255
|
+
onClick: () => R(!0),
|
|
256
|
+
children: "Edit"
|
|
257
|
+
}), /* @__PURE__ */ x(i, {
|
|
258
|
+
label: "",
|
|
259
|
+
ariaLabel: "Delete comment",
|
|
260
|
+
variant: "outline",
|
|
261
|
+
icon: /* @__PURE__ */ x(_, {
|
|
262
|
+
className: "h-3.5 w-3.5",
|
|
263
|
+
"aria-hidden": "true"
|
|
264
|
+
}),
|
|
265
|
+
title: "Delete this comment?",
|
|
266
|
+
description: "It is removed from the discussion for everyone, replies included. This cannot be undone here.",
|
|
267
|
+
confirmLabel: "Delete",
|
|
268
|
+
destructive: !0,
|
|
269
|
+
disabled: te.loading,
|
|
270
|
+
onConfirm: () => void ue()
|
|
271
|
+
})] }),
|
|
272
|
+
/* @__PURE__ */ x(C, {
|
|
273
|
+
size: "sm",
|
|
274
|
+
variant: Q ? "outline" : "ghost",
|
|
275
|
+
className: "h-6 px-2 text-xs",
|
|
276
|
+
"data-testid": "comment-resolve",
|
|
277
|
+
disabled: re.loading,
|
|
278
|
+
onClick: () => void de(),
|
|
279
|
+
children: Q ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(g, {
|
|
280
|
+
className: "mr-1 h-3.5 w-3.5",
|
|
281
|
+
"aria-hidden": "true"
|
|
282
|
+
}), "Reopen"] }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(f, {
|
|
283
|
+
className: "mr-1 h-3.5 w-3.5",
|
|
284
|
+
"aria-hidden": "true"
|
|
285
|
+
}), "Resolve"] })
|
|
286
|
+
}),
|
|
287
|
+
Q && /* @__PURE__ */ S(C, {
|
|
288
|
+
size: "sm",
|
|
289
|
+
variant: "ghost",
|
|
290
|
+
className: "h-6 px-2 text-xs",
|
|
291
|
+
"aria-expanded": !0,
|
|
292
|
+
"aria-controls": $,
|
|
293
|
+
onClick: () => V(!1),
|
|
294
|
+
children: [/* @__PURE__ */ x(p, {
|
|
295
|
+
className: "mr-1 h-3.5 w-3.5",
|
|
296
|
+
"aria-hidden": "true"
|
|
297
|
+
}), "Collapse"]
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
})]
|
|
301
|
+
}),
|
|
302
|
+
L ? /* @__PURE__ */ S("div", {
|
|
303
|
+
className: "space-y-2",
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ x(c, {
|
|
306
|
+
id: `${$}-edit`,
|
|
307
|
+
ariaLabel: "Edit comment",
|
|
308
|
+
className: "min-h-[60px]",
|
|
309
|
+
value: z,
|
|
310
|
+
onChange: B,
|
|
311
|
+
workspaceId: P,
|
|
312
|
+
authToken: F,
|
|
313
|
+
apiGatewayUrl: I
|
|
314
|
+
}),
|
|
315
|
+
se && /* @__PURE__ */ x(a, { message: `A comment can be at most ${T} characters.` }),
|
|
316
|
+
/* @__PURE__ */ S("div", {
|
|
317
|
+
className: "flex justify-end gap-2",
|
|
318
|
+
children: [/* @__PURE__ */ x(C, {
|
|
319
|
+
size: "sm",
|
|
320
|
+
variant: "outline",
|
|
321
|
+
onClick: () => {
|
|
322
|
+
R(!1), B(e.body), M(null);
|
|
323
|
+
},
|
|
324
|
+
children: "Cancel"
|
|
325
|
+
}), /* @__PURE__ */ x(C, {
|
|
326
|
+
size: "sm",
|
|
327
|
+
onClick: () => void le(),
|
|
328
|
+
disabled: !z.trim() || se || X.loading,
|
|
329
|
+
children: X.loading ? "Saving…" : "Save"
|
|
330
|
+
})]
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
}) : /* @__PURE__ */ x(l, { text: e.body }),
|
|
334
|
+
!L && /* @__PURE__ */ S(C, {
|
|
335
|
+
size: "sm",
|
|
336
|
+
variant: "ghost",
|
|
337
|
+
className: "h-6 px-2 text-xs",
|
|
338
|
+
"data-testid": "comment-reply",
|
|
339
|
+
onClick: () => fe(J?.displayName ?? "this comment", e.authorId, J?.displayName),
|
|
340
|
+
children: [/* @__PURE__ */ x(h, {
|
|
341
|
+
className: "mr-1 h-3.5 w-3.5",
|
|
342
|
+
"aria-hidden": "true"
|
|
343
|
+
}), "Reply"]
|
|
344
|
+
}),
|
|
345
|
+
e.replies.length > 0 && /* @__PURE__ */ x("ol", {
|
|
346
|
+
className: "ml-5 space-y-2 border-l border-border-default pl-3",
|
|
347
|
+
children: e.replies.map((e) => /* @__PURE__ */ x(k, {
|
|
348
|
+
reply: e,
|
|
349
|
+
currentUserId: u,
|
|
350
|
+
editMutation: y,
|
|
351
|
+
removeMutation: w,
|
|
352
|
+
mutationRefetch: j,
|
|
353
|
+
onError: M,
|
|
354
|
+
idPrefix: N,
|
|
355
|
+
workspaceId: P,
|
|
356
|
+
authToken: F,
|
|
357
|
+
apiGatewayUrl: I,
|
|
358
|
+
onReply: fe
|
|
359
|
+
}, e.id))
|
|
360
|
+
}),
|
|
361
|
+
H && /* @__PURE__ */ S("div", {
|
|
362
|
+
className: "ml-5 space-y-2 border-l border-border-default pl-3",
|
|
363
|
+
children: [
|
|
364
|
+
K && /* @__PURE__ */ S("p", {
|
|
365
|
+
className: "text-xs text-muted-foreground",
|
|
366
|
+
children: ["Replying to ", K]
|
|
367
|
+
}),
|
|
368
|
+
/* @__PURE__ */ x(c, {
|
|
369
|
+
id: `${$}-reply`,
|
|
370
|
+
ariaLabel: "Write a reply",
|
|
371
|
+
className: "min-h-[60px]",
|
|
372
|
+
value: W,
|
|
373
|
+
onChange: G,
|
|
374
|
+
autoFocus: !0,
|
|
375
|
+
workspaceId: P,
|
|
376
|
+
authToken: F,
|
|
377
|
+
apiGatewayUrl: I
|
|
378
|
+
}),
|
|
379
|
+
ce && /* @__PURE__ */ x(a, { message: `A comment can be at most ${T} characters.` }),
|
|
380
|
+
/* @__PURE__ */ S("div", {
|
|
381
|
+
className: "flex justify-end gap-2",
|
|
382
|
+
children: [/* @__PURE__ */ x(C, {
|
|
383
|
+
size: "sm",
|
|
384
|
+
variant: "outline",
|
|
385
|
+
onClick: () => {
|
|
386
|
+
U(!1), G(""), q(null);
|
|
387
|
+
},
|
|
388
|
+
children: "Cancel"
|
|
389
|
+
}), /* @__PURE__ */ x(C, {
|
|
390
|
+
size: "sm",
|
|
391
|
+
onClick: () => void pe(),
|
|
392
|
+
disabled: !W.trim() || ce || ae.loading,
|
|
393
|
+
children: ae.loading ? "Posting…" : "Reply"
|
|
394
|
+
})]
|
|
395
|
+
})
|
|
396
|
+
]
|
|
397
|
+
})
|
|
398
|
+
]
|
|
399
|
+
})
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
function k({ reply: e, currentUserId: o, editMutation: u, removeMutation: f, mutationRefetch: p, onError: m, idPrefix: g, workspaceId: y, authToken: b, apiGatewayUrl: w, onReply: D }) {
|
|
403
|
+
let [O, k] = d(!1), [A, j] = d(e.body), M = n(e.authorId), [N, P] = v(u, p), [F, I] = v(f, p), L = e.authorId === o, R = A.trim().length > T, z = async () => {
|
|
404
|
+
m(null);
|
|
405
|
+
try {
|
|
406
|
+
await r(N({ variables: {
|
|
407
|
+
id: e.id,
|
|
408
|
+
body: A.trim()
|
|
409
|
+
} })), k(!1);
|
|
410
|
+
} catch (e) {
|
|
411
|
+
m(s(e, "The reply could not be saved."));
|
|
412
|
+
}
|
|
413
|
+
}, B = async () => {
|
|
414
|
+
m(null);
|
|
415
|
+
try {
|
|
416
|
+
await r(F({ variables: { id: e.id } }));
|
|
417
|
+
} catch (e) {
|
|
418
|
+
m(s(e, "The reply could not be deleted."));
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
return /* @__PURE__ */ S("li", {
|
|
422
|
+
className: "space-y-1",
|
|
423
|
+
"data-testid": "comment-reply-item",
|
|
424
|
+
children: [
|
|
425
|
+
/* @__PURE__ */ S("div", {
|
|
426
|
+
className: "flex items-start justify-between gap-2 text-xs text-muted-foreground",
|
|
427
|
+
children: [/* @__PURE__ */ S("span", { children: [
|
|
428
|
+
/* @__PURE__ */ x("span", {
|
|
429
|
+
className: "font-medium text-foreground",
|
|
430
|
+
children: /* @__PURE__ */ x(t, { id: e.authorId })
|
|
431
|
+
}),
|
|
432
|
+
" ",
|
|
433
|
+
"· ",
|
|
434
|
+
E(e.createdAt),
|
|
435
|
+
e.editedAt && /* @__PURE__ */ x("span", {
|
|
436
|
+
title: `Edited ${E(e.editedAt)}`,
|
|
437
|
+
children: " · edited"
|
|
438
|
+
})
|
|
439
|
+
] }), L && !O && /* @__PURE__ */ S("span", {
|
|
440
|
+
className: "flex shrink-0 items-center gap-1",
|
|
441
|
+
children: [/* @__PURE__ */ x(C, {
|
|
442
|
+
size: "sm",
|
|
443
|
+
variant: "ghost",
|
|
444
|
+
className: "h-6 px-2 text-xs",
|
|
445
|
+
onClick: () => k(!0),
|
|
446
|
+
children: "Edit"
|
|
447
|
+
}), /* @__PURE__ */ x(i, {
|
|
448
|
+
label: "",
|
|
449
|
+
ariaLabel: "Delete reply",
|
|
450
|
+
variant: "outline",
|
|
451
|
+
icon: /* @__PURE__ */ x(_, {
|
|
452
|
+
className: "h-3.5 w-3.5",
|
|
453
|
+
"aria-hidden": "true"
|
|
454
|
+
}),
|
|
455
|
+
title: "Delete this reply?",
|
|
456
|
+
description: "It is removed from the discussion for everyone. This cannot be undone here.",
|
|
457
|
+
confirmLabel: "Delete",
|
|
458
|
+
destructive: !0,
|
|
459
|
+
disabled: I.loading,
|
|
460
|
+
onConfirm: () => void B()
|
|
461
|
+
})]
|
|
462
|
+
})]
|
|
463
|
+
}),
|
|
464
|
+
O ? /* @__PURE__ */ S("div", {
|
|
465
|
+
className: "space-y-2",
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ x(c, {
|
|
468
|
+
id: `${g}-reply-${e.id}-edit`,
|
|
469
|
+
ariaLabel: "Edit reply",
|
|
470
|
+
className: "min-h-[56px]",
|
|
471
|
+
value: A,
|
|
472
|
+
onChange: j,
|
|
473
|
+
workspaceId: y,
|
|
474
|
+
authToken: b,
|
|
475
|
+
apiGatewayUrl: w
|
|
476
|
+
}),
|
|
477
|
+
R && /* @__PURE__ */ x(a, { message: `A comment can be at most ${T} characters.` }),
|
|
478
|
+
/* @__PURE__ */ S("div", {
|
|
479
|
+
className: "flex justify-end gap-2",
|
|
480
|
+
children: [/* @__PURE__ */ x(C, {
|
|
481
|
+
size: "sm",
|
|
482
|
+
variant: "outline",
|
|
483
|
+
onClick: () => {
|
|
484
|
+
k(!1), j(e.body), m(null);
|
|
485
|
+
},
|
|
486
|
+
children: "Cancel"
|
|
487
|
+
}), /* @__PURE__ */ x(C, {
|
|
488
|
+
size: "sm",
|
|
489
|
+
onClick: () => void z(),
|
|
490
|
+
disabled: !A.trim() || R || P.loading,
|
|
491
|
+
children: P.loading ? "Saving…" : "Save"
|
|
492
|
+
})]
|
|
493
|
+
})
|
|
494
|
+
]
|
|
495
|
+
}) : /* @__PURE__ */ x(l, { text: e.body }),
|
|
496
|
+
!O && /* @__PURE__ */ S(C, {
|
|
497
|
+
size: "sm",
|
|
498
|
+
variant: "ghost",
|
|
499
|
+
className: "h-6 px-2 text-xs",
|
|
500
|
+
"data-testid": "comment-reply",
|
|
501
|
+
onClick: () => D(M?.displayName ?? "this reply", e.authorId, M?.displayName),
|
|
502
|
+
children: [/* @__PURE__ */ x(h, {
|
|
503
|
+
className: "mr-1 h-3.5 w-3.5",
|
|
504
|
+
"aria-hidden": "true"
|
|
505
|
+
}), "Reply"]
|
|
506
|
+
})
|
|
507
|
+
]
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
//#endregion
|
|
511
|
+
export { D as CommentThread };
|
|
512
|
+
|
|
513
|
+
//# sourceMappingURL=CommentThread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommentThread.js","names":[],"sources":["../../../src/planmagnet/comments/CommentThread.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport type { DocumentNode } from 'graphql';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { CheckCircle2, ChevronDown, ChevronRight, Reply, RotateCcw, Trash2 } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { PersonName, usePersonProfile } from '../people/People';\nimport { ConfirmButton, ErrorLine } from '../controls/ConfirmButton';\nimport { throwOnError } from '../utils/mutationResult';\nimport { isForbidden, mutationErrorMessage } from '../utils/graphqlErrors';\nimport { MentionComposer, MentionText } from './MentionComposer';\n\n/**\n * The comment thread engine shared by every commentable surface in this MFE: a work item (CWF-02, via\n * `WorkItemComments.tsx`) and a project/doc (CWF-12, via `TargetComments.tsx`). Modeled on\n * `comments/RoadmapComments.tsx`'s list/add/author-only-edit/delete structure, extended with:\n *\n * - Threading (CWF-02): `PlanmagnetWorkItemComment`/`PlanmagnetComment.replies` are ONE level deep by contract —\n * the server reparents \"a reply to a reply\" onto ITS OWN top-level parent. So a Reply action lives on both a\n * top-level comment and on one of its replies, but both always post with `parentId = <the top-level id>`\n * (`replyTargetId` below), matching what the server would do anyway — never a reply's own id.\n * - Resolution (CWF-14): a top-level-only OPEN/RESOLVED toggle, not restricted to the comment's author. A\n * resolved thread collapses to a one-line summary that can be expanded back out.\n * - Mentions (CWF-13): every composer here (add / reply / edit) is a `MentionComposer`; every rendered body is\n * `MentionText`, so a `@[Name](actorId)` token always shows as a highlighted name, never raw markup.\n * - A caller-agnostic core: `query`/`add`/`edit`/`remove`/`resolve` are passed in per surface (different\n * operation names, same field shapes — see `graphql/wspace.graphql`'s `PlanmagnetWorkItemComment` vs\n * `PlanmagnetComment` doc comments: \"everything here means exactly what it means on\" the other type).\n *\n * The status filter (Open/Resolved/All) is applied CLIENT-SIDE over the loaded page: none of\n * `planmagnetWorkItemComments`/`planmagnetProjectComments`/`planmagnetDocComments` take a status argument, only\n * `pagination` — same constraint the pre-existing pagination already lived with.\n */\n\nconst PAGE = 30;\nconst MAX_LENGTH = 10_000; // Every Add*CommentInput: \"1 to 10,000 characters after trimming\"\n\ntype CommentStatus = 'OPEN' | 'RESOLVED';\n\nexport interface ThreadComment {\n id: string;\n authorId: string;\n body: string;\n createdAt: string;\n editedAt: string | null;\n parentId: string | null;\n status: CommentStatus;\n resolvedBy: string | null;\n resolvedAt: string | null;\n mentions: string[];\n replies: ThreadComment[];\n}\n\ninterface ThreadList {\n totalCount: number;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n items: ThreadComment[];\n}\n\ntype ThreadQueryData = Record<string, ThreadList>;\n\nexport interface CommentThreadProps {\n /** What this thread is attached to, used only in accessible copy (\"Add a comment on this task…\"). */\n targetNoun: string;\n /** Seeds every form-control id this instance renders, so two threads on the same page never collide. */\n idPrefix: string;\n query: {\n document: DocumentNode;\n /** The response field this query's data lands under (`planmagnetWorkItemComments`, …). */\n dataKey: string;\n variables: Record<string, unknown>;\n skip?: boolean;\n };\n add: {\n document: DocumentNode;\n buildVariables: (body: string, parentId: string | null) => Record<string, unknown>;\n };\n edit: DocumentNode;\n remove: DocumentNode;\n resolve: DocumentNode;\n /** Apollo operation names to refetch after any write here (this thread's own query, plus e.g. an Activity\n * panel on the same page that also shows COMMENTED events). */\n refetchQueries: string[];\n /** Reports the thread's live top-level count up to the caller, for a \"Comments (n)\" title. */\n onTotalCount?: (count: number) => void;\n}\n\nconst when = (iso: string) => new Date(iso).toLocaleString();\n\nexport function CommentThread({\n targetNoun,\n idPrefix,\n query,\n add,\n edit,\n remove,\n resolve,\n refetchQueries,\n onTotalCount,\n}: CommentThreadProps) {\n const { currentUser, workspaceId, authToken, apiGatewayUrl } = usePlanMagnet();\n const [draft, setDraft] = useState('');\n const [error, setError] = useState<string | null>(null);\n const [loadingMore, setLoadingMore] = useState(false);\n const [filter, setFilter] = useState<'OPEN' | 'RESOLVED' | 'ALL'>('ALL');\n\n const mutationRefetch = { refetchQueries, awaitRefetchQueries: true };\n\n const {\n data,\n loading,\n error: loadError,\n fetchMore,\n } = useQuery<ThreadQueryData>(query.document, {\n variables: { ...query.variables, pagination: { first: PAGE } },\n skip: query.skip,\n });\n const [addComment, addState] = useMutation(add.document, mutationRefetch);\n\n const thread = data?.[query.dataKey];\n // The server returns TOP-LEVEL comments here; each carries its own (bounded, unpaginated) `replies`.\n const topLevel = thread?.items ?? [];\n const visible = filter === 'ALL' ? topLevel : topLevel.filter((c) => c.status === filter);\n const openCount = topLevel.filter((c) => c.status === 'OPEN').length;\n const resolvedCount = topLevel.length - openCount;\n\n const trimmed = draft.trim();\n const tooLong = trimmed.length > MAX_LENGTH;\n\n useEffect(() => {\n if (thread) onTotalCount?.(thread.totalCount);\n }, [thread, onTotalCount]);\n\n const post = async (body: string, parentId: string | null): Promise<boolean> => {\n setError(null);\n try {\n await throwOnError(addComment({ variables: add.buildVariables(body, parentId) }));\n return true;\n } catch (e) {\n setError(\n isForbidden(e)\n ? 'Your role can read but not comment.'\n : mutationErrorMessage(e, 'The comment could not be posted.')\n );\n return false;\n }\n };\n\n const submitTop = async () => {\n if (await post(trimmed, null)) setDraft('');\n };\n\n const loadMore = async () => {\n const after = thread?.pageInfo.endCursor;\n if (!after) return;\n setLoadingMore(true);\n try {\n await fetchMore({\n variables: { ...query.variables, pagination: { first: PAGE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n [query.dataKey]: {\n ...fetchMoreResult[query.dataKey],\n items: [...prev[query.dataKey].items, ...fetchMoreResult[query.dataKey].items],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n return (\n <div className=\"space-y-4\" data-testid=\"comment-thread\">\n {error && <ErrorLine message={error} />}\n {loading && !data && <p className=\"text-sm text-muted-foreground\">Loading comments…</p>}\n {loadError && <ErrorLine message={`Comments could not be loaded: ${loadError.message}`} />}\n\n {thread && topLevel.length > 0 && (\n <div\n role=\"group\"\n aria-label=\"Filter comments by resolution\"\n data-testid=\"comment-filter\"\n className=\"flex flex-wrap gap-1\"\n >\n {(\n [\n ['OPEN', `Open (${openCount})`],\n ['RESOLVED', `Resolved (${resolvedCount})`],\n ['ALL', `All (${topLevel.length})`],\n ] as const\n ).map(([mode, label]) => (\n <Button\n key={mode}\n type=\"button\"\n size=\"sm\"\n variant={filter === mode ? 'default' : 'outline'}\n aria-pressed={filter === mode}\n className=\"h-7 px-2.5 text-xs\"\n onClick={() => setFilter(mode)}\n >\n {label}\n </Button>\n ))}\n </div>\n )}\n\n {thread && visible.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">\n {topLevel.length === 0 ? 'No comments yet.' : 'No comments match this filter.'}\n </p>\n )}\n\n <ol className=\"space-y-3\">\n {visible.map((comment) => (\n <TopLevelThread\n key={comment.id}\n comment={comment}\n currentUserId={currentUser?.id}\n editMutation={edit}\n removeMutation={remove}\n resolveMutation={resolve}\n addMutation={add.document}\n buildReplyVariables={(body) => add.buildVariables(body, comment.id)}\n mutationRefetch={mutationRefetch}\n onError={setError}\n idPrefix={idPrefix}\n workspaceId={workspaceId}\n authToken={authToken}\n apiGatewayUrl={apiGatewayUrl}\n />\n ))}\n </ol>\n\n {thread?.pageInfo.hasNextPage && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => void loadMore()} disabled={loadingMore}>\n {loadingMore ? 'Loading…' : `Show more (${topLevel.length} of ${thread.totalCount})`}\n </Button>\n )}\n\n <div className=\"space-y-2 border-t border-border-default pt-4\">\n <label htmlFor={`${idPrefix}-add`} className=\"sr-only\">\n Add a comment\n </label>\n <MentionComposer\n id={`${idPrefix}-add`}\n ariaLabel={`Add a comment on this ${targetNoun}`}\n placeholder=\"Add a comment…\"\n className=\"min-h-[72px]\"\n value={draft}\n onChange={setDraft}\n workspaceId={workspaceId}\n authToken={authToken}\n apiGatewayUrl={apiGatewayUrl}\n />\n {tooLong && <ErrorLine message={`A comment can be at most ${MAX_LENGTH} characters.`} />}\n <div className=\"flex justify-end\">\n <Button\n size=\"sm\"\n onClick={() => void submitTop()}\n disabled={!trimmed || tooLong || addState.loading}\n data-testid=\"comment-post\"\n >\n {addState.loading ? 'Posting…' : 'Comment'}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\ninterface RowMutationProps {\n editMutation: DocumentNode;\n removeMutation: DocumentNode;\n mutationRefetch: { refetchQueries: string[]; awaitRefetchQueries: boolean };\n onError: (message: string | null) => void;\n idPrefix: string;\n workspaceId?: string;\n authToken?: string;\n apiGatewayUrl?: string;\n}\n\n/**\n * One top-level comment: header, body, its replies (indented), a Reply action, and — top-level only — the\n * Resolve/Reopen toggle. A resolved thread starts collapsed to a one-line summary; expand/collapse is local UI\n * state that does not reset when Resolve/Reopen flips (so reopening mid-review doesn't yank the view around).\n */\nfunction TopLevelThread({\n comment,\n currentUserId,\n editMutation,\n removeMutation,\n resolveMutation,\n addMutation,\n buildReplyVariables,\n mutationRefetch,\n onError,\n idPrefix,\n workspaceId,\n authToken,\n apiGatewayUrl,\n}: RowMutationProps & {\n comment: ThreadComment;\n currentUserId: string | undefined;\n resolveMutation: DocumentNode;\n addMutation: DocumentNode;\n buildReplyVariables: (body: string) => Record<string, unknown>;\n}) {\n const [editing, setEditing] = useState(false);\n const [text, setText] = useState(comment.body);\n const [expanded, setExpanded] = useState(comment.status !== 'RESOLVED');\n const [replyOpen, setReplyOpen] = useState(false);\n const [replyDraft, setReplyDraft] = useState('');\n const [replyingToName, setReplyingToName] = useState<string | null>(null);\n\n const authorProfile = usePersonProfile(comment.authorId);\n const [edit, editState] = useMutation(editMutation, mutationRefetch);\n const [remove, removeState] = useMutation(removeMutation, mutationRefetch);\n const [resolveComment, resolveState] = useMutation(resolveMutation, mutationRefetch);\n const [reply, replyState] = useMutation(addMutation, mutationRefetch);\n\n const mine = comment.authorId === currentUserId;\n const resolved = comment.status === 'RESOLVED';\n const editTooLong = text.trim().length > MAX_LENGTH;\n const replyTooLong = replyDraft.trim().length > MAX_LENGTH;\n\n const save = async () => {\n onError(null);\n try {\n await throwOnError(edit({ variables: { id: comment.id, body: text.trim() } }));\n setEditing(false);\n } catch (e) {\n onError(mutationErrorMessage(e, 'The comment could not be saved.'));\n }\n };\n\n const onRemove = async () => {\n onError(null);\n try {\n await throwOnError(remove({ variables: { id: comment.id } }));\n } catch (e) {\n onError(mutationErrorMessage(e, 'The comment could not be deleted.'));\n }\n };\n\n const toggleResolve = async () => {\n onError(null);\n try {\n await throwOnError(resolveComment({ variables: { id: comment.id, resolved: !resolved } }));\n } catch (e) {\n onError(\n isForbidden(e)\n ? 'Your role can read but not resolve comments.'\n : mutationErrorMessage(e, 'The resolution could not be changed.')\n );\n }\n };\n\n const openReply = (name: string, mentionId?: string, mentionName?: string) => {\n setReplyingToName(name);\n setReplyDraft(mentionId && mentionName ? `@[${mentionName}](${mentionId}) ` : '');\n setReplyOpen(true);\n setExpanded(true);\n };\n\n const submitReply = async () => {\n const body = replyDraft.trim();\n if (!body) return;\n onError(null);\n try {\n await throwOnError(reply({ variables: buildReplyVariables(body) }));\n setReplyDraft('');\n setReplyOpen(false);\n setReplyingToName(null);\n } catch (e) {\n onError(\n isForbidden(e)\n ? 'Your role can read but not comment.'\n : mutationErrorMessage(e, 'The reply could not be posted.')\n );\n }\n };\n\n const rowId = `${idPrefix}-comment-${comment.id}`;\n\n return (\n <li\n className=\"rounded-md border border-border-default p-3 space-y-2\"\n data-testid=\"comment-thread-item\"\n >\n {resolved && !expanded ? (\n <div className=\"flex items-center justify-between gap-2\">\n <p className=\"min-w-0 truncate text-sm text-muted-foreground\">\n <CheckCircle2\n className=\"mr-1 inline h-3.5 w-3.5 text-status-success-text\"\n aria-hidden=\"true\"\n />\n Resolved by <PersonName id={comment.resolvedBy} />\n {comment.resolvedAt ? ` · ${when(comment.resolvedAt)}` : ''}\n {comment.replies.length > 0\n ? ` · ${comment.replies.length} repl${comment.replies.length === 1 ? 'y' : 'ies'}`\n : ''}\n </p>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 shrink-0 px-2 text-xs\"\n aria-expanded={false}\n aria-controls={rowId}\n onClick={() => setExpanded(true)}\n >\n <ChevronRight className=\"mr-1 h-3.5 w-3.5\" aria-hidden=\"true\" />\n Expand\n </Button>\n </div>\n ) : (\n <div id={rowId} className=\"space-y-2\">\n <div className=\"flex items-start justify-between gap-2 text-xs text-muted-foreground\">\n <span>\n <span className=\"font-medium text-foreground\">\n <PersonName id={comment.authorId} />\n </span>{' '}\n · {when(comment.createdAt)}\n {comment.editedAt && (\n <span title={`Edited ${when(comment.editedAt)}`}> · edited</span>\n )}\n {resolved && (\n <span className=\"ml-1 inline-flex items-center gap-1 text-status-success-text\">\n <CheckCircle2 className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n Resolved\n </span>\n )}\n </span>\n <span className=\"flex shrink-0 items-center gap-1\">\n {mine && !editing && (\n <>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 px-2 text-xs\"\n onClick={() => setEditing(true)}\n >\n Edit\n </Button>\n <ConfirmButton\n label=\"\"\n ariaLabel=\"Delete comment\"\n variant=\"outline\"\n icon={<Trash2 className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />}\n title=\"Delete this comment?\"\n description=\"It is removed from the discussion for everyone, replies included. This cannot be undone here.\"\n confirmLabel=\"Delete\"\n destructive\n disabled={removeState.loading}\n onConfirm={() => void onRemove()}\n />\n </>\n )}\n <Button\n size=\"sm\"\n variant={resolved ? 'outline' : 'ghost'}\n className=\"h-6 px-2 text-xs\"\n data-testid=\"comment-resolve\"\n disabled={resolveState.loading}\n onClick={() => void toggleResolve()}\n >\n {resolved ? (\n <>\n <RotateCcw className=\"mr-1 h-3.5 w-3.5\" aria-hidden=\"true\" />\n Reopen\n </>\n ) : (\n <>\n <CheckCircle2 className=\"mr-1 h-3.5 w-3.5\" aria-hidden=\"true\" />\n Resolve\n </>\n )}\n </Button>\n {resolved && (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 px-2 text-xs\"\n aria-expanded\n aria-controls={rowId}\n onClick={() => setExpanded(false)}\n >\n <ChevronDown className=\"mr-1 h-3.5 w-3.5\" aria-hidden=\"true\" />\n Collapse\n </Button>\n )}\n </span>\n </div>\n\n {editing ? (\n <div className=\"space-y-2\">\n <MentionComposer\n id={`${rowId}-edit`}\n ariaLabel=\"Edit comment\"\n className=\"min-h-[60px]\"\n value={text}\n onChange={setText}\n workspaceId={workspaceId}\n authToken={authToken}\n apiGatewayUrl={apiGatewayUrl}\n />\n {editTooLong && (\n <ErrorLine message={`A comment can be at most ${MAX_LENGTH} characters.`} />\n )}\n <div className=\"flex justify-end gap-2\">\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => {\n setEditing(false);\n setText(comment.body);\n onError(null);\n }}\n >\n Cancel\n </Button>\n <Button\n size=\"sm\"\n onClick={() => void save()}\n disabled={!text.trim() || editTooLong || editState.loading}\n >\n {editState.loading ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n ) : (\n <MentionText text={comment.body} />\n )}\n\n {!editing && (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 px-2 text-xs\"\n data-testid=\"comment-reply\"\n onClick={() =>\n openReply(\n authorProfile?.displayName ?? 'this comment',\n comment.authorId,\n authorProfile?.displayName\n )\n }\n >\n <Reply className=\"mr-1 h-3.5 w-3.5\" aria-hidden=\"true\" />\n Reply\n </Button>\n )}\n\n {comment.replies.length > 0 && (\n <ol className=\"ml-5 space-y-2 border-l border-border-default pl-3\">\n {comment.replies.map((r) => (\n <ReplyItem\n key={r.id}\n reply={r}\n currentUserId={currentUserId}\n editMutation={editMutation}\n removeMutation={removeMutation}\n mutationRefetch={mutationRefetch}\n onError={onError}\n idPrefix={idPrefix}\n workspaceId={workspaceId}\n authToken={authToken}\n apiGatewayUrl={apiGatewayUrl}\n onReply={openReply}\n />\n ))}\n </ol>\n )}\n\n {replyOpen && (\n <div className=\"ml-5 space-y-2 border-l border-border-default pl-3\">\n {replyingToName && (\n <p className=\"text-xs text-muted-foreground\">Replying to {replyingToName}</p>\n )}\n <MentionComposer\n id={`${rowId}-reply`}\n ariaLabel=\"Write a reply\"\n className=\"min-h-[60px]\"\n value={replyDraft}\n onChange={setReplyDraft}\n autoFocus\n workspaceId={workspaceId}\n authToken={authToken}\n apiGatewayUrl={apiGatewayUrl}\n />\n {replyTooLong && (\n <ErrorLine message={`A comment can be at most ${MAX_LENGTH} characters.`} />\n )}\n <div className=\"flex justify-end gap-2\">\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => {\n setReplyOpen(false);\n setReplyDraft('');\n setReplyingToName(null);\n }}\n >\n Cancel\n </Button>\n <Button\n size=\"sm\"\n onClick={() => void submitReply()}\n disabled={!replyDraft.trim() || replyTooLong || replyState.loading}\n >\n {replyState.loading ? 'Posting…' : 'Reply'}\n </Button>\n </div>\n </div>\n )}\n </div>\n )}\n </li>\n );\n}\n\n/** One reply, indented under its top-level parent. Replies carry no resolution state of their own (only a\n * top-level comment does — CWF-14) and their own Reply action still targets the TOP-LEVEL thread\n * (`onReply` is the parent's `openReply`, called with this reply's own author as the \"replying to\" context). */\nfunction ReplyItem({\n reply,\n currentUserId,\n editMutation,\n removeMutation,\n mutationRefetch,\n onError,\n idPrefix,\n workspaceId,\n authToken,\n apiGatewayUrl,\n onReply,\n}: RowMutationProps & {\n reply: ThreadComment;\n currentUserId: string | undefined;\n onReply: (name: string, mentionId?: string, mentionName?: string) => void;\n}) {\n const [editing, setEditing] = useState(false);\n const [text, setText] = useState(reply.body);\n const profile = usePersonProfile(reply.authorId);\n const [edit, editState] = useMutation(editMutation, mutationRefetch);\n const [remove, removeState] = useMutation(removeMutation, mutationRefetch);\n\n const mine = reply.authorId === currentUserId;\n const editTooLong = text.trim().length > MAX_LENGTH;\n\n const save = async () => {\n onError(null);\n try {\n await throwOnError(edit({ variables: { id: reply.id, body: text.trim() } }));\n setEditing(false);\n } catch (e) {\n onError(mutationErrorMessage(e, 'The reply could not be saved.'));\n }\n };\n\n const onRemove = async () => {\n onError(null);\n try {\n await throwOnError(remove({ variables: { id: reply.id } }));\n } catch (e) {\n onError(mutationErrorMessage(e, 'The reply could not be deleted.'));\n }\n };\n\n return (\n <li className=\"space-y-1\" data-testid=\"comment-reply-item\">\n <div className=\"flex items-start justify-between gap-2 text-xs text-muted-foreground\">\n <span>\n <span className=\"font-medium text-foreground\">\n <PersonName id={reply.authorId} />\n </span>{' '}\n · {when(reply.createdAt)}\n {reply.editedAt && <span title={`Edited ${when(reply.editedAt)}`}> · edited</span>}\n </span>\n {mine && !editing && (\n <span className=\"flex shrink-0 items-center gap-1\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 px-2 text-xs\"\n onClick={() => setEditing(true)}\n >\n Edit\n </Button>\n <ConfirmButton\n label=\"\"\n ariaLabel=\"Delete reply\"\n variant=\"outline\"\n icon={<Trash2 className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />}\n title=\"Delete this reply?\"\n description=\"It is removed from the discussion for everyone. This cannot be undone here.\"\n confirmLabel=\"Delete\"\n destructive\n disabled={removeState.loading}\n onConfirm={() => void onRemove()}\n />\n </span>\n )}\n </div>\n\n {editing ? (\n <div className=\"space-y-2\">\n <MentionComposer\n id={`${idPrefix}-reply-${reply.id}-edit`}\n ariaLabel=\"Edit reply\"\n className=\"min-h-[56px]\"\n value={text}\n onChange={setText}\n workspaceId={workspaceId}\n authToken={authToken}\n apiGatewayUrl={apiGatewayUrl}\n />\n {editTooLong && (\n <ErrorLine message={`A comment can be at most ${MAX_LENGTH} characters.`} />\n )}\n <div className=\"flex justify-end gap-2\">\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => {\n setEditing(false);\n setText(reply.body);\n onError(null);\n }}\n >\n Cancel\n </Button>\n <Button\n size=\"sm\"\n onClick={() => void save()}\n disabled={!text.trim() || editTooLong || editState.loading}\n >\n {editState.loading ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n ) : (\n <MentionText text={reply.body} />\n )}\n\n {!editing && (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 px-2 text-xs\"\n data-testid=\"comment-reply\"\n onClick={() =>\n onReply(profile?.displayName ?? 'this reply', reply.authorId, profile?.displayName)\n }\n >\n <Reply className=\"mr-1 h-3.5 w-3.5\" aria-hidden=\"true\" />\n Reply\n </Button>\n )}\n </li>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,IAAM,IAAO,IACP,IAAa,KAoDb,KAAQ,MAAgB,IAAI,KAAK,EAAI,CAAC,gBAAgB;AAE5D,SAAgB,EAAc,EAC5B,eACA,aACA,UACA,QACA,SACA,WACA,YACA,mBACA,mBACqB;CACrB,IAAM,EAAE,gBAAa,gBAAa,cAAW,qBAAkB,GAAe,EACxE,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,CAAC,GAAQ,KAAa,EAAsC,MAAM,EAElE,IAAkB;EAAE;EAAgB,qBAAqB;EAAM,EAE/D,EACJ,SACA,YACA,OAAO,GACP,kBACE,EAA0B,EAAM,UAAU;EAC5C,WAAW;GAAE,GAAG,EAAM;GAAW,YAAY,EAAE,OAAO,GAAM;GAAE;EAC9D,MAAM,EAAM;EACb,CAAC,EACI,CAAC,GAAY,KAAY,EAAY,EAAI,UAAU,EAAgB,EAEnE,IAAS,IAAO,EAAM,UAEtB,IAAW,GAAQ,SAAS,EAAE,EAC9B,IAAU,MAAW,QAAQ,IAAW,EAAS,QAAQ,MAAM,EAAE,WAAW,EAAO,EACnF,IAAY,EAAS,QAAQ,MAAM,EAAE,WAAW,OAAO,CAAC,QACxD,IAAgB,EAAS,SAAS,GAElC,IAAU,EAAM,MAAM,EACtB,IAAU,EAAQ,SAAS;AAEjC,SAAgB;AACd,EAAI,KAA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AC,GAAD;OACE,MAAK;OACL,eAAe,KAAK,GAAM;OAC1B,UAAU,CAAC,EAAK,MAAM,IAAI,KAAe,EAAU;iBAElD,EAAU,UAAU,YAAY;OAC1B,CAAA,CACL;;KACF;QAEN,kBAAC,GAAD,EAAa,MAAM,EAAM,MAAQ,CAAA;GAGlC,CAAC,KACA,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,WAAU;IACV,eAAY;IACZ,eACE,EAAQ,GAAS,eAAe,cAAc,EAAM,UAAU,GAAS,YAAY;cANvF,CASE,kBAAC,GAAD;KAAO,WAAU;KAAmB,eAAY;KAAS,CAAA,EAAA,QAElD;;GAER"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface MentionComposerProps {
|
|
2
|
+
id: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Merged with the Textarea's own base styling (e.g. `"min-h-[60px]"` for a reply box). */
|
|
9
|
+
className?: string;
|
|
10
|
+
autoFocus?: boolean;
|
|
11
|
+
workspaceId?: string;
|
|
12
|
+
authToken?: string;
|
|
13
|
+
apiGatewayUrl?: string;
|
|
14
|
+
}
|
|
15
|
+
/** A plain multi-line composer with an @-mention autocomplete overlay. Controlled, like every other composer in
|
|
16
|
+
* this MFE (`value`/`onChange`) — the mention token is spliced into that same string, never a side channel. */
|
|
17
|
+
export declare function MentionComposer({ id, value, onChange, placeholder, ariaLabel, disabled, className, autoFocus, workspaceId, authToken, apiGatewayUrl, }: MentionComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
/** A comment body as displayed text, with `@[Name](actorId)` tokens rendered as highlighted, live-resolved names
|
|
19
|
+
* instead of the raw markup (CWF-13). `actorId` drives the rendering via `PersonName` so a since-renamed member
|
|
20
|
+
* shows their current name, not the one captured when the mention was typed. */
|
|
21
|
+
export declare function MentionText({ text, className }: {
|
|
22
|
+
text: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=MentionComposer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionComposer.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/comments/MentionComposer.tsx"],"names":[],"mappings":"AAwCA,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;+GAC+G;AAC/G,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,KAAK,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAgB,EAChB,SAAS,EACT,SAAiB,EACjB,WAAW,EACX,SAAS,EACT,aAAa,GACd,EAAE,oBAAoB,2CAiLtB;AAID;;gFAEgF;AAChF,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAwBpF"}
|