@burdenoff/microfe-planmagnet 2026.930.6 → 2026.930.7

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 (58) hide show
  1. package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
  2. package/dist/planmagnet/PlanMagnetRoot.js +132 -108
  3. package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
  4. package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
  5. package/dist/planmagnet/PlanMagnetRoutes.js +24 -12
  6. package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
  7. package/dist/planmagnet/controls/FeatureControls.js +25 -25
  8. package/dist/planmagnet/controls/Pickers.d.ts +2 -1
  9. package/dist/planmagnet/controls/Pickers.d.ts.map +1 -1
  10. package/dist/planmagnet/controls/Pickers.js +133 -102
  11. package/dist/planmagnet/controls/Pickers.js.map +1 -1
  12. package/dist/planmagnet/controls/QualityGateControls.d.ts +64 -0
  13. package/dist/planmagnet/controls/QualityGateControls.d.ts.map +1 -0
  14. package/dist/planmagnet/controls/QualityGateControls.js +390 -0
  15. package/dist/planmagnet/controls/QualityGateControls.js.map +1 -0
  16. package/dist/planmagnet/create/CreateDialogs.d.ts +8 -0
  17. package/dist/planmagnet/create/CreateDialogs.d.ts.map +1 -1
  18. package/dist/planmagnet/create/CreateDialogs.js +344 -206
  19. package/dist/planmagnet/create/CreateDialogs.js.map +1 -1
  20. package/dist/planmagnet/pages/AiActivityPagePage.d.ts +2 -0
  21. package/dist/planmagnet/pages/AiActivityPagePage.d.ts.map +1 -0
  22. package/dist/planmagnet/pages/AiActivityPagePage.js +249 -0
  23. package/dist/planmagnet/pages/AiActivityPagePage.js.map +1 -0
  24. package/dist/planmagnet/pages/AiPlanPagePage.d.ts +2 -0
  25. package/dist/planmagnet/pages/AiPlanPagePage.d.ts.map +1 -0
  26. package/dist/planmagnet/pages/AiPlanPagePage.js +381 -0
  27. package/dist/planmagnet/pages/AiPlanPagePage.js.map +1 -0
  28. package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js +4 -4
  29. package/dist/planmagnet/pages/ProductsEditProductPagePage.js +5 -5
  30. package/dist/planmagnet/pages/ProductsEditRoadmapPagePage.js +4 -4
  31. package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +4 -4
  32. package/dist/planmagnet/pages/ProgramsEditProgramPagePage.js +4 -4
  33. package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js +4 -4
  34. package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js +4 -4
  35. package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +11 -11
  36. package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +6 -6
  37. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
  38. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +209 -199
  39. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
  40. package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.d.ts +2 -0
  41. package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.d.ts.map +1 -0
  42. package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js +236 -0
  43. package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js.map +1 -0
  44. package/dist/planmagnet/pages/RisksRiskDetailPagePage.js +5 -5
  45. package/dist/planmagnet/pages/TasksTimesheetDetailPagePage.js +6 -6
  46. package/dist/planmagnet/pages/TeamCreateTeamPagePage.js +4 -4
  47. package/dist/planmagnet/pages/TeamTeamEditPagePage.js +8 -8
  48. package/dist/planmagnet/pages/TemplatesEditTemplatePagePage.js +7 -7
  49. package/dist/planmagnet/releases/useReleaseOptions.d.ts +21 -0
  50. package/dist/planmagnet/releases/useReleaseOptions.d.ts.map +1 -0
  51. package/dist/planmagnet/releases/useReleaseOptions.js +75 -0
  52. package/dist/planmagnet/releases/useReleaseOptions.js.map +1 -0
  53. package/dist/planmagnet/roadmaps/RoadmapControls.js +13 -13
  54. package/dist/planmagnet/utils/qualityGateCriteria.d.ts +33 -0
  55. package/dist/planmagnet/utils/qualityGateCriteria.d.ts.map +1 -0
  56. package/dist/planmagnet/utils/qualityGateCriteria.js +58 -0
  57. package/dist/planmagnet/utils/qualityGateCriteria.js.map +1 -0
  58. package/package.json +1 -1
