@burdenoff/microfe-planmagnet 2026.930.15 → 2026.930.17

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 (40) hide show
  1. package/dist/planmagnet/comments/CommentThread.d.ts +44 -0
  2. package/dist/planmagnet/comments/CommentThread.d.ts.map +1 -0
  3. package/dist/planmagnet/comments/CommentThread.js +513 -0
  4. package/dist/planmagnet/comments/CommentThread.js.map +1 -0
  5. package/dist/planmagnet/comments/MentionComposer.d.ts +25 -0
  6. package/dist/planmagnet/comments/MentionComposer.d.ts.map +1 -0
  7. package/dist/planmagnet/comments/MentionComposer.js +148 -0
  8. package/dist/planmagnet/comments/MentionComposer.js.map +1 -0
  9. package/dist/planmagnet/comments/RoadmapComments.d.ts +29 -0
  10. package/dist/planmagnet/comments/RoadmapComments.d.ts.map +1 -0
  11. package/dist/planmagnet/comments/RoadmapComments.js +310 -0
  12. package/dist/planmagnet/comments/RoadmapComments.js.map +1 -0
  13. package/dist/planmagnet/comments/TargetComments.d.ts +7 -0
  14. package/dist/planmagnet/comments/TargetComments.d.ts.map +1 -0
  15. package/dist/planmagnet/comments/TargetComments.js +207 -0
  16. package/dist/planmagnet/comments/TargetComments.js.map +1 -0
  17. package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -1
  18. package/dist/planmagnet/comments/WorkItemComments.js +68 -216
  19. package/dist/planmagnet/comments/WorkItemComments.js.map +1 -1
  20. package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
  21. package/dist/planmagnet/pages/DocsDocDetailPagePage.js +74 -72
  22. package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
  23. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
  24. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +130 -112
  25. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
  26. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
  27. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +76 -74
  28. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
  29. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
  30. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +157 -151
  31. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
  32. package/dist/planmagnet/roadmaps/RoadmapReviewPanel.d.ts +4 -0
  33. package/dist/planmagnet/roadmaps/RoadmapReviewPanel.d.ts.map +1 -0
  34. package/dist/planmagnet/roadmaps/RoadmapReviewPanel.js +370 -0
  35. package/dist/planmagnet/roadmaps/RoadmapReviewPanel.js.map +1 -0
  36. package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.d.ts +4 -0
  37. package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.d.ts.map +1 -0
  38. package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.js +396 -0
  39. package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.js.map +1 -0
  40. package/package.json +1 -1