@@ -0,0 +1,381 @@
1
+ import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
2
+ import { throwOnError as n } from "../utils/mutationResult.js";
3
+ import { ConfirmButton as r, ErrorLine as i } from "../controls/ConfirmButton.js";
4
+ import { ProjectSelect as a } from "../controls/Pickers.js";
5
+ import { WORK_ITEM_PRIORITIES as o, enumLabel as s } from "../controls/WorkItemControls.js";
6
+ import { parseEstimateHours as c } from "../utils/formValidation.js";
7
+ import { useState as l } from "react";
8
+ import { CheckCircle2 as u, History as d, Sparkles as f, Wand2 as p } from "lucide-react";
9
+ import { gql as m } from "@apollo/client";
10
+ import { useMutation as h } from "@apollo/client/react";
11
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
12
+ import { Badge as v, Button as y, Card as b, CardContent as x, CardHeader as ee, CardTitle as S, Checkbox as C, Input as w, Textarea as T } from "@burdenoff/fe-libs/ui";
13
+ //#region src/planmagnet/pages/AiPlanPagePage.tsx
14
+ var E = [
15
+ "STORY",
16
+ "BUG",
17
+ "TASK",
18
+ "EPIC",
19
+ "SUB_TASK"
20
+ ], D = 4e3, O = m`
21
+ mutation SuggestWorkItemBreakdown($input: PlanmagnetSuggestWorkItemBreakdownInput!) {
22
+ planmagnetSuggestWorkItemBreakdown(input: $input) {
23
+ agentRunId
24
+ provider
25
+ suggestions {
26
+ title
27
+ type
28
+ priority
29
+ description
30
+ estimatedHours
31
+ }
32
+ }
33
+ }
34
+ `, k = m`
35
+ mutation CreateWorkItemFromSuggestion($input: PlanmagnetCreateWorkItemInput!) {
36
+ planmagnetCreateWorkItem(input: $input) {
37
+ id
38
+ title
39
+ }
40
+ }
41
+ `, A = "w-full rounded-md border border-input bg-background px-2 py-1 text-sm disabled:opacity-60";
42
+ function j() {
43
+ let { workspaceId: m } = e(), j = t(), [M, N] = l(""), [P, F] = l(""), [I, L] = l(null), [R, z] = l(null), [B, V] = l(null), [H, U] = l({}), [W, G] = l(!1), [K, q] = h(O), [J] = h(k, { refetchQueries: ["GetWorkItems"] }), Y = M.trim(), X = !!m && !!P && Y.length > 0 && Y.length <= D && !q.loading && !W, Z = async () => {
44
+ if (X) {
45
+ V(null), L(null), U({}), z(null);
46
+ try {
47
+ let e = (await n(K({ variables: { input: { description: Y } } }))).data?.planmagnetSuggestWorkItemBreakdown;
48
+ if (!e) return;
49
+ z(e.provider), L(e.suggestions.map((t, n) => ({
50
+ localId: `${e.agentRunId}-${n}`,
51
+ title: t.title,
52
+ type: t.type,
53
+ priority: t.priority,
54
+ description: t.description ?? "",
55
+ estimateHours: t.estimatedHours == null ? "" : String(t.estimatedHours),
56
+ include: !0
57
+ })));
58
+ } catch (e) {
59
+ V(e instanceof Error ? e.message : "AI assistance is unavailable right now.");
60
+ }
61
+ }
62
+ }, Q = (e, t) => {
63
+ L((n) => n?.map((n) => n.localId === e ? {
64
+ ...n,
65
+ ...t
66
+ } : n) ?? n);
67
+ }, $ = (I ?? []).filter((e) => e.include && H[e.localId]?.status !== "created"), te = $.some((e) => !e.title.trim() || c(e.estimateHours).invalid), ne = async () => {
68
+ if (!(!I || $.length === 0 || !P)) {
69
+ G(!0);
70
+ for (let e of $) {
71
+ U((t) => ({
72
+ ...t,
73
+ [e.localId]: { status: "creating" }
74
+ }));
75
+ try {
76
+ let t = c(e.estimateHours), r = (await n(J({ variables: { input: {
77
+ projectId: P,
78
+ title: e.title.trim(),
79
+ type: e.type,
80
+ priority: e.priority,
81
+ description: e.description.trim() || void 0,
82
+ estimateMinutes: t.minutes
83
+ } } }))).data?.planmagnetCreateWorkItem;
84
+ U((t) => ({
85
+ ...t,
86
+ [e.localId]: r ? {
87
+ status: "created",
88
+ workItemId: r.id
89
+ } : {
90
+ status: "error",
91
+ message: "Created, but no id was returned."
92
+ }
93
+ })), r && Q(e.localId, { include: !1 });
94
+ } catch (t) {
95
+ U((n) => ({
96
+ ...n,
97
+ [e.localId]: {
98
+ status: "error",
99
+ message: t instanceof Error ? t.message : "This work item could not be created."
100
+ }
101
+ }));
102
+ }
103
+ }
104
+ G(!1);
105
+ }
106
+ };
107
+ return /* @__PURE__ */ _("div", {
108
+ className: "max-w-4xl space-y-6 p-6",
109
+ "data-testid": "ai-plan-page",
110
+ children: [
111
+ /* @__PURE__ */ _("div", {
112
+ className: "flex flex-wrap items-center justify-between gap-2",
113
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("h1", {
114
+ className: "flex items-center gap-2 text-2xl font-semibold",
115
+ children: [/* @__PURE__ */ g(f, { className: "h-6 w-6" }), "AI breakdown"]
116
+ }), /* @__PURE__ */ g("p", {
117
+ className: "text-sm text-muted-foreground",
118
+ children: "Describe a feature and get a suggested work-item breakdown from the configured AI provider. Nothing is created until you review it and confirm."
119
+ })] }), /* @__PURE__ */ _(y, {
120
+ variant: "outline",
121
+ size: "sm",
122
+ onClick: () => j("/ai/activity-page"),
123
+ "data-testid": "ai-plan-view-activity",
124
+ children: [/* @__PURE__ */ g(d, { className: "mr-1 h-4 w-4" }), "View AI activity"]
125
+ })]
126
+ }),
127
+ /* @__PURE__ */ _(b, { children: [/* @__PURE__ */ g(ee, { children: /* @__PURE__ */ g(S, { children: "Describe what you need built" }) }), /* @__PURE__ */ _(x, {
128
+ className: "space-y-4",
129
+ children: [
130
+ /* @__PURE__ */ _("div", { children: [
131
+ /* @__PURE__ */ g("label", {
132
+ htmlFor: "ai-plan-description",
133
+ className: "text-sm font-medium",
134
+ children: "Description"
135
+ }),
136
+ /* @__PURE__ */ g(T, {
137
+ id: "ai-plan-description",
138
+ "data-testid": "ai-plan-description",
139
+ className: "mt-1 min-h-[140px]",
140
+ value: M,
141
+ maxLength: D,
142
+ onChange: (e) => N(e.target.value),
143
+ placeholder: "e.g. Let workspace admins export a project's tasks to CSV, filtered by status and assignee, from the project detail page.",
144
+ "aria-describedby": "ai-plan-description-count"
145
+ }),
146
+ /* @__PURE__ */ _("p", {
147
+ id: "ai-plan-description-count",
148
+ className: "mt-1 text-xs text-muted-foreground",
149
+ "data-testid": "ai-plan-description-count",
150
+ children: [
151
+ M.length,
152
+ " / ",
153
+ D
154
+ ]
155
+ })
156
+ ] }),
157
+ /* @__PURE__ */ _("div", { children: [
158
+ /* @__PURE__ */ g("label", {
159
+ htmlFor: "ai-plan-project",
160
+ className: "text-sm font-medium",
161
+ children: "Project"
162
+ }),
163
+ /* @__PURE__ */ g("div", {
164
+ className: "mt-1",
165
+ children: /* @__PURE__ */ g(a, {
166
+ id: "ai-plan-project",
167
+ value: P,
168
+ onChange: F,
169
+ noneLabel: "Choose a project…",
170
+ disabled: W
171
+ })
172
+ }),
173
+ /* @__PURE__ */ g("p", {
174
+ className: "mt-1 text-xs text-muted-foreground",
175
+ children: "Kept suggestions are created as work items in this project."
176
+ })
177
+ ] }),
178
+ /* @__PURE__ */ g("div", {
179
+ className: "flex justify-end",
180
+ children: /* @__PURE__ */ _(y, {
181
+ onClick: () => void Z(),
182
+ disabled: !X,
183
+ "data-testid": "ai-plan-suggest",
184
+ children: [/* @__PURE__ */ g(p, { className: "mr-1 h-4 w-4" }), q.loading ? "Suggesting…" : "Suggest breakdown"]
185
+ })
186
+ })
187
+ ]
188
+ })] }),
189
+ B && /* @__PURE__ */ _("div", {
190
+ role: "alert",
191
+ className: "space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive",
192
+ "data-testid": "ai-plan-suggest-error",
193
+ children: [/* @__PURE__ */ g("p", { children: B }), /* @__PURE__ */ _(y, {
194
+ variant: "outline",
195
+ size: "sm",
196
+ onClick: () => j("/ai/activity-page"),
197
+ "data-testid": "ai-plan-suggest-error-activity-link",
198
+ children: [/* @__PURE__ */ g(d, { className: "mr-1 h-4 w-4" }), "View AI activity for the recorded attempt"]
199
+ })]
200
+ }),
201
+ I && /* @__PURE__ */ _("div", {
202
+ className: "space-y-4",
203
+ children: [
204
+ /* @__PURE__ */ _("div", {
205
+ className: "flex flex-wrap items-center justify-between gap-2",
206
+ children: [/* @__PURE__ */ _("div", {
207
+ className: "space-y-1",
208
+ children: [/* @__PURE__ */ g("p", {
209
+ className: "text-sm font-medium text-muted-foreground",
210
+ "data-testid": "ai-plan-disclaimer",
211
+ children: "AI-assisted — review each suggestion before creating; suggestions can be wrong."
212
+ }), R && /* @__PURE__ */ _("p", {
213
+ className: "text-xs text-muted-foreground",
214
+ children: ["Suggested by ", /* @__PURE__ */ g("span", {
215
+ className: "font-medium",
216
+ children: R
217
+ })]
218
+ })]
219
+ }), /* @__PURE__ */ g("div", {
220
+ "data-testid": "ai-plan-create-selected",
221
+ children: /* @__PURE__ */ g(r, {
222
+ label: `Create ${$.length} selected`,
223
+ icon: /* @__PURE__ */ g(u, { className: "mr-1 h-4 w-4" }),
224
+ title: "Create the selected work items?",
225
+ description: `This creates ${$.length} work item(s) in the chosen project, one at a time. Review each suggestion first — AI suggestions can be wrong.`,
226
+ confirmLabel: `Create ${$.length}`,
227
+ disabled: W || $.length === 0 || !P || te,
228
+ onConfirm: () => void ne()
229
+ })
230
+ })]
231
+ }),
232
+ I.length === 0 && /* @__PURE__ */ g("p", {
233
+ className: "text-sm text-muted-foreground",
234
+ children: "The provider returned no suggestions for this description."
235
+ }),
236
+ /* @__PURE__ */ g("div", {
237
+ className: "space-y-3",
238
+ children: I.map((e) => {
239
+ let t = H[e.localId], n = c(e.estimateHours), r = !e.title.trim();
240
+ return /* @__PURE__ */ g(b, {
241
+ "data-testid": "ai-suggestion-card",
242
+ children: /* @__PURE__ */ g(x, {
243
+ className: "space-y-3 pt-4",
244
+ children: /* @__PURE__ */ _("div", {
245
+ className: "flex items-start gap-3",
246
+ children: [/* @__PURE__ */ g(C, {
247
+ id: `ai-suggestion-include-${e.localId}`,
248
+ checked: e.include,
249
+ disabled: W || t?.status === "created",
250
+ onCheckedChange: (t) => Q(e.localId, { include: t === !0 }),
251
+ "data-testid": "ai-suggestion-include",
252
+ "aria-label": `Include "${e.title}"`
253
+ }), /* @__PURE__ */ _("div", {
254
+ className: "flex-1 space-y-3",
255
+ children: [
256
+ /* @__PURE__ */ _("div", { children: [
257
+ /* @__PURE__ */ g("label", {
258
+ htmlFor: `ai-suggestion-title-${e.localId}`,
259
+ className: "text-xs font-medium text-muted-foreground",
260
+ children: "Title"
261
+ }),
262
+ /* @__PURE__ */ g(w, {
263
+ id: `ai-suggestion-title-${e.localId}`,
264
+ "data-testid": "ai-suggestion-title",
265
+ className: "mt-1",
266
+ value: e.title,
267
+ disabled: W,
268
+ "aria-invalid": r,
269
+ onChange: (t) => Q(e.localId, { title: t.target.value })
270
+ }),
271
+ r && /* @__PURE__ */ g("p", {
272
+ role: "alert",
273
+ className: "mt-1 text-xs text-destructive",
274
+ children: "A title is required."
275
+ })
276
+ ] }),
277
+ /* @__PURE__ */ _("div", {
278
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
279
+ children: [
280
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
281
+ className: "text-xs font-medium text-muted-foreground",
282
+ children: "Type"
283
+ }), /* @__PURE__ */ g("select", {
284
+ className: `mt-1 ${A}`,
285
+ value: e.type,
286
+ disabled: W,
287
+ "data-testid": "ai-suggestion-type",
288
+ onChange: (t) => Q(e.localId, { type: t.target.value }),
289
+ children: E.map((e) => /* @__PURE__ */ g("option", {
290
+ value: e,
291
+ children: s(e)
292
+ }, e))
293
+ })] }),
294
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
295
+ className: "text-xs font-medium text-muted-foreground",
296
+ children: "Priority"
297
+ }), /* @__PURE__ */ g("select", {
298
+ className: `mt-1 ${A}`,
299
+ value: e.priority,
300
+ disabled: W,
301
+ "data-testid": "ai-suggestion-priority",
302
+ onChange: (t) => Q(e.localId, { priority: t.target.value }),
303
+ children: o.map((e) => /* @__PURE__ */ g("option", {
304
+ value: e,
305
+ children: s(e)
306
+ }, e))
307
+ })] }),
308
+ /* @__PURE__ */ _("div", { children: [
309
+ /* @__PURE__ */ g("label", {
310
+ htmlFor: `ai-suggestion-estimate-${e.localId}`,
311
+ className: "text-xs font-medium text-muted-foreground",
312
+ children: "Estimate (hours)"
313
+ }),
314
+ /* @__PURE__ */ g(w, {
315
+ id: `ai-suggestion-estimate-${e.localId}`,
316
+ "data-testid": "ai-suggestion-estimate",
317
+ type: "number",
318
+ min: 0,
319
+ step: .25,
320
+ className: "mt-1",
321
+ value: e.estimateHours,
322
+ disabled: W,
323
+ "aria-invalid": n.invalid,
324
+ onChange: (t) => Q(e.localId, { estimateHours: t.target.value })
325
+ }),
326
+ n.invalid && /* @__PURE__ */ g("p", {
327
+ role: "alert",
328
+ className: "mt-1 text-xs text-destructive",
329
+ children: "Hours must be 0 or more."
330
+ })
331
+ ] })
332
+ ]
333
+ }),
334
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
335
+ className: "text-xs font-medium text-muted-foreground",
336
+ children: "Description"
337
+ }), /* @__PURE__ */ g(T, {
338
+ className: "mt-1 min-h-[80px]",
339
+ value: e.description,
340
+ disabled: W,
341
+ "data-testid": "ai-suggestion-description",
342
+ onChange: (t) => Q(e.localId, { description: t.target.value })
343
+ })] }),
344
+ t?.status === "creating" && /* @__PURE__ */ g("p", {
345
+ className: "text-xs text-muted-foreground",
346
+ "data-testid": "ai-suggestion-result",
347
+ children: "Creating…"
348
+ }),
349
+ t?.status === "created" && /* @__PURE__ */ _("div", {
350
+ className: "flex items-center gap-2 text-xs",
351
+ "data-testid": "ai-suggestion-result",
352
+ children: [/* @__PURE__ */ g(v, {
353
+ variant: "success",
354
+ children: "Created"
355
+ }), /* @__PURE__ */ g("button", {
356
+ type: "button",
357
+ className: "text-primary underline",
358
+ onClick: () => j(`/tasks/task-detail-page?taskId=${encodeURIComponent(t.workItemId)}`),
359
+ children: "Open task"
360
+ })]
361
+ }),
362
+ t?.status === "error" && /* @__PURE__ */ g("div", {
363
+ "data-testid": "ai-suggestion-result",
364
+ children: /* @__PURE__ */ g(i, { message: t.message })
365
+ })
366
+ ]
367
+ })]
368
+ })
369
+ })
370
+ }, e.localId);
371
+ })
372
+ })
373
+ ]
374
+ })
375
+ ]
376
+ });
377
+ }
378
+ //#endregion
379
+ export { j as AiPlanPagePage };
380
+
381
+ //# sourceMappingURL=AiPlanPagePage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiPlanPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/AiPlanPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n Badge,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Checkbox,\n Input,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\nimport { CheckCircle2, History, Sparkles, Wand2 } from 'lucide-react';\nimport { ConfirmButton, ErrorLine } from '../controls/ConfirmButton';\nimport { ProjectSelect } from '../controls/Pickers';\nimport { WORK_ITEM_PRIORITIES, enumLabel } from '../controls/WorkItemControls';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { throwOnError } from '../utils/mutationResult';\nimport { parseEstimateHours } from '../utils/formValidation';\n\n/**\n * AI-05: describe a feature in plain text, get a suggested work-item breakdown from the configured LLM provider,\n * review/edit every suggestion, then create only the ones explicitly kept — one at a time, each showing its own\n * result. In production today `planmagnetSuggestWorkItemBreakdown` fails with SERVICE_UNAVAILABLE (BOFF-7869: no\n * provider key configured) — this page must show that refusal plainly and must never fabricate suggestions of its\n * own. See AiActivityPagePage (AI-24) for the ledger this call is recorded onto either way.\n */\n\nconst WORK_ITEM_TYPES = ['STORY', 'BUG', 'TASK', 'EPIC', 'SUB_TASK'] as const;\nconst MAX_DESCRIPTION_LENGTH = 4000;\n\nconst SUGGEST_BREAKDOWN = gql`\n mutation SuggestWorkItemBreakdown($input: PlanmagnetSuggestWorkItemBreakdownInput!) {\n planmagnetSuggestWorkItemBreakdown(input: $input) {\n agentRunId\n provider\n suggestions {\n title\n type\n priority\n description\n estimatedHours\n }\n }\n }\n`;\n\nconst CREATE_WORK_ITEM_FROM_SUGGESTION = gql`\n mutation CreateWorkItemFromSuggestion($input: PlanmagnetCreateWorkItemInput!) {\n planmagnetCreateWorkItem(input: $input) {\n id\n title\n }\n }\n`;\n\ninterface BreakdownSuggestion {\n title: string;\n type: string;\n priority: string;\n description: string | null;\n estimatedHours: number | null;\n}\n\ninterface SuggestBreakdownData {\n planmagnetSuggestWorkItemBreakdown: {\n agentRunId: string;\n provider: string;\n suggestions: BreakdownSuggestion[];\n };\n}\n\ninterface CreateWorkItemData {\n planmagnetCreateWorkItem: { id: string; title: string };\n}\n\ninterface SuggestionCard {\n localId: string;\n title: string;\n type: string;\n priority: string;\n description: string;\n estimateHours: string;\n include: boolean;\n}\n\ntype CardResult =\n | { status: 'creating' }\n | { status: 'created'; workItemId: string }\n | { status: 'error'; message: string };\n\nconst cardSelectClass =\n 'w-full rounded-md border border-input bg-background px-2 py-1 text-sm disabled:opacity-60';\n\nexport function AiPlanPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n\n const [description, setDescription] = useState('');\n const [projectId, setProjectId] = useState('');\n const [cards, setCards] = useState<SuggestionCard[] | null>(null);\n const [provider, setProvider] = useState<string | null>(null);\n const [suggestError, setSuggestError] = useState<string | null>(null);\n const [results, setResults] = useState<Record<string, CardResult>>({});\n const [creating, setCreating] = useState(false);\n\n const [suggestBreakdown, suggestState] = useMutation(SUGGEST_BREAKDOWN);\n const [createWorkItem] = useMutation(CREATE_WORK_ITEM_FROM_SUGGESTION, {\n refetchQueries: ['GetWorkItems'],\n });\n\n const trimmedDescription = description.trim();\n const canSuggest =\n !!workspaceId &&\n !!projectId &&\n trimmedDescription.length > 0 &&\n trimmedDescription.length <= MAX_DESCRIPTION_LENGTH &&\n !suggestState.loading &&\n !creating;\n\n const handleSuggest = async () => {\n if (!canSuggest) return;\n setSuggestError(null);\n setCards(null);\n setResults({});\n setProvider(null);\n try {\n const result = await throwOnError(\n suggestBreakdown({ variables: { input: { description: trimmedDescription } } })\n );\n const data = (result.data as SuggestBreakdownData | undefined)\n ?.planmagnetSuggestWorkItemBreakdown;\n if (!data) return;\n setProvider(data.provider);\n setCards(\n data.suggestions.map((s, index) => ({\n localId: `${data.agentRunId}-${index}`,\n title: s.title,\n type: s.type,\n priority: s.priority,\n description: s.description ?? '',\n estimateHours: s.estimatedHours != null ? String(s.estimatedHours) : '',\n include: true,\n }))\n );\n } catch (e) {\n // AI assistance can be unavailable by design (BOFF-7869, no provider key configured) — the server's own\n // message is shown as-is; this page never invents a breakdown when the call fails.\n setSuggestError(e instanceof Error ? e.message : 'AI assistance is unavailable right now.');\n }\n };\n\n const updateCard = (localId: string, patch: Partial<SuggestionCard>) => {\n setCards((prev) => prev?.map((c) => (c.localId === localId ? { ...c, ...patch } : c)) ?? prev);\n };\n\n // A card already reported `created` must never be counted again — otherwise a second confirmed batch (after\n // checking one more suggestion, or simply re-confirming) would re-create it, producing a duplicate work item.\n const includedCards = (cards ?? []).filter(\n (c) => c.include && results[c.localId]?.status !== 'created'\n );\n const invalidIncluded = includedCards.some(\n (c) => !c.title.trim() || parseEstimateHours(c.estimateHours).invalid\n );\n\n const createSelected = async () => {\n if (!cards || includedCards.length === 0 || !projectId) return;\n setCreating(true);\n // One at a time (not Promise.all): each card's own result must reflect exactly what the server did with it,\n // and a later item must not be attempted against a project the caller has since lost access to mid-batch.\n for (const card of includedCards) {\n setResults((prev) => ({ ...prev, [card.localId]: { status: 'creating' } }));\n try {\n const estimate = parseEstimateHours(card.estimateHours);\n const result = await throwOnError(\n createWorkItem({\n variables: {\n input: {\n projectId,\n title: card.title.trim(),\n type: card.type,\n priority: card.priority,\n description: card.description.trim() || undefined,\n estimateMinutes: estimate.minutes,\n },\n },\n })\n );\n const created = (result.data as CreateWorkItemData | undefined)?.planmagnetCreateWorkItem;\n setResults((prev) => ({\n ...prev,\n [card.localId]: created\n ? { status: 'created', workItemId: created.id }\n : { status: 'error', message: 'Created, but no id was returned.' },\n }));\n if (created) {\n // Drop it out of `include` too so a stale checkbox state can never re-add it to a later batch.\n updateCard(card.localId, { include: false });\n }\n } catch (e) {\n setResults((prev) => ({\n ...prev,\n [card.localId]: {\n status: 'error',\n message: e instanceof Error ? e.message : 'This work item could not be created.',\n },\n }));\n }\n }\n setCreating(false);\n };\n\n return (\n <div className=\"max-w-4xl space-y-6 p-6\" data-testid=\"ai-plan-page\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div>\n <h1 className=\"flex items-center gap-2 text-2xl font-semibold\">\n <Sparkles className=\"h-6 w-6\" />\n AI breakdown\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n Describe a feature and get a suggested work-item breakdown from the configured AI\n provider. Nothing is created until you review it and confirm.\n </p>\n </div>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => navigate('/ai/activity-page')}\n data-testid=\"ai-plan-view-activity\"\n >\n <History className=\"mr-1 h-4 w-4\" />\n View AI activity\n </Button>\n </div>\n\n <Card>\n <CardHeader>\n <CardTitle>Describe what you need built</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div>\n <label htmlFor=\"ai-plan-description\" className=\"text-sm font-medium\">\n Description\n </label>\n <Textarea\n id=\"ai-plan-description\"\n data-testid=\"ai-plan-description\"\n className=\"mt-1 min-h-[140px]\"\n value={description}\n maxLength={MAX_DESCRIPTION_LENGTH}\n onChange={(e) => setDescription(e.target.value)}\n placeholder=\"e.g. Let workspace admins export a project's tasks to CSV, filtered by status and assignee, from the project detail page.\"\n aria-describedby=\"ai-plan-description-count\"\n />\n <p\n id=\"ai-plan-description-count\"\n className=\"mt-1 text-xs text-muted-foreground\"\n data-testid=\"ai-plan-description-count\"\n >\n {description.length} / {MAX_DESCRIPTION_LENGTH}\n </p>\n </div>\n <div>\n <label htmlFor=\"ai-plan-project\" className=\"text-sm font-medium\">\n Project\n </label>\n <div className=\"mt-1\">\n {/* Frozen while a batch is being created: every card of one batch goes to the project it started in. */}\n <ProjectSelect\n id=\"ai-plan-project\"\n value={projectId}\n onChange={setProjectId}\n noneLabel=\"Choose a project…\"\n disabled={creating}\n />\n </div>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n Kept suggestions are created as work items in this project.\n </p>\n </div>\n <div className=\"flex justify-end\">\n <Button\n onClick={() => void handleSuggest()}\n disabled={!canSuggest}\n data-testid=\"ai-plan-suggest\"\n >\n <Wand2 className=\"mr-1 h-4 w-4\" />\n {suggestState.loading ? 'Suggesting…' : 'Suggest breakdown'}\n </Button>\n </div>\n </CardContent>\n </Card>\n\n {suggestError && (\n <div\n role=\"alert\"\n className=\"space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive\"\n data-testid=\"ai-plan-suggest-error\"\n >\n <p>{suggestError}</p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => navigate('/ai/activity-page')}\n data-testid=\"ai-plan-suggest-error-activity-link\"\n >\n <History className=\"mr-1 h-4 w-4\" />\n View AI activity for the recorded attempt\n </Button>\n </div>\n )}\n\n {cards && (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div className=\"space-y-1\">\n <p\n className=\"text-sm font-medium text-muted-foreground\"\n data-testid=\"ai-plan-disclaimer\"\n >\n AI-assisted — review each suggestion before creating; suggestions can be wrong.\n </p>\n {provider && (\n <p className=\"text-xs text-muted-foreground\">\n Suggested by <span className=\"font-medium\">{provider}</span>\n </p>\n )}\n </div>\n <div data-testid=\"ai-plan-create-selected\">\n <ConfirmButton\n label={`Create ${includedCards.length} selected`}\n icon={<CheckCircle2 className=\"mr-1 h-4 w-4\" />}\n title=\"Create the selected work items?\"\n description={`This creates ${includedCards.length} work item(s) in the chosen project, one at a time. Review each suggestion first — AI suggestions can be wrong.`}\n confirmLabel={`Create ${includedCards.length}`}\n disabled={creating || includedCards.length === 0 || !projectId || invalidIncluded}\n onConfirm={() => void createSelected()}\n />\n </div>\n </div>\n\n {cards.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">\n The provider returned no suggestions for this description.\n </p>\n )}\n\n <div className=\"space-y-3\">\n {cards.map((card) => {\n const result = results[card.localId];\n const estimate = parseEstimateHours(card.estimateHours);\n const titleInvalid = !card.title.trim();\n return (\n <Card key={card.localId} data-testid=\"ai-suggestion-card\">\n <CardContent className=\"space-y-3 pt-4\">\n <div className=\"flex items-start gap-3\">\n <Checkbox\n id={`ai-suggestion-include-${card.localId}`}\n checked={card.include}\n disabled={creating || result?.status === 'created'}\n onCheckedChange={(checked) =>\n updateCard(card.localId, { include: checked === true })\n }\n data-testid=\"ai-suggestion-include\"\n aria-label={`Include \"${card.title}\"`}\n />\n <div className=\"flex-1 space-y-3\">\n <div>\n <label\n htmlFor={`ai-suggestion-title-${card.localId}`}\n className=\"text-xs font-medium text-muted-foreground\"\n >\n Title\n </label>\n <Input\n id={`ai-suggestion-title-${card.localId}`}\n data-testid=\"ai-suggestion-title\"\n className=\"mt-1\"\n value={card.title}\n disabled={creating}\n aria-invalid={titleInvalid}\n onChange={(e) => updateCard(card.localId, { title: e.target.value })}\n />\n {titleInvalid && (\n <p role=\"alert\" className=\"mt-1 text-xs text-destructive\">\n A title is required.\n </p>\n )}\n </div>\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">\n Type\n </label>\n <select\n className={`mt-1 ${cardSelectClass}`}\n value={card.type}\n disabled={creating}\n data-testid=\"ai-suggestion-type\"\n onChange={(e) => updateCard(card.localId, { type: e.target.value })}\n >\n {WORK_ITEM_TYPES.map((t) => (\n <option key={t} value={t}>\n {enumLabel(t)}\n </option>\n ))}\n </select>\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">\n Priority\n </label>\n <select\n className={`mt-1 ${cardSelectClass}`}\n value={card.priority}\n disabled={creating}\n data-testid=\"ai-suggestion-priority\"\n onChange={(e) =>\n updateCard(card.localId, { priority: e.target.value })\n }\n >\n {WORK_ITEM_PRIORITIES.map((p) => (\n <option key={p} value={p}>\n {enumLabel(p)}\n </option>\n ))}\n </select>\n </div>\n <div>\n <label\n htmlFor={`ai-suggestion-estimate-${card.localId}`}\n className=\"text-xs font-medium text-muted-foreground\"\n >\n Estimate (hours)\n </label>\n <Input\n id={`ai-suggestion-estimate-${card.localId}`}\n data-testid=\"ai-suggestion-estimate\"\n type=\"number\"\n min={0}\n step={0.25}\n className=\"mt-1\"\n value={card.estimateHours}\n disabled={creating}\n aria-invalid={estimate.invalid}\n onChange={(e) =>\n updateCard(card.localId, { estimateHours: e.target.value })\n }\n />\n {estimate.invalid && (\n <p role=\"alert\" className=\"mt-1 text-xs text-destructive\">\n Hours must be 0 or more.\n </p>\n )}\n </div>\n </div>\n <div>\n <label className=\"text-xs font-medium text-muted-foreground\">\n Description\n </label>\n <Textarea\n className=\"mt-1 min-h-[80px]\"\n value={card.description}\n disabled={creating}\n data-testid=\"ai-suggestion-description\"\n onChange={(e) =>\n updateCard(card.localId, { description: e.target.value })\n }\n />\n </div>\n {result?.status === 'creating' && (\n <p\n className=\"text-xs text-muted-foreground\"\n data-testid=\"ai-suggestion-result\"\n >\n Creating…\n </p>\n )}\n {result?.status === 'created' && (\n <div\n className=\"flex items-center gap-2 text-xs\"\n data-testid=\"ai-suggestion-result\"\n >\n <Badge variant=\"success\">Created</Badge>\n <button\n type=\"button\"\n className=\"text-primary underline\"\n onClick={() =>\n navigate(\n `/tasks/task-detail-page?taskId=${encodeURIComponent(result.workItemId)}`\n )\n }\n >\n Open task\n </button>\n </div>\n )}\n {result?.status === 'error' && (\n <div data-testid=\"ai-suggestion-result\">\n <ErrorLine message={result.message} />\n </div>\n )}\n </div>\n </div>\n </CardContent>\n </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ACV,eAAY;uBAFd,CAIE,kBAAC,GAAD;cAAO,SAAQ;wBAAU;cAAe,CAAA,EACxC,kBAAC,UAAD;cACE,MAAK;cACL,WAAU;cACV,eACE,EACE,kCAAkC,mBAAmB,EAAO,WAAW,GACxE;wBAEJ;cAEQ,CAAA,CACL;;YAEP,GAAQ,WAAW,WAClB,kBAAC,OAAD;aAAK,eAAY;uBACf,kBAAC,GAAD,EAAW,SAAS,EAAO,SAAW,CAAA;aAClC,CAAA;YAEJ;aACF;;SACM,CAAA;QACT,EAxJI,EAAK,QAwJT;QAET;MACE,CAAA;KACF;;GAEJ"}
@@ -1,7 +1,7 @@
1
1
  import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { throwOnError as t } from "../utils/mutationResult.js";
3
- import { useEntityId as n } from "../hooks/useEntityId.js";
4
- import { ErrorLine as r } from "../controls/ConfirmButton.js";
3
+ import { ErrorLine as n } from "../controls/ConfirmButton.js";
4
+ import { useEntityId as r } from "../hooks/useEntityId.js";
5
5
  import { AUTOMATION_RULE_QUERIES as i, AutomationRuleDeleteButton as a, AutomationRuleStatusSwitch as o, RunAutomationRuleDialog as s } from "../controls/AutomationRuleControls.js";
6
6
  import { AutomationExecutionsPanel as c } from "../automation/AutomationExecutionsPanel.js";
7
7
  import { actionsFromApi as l, actionsToApi as u, conditionsFromApi as d, conditionsToApi as f } from "../automation/automationRuleTypes.js";
@@ -55,7 +55,7 @@ function A(e) {
55
55
  };
56
56
  }
57
57
  function j() {
58
- let l = n(), { workspaceId: d } = e(), { data: v, loading: j, error: M } = b(O, {
58
+ let l = r(), { workspaceId: d } = e(), { data: v, loading: j, error: M } = b(O, {
59
59
  variables: { id: l ?? "" },
60
60
  skip: !l,
61
61
  fetchPolicy: "cache-and-network"
@@ -128,7 +128,7 @@ function j() {
128
128
  })
129
129
  })]
130
130
  }),