@@ -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"}
@@ -0,0 +1,148 @@
1
+ import { PersonName as e } from "../people/People.js";
2
+ import { Fragment as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
3
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
+ import { Textarea as c } from "@burdenoff/fe-libs/ui";
5
+ import { useWorkspaceDirectory as l } from "@burdenoff/fe-libs/sharing";
6
+ //#region src/planmagnet/comments/MentionComposer.tsx
7
+ var u = 6, d = /(?:^|\s)@([^\s@]{0,40})$/;
8
+ function f(e, t) {
9
+ let n = e.slice(0, t), r = d.exec(n);
10
+ return r ? {
11
+ start: r[0].startsWith("@") ? r.index : r.index + 1,
12
+ query: r[1]
13
+ } : null;
14
+ }
15
+ function p({ id: e, value: t, onChange: d, placeholder: p, ariaLabel: m, disabled: h = !1, className: g, autoFocus: _ = !1, workspaceId: v, authToken: y, apiGatewayUrl: b }) {
16
+ let x = i(null), S = i(null), [C, w] = a(null), [T, E] = a(0), D = l({
17
+ workspaceId: v ?? "",
18
+ authToken: y,
19
+ apiGatewayUrl: b
20
+ }), { search: O, hasMore: k, fetchMore: A } = D;
21
+ n(() => {
22
+ O(C?.query ?? "");
23
+ }, [C?.query, O]), n(() => {
24
+ if (S.current !== null && x.current) {
25
+ let e = S.current;
26
+ S.current = null, x.current.focus(), x.current.setSelectionRange(e, e);
27
+ }
28
+ }, [t]);
29
+ let j = r(() => C ? D.members.slice(0, u) : [], [C, D.members]), M = C !== null && !h, N = (e, t) => {
30
+ w(f(e, t)), E(0);
31
+ }, P = (e) => {
32
+ if (!C) return;
33
+ let n = C.start + 1 + C.query.length, r = `@[${e.name}](${e.id})`, i = `${t.slice(0, C.start)}${r} ${t.slice(n)}`;
34
+ S.current = C.start + r.length + 1, w(null), d(i);
35
+ }, F = `${e}-mentions`, I = M ? j[T] : void 0;
36
+ return /* @__PURE__ */ s("div", {
37
+ className: "relative",
38
+ children: [
39
+ /* @__PURE__ */ o(c, {
40
+ ref: x,
41
+ id: e,
42
+ "aria-label": m,
43
+ className: g,
44
+ placeholder: p,
45
+ value: t,
46
+ disabled: h,
47
+ autoFocus: _,
48
+ "aria-expanded": M,
49
+ "aria-controls": M ? F : void 0,
50
+ "aria-haspopup": "listbox",
51
+ "aria-autocomplete": "list",
52
+ "aria-activedescendant": I ? `${F}-${I.id}` : void 0,
53
+ onChange: (e) => {
54
+ d(e.target.value), N(e.target.value, e.target.selectionStart ?? e.target.value.length);
55
+ },
56
+ onSelect: (e) => {
57
+ let t = e.currentTarget;
58
+ N(t.value, t.selectionStart ?? t.value.length);
59
+ },
60
+ onBlur: () => w(null),
61
+ onKeyDown: (e) => {
62
+ if (!(!M || j.length === 0)) if (e.key === "ArrowDown") e.preventDefault(), E((e) => (e + 1) % j.length);
63
+ else if (e.key === "ArrowUp") e.preventDefault(), E((e) => (e - 1 + j.length) % j.length);
64
+ else if (e.key === "Enter" || e.key === "Tab") {
65
+ let t = j[T] ?? j[0];
66
+ if (!t) return;
67
+ e.preventDefault(), P(t);
68
+ } else e.key === "Escape" && (e.preventDefault(), w(null));
69
+ }
70
+ }),
71
+ M && /* @__PURE__ */ s("div", {
72
+ className: "absolute z-20 mt-1 w-72 overflow-hidden rounded-md border border-border-default bg-bg-surface text-sm shadow-md",
73
+ children: [/* @__PURE__ */ s("div", {
74
+ role: "listbox",
75
+ id: F,
76
+ "aria-label": "Workspace members",
77
+ "data-testid": "mention-suggestions",
78
+ className: "max-h-56 overflow-y-auto p-1",
79
+ children: [
80
+ D.loading && j.length === 0 && /* @__PURE__ */ o("p", {
81
+ className: "px-2 py-1.5 text-xs text-muted-foreground",
82
+ children: "Loading members…"
83
+ }),
84
+ !D.loading && j.length === 0 && /* @__PURE__ */ o("p", {
85
+ className: "px-2 py-1.5 text-xs text-muted-foreground",
86
+ children: "No matching members."
87
+ }),
88
+ j.map((e, t) => /* @__PURE__ */ s("button", {
89
+ type: "button",
90
+ id: `${F}-${e.id}`,
91
+ role: "option",
92
+ "aria-selected": t === T,
93
+ className: `flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-left ${t === T ? "bg-primary/10 text-primary" : "hover:bg-muted"}`,
94
+ onMouseDown: (t) => {
95
+ t.preventDefault(), P(e);
96
+ },
97
+ onMouseEnter: () => E(t),
98
+ children: [/* @__PURE__ */ o("span", {
99
+ className: "truncate font-medium",
100
+ children: e.name
101
+ }), e.email && /* @__PURE__ */ o("span", {
102
+ className: "shrink-0 truncate text-xs text-muted-foreground",
103
+ children: e.email
104
+ })]
105
+ }, e.id))
106
+ ]
107
+ }), k && /* @__PURE__ */ o("button", {
108
+ type: "button",
109
+ className: "w-full border-t border-border-default px-2 py-1.5 text-left text-xs text-primary hover:bg-muted hover:underline",
110
+ onMouseDown: (e) => {
111
+ e.preventDefault(), A();
112
+ },
113
+ children: "Show more members"
114
+ })]
115
+ }),
116
+ /* @__PURE__ */ o("span", {
117
+ className: "sr-only",
118
+ "aria-live": "polite",
119
+ children: M ? I ? `${I.name} highlighted, ${j.length} member${j.length === 1 ? "" : "s"} matching` : D.loading ? "Loading members" : "No matching members" : ""
120
+ })
121
+ ]
122
+ });
123
+ }
124
+ var m = /@\[([^\]]+)\]\(([^)\s]+)\)/g;
125
+ function h({ text: n, className: r }) {
126
+ let i = [], a = 0;
127
+ for (let e of n.matchAll(m)) {
128
+ let t = e.index ?? 0;
129
+ t > a && i.push(n.slice(a, t)), i.push({
130
+ name: e[1],
131
+ actorId: e[2]
132
+ }), a = t + e[0].length;
133
+ }
134
+ return a < n.length && i.push(n.slice(a)), /* @__PURE__ */ o("p", {
135
+ className: r ?? "text-sm whitespace-pre-wrap break-words",
136
+ children: i.map((n, r) => typeof n == "string" ? /* @__PURE__ */ o(t, { children: n }, r) : /* @__PURE__ */ s("span", {
137
+ className: "rounded bg-primary/10 px-1 py-0.5 font-medium text-primary",
138
+ children: ["@", /* @__PURE__ */ o(e, {
139
+ id: n.actorId,
140
+ className: "text-primary"
141
+ })]
142
+ }, r))
143
+ });
144
+ }
145
+ //#endregion
146
+ export { p as MentionComposer, h as MentionText };
147
+
148
+ //# sourceMappingURL=MentionComposer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MentionComposer.js","names":[],"sources":["../../../src/planmagnet/comments/MentionComposer.tsx"],"sourcesContent":["import { Fragment, useEffect, useMemo, useRef, useState, type KeyboardEvent } from 'react';\nimport { useWorkspaceDirectory, type WorkspaceDirectoryMember } from '@burdenoff/fe-libs/sharing';\nimport { Textarea } from '@burdenoff/fe-libs/ui';\nimport { PersonName } from '../people/People';\n\n/**\n * @-mention support (CWF-13), shared by every comment composer — the top-level \"Add a comment\" box, a reply box\n * and an edit box, on all three surfaces this MFE has comments on (task, project, doc; see CommentThread.tsx).\n *\n * A mention is stored as the literal token `@[Name](actorId)` inside the comment body — the server parses it out\n * of the raw text (`PlanmagnetComment.mentions` / `PlanmagnetWorkItemComment.mentions` in graphql/wspace.graphql\n * are populated FROM this token, read-only). There is no separate \"mention\" API call: typing \"@\", picking someone\n * and posting the comment is the whole mechanism.\n *\n * Suggestions reuse the same workspace directory the assignee picker already calls\n * (`useWorkspaceDirectory`, see `controls/WorkItemControls.tsx`'s `useAssigneeOptions`): one paged list of\n * members, filtered case-insensitively client-side by `.search(query)`. The dropdown is anchored to the\n * composer box itself, not to the caret's pixel position — a caret-coordinate \"mirror div\" measurement is the\n * textbook way to do that, but it is fragile across zoom levels, font loading and line-wrap, and not worth it for\n * a box this short; anchoring to the field is the same trade-off GitHub's and Linear's own comment composers make.\n *\n * Mention delivery: the server records `mentions` but does NOT notify anyone yet (BOFF-7927, see the schema doc\n * comment on `mentions`) — this component only inserts the token and later renders it highlighted\n * (`MentionText`), and never implies a mentioned person was paged, emailed or pushed.\n */\n\nconst MAX_SUGGESTIONS = 6;\n/** `@name` trigger: an \"@\" that starts a word (line start or preceded by whitespace), followed by up to 40\n * non-space, non-\"@\" characters up to the caret. Requiring a word boundary before \"@\" keeps this from firing\n * mid-token on something like an email address (\"ada@example.com\"). */\nconst TRIGGER_PATTERN = /(?:^|\\s)@([^\\s@]{0,40})$/;\n\nfunction findTrigger(text: string, caret: number): { start: number; query: string } | null {\n const head = text.slice(0, caret);\n const match = TRIGGER_PATTERN.exec(head);\n if (!match) return null;\n const start = match[0].startsWith('@') ? match.index : match.index + 1;\n return { start, query: match[1] };\n}\n\nexport interface MentionComposerProps {\n id: string;\n value: string;\n onChange: (value: string) => void;\n placeholder?: string;\n ariaLabel?: string;\n disabled?: boolean;\n /** Merged with the Textarea's own base styling (e.g. `\"min-h-[60px]\"` for a reply box). */\n className?: string;\n autoFocus?: boolean;\n workspaceId?: string;\n authToken?: string;\n apiGatewayUrl?: string;\n}\n\n/** A plain multi-line composer with an @-mention autocomplete overlay. Controlled, like every other composer in\n * this MFE (`value`/`onChange`) — the mention token is spliced into that same string, never a side channel. */\nexport function MentionComposer({\n id,\n value,\n onChange,\n placeholder,\n ariaLabel,\n disabled = false,\n className,\n autoFocus = false,\n workspaceId,\n authToken,\n apiGatewayUrl,\n}: MentionComposerProps) {\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n // Caret position to restore after a mention is spliced in — `value` is controlled by the parent, so the new\n // selection can only be applied once the DOM has the new text (the effect below, keyed on `value`).\n const pendingCaretRef = useRef<number | null>(null);\n const [trigger, setTrigger] = useState<{ start: number; query: string } | null>(null);\n const [highlight, setHighlight] = useState(0);\n\n const directory = useWorkspaceDirectory({\n workspaceId: workspaceId ?? '',\n authToken,\n apiGatewayUrl,\n });\n const { search, hasMore, fetchMore } = directory;\n\n useEffect(() => {\n search(trigger?.query ?? '');\n }, [trigger?.query, search]);\n\n useEffect(() => {\n if (pendingCaretRef.current !== null && textareaRef.current) {\n const pos = pendingCaretRef.current;\n pendingCaretRef.current = null;\n textareaRef.current.focus();\n textareaRef.current.setSelectionRange(pos, pos);\n }\n }, [value]);\n\n const options = useMemo(\n () => (trigger ? directory.members.slice(0, MAX_SUGGESTIONS) : []),\n [trigger, directory.members]\n );\n const open = trigger !== null && !disabled;\n\n // Resets the highlighted option whenever the trigger changes (new \"@query\", or it closed/opened) — done here,\n // synchronously with the same event that changed it, rather than in an effect keyed on `trigger?.query`\n // (react-hooks/set-state-in-effect: a setState called directly in an effect body cascades an extra render).\n const recomputeTrigger = (text: string, caret: number) => {\n setTrigger(findTrigger(text, caret));\n setHighlight(0);\n };\n\n const insertMention = (member: WorkspaceDirectoryMember) => {\n if (!trigger) return;\n const end = trigger.start + 1 + trigger.query.length;\n const token = `@[${member.name}](${member.id})`;\n const next = `${value.slice(0, trigger.start)}${token} ${value.slice(end)}`;\n pendingCaretRef.current = trigger.start + token.length + 1;\n setTrigger(null);\n onChange(next);\n };\n\n const listId = `${id}-mentions`;\n const activeOption = open ? options[highlight] : undefined;\n\n return (\n <div className=\"relative\">\n <Textarea\n ref={textareaRef}\n id={id}\n aria-label={ariaLabel}\n className={className}\n placeholder={placeholder}\n value={value}\n disabled={disabled}\n autoFocus={autoFocus}\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n aria-activedescendant={activeOption ? `${listId}-${activeOption.id}` : undefined}\n onChange={(e) => {\n onChange(e.target.value);\n recomputeTrigger(e.target.value, e.target.selectionStart ?? e.target.value.length);\n }}\n onSelect={(e) => {\n const el = e.currentTarget;\n recomputeTrigger(el.value, el.selectionStart ?? el.value.length);\n }}\n onBlur={() => setTrigger(null)}\n onKeyDown={(e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (!open || options.length === 0) return;\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setHighlight((h) => (h + 1) % options.length);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n setHighlight((h) => (h - 1 + options.length) % options.length);\n } else if (e.key === 'Enter' || e.key === 'Tab') {\n // `highlight` can only be stale within the bounds already guarded above (`options.length === 0`\n // returns early); still resolved defensively rather than indexing blind.\n const member = options[highlight] ?? options[0];\n if (!member) return;\n e.preventDefault();\n insertMention(member);\n } else if (e.key === 'Escape') {\n e.preventDefault();\n setTrigger(null);\n }\n }}\n />\n {open && (\n <div className=\"absolute z-20 mt-1 w-72 overflow-hidden rounded-md border border-border-default bg-bg-surface text-sm shadow-md\">\n <div\n role=\"listbox\"\n id={listId}\n aria-label=\"Workspace members\"\n data-testid=\"mention-suggestions\"\n className=\"max-h-56 overflow-y-auto p-1\"\n >\n {directory.loading && options.length === 0 && (\n <p className=\"px-2 py-1.5 text-xs text-muted-foreground\">Loading members…</p>\n )}\n {!directory.loading && options.length === 0 && (\n <p className=\"px-2 py-1.5 text-xs text-muted-foreground\">No matching members.</p>\n )}\n {options.map((member, i) => (\n <button\n key={member.id}\n type=\"button\"\n id={`${listId}-${member.id}`}\n role=\"option\"\n aria-selected={i === highlight}\n className={`flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-left ${\n i === highlight ? 'bg-primary/10 text-primary' : 'hover:bg-muted'\n }`}\n // mousedown (not click) + preventDefault: keeps focus (and the caret we're about to restore) on\n // the textarea instead of letting the browser blur it into this button first.\n onMouseDown={(e) => {\n e.preventDefault();\n insertMention(member);\n }}\n onMouseEnter={() => setHighlight(i)}\n >\n <span className=\"truncate font-medium\">{member.name}</span>\n {member.email && (\n <span className=\"shrink-0 truncate text-xs text-muted-foreground\">\n {member.email}\n </span>\n )}\n </button>\n ))}\n </div>\n {\n // The directory loads members a page (50) at a time (`useWorkspaceDirectory`, PAGE_SIZE) and\n // `search()` only filters what's already loaded — someone outside the first page is unmentionable\n // until more is fetched. Mirrors the \"Show more members\" affordance the assignee picker and the\n // roadmap reviewer picker already wire onto this same hook (WorkItemControls' AssigneeSelect,\n // RoadmapReviewPanel).\n hasMore && (\n <button\n type=\"button\"\n className=\"w-full border-t border-border-default px-2 py-1.5 text-left text-xs text-primary hover:bg-muted hover:underline\"\n // Same mousedown/preventDefault trick as the option buttons above: fetchMore() must not blur\n // the textarea (which would close the dropdown via onBlur before the click is handled).\n onMouseDown={(e) => {\n e.preventDefault();\n fetchMore();\n }}\n >\n Show more members\n </button>\n )\n }\n </div>\n )}\n <span className=\"sr-only\" aria-live=\"polite\">\n {open\n ? activeOption\n ? `${activeOption.name} highlighted, ${options.length} member${options.length === 1 ? '' : 's'} matching`\n : directory.loading\n ? 'Loading members'\n : 'No matching members'\n : ''}\n </span>\n </div>\n );\n}\n\nconst MENTION_PATTERN = /@\\[([^\\]]+)\\]\\(([^)\\s]+)\\)/g;\n\n/** A comment body as displayed text, with `@[Name](actorId)` tokens rendered as highlighted, live-resolved names\n * instead of the raw markup (CWF-13). `actorId` drives the rendering via `PersonName` so a since-renamed member\n * shows their current name, not the one captured when the mention was typed. */\nexport function MentionText({ text, className }: { text: string; className?: string }) {\n const parts: Array<string | { name: string; actorId: string }> = [];\n let last = 0;\n for (const match of text.matchAll(MENTION_PATTERN)) {\n const index = match.index ?? 0;\n if (index > last) parts.push(text.slice(last, index));\n parts.push({ name: match[1], actorId: match[2] });\n last = index + match[0].length;\n }\n if (last < text.length) parts.push(text.slice(last));\n\n return (\n <p className={className ?? 'text-sm whitespace-pre-wrap break-words'}>\n {parts.map((part, i) =>\n typeof part === 'string' ? (\n <Fragment key={i}>{part}</Fragment>\n ) : (\n <span key={i} className=\"rounded bg-primary/10 px-1 py-0.5 font-medium text-primary\">\n @<PersonName id={part.actorId} className=\"text-primary\" />\n </span>\n )\n )}\n </p>\n );\n}\n"],"mappings":";;;;;;AA0BA,IAAM,IAAkB,GAIlB,IAAkB;AAExB,SAAS,EAAY,GAAc,GAAwD;CACzF,IAAM,IAAO,EAAK,MAAM,GAAG,EAAM,EAC3B,IAAQ,EAAgB,KAAK,EAAK;AAGxC,QAFK,IAEE;EAAE,OADK,EAAM,GAAG,WAAW,IAAI,GAAG,EAAM,QAAQ,EAAM,QAAQ;EACrD,OAAO,EAAM;EAAI,GAFd;;AAsBrB,SAAgB,EAAgB,EAC9B,OACA,UACA,aACA,gBACA,cACA,cAAW,IACX,cACA,eAAY,IACZ,gBACA,cACA,oBACuB;CACvB,IAAM,IAAc,EAA4B,KAAK,EAG/C,IAAkB,EAAsB,KAAK,EAC7C,CAAC,GAAS,KAAc,EAAkD,KAAK,EAC/E,CAAC,GAAW,KAAgB,EAAS,EAAE,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0 +1,29 @@
1
+ /**
2
+ * The list + composer, with no Card of its own: `RoadmapDiscussionPanel` wraps it in one for the roadmap-level
3
+ * panel, `RoadmapItemCommentsButton` drops it straight into a dialog for an item's thread (a second nested Card
4
+ * there would just be visual noise inside the dialog's own chrome).
5
+ */
6
+ export declare function RoadmapCommentThread({ roadmapId, roadmapItemId, onTotalCount, }: {
7
+ roadmapId: string;
8
+ /** Omitted = the roadmap's own thread; set = one item's thread. */
9
+ roadmapItemId?: string;
10
+ /** Reports the thread's live total up to the caller (e.g. for a "Discussion (n)" title) once known. */
11
+ onTotalCount?: (count: number) => void;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ /** The roadmap-level Discussion panel (`roadmapItemId` omitted — the roadmap's own thread, not any item's). */
14
+ export declare function RoadmapDiscussionPanel({ roadmapId }: {
15
+ roadmapId: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ /**
18
+ * The small "Comments" affordance opened from a roadmap item, in both the Timeline and Now/Next/Later views. It
19
+ * deliberately does NOT pre-fetch a count for the collapsed label: `RoadmapItem` carries no `commentCount` field
20
+ * of its own (unlike `WorkItem`), and both views already render every item on the roadmap unwindowed (Now/Next/
21
+ * Later loads up to 2,000) — firing one count query per row would turn a single page load into a query-per-item
22
+ * burst. The count instead comes from the thread itself, once it has been opened in this session.
23
+ */
24
+ export declare function RoadmapItemCommentsButton({ roadmapId, itemId, itemTitle, }: {
25
+ roadmapId: string;
26
+ itemId: string;
27
+ itemTitle: string;
28
+ }): import("react/jsx-runtime").JSX.Element;
29
+ //# sourceMappingURL=RoadmapComments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoadmapComments.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/comments/RoadmapComments.tsx"],"names":[],"mappings":"AAwGA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,aAAa,EACb,YAAY,GACb,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uGAAuG;IACvG,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,2CAkHA;AAqHD,+GAA+G;AAC/G,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CAe1E;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,MAAM,EACN,SAAS,GACV,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,2CAsCA"}
@@ -0,0 +1,310 @@
1
+ import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
2
+ import { PersonName as t } from "../people/People.js";
3
+ import { throwOnError as n } from "../utils/mutationResult.js";
4
+ import { ConfirmButton as r, ErrorLine as i } from "../controls/ConfirmButton.js";
5
+ import { isForbidden as a, mutationErrorMessage as o } from "../utils/graphqlErrors.js";
6
+ import { useEffect as s, useState as c } from "react";
7
+ import { MessageSquare as l, Trash2 as u } from "lucide-react";
8
+ import { gql as d } from "@apollo/client";
9
+ import { useMutation as f, useQuery as p } from "@apollo/client/react";
10
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
11
+ import { Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, ResponsiveDialog as x, ResponsiveDialogContent as S, ResponsiveDialogDescription as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, ResponsiveDialogTrigger as E } from "@burdenoff/fe-libs/ui";
12
+ //#region src/planmagnet/comments/RoadmapComments.tsx
13
+ var D = 5e3, O = 20, k = d`
14
+ query RoadmapCommentsThread(
15
+ $roadmapId: ID!
16
+ $roadmapItemId: ID
17
+ $pagination: PlanmagnetPaginationInput
18
+ ) {
19
+ planmagnetRoadmapComments(
20
+ roadmapId: $roadmapId
21
+ roadmapItemId: $roadmapItemId
22
+ pagination: $pagination
23
+ ) {
24
+ totalCount
25
+ pageInfo {
26
+ hasNextPage
27
+ endCursor
28
+ }
29
+ items {
30
+ id
31
+ authorId
32
+ body
33
+ createdAt
34
+ editedAt
35
+ }
36
+ }
37
+ }
38
+ `, A = d`
39
+ mutation RoadmapCommentAdd($input: PlanmagnetAddRoadmapCommentInput!) {
40
+ planmagnetAddRoadmapComment(input: $input) {
41
+ id
42
+ }
43
+ }
44
+ `, j = d`
45
+ mutation RoadmapCommentEdit($id: ID!, $body: String!) {
46
+ planmagnetEditRoadmapComment(id: $id, body: $body) {
47
+ id
48
+ body
49
+ editedAt
50
+ }
51
+ }
52
+ `, M = d`
53
+ mutation RoadmapCommentDelete($id: ID!) {
54
+ planmagnetDeleteRoadmapComment(id: $id)
55
+ }
56
+ `, N = (e) => new Date(e).toLocaleString(), P = {
57
+ refetchQueries: ["RoadmapCommentsThread"],
58
+ awaitRefetchQueries: !0
59
+ };
60
+ function F({ roadmapId: t, roadmapItemId: r, onTotalCount: l }) {
61
+ let { currentUser: u } = e(), [d, _] = c(""), [v, y] = c(null), [b, x] = c(!1), { data: S, loading: C, error: w, fetchMore: T } = p(k, {
62
+ variables: {
63
+ roadmapId: t,
64
+ roadmapItemId: r ?? null,
65
+ pagination: { first: O }
66
+ },
67
+ skip: !t
68
+ }), [E, j] = f(A, P), M = S?.planmagnetRoadmapComments, N = M?.items ?? [], F = d.trim(), L = F.length > D;
69
+ s(() => {
70
+ M && l?.(M.totalCount);
71
+ }, [M, l]);
72
+ let R = async () => {
73
+ y(null);
74
+ try {
75
+ await n(E({ variables: { input: {
76
+ roadmapId: t,
77
+ roadmapItemId: r ?? null,
78
+ body: F
79
+ } } })), _("");
80
+ } catch (e) {
81
+ y(a(e) ? "Your role can read but not comment." : o(e, "The comment could not be posted."));
82
+ }
83
+ }, z = async () => {
84
+ let e = M?.pageInfo.endCursor;
85
+ if (e) {
86
+ x(!0);
87
+ try {
88
+ await T({
89
+ variables: { pagination: {
90
+ first: O,
91
+ after: e
92
+ } },
93
+ updateQuery: (e, { fetchMoreResult: t }) => ({ planmagnetRoadmapComments: {
94
+ ...t.planmagnetRoadmapComments,
95
+ items: [...e.planmagnetRoadmapComments.items, ...t.planmagnetRoadmapComments.items]
96
+ } })
97
+ });
98
+ } finally {
99
+ x(!1);
100
+ }
101
+ }
102
+ };
103
+ return /* @__PURE__ */ h("div", {
104
+ className: "space-y-4",
105
+ children: [
106
+ v && /* @__PURE__ */ m(i, { message: v }),
107
+ C && !S && /* @__PURE__ */ m("p", {
108
+ className: "text-sm text-muted-foreground",
109
+ children: "Loading comments…"
110
+ }),
111
+ w && /* @__PURE__ */ m(i, { message: `Comments could not be loaded: ${w.message}` }),
112
+ M && N.length === 0 && /* @__PURE__ */ m("p", {
113
+ className: "text-sm text-muted-foreground",
114
+ children: "No comments yet."
115
+ }),
116
+ /* @__PURE__ */ m("ol", {
117
+ className: "space-y-3",
118
+ children: N.map((e) => /* @__PURE__ */ m(I, {
119
+ comment: e,
120
+ mine: e.authorId === u?.id,
121
+ onError: y
122
+ }, e.id))
123
+ }),
124
+ M?.pageInfo.hasNextPage && /* @__PURE__ */ m(g, {
125
+ size: "sm",
126
+ variant: "outline",
127
+ onClick: () => void z(),
128
+ disabled: b,
129
+ children: b ? "Loading…" : `Show more (${N.length} of ${M.totalCount})`
130
+ }),
131
+ /* @__PURE__ */ h("div", {
132
+ className: "space-y-2 border-t pt-4",
133
+ children: [
134
+ /* @__PURE__ */ m("label", {
135
+ htmlFor: `roadmap-comment-draft-${r ?? t}`,
136
+ className: "sr-only",
137
+ children: "Add a comment"
138
+ }),
139
+ /* @__PURE__ */ m("textarea", {
140
+ id: `roadmap-comment-draft-${r ?? t}`,
141
+ className: "w-full min-h-[72px] rounded-md border border-input bg-background px-3 py-2 text-sm",
142
+ placeholder: "Add a comment…",
143
+ value: d,
144
+ onChange: (e) => _(e.target.value)
145
+ }),
146
+ L && /* @__PURE__ */ m(i, { message: `A comment can be at most ${D} characters.` }),
147
+ /* @__PURE__ */ m("div", {
148
+ className: "flex justify-end",
149
+ children: /* @__PURE__ */ m(g, {
150
+ size: "sm",
151
+ onClick: () => void R(),
152
+ disabled: !F || L || j.loading,
153
+ "data-testid": "roadmap-comment-add",
154
+ children: j.loading ? "Posting…" : "Comment"
155
+ })
156
+ })
157
+ ]
158
+ })
159
+ ]
160
+ });
161
+ }
162
+ function I({ comment: e, mine: a, onError: s }) {
163
+ let [l, d] = c(!1), [p, _] = c(e.body), v = p.trim().length > D, y = s, [b, x] = f(j, P), [S, C] = f(M, P), w = async () => {
164
+ y(null);
165
+ try {
166
+ await n(b({ variables: {
167
+ id: e.id,
168
+ body: p.trim()
169
+ } })), d(!1);
170
+ } catch (e) {
171
+ y(o(e, "The comment could not be saved."));
172
+ }
173
+ }, T = async () => {
174
+ y(null);
175
+ try {
176
+ await n(S({ variables: { id: e.id } }));
177
+ } catch (e) {
178
+ y(o(e, "The comment could not be deleted."));
179
+ }
180
+ };
181
+ return /* @__PURE__ */ h("li", {
182
+ className: "rounded-md border p-3 space-y-1",
183
+ "data-testid": "roadmap-comment",
184
+ children: [/* @__PURE__ */ h("div", {
185
+ className: "flex items-center justify-between gap-2 text-xs text-muted-foreground",
186
+ children: [/* @__PURE__ */ h("span", { children: [
187
+ /* @__PURE__ */ m("span", {
188
+ className: "font-medium text-foreground",
189
+ children: /* @__PURE__ */ m(t, { id: e.authorId })
190
+ }),
191
+ " ",
192
+ "· ",
193
+ N(e.createdAt),
194
+ e.editedAt && /* @__PURE__ */ m("span", {
195
+ title: `Edited ${N(e.editedAt)}`,
196
+ children: " · edited"
197
+ })
198
+ ] }), a && !l && /* @__PURE__ */ h("span", {
199
+ className: "flex items-center gap-1",
200
+ children: [/* @__PURE__ */ m(g, {
201
+ size: "sm",
202
+ variant: "ghost",
203
+ className: "h-6 px-2 text-xs",
204
+ onClick: () => d(!0),
205
+ children: "Edit"
206
+ }), /* @__PURE__ */ m(r, {
207
+ label: "",
208
+ ariaLabel: "Delete comment",
209
+ variant: "outline",
210
+ icon: /* @__PURE__ */ m(u, { className: "h-3.5 w-3.5" }),
211
+ title: "Delete this comment?",
212
+ description: "It is removed from the discussion for everyone. This cannot be undone here.",
213
+ confirmLabel: "Delete",
214
+ destructive: !0,
215
+ disabled: C.loading,
216
+ onConfirm: () => void T()
217
+ })]
218
+ })]
219
+ }), l ? /* @__PURE__ */ h("div", {
220
+ className: "space-y-2",
221
+ children: [
222
+ /* @__PURE__ */ m("textarea", {
223
+ "aria-label": "Edit comment",
224
+ className: "w-full min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm",
225
+ value: p,
226
+ onChange: (e) => _(e.target.value)
227
+ }),
228
+ v && /* @__PURE__ */ m(i, { message: `A comment can be at most ${D} characters.` }),
229
+ /* @__PURE__ */ h("div", {
230
+ className: "flex justify-end gap-2",
231
+ children: [/* @__PURE__ */ m(g, {
232
+ size: "sm",
233
+ variant: "outline",
234
+ onClick: () => {
235
+ d(!1), _(e.body), y(null);
236
+ },
237
+ children: "Cancel"
238
+ }), /* @__PURE__ */ m(g, {
239
+ size: "sm",
240
+ onClick: () => void w(),
241
+ disabled: !p.trim() || v || x.loading,
242
+ children: x.loading ? "Saving…" : "Save"
243
+ })]
244
+ })
245
+ ]
246
+ }) : /* @__PURE__ */ m("p", {
247
+ className: "text-sm whitespace-pre-wrap break-words",
248
+ children: e.body
249
+ })]
250
+ });
251
+ }
252
+ function L({ roadmapId: e }) {
253
+ let [t, n] = c(null);
254
+ return /* @__PURE__ */ h(_, {
255
+ "data-testid": "roadmap-discussion",
256
+ children: [/* @__PURE__ */ m(y, { children: /* @__PURE__ */ h(b, {
257
+ className: "flex items-center gap-2",
258
+ children: [
259
+ /* @__PURE__ */ m(l, {
260
+ className: "h-4 w-4",
261
+ "aria-hidden": "true"
262
+ }),
263
+ "Discussion",
264
+ t === null ? "" : ` (${t})`
265
+ ]
266
+ }) }), /* @__PURE__ */ m(v, { children: /* @__PURE__ */ m(F, {
267
+ roadmapId: e,
268
+ onTotalCount: n
269
+ }) })]
270
+ });
271
+ }
272
+ function R({ roadmapId: e, itemId: t, itemTitle: n }) {
273
+ let [r, i] = c(!1), [a, o] = c(null);
274
+ return /* @__PURE__ */ h(x, {
275
+ open: r,
276
+ onOpenChange: i,
277
+ children: [/* @__PURE__ */ m(E, {
278
+ asChild: !0,
279
+ children: /* @__PURE__ */ h(g, {
280
+ size: "sm",
281
+ variant: "ghost",
282
+ className: "h-7 px-2 text-xs",
283
+ "data-testid": "roadmap-item-comments",
284
+ "aria-label": `Comments on ${n}`,
285
+ children: [
286
+ /* @__PURE__ */ m(l, {
287
+ className: "mr-1 h-3.5 w-3.5",
288
+ "aria-hidden": "true"
289
+ }),
290
+ "Comments",
291
+ a !== null && a > 0 ? ` (${a})` : ""
292
+ ]
293
+ })
294
+ }), /* @__PURE__ */ h(S, {
295
+ className: "max-w-lg",
296
+ children: [/* @__PURE__ */ h(w, { children: [/* @__PURE__ */ h(T, { children: ["Comments — ", n] }), /* @__PURE__ */ m(C, { children: "Visible to everyone who can read this roadmap." })] }), /* @__PURE__ */ m("div", {
297
+ className: "max-h-[60vh] overflow-y-auto pr-1",
298
+ children: r && /* @__PURE__ */ m(F, {
299
+ roadmapId: e,
300
+ roadmapItemId: t,
301
+ onTotalCount: o
302
+ })
303
+ })]
304
+ })]
305
+ });
306
+ }
307
+ //#endregion
308
+ export { L as RoadmapDiscussionPanel, R as RoadmapItemCommentsButton };
309
+
310
+ //# sourceMappingURL=RoadmapComments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoadmapComments.js","names":[],"sources":["../../../src/planmagnet/comments/RoadmapComments.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogTrigger,\n} from '@burdenoff/fe-libs/ui';\nimport { MessageSquare, Trash2 } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { PersonName } from '../people/People';\nimport { ConfirmButton, ErrorLine } from '../controls/ConfirmButton';\nimport { throwOnError } from '../utils/mutationResult';\nimport { isForbidden, mutationErrorMessage } from '../utils/graphqlErrors';\n\n/**\n * Roadmap collaboration: discussion (PRM-11). `PlanmagnetRoadmapComment`'s own doc comment says it is the \"same\n * shape as PlanmagnetWorkItemComment\" — this mirrors `WorkItemComments.tsx`'s list/add/author-only-edit/delete\n * thread, parameterized on `roadmapItemId` so ONE component serves both the roadmap-level Discussion panel\n * (`roadmapItemId` omitted) and a per-item thread opened from an item (`roadmapItemId` set) — the server's own\n * \"filter present = exact match, absent = unplaced/unattached\" convention on that field.\n *\n * Posting needs the roadmap's write tier; a Stakeholder-Viewer role that can read but not comment gets FORBIDDEN,\n * shown here as a fixed, specific message (per BOFF-8168-style precedent elsewhere in this MFE) rather than the\n * server's generic one.\n */\n\nconst MAX_LENGTH = 5_000; // PlanmagnetAddRoadmapCommentInput: \"1 to 5,000 characters after trimming\"\nconst PAGE = 20;\n\nconst ROADMAP_COMMENTS = gql`\n query RoadmapCommentsThread(\n $roadmapId: ID!\n $roadmapItemId: ID\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetRoadmapComments(\n roadmapId: $roadmapId\n roadmapItemId: $roadmapItemId\n pagination: $pagination\n ) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n items {\n id\n authorId\n body\n createdAt\n editedAt\n }\n }\n }\n`;\nconst ADD_ROADMAP_COMMENT = gql`\n mutation RoadmapCommentAdd($input: PlanmagnetAddRoadmapCommentInput!) {\n planmagnetAddRoadmapComment(input: $input) {\n id\n }\n }\n`;\nconst EDIT_ROADMAP_COMMENT = gql`\n mutation RoadmapCommentEdit($id: ID!, $body: String!) {\n planmagnetEditRoadmapComment(id: $id, body: $body) {\n id\n body\n editedAt\n }\n }\n`;\nconst DELETE_ROADMAP_COMMENT = gql`\n mutation RoadmapCommentDelete($id: ID!) {\n planmagnetDeleteRoadmapComment(id: $id)\n }\n`;\n\ninterface RoadmapComment {\n id: string;\n authorId: string;\n body: string;\n createdAt: string;\n editedAt: string | null;\n}\ninterface RoadmapCommentsData {\n planmagnetRoadmapComments: {\n totalCount: number;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n items: RoadmapComment[];\n };\n}\n\nconst when = (iso: string) => new Date(iso).toLocaleString();\nconst THREAD_REFETCH = { refetchQueries: ['RoadmapCommentsThread'], awaitRefetchQueries: true };\n\n/**\n * The list + composer, with no Card of its own: `RoadmapDiscussionPanel` wraps it in one for the roadmap-level\n * panel, `RoadmapItemCommentsButton` drops it straight into a dialog for an item's thread (a second nested Card\n * there would just be visual noise inside the dialog's own chrome).\n */\nexport function RoadmapCommentThread({\n roadmapId,\n roadmapItemId,\n onTotalCount,\n}: {\n roadmapId: string;\n /** Omitted = the roadmap's own thread; set = one item's thread. */\n roadmapItemId?: string;\n /** Reports the thread's live total up to the caller (e.g. for a \"Discussion (n)\" title) once known. */\n onTotalCount?: (count: number) => void;\n}) {\n const { currentUser } = usePlanMagnet();\n const [draft, setDraft] = useState('');\n const [error, setError] = useState<string | null>(null);\n const [loadingMore, setLoadingMore] = useState(false);\n\n const {\n data,\n loading,\n error: loadError,\n fetchMore,\n } = useQuery<RoadmapCommentsData>(ROADMAP_COMMENTS, {\n variables: { roadmapId, roadmapItemId: roadmapItemId ?? null, pagination: { first: PAGE } },\n skip: !roadmapId,\n });\n const [add, addState] = useMutation(ADD_ROADMAP_COMMENT, THREAD_REFETCH);\n\n const thread = data?.planmagnetRoadmapComments;\n const comments = thread?.items ?? [];\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 () => {\n setError(null);\n try {\n await throwOnError(\n add({\n variables: { input: { roadmapId, roadmapItemId: roadmapItemId ?? null, body: trimmed } },\n })\n );\n setDraft('');\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 }\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: { pagination: { first: PAGE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetRoadmapComments: {\n ...fetchMoreResult.planmagnetRoadmapComments,\n items: [\n ...prev.planmagnetRoadmapComments.items,\n ...fetchMoreResult.planmagnetRoadmapComments.items,\n ],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n return (\n <div className=\"space-y-4\">\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 {thread && comments.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">No comments yet.</p>\n )}\n <ol className=\"space-y-3\">\n {comments.map((comment) => (\n <CommentRow\n key={comment.id}\n comment={comment}\n mine={comment.authorId === currentUser?.id}\n onError={setError}\n />\n ))}\n </ol>\n {thread?.pageInfo.hasNextPage && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => void loadMore()} disabled={loadingMore}>\n {loadingMore ? 'Loading…' : `Show more (${comments.length} of ${thread.totalCount})`}\n </Button>\n )}\n <div className=\"space-y-2 border-t pt-4\">\n <label htmlFor={`roadmap-comment-draft-${roadmapItemId ?? roadmapId}`} className=\"sr-only\">\n Add a comment\n </label>\n <textarea\n id={`roadmap-comment-draft-${roadmapItemId ?? roadmapId}`}\n className=\"w-full min-h-[72px] rounded-md border border-input bg-background px-3 py-2 text-sm\"\n placeholder=\"Add a comment…\"\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\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 post()}\n disabled={!trimmed || tooLong || addState.loading}\n data-testid=\"roadmap-comment-add\"\n >\n {addState.loading ? 'Posting…' : 'Comment'}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Refusals are reported to the PANEL, not kept in the row — same reasoning as `WorkItemComments.tsx`'s\n * `CommentRow`: a refused edit/delete still refetches the thread, and a row that vanished with it (deleted\n * elsewhere) would take a row-level message down with it.\n */\nfunction CommentRow({\n comment,\n mine,\n onError,\n}: {\n comment: RoadmapComment;\n mine: boolean;\n onError: (message: string | null) => void;\n}) {\n const [editing, setEditing] = useState(false);\n const [text, setText] = useState(comment.body);\n // Same limit as the Add composer (the edit mutation takes the same 1..5,000 characters after trimming).\n const editTooLong = text.trim().length > MAX_LENGTH;\n const setError = onError;\n const [edit, editState] = useMutation(EDIT_ROADMAP_COMMENT, THREAD_REFETCH);\n const [remove, removeState] = useMutation(DELETE_ROADMAP_COMMENT, THREAD_REFETCH);\n\n const save = async () => {\n setError(null);\n try {\n await throwOnError(edit({ variables: { id: comment.id, body: text.trim() } }));\n setEditing(false);\n } catch (e) {\n setError(mutationErrorMessage(e, 'The comment could not be saved.'));\n }\n };\n\n const onRemove = async () => {\n setError(null);\n try {\n await throwOnError(remove({ variables: { id: comment.id } }));\n } catch (e) {\n setError(mutationErrorMessage(e, 'The comment could not be deleted.'));\n }\n };\n\n return (\n <li className=\"rounded-md border p-3 space-y-1\" data-testid=\"roadmap-comment\">\n <div className=\"flex items-center 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 && <span title={`Edited ${when(comment.editedAt)}`}> · edited</span>}\n </span>\n {mine && !editing && (\n <span className=\"flex 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 comment\"\n variant=\"outline\"\n icon={<Trash2 className=\"h-3.5 w-3.5\" />}\n title=\"Delete this comment?\"\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 {editing ? (\n <div className=\"space-y-2\">\n <textarea\n aria-label=\"Edit comment\"\n className=\"w-full min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm\"\n value={text}\n onChange={(e) => setText(e.target.value)}\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 setError(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 <p className=\"text-sm whitespace-pre-wrap break-words\">{comment.body}</p>\n )}\n </li>\n );\n}\n\n/** The roadmap-level Discussion panel (`roadmapItemId` omitted — the roadmap's own thread, not any item's). */\nexport function RoadmapDiscussionPanel({ roadmapId }: { roadmapId: string }) {\n const [totalCount, setTotalCount] = useState<number | null>(null);\n return (\n <Card data-testid=\"roadmap-discussion\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <MessageSquare className=\"h-4 w-4\" aria-hidden=\"true\" />\n Discussion{totalCount !== null ? ` (${totalCount})` : ''}\n </CardTitle>\n </CardHeader>\n <CardContent>\n <RoadmapCommentThread roadmapId={roadmapId} onTotalCount={setTotalCount} />\n </CardContent>\n </Card>\n );\n}\n\n/**\n * The small \"Comments\" affordance opened from a roadmap item, in both the Timeline and Now/Next/Later views. It\n * deliberately does NOT pre-fetch a count for the collapsed label: `RoadmapItem` carries no `commentCount` field\n * of its own (unlike `WorkItem`), and both views already render every item on the roadmap unwindowed (Now/Next/\n * Later loads up to 2,000) — firing one count query per row would turn a single page load into a query-per-item\n * burst. The count instead comes from the thread itself, once it has been opened in this session.\n */\nexport function RoadmapItemCommentsButton({\n roadmapId,\n itemId,\n itemTitle,\n}: {\n roadmapId: string;\n itemId: string;\n itemTitle: string;\n}) {\n const [open, setOpen] = useState(false);\n const [count, setCount] = useState<number | null>(null);\n\n return (\n <ResponsiveDialog open={open} onOpenChange={setOpen}>\n <ResponsiveDialogTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-7 px-2 text-xs\"\n data-testid=\"roadmap-item-comments\"\n aria-label={`Comments on ${itemTitle}`}\n >\n <MessageSquare className=\"mr-1 h-3.5 w-3.5\" aria-hidden=\"true\" />\n Comments{count !== null && count > 0 ? ` (${count})` : ''}\n </Button>\n </ResponsiveDialogTrigger>\n <ResponsiveDialogContent className=\"max-w-lg\">\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>Comments — {itemTitle}</ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n Visible to everyone who can read this roadmap.\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n <div className=\"max-h-[60vh] overflow-y-auto pr-1\">\n {/* Mounted only while open: the thread's own query never fires just because the row rendered. */}\n {open && (\n <RoadmapCommentThread\n roadmapId={roadmapId}\n roadmapItemId={itemId}\n onTotalCount={setCount}\n />\n )}\n </div>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAmCA,IAAM,IAAa,KACb,IAAO,IAEP,IAAmB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;GA0BtB,IAAsB,CAAG;;;;;;GAOzB,IAAuB,CAAG;;;;;;;;GAS1B,IAAyB,CAAG;;;;GAqB5B,KAAQ,MAAgB,IAAI,KAAK,EAAI,CAAC,gBAA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YAA5C,CACE,kBAAC,GAAD;GAAyB,SAAA;aACvB,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,WAAU;IACV,eAAY;IACZ,cAAY,eAAe;cAL7B;KAOE,kBAAC,GAAD;MAAe,WAAU;MAAmB,eAAY;MAAS,CAAA;;KACxD,MAAU,QAAQ,IAAQ,IAAI,KAAK,EAAM,KAAK;KAChD;;GACe,CAAA,EAC1B,kBAAC,GAAD;GAAyB,WAAU;aAAnC,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CAAuB,eAAY,EAAkC,EAAA,CAAA,EACrE,kBAAC,GAAD,EAAA,UAA6B,kDAEC,CAAA,CACP,EAAA,CAAA,EACzB,kBAAC,OAAD;IAAK,WAAU;cAEZ,KACC,kBAAC,GAAD;KACa;KACX,eAAe;KACf,cAAc;KACd,CAAA;IAEA,CAAA,CACkB;KACT"}
@@ -0,0 +1,7 @@
1
+ export declare function ProjectComments({ projectId }: {
2
+ projectId: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export declare function DocComments({ docId }: {
5
+ docId: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=TargetComments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TargetComments.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/comments/TargetComments.tsx"],"names":[],"mappings":"AAoFA,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CAiCnE;AAqED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,2CAiCvD"}