131
- F && /* @__PURE__ */ x(r, { message: F }),
131
+ F && /* @__PURE__ */ x(n, { message: F }),
132
132
  L && !F && /* @__PURE__ */ x("p", {
133
133
  className: "text-sm text-muted-foreground",
134
134
  children: "Saved."
@@ -1,8 +1,8 @@
1
1
  import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { PersonName as t } from "../people/People.js";
3
3
  import { throwOnError as n } from "../utils/mutationResult.js";
4
- import { useEntityId as r } from "../hooks/useEntityId.js";
5
- import { enumLabel as i } from "../controls/WorkItemControls.js";
4
+ import { enumLabel as r } from "../controls/WorkItemControls.js";
5
+ import { useEntityId as i } from "../hooks/useEntityId.js";
6
6
  import { detailPath as a } from "../utils/rowNavigation.js";
7
7
  import { ProductHeaderActions as o } from "../product/ProductControls.js";
8
8
  import { useMemo as s, useState as c } from "react";
@@ -68,7 +68,7 @@ var w = [
68
68
  window: ""
69
69
  };
70
70
  function O() {
71
- let p = e(), O = r("productId") ?? "", { data: k, loading: A, error: j } = h(T, {
71
+ let p = e(), O = i("productId") ?? "", { data: k, loading: A, error: j } = h(T, {
72
72
  variables: { id: O },
73
73
  skip: !O
74
74
  }), [M, { loading: N }] = m(E, {
@@ -233,7 +233,7 @@ function O() {
233
233
  }),
234
234
  children: w.map((e) => /* @__PURE__ */ g("option", {
235
235
  value: e,
236
- children: i(e)
236
+ children: r(e)
237
237
  }, e))
238
238
  })] })
239
239
  ]
@@ -327,7 +327,7 @@ function O() {
327
327
  children: "Lifecycle stage"
328
328
  }), /* @__PURE__ */ g("span", {
329
329
  className: "font-medium capitalize",
330
- children: i(R.lifecycleStage)
330
+ children: r(R.lifecycleStage)
331
331
  })]
332
332
  }),
333
333
  /* @__PURE__ */ _("div", {
@@ -1,8 +1,8 @@
1
1
  import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { PersonName as t } from "../people/People.js";
3
3
  import { LEAVES_PAGE_CONTEXT as n, throwOnError as r } from "../utils/mutationResult.js";
4
- import { useEntityId as i } from "../hooks/useEntityId.js";
5
- import { ConfirmButton as a } from "../controls/ConfirmButton.js";
4
+ import { ConfirmButton as i } from "../controls/ConfirmButton.js";
5
+ import { useEntityId as a } from "../hooks/useEntityId.js";
6
6
  import { detailPath as o } from "../utils/rowNavigation.js";
7
7
  import { PlanningFocusBadge as s, PlanningFocusSelect as c } from "../roadmaps/planningFocus.js";
8
8
  import { useMemo as l, useState as u } from "react";
@@ -50,7 +50,7 @@ var D = g`
50
50
  }
51
51
  `;
52
52
  function A() {
53
- let g = e(), A = i("roadmapId") ?? "", { data: j, loading: M, error: N } = v(D, {
53
+ let g = e(), A = a("roadmapId") ?? "", { data: j, loading: M, error: N } = v(D, {
54
54
  variables: { id: A },
55
55
  skip: !A
56
56
  }), [P, { loading: F }] = _(O, {
@@ -261,7 +261,7 @@ function A() {
261
261
  }), /* @__PURE__ */ y("span", { children: new Date(H.updatedAt).toLocaleDateString() })]
262
262
  })
263
263
  ]
264
- })] }), /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(w, { children: /* @__PURE__ */ y(T, { children: "Danger Zone" }) }), /* @__PURE__ */ y(C, { children: /* @__PURE__ */ y(a, {
264
+ })] }), /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(w, { children: /* @__PURE__ */ y(T, { children: "Danger Zone" }) }), /* @__PURE__ */ y(C, { children: /* @__PURE__ */ y(i, {
265
265
  label: L ? "Deleting…" : "Delete roadmap",
266
266
  variant: "outline",
267
267
  icon: /* @__PURE__ */ y(h, { className: "mr-1 h-4 w-4" }),
@@ -1,7 +1,7 @@
1
1
  import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { PersonName as t } from "../people/People.js";
3
- import { useEntityId as n } from "../hooks/useEntityId.js";
4
- import { enumLabel as r } from "../controls/WorkItemControls.js";
3
+ import { enumLabel as n } from "../controls/WorkItemControls.js";
4
+ import { useEntityId as r } from "../hooks/useEntityId.js";
5
5
  import { detailPath as i } from "../utils/rowNavigation.js";
6
6
  import { PlanMagnetNotFoundPage as a } from "./NotFoundPage.js";
7
7
  import { ProductFeatureRequestsPanel as o, ProductHeaderActions as s, ProductObjectivesPanel as c, ProductReleasesPanel as l, ProductRoadmapsPanel as u } from "../product/ProductControls.js";
@@ -57,7 +57,7 @@ var D = _`
57
57
  }
58
58
  `;
59
59
  function O() {
60
- let _ = e(), O = n("productId") ?? "", { data: k, loading: A, error: j } = v(D, {
60
+ let _ = e(), O = r("productId") ?? "", { data: k, loading: A, error: j } = v(D, {
61
61
  variables: { id: O },
62
62
  skip: !O
63
63
  });
@@ -94,7 +94,7 @@ function O() {
94
94
  /* @__PURE__ */ y(x, {
95
95
  variant: "secondary",
96
96
  className: "capitalize",
97
- children: r(M.lifecycleStage)
97
+ children: n(M.lifecycleStage)
98
98
  })
99
99
  ]
100
100
  }), /* @__PURE__ */ y("p", {
@@ -1,8 +1,8 @@
1
1
  import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { throwOnError as t } from "../utils/mutationResult.js";
3
3
  import { enumLabel as n } from "../controls/WorkItemControls.js";
4
- import { detailPath as r } from "../utils/rowNavigation.js";
5
- import { endBeforeStart as i } from "../utils/formValidation.js";
4
+ import { endBeforeStart as r } from "../utils/formValidation.js";
5
+ import { detailPath as i } from "../utils/rowNavigation.js";
6
6
  import { PROGRAM_STATUSES as a } from "../controls/ProgramControls.js";
7
7
  import { useMemo as o, useState as s } from "react";
8
8
  import { ArrowLeft as c, Loader2 as l, Save as u } from "lucide-react";
@@ -65,7 +65,7 @@ function T() {
65
65
  }), [F]), [L, R] = s({}), z = {
66
66
  ...I,
67
67
  ...L
68
- }, B = (e) => R(e), V = a.includes(z.status) ? a : [z.status, ...a], H = i(z.startDate, z.endDate), U = z.budgetTotal !== "" && Number(z.budgetTotal) < 0;
68
+ }, B = (e) => R(e), V = a.includes(z.status) ? a : [z.status, ...a], H = r(z.startDate, z.endDate), U = z.budgetTotal !== "" && Number(z.budgetTotal) < 0;
69
69
  return D && !E ? /* @__PURE__ */ h("div", {
70
70
  className: "flex items-center justify-center p-12",
71
71
  children: /* @__PURE__ */ h(l, { className: "h-8 w-8 animate-spin text-muted-foreground" })
@@ -83,7 +83,7 @@ function T() {
83
83
  variant: "ghost",
84
84
  size: "sm",
85
85
  "aria-label": "Back to the program",
86
- onClick: () => f(r("/products/program-detail-page", T)),
86
+ onClick: () => f(i("/products/program-detail-page", T)),
87
87
  children: /* @__PURE__ */ h(c, { className: "h-4 w-4" })
88
88
  }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
89
89
  className: "text-2xl font-semibold",
@@ -1,8 +1,8 @@
1
1
  import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
2
2
  import { PersonName as t } from "../people/People.js";
3
3
  import { BUDGET_STATE_STYLE as n, budgetState as r, budgetUsage as i, money as a } from "../budgets/budgetMath.js";
4
- import { useEntityId as o } from "../hooks/useEntityId.js";
5
- import { enumLabel as s } from "../controls/WorkItemControls.js";
4
+ import { enumLabel as o } from "../controls/WorkItemControls.js";
5
+ import { useEntityId as s } from "../hooks/useEntityId.js";
6
6
  import { BudgetHeaderActions as c } from "../budgets/BudgetControls.js";
7
7
  import { DeleteExpenseButton as l, EditExpenseDialog as u, LogExpenseDialog as d } from "../budgets/ExpenseControls.js";
8
8
  import { ArrowLeft as f, Receipt as p } from "lucide-react";
@@ -48,7 +48,7 @@ var C = m`
48
48
  }
49
49
  `;
50
50
  function w() {
51
- let m = o("budgetId"), w = e(), { data: T, loading: E, error: D } = h(C, {
51
+ let m = s("budgetId"), w = e(), { data: T, loading: E, error: D } = h(C, {
52
52
  variables: { id: m },
53
53
  skip: !m
54
54
  });
@@ -257,7 +257,7 @@ function w() {
257
257
  children: [/* @__PURE__ */ g("span", {
258
258
  className: "text-muted-foreground",
259
259
  children: "Status"
260
- }), /* @__PURE__ */ g("span", { children: s(O.status) })]
260
+ }), /* @__PURE__ */ g("span", { children: o(O.status) })]
261
261
  }),
262
262
  /* @__PURE__ */ _("div", {
263
263
  className: "flex justify-between",