@burdenoff/microfe-planmagnet 2026.1126.2 → 2026.1127.1

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.
@@ -1,13 +1,15 @@
1
- import { isForbidden as e } from "../utils/graphqlErrors.js";
2
- import { useState as t } from "react";
3
- import { CalendarRange as n } from "lucide-react";
4
- import { gql as r } from "@apollo/client";
5
- import { useQuery as i } from "@apollo/client/react";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { Card as s, CardContent as c, CardHeader as l, CardTitle as u, Checkbox as d } from "@burdenoff/fe-libs/ui";
8
- import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
1
+ import { resolvePlanMagnetPath as e, usePlanMagnet as t, usePlanMagnetNavigate as n } from "../providers/PlanMagnetProvider.js";
2
+ import { isForbidden as r } from "../utils/graphqlErrors.js";
3
+ import { detailPath as i } from "../utils/rowNavigation.js";
4
+ import { useState as a } from "react";
5
+ import { CalendarRange as o } from "lucide-react";
6
+ import { gql as s } from "@apollo/client";
7
+ import { useQuery as c } from "@apollo/client/react";
8
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
+ import { Card as d, CardContent as f, CardHeader as p, CardTitle as m, Checkbox as h } from "@burdenoff/fe-libs/ui";
10
+ import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
11
  // src/planmagnet/forecast/DeliveryForecastCard.tsx
10
- var p = r`
12
+ var _ = s`
11
13
  query PlanmagnetDeliveryForecast(
12
14
  $workspaceId: ID!
13
15
  $projectId: ID!
@@ -40,7 +42,7 @@ var p = r`
40
42
  }
41
43
  }
42
44
  `;
43
- function m(e) {
45
+ function v(e) {
44
46
  return new Date(e).toLocaleDateString(void 0, {
45
47
  timeZone: "UTC",
46
48
  year: "numeric",
@@ -48,158 +50,165 @@ function m(e) {
48
50
  day: "numeric"
49
51
  });
50
52
  }
51
- function h({ workspaceId: r, projectId: h, sprintId: g, sprintName: _ }) {
52
- let { t: v } = f(), [y, b] = t(!1), x = y && !!g, { data: S, loading: C, error: w } = i(p, {
53
+ function y({ workspaceId: s, projectId: y, sprintId: b, sprintName: x }) {
54
+ let { t: S } = g(), { basePath: C } = t(), w = n(), [T, E] = a(!1), D = T && !!b, { data: O, loading: k, error: A } = c(_, {
53
55
  variables: {
54
- workspaceId: r,
55
- projectId: h,
56
- scope: x && g ? { sprintId: g } : void 0
56
+ workspaceId: s,
57
+ projectId: y,
58
+ scope: D && b ? { sprintId: b } : void 0
57
59
  },
58
- skip: !r || !h
59
- }), T = S?.planmagnetForecastDelivery;
60
- return /* @__PURE__ */ o(s, {
60
+ skip: !s || !y
61
+ }), j = O?.planmagnetForecastDelivery;
62
+ return /* @__PURE__ */ u(d, {
61
63
  "data-testid": "forecast-card",
62
- children: [/* @__PURE__ */ o(l, { children: [
63
- /* @__PURE__ */ o(u, {
64
+ children: [/* @__PURE__ */ u(p, { children: [
65
+ /* @__PURE__ */ u(m, {
64
66
  className: "flex items-center gap-2",
65
- children: [/* @__PURE__ */ a(n, { className: "h-4 w-4" }), v("planmagnet.forecast.delivery.title", "Delivery forecast")]
67
+ children: [/* @__PURE__ */ l(o, { className: "h-4 w-4" }), S("planmagnet.forecast.delivery.title", "Delivery forecast")]
66
68
  }),
67
- /* @__PURE__ */ a("p", {
69
+ /* @__PURE__ */ l("p", {
68
70
  className: "text-xs text-muted-foreground",
69
- children: x ? v("planmagnet.forecast.delivery.subtitleSprint", "For the open items of {{sprint}} only.", { sprint: _ ?? v("planmagnet.forecast.delivery.thisSprint", "this sprint") }) : v("planmagnet.forecast.delivery.subtitle", "For this project's own open, estimated work items.")
71
+ children: D ? S("planmagnet.forecast.delivery.subtitleSprint", "For the open items of {{sprint}} only.", { sprint: x ?? S("planmagnet.forecast.delivery.thisSprint", "this sprint") }) : S("planmagnet.forecast.delivery.subtitle", "For this project's own open, estimated work items.")
70
72
  }),
71
- g && /* @__PURE__ */ o("label", {
72
- htmlFor: `forecast-scope-sprint-${h}`,
73
+ b && /* @__PURE__ */ u("label", {
74
+ htmlFor: `forecast-scope-sprint-${y}`,
73
75
  className: "flex items-center gap-2 pt-1 text-xs font-normal text-muted-foreground",
74
- children: [/* @__PURE__ */ a(d, {
75
- id: `forecast-scope-sprint-${h}`,
76
- checked: y,
77
- onCheckedChange: (e) => b(e === !0)
78
- }), v("planmagnet.forecast.delivery.scopeToggle", "Only this sprint's items ({{sprint}})", { sprint: _ ?? v("planmagnet.forecast.delivery.thisSprint", "this sprint") })]
76
+ children: [/* @__PURE__ */ l(h, {
77
+ id: `forecast-scope-sprint-${y}`,
78
+ checked: T,
79
+ onCheckedChange: (e) => E(e === !0)
80
+ }), S("planmagnet.forecast.delivery.scopeToggle", "Only this sprint's items ({{sprint}})", { sprint: x ?? S("planmagnet.forecast.delivery.thisSprint", "this sprint") })]
79
81
  })
80
- ] }), /* @__PURE__ */ a(c, { children: h ? C && !S ? /* @__PURE__ */ a("div", {
82
+ ] }), /* @__PURE__ */ l(f, { children: y ? k && !O ? /* @__PURE__ */ l("div", {
81
83
  className: "flex justify-center py-8",
82
- children: /* @__PURE__ */ a("div", { className: "animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full" })
83
- }) : w ? /* @__PURE__ */ a("p", {
84
+ children: /* @__PURE__ */ l("div", { className: "animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full" })
85
+ }) : A ? /* @__PURE__ */ l("p", {
84
86
  className: "text-sm text-status-error-text",
85
- children: e(w) ? v("planmagnet.forecast.delivery.forbidden", "You do not have access to the delivery forecast for this project.") : `${v("planmagnet.forecast.delivery.error", "Delivery forecast could not be loaded")}: ${w.message}`
86
- }) : T ? T.insufficientHistory ? /* @__PURE__ */ o("div", {
87
+ children: r(A) ? S("planmagnet.forecast.delivery.forbidden", "You do not have access to the delivery forecast for this project.") : `${S("planmagnet.forecast.delivery.error", "Delivery forecast could not be loaded")}: ${A.message}`
88
+ }) : j ? j.insufficientHistory ? /* @__PURE__ */ u("div", {
87
89
  className: "space-y-2",
88
90
  "data-testid": "forecast-insufficient",
89
- children: [/* @__PURE__ */ a("p", {
91
+ children: [/* @__PURE__ */ l("p", {
90
92
  className: "text-sm text-muted-foreground",
91
- children: T.reason ?? v("planmagnet.forecast.delivery.insufficientFallback", "Not enough completed-sprint history yet to forecast a delivery date.")
92
- }), /* @__PURE__ */ a("p", {
93
+ children: j.reason ?? S("planmagnet.forecast.delivery.insufficientFallback", "Not enough completed-sprint history yet to forecast a delivery date.")
94
+ }), /* @__PURE__ */ l("p", {
93
95
  className: "text-xs text-muted-foreground",
94
- children: T.confidenceNote
96
+ children: j.confidenceNote
95
97
  })]
96
- }) : /* @__PURE__ */ o("div", {
98
+ }) : /* @__PURE__ */ u("div", {
97
99
  className: "space-y-4",
98
100
  children: [
99
- /* @__PURE__ */ o("dl", {
101
+ /* @__PURE__ */ u("dl", {
100
102
  className: "grid grid-cols-3 gap-3 text-center",
101
103
  "data-testid": "forecast-dates",
102
104
  children: [
103
- /* @__PURE__ */ o("div", {
105
+ /* @__PURE__ */ u("div", {
104
106
  className: "rounded-md border p-2.5",
105
107
  children: [
106
- /* @__PURE__ */ a("dt", {
108
+ /* @__PURE__ */ l("dt", {
107
109
  className: "text-xs text-muted-foreground",
108
- children: v("planmagnet.forecast.delivery.p50Label", "Likely by (p50)")
110
+ children: S("planmagnet.forecast.delivery.p50Label", "Likely by (p50)")
109
111
  }),
110
- /* @__PURE__ */ a("dd", {
112
+ /* @__PURE__ */ l("dd", {
111
113
  className: "mt-1 text-sm font-semibold",
112
- children: T.dates ? m(T.dates.p50) : "—"
114
+ children: j.dates ? v(j.dates.p50) : "—"
113
115
  }),
114
- /* @__PURE__ */ a("dd", {
116
+ /* @__PURE__ */ l("dd", {
115
117
  className: "text-xs text-muted-foreground",
116
- children: T.sprintsNeeded ? v("planmagnet.forecast.delivery.sprints", "{{count}} sprint(s)", { count: T.sprintsNeeded.p50 }) : "—"
118
+ children: j.sprintsNeeded ? S("planmagnet.forecast.delivery.sprints", "{{count}} sprint(s)", { count: j.sprintsNeeded.p50 }) : "—"
117
119
  })
118
120
  ]
119
121
  }),
120
- /* @__PURE__ */ o("div", {
122
+ /* @__PURE__ */ u("div", {
121
123
  className: "rounded-md border p-2.5",
122
124
  children: [
123
- /* @__PURE__ */ a("dt", {
125
+ /* @__PURE__ */ l("dt", {
124
126
  className: "text-xs text-muted-foreground",
125
- children: v("planmagnet.forecast.delivery.p85Label", "Confident by (p85)")
127
+ children: S("planmagnet.forecast.delivery.p85Label", "Confident by (p85)")
126
128
  }),
127
- /* @__PURE__ */ a("dd", {
129
+ /* @__PURE__ */ l("dd", {
128
130
  className: "mt-1 text-sm font-semibold",
129
- children: T.dates ? m(T.dates.p85) : "—"
131
+ children: j.dates ? v(j.dates.p85) : "—"
130
132
  }),
131
- /* @__PURE__ */ a("dd", {
133
+ /* @__PURE__ */ l("dd", {
132
134
  className: "text-xs text-muted-foreground",
133
- children: T.sprintsNeeded ? v("planmagnet.forecast.delivery.sprints", "{{count}} sprint(s)", { count: T.sprintsNeeded.p85 }) : "—"
135
+ children: j.sprintsNeeded ? S("planmagnet.forecast.delivery.sprints", "{{count}} sprint(s)", { count: j.sprintsNeeded.p85 }) : "—"
134
136
  })
135
137
  ]
136
138
  }),
137
- /* @__PURE__ */ o("div", {
139
+ /* @__PURE__ */ u("div", {
138
140
  className: "rounded-md border p-2.5",
139
141
  children: [
140
- /* @__PURE__ */ a("dt", {
142
+ /* @__PURE__ */ l("dt", {
141
143
  className: "text-xs text-muted-foreground",
142
- children: v("planmagnet.forecast.delivery.p95Label", "Very confident by (p95)")
144
+ children: S("planmagnet.forecast.delivery.p95Label", "Very confident by (p95)")
143
145
  }),
144
- /* @__PURE__ */ a("dd", {
146
+ /* @__PURE__ */ l("dd", {
145
147
  className: "mt-1 text-sm font-semibold",
146
- children: T.dates ? m(T.dates.p95) : "—"
148
+ children: j.dates ? v(j.dates.p95) : "—"
147
149
  }),
148
- /* @__PURE__ */ a("dd", {
150
+ /* @__PURE__ */ l("dd", {
149
151
  className: "text-xs text-muted-foreground",
150
- children: T.sprintsNeeded ? v("planmagnet.forecast.delivery.sprints", "{{count}} sprint(s)", { count: T.sprintsNeeded.p95 }) : "—"
152
+ children: j.sprintsNeeded ? S("planmagnet.forecast.delivery.sprints", "{{count}} sprint(s)", { count: j.sprintsNeeded.p95 }) : "—"
151
153
  })
152
154
  ]
153
155
  })
154
156
  ]
155
157
  }),
156
- /* @__PURE__ */ o("div", {
158
+ /* @__PURE__ */ u("div", {
157
159
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",
158
- children: [/* @__PURE__ */ a("span", { children: v("planmagnet.forecast.delivery.remaining", "Remaining: {{points}} pts", { points: T.remainingPoints }) }), T.unestimatedItems > 0 && /* @__PURE__ */ a("span", {
160
+ children: [/* @__PURE__ */ l("span", { children: S("planmagnet.forecast.delivery.remaining", "Remaining: {{points}} pts", { points: j.remainingPoints }) }), j.unestimatedItems > 0 && /* @__PURE__ */ l("span", {
159
161
  className: "text-status-warning-text",
160
- children: v("planmagnet.forecast.delivery.unestimated", "{{count}} open item(s) have no estimate (counted as 0 pts)", { count: T.unestimatedItems })
162
+ children: S("planmagnet.forecast.delivery.unestimated", "{{count}} open item(s) have no estimate (counted as 0 pts)", { count: j.unestimatedItems })
161
163
  })]
162
164
  }),
163
- T.scopeTruncated && /* @__PURE__ */ a("p", {
165
+ j.scopeTruncated && /* @__PURE__ */ l("p", {
164
166
  className: "text-xs text-status-warning-text",
165
- children: v("planmagnet.forecast.delivery.truncated", "This scope is large enough that the scan stopped early — remaining points and unestimated items reflect only the first items found, not the whole project.")
167
+ children: S("planmagnet.forecast.delivery.truncated", "This scope is large enough that the scan stopped early — remaining points and unestimated items reflect only the first items found, not the whole project.")
166
168
  }),
167
- /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h3", {
169
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
168
170
  className: "mb-1 text-sm font-medium",
169
- children: v("planmagnet.forecast.delivery.evidence", "Based on")
170
- }), /* @__PURE__ */ o("ul", {
171
+ children: S("planmagnet.forecast.delivery.evidence", "Based on")
172
+ }), /* @__PURE__ */ u("ul", {
171
173
  className: "space-y-1 text-xs text-muted-foreground",
172
174
  "data-testid": "forecast-inputs",
173
- children: [T.inputRefs.map((e) => /* @__PURE__ */ o("li", {
174
- className: "flex items-center justify-between gap-2",
175
- children: [/* @__PURE__ */ a("span", {
176
- className: "truncate",
177
- children: e.name
178
- }), /* @__PURE__ */ o("span", {
179
- className: "shrink-0 tabular-nums",
180
- children: [v("planmagnet.forecast.delivery.evidenceRow", "{{points}} pts", { points: e.completedPoints }), e.endDate ? ` · ${m(e.endDate)}` : ""]
181
- })]
182
- }, e.sprintId)), T.inputRefs.length === 0 && /* @__PURE__ */ a("li", { children: v("planmagnet.forecast.delivery.noInputs", "No sprint history available.") })]
175
+ children: [j.inputRefs.map((t) => {
176
+ let n = i("/projects/planning-detail-page", t.sprintId);
177
+ return /* @__PURE__ */ u("li", {
178
+ className: "flex items-center justify-between gap-2",
179
+ children: [/* @__PURE__ */ l("a", {
180
+ className: "truncate text-foreground underline underline-offset-2",
181
+ href: e(n, C),
182
+ onClick: (e) => {
183
+ e.defaultPrevented || e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || (e.preventDefault(), w(n));
184
+ },
185
+ children: t.name
186
+ }), /* @__PURE__ */ u("span", {
187
+ className: "shrink-0 tabular-nums",
188
+ children: [S("planmagnet.forecast.delivery.evidenceRow", "{{points}} pts", { points: t.completedPoints }), t.endDate ? ` · ${v(t.endDate)}` : ""]
189
+ })]
190
+ }, t.sprintId);
191
+ }), j.inputRefs.length === 0 && /* @__PURE__ */ l("li", { children: S("planmagnet.forecast.delivery.noInputs", "No sprint history available.") })]
183
192
  })] }),
184
- /* @__PURE__ */ a("p", {
193
+ /* @__PURE__ */ l("p", {
185
194
  className: "text-xs text-muted-foreground",
186
- children: T.confidenceNote
195
+ children: j.confidenceNote
187
196
  }),
188
- /* @__PURE__ */ o("details", {
197
+ /* @__PURE__ */ u("details", {
189
198
  className: "text-xs text-muted-foreground",
190
- children: [/* @__PURE__ */ a("summary", {
199
+ children: [/* @__PURE__ */ l("summary", {
191
200
  className: "cursor-pointer select-none font-medium text-foreground",
192
- children: v("planmagnet.forecast.whatIsThis", "What is this?")
193
- }), /* @__PURE__ */ a("p", {
201
+ children: S("planmagnet.forecast.whatIsThis", "What is this?")
202
+ }), /* @__PURE__ */ l("p", {
194
203
  className: "mt-1",
195
- children: v("planmagnet.forecast.delivery.explainer", "Statistical forecast (Monte Carlo over past sprints): a simulation that resamples this project’s trailing completed sprints’ real velocities thousands of times to see how many more sprints the remaining work is likely to take. It is never an AI/LLM call, and it never invents a date from a sample it doesn’t trust — when history is too thin, it says so instead of guessing.")
204
+ children: S("planmagnet.forecast.delivery.explainer", "Statistical forecast (Monte Carlo over past sprints): a simulation that resamples this project’s trailing completed sprints’ real velocities thousands of times to see how many more sprints the remaining work is likely to take. It is never an AI/LLM call, and it never invents a date from a sample it doesn’t trust — when history is too thin, it says so instead of guessing.")
196
205
  })]
197
206
  })
198
207
  ]
199
- }) : null : /* @__PURE__ */ a("p", {
208
+ }) : null : /* @__PURE__ */ l("p", {
200
209
  className: "text-sm text-muted-foreground",
201
- children: v("planmagnet.forecast.delivery.noProject", "Select a project to see its forecast.")
210
+ children: S("planmagnet.forecast.delivery.noProject", "Select a project to see its forecast.")
202
211
  }) })]
203
212
  });
204
213
  }
205
- export { h as DeliveryForecastCard };
214
+ export { y as DeliveryForecastCard };
@@ -4,6 +4,7 @@ import { PlanMagnetRootProps } from '../types';
4
4
  * Hook to access PlanMagnet context
5
5
  */
6
6
  export declare const usePlanMagnet: () => PlanMagnetRootProps;
7
+ export declare function resolvePlanMagnetPath(path: string, basePath?: string): string;
7
8
  /**
8
9
  * Hook for navigation within the PlanMagnet microfrontend.
9
10
  * Uses the shell's navigate function if available, falling back to
@@ -34,17 +34,21 @@ var C = (e) => e.stop(), w = (e) => e.clear(), T = n(null), E = () => {
34
34
  let e = i(T);
35
35
  if (!e) throw Error("usePlanMagnet must be used within PlanMagnetProvider");
36
36
  return e;
37
- }, D = () => {
37
+ };
38
+ function D(e, t) {
39
+ return t && t !== "/" ? `${t}${e}` : e;
40
+ }
41
+ var O = () => {
38
42
  let { navigate: e, basePath: t } = E(), n = l();
39
43
  return r((r) => {
40
- let i = t && t !== "/" ? `${t}${r}` : r;
44
+ let i = D(r, t);
41
45
  e ? e(i) : n(i);
42
46
  }, [
43
47
  e,
44
48
  t,
45
49
  n
46
50
  ]);
47
- }, O = ({ children: n, basePath: r, navigate: i, currentUser: a, workspaceId: s, tenantId: l, organizationId: _, apiGatewayUrl: E, authToken: D, workspaceToken: O, registerNavItems: k, registerFooterItems: A, onAuthError: j, isolateRequests: M = !1 }) => {
51
+ }, k = ({ children: n, basePath: r, navigate: i, currentUser: a, workspaceId: s, tenantId: l, organizationId: _, apiGatewayUrl: E, authToken: D, workspaceToken: O, registerNavItems: k, registerFooterItems: A, onAuthError: j, isolateRequests: M = !1 }) => {
48
52
  let N = o(() => M ? b() : x, [M]), P = o(() => {
49
53
  let n = m(({ error: n }) => {
50
54
  if (e.is(n)) for (let e of n.errors) {
@@ -140,4 +144,4 @@ var C = (e) => e.stop(), w = (e) => e.clear(), T = n(null), E = () => {
140
144
  children: R
141
145
  }) : R;
142
146
  };
143
- export { O as PlanMagnetProvider, E as usePlanMagnet, D as usePlanMagnetNavigate };
147
+ export { k as PlanMagnetProvider, D as resolvePlanMagnetPath, E as usePlanMagnet, O as usePlanMagnetNavigate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-planmagnet",
3
- "version": "2026.1126.2",
3
+ "version": "2026.1127.1",
4
4
  "description": "Burdenoff PlanMagnet Microfrontend",
5
5
  "type": "module",
6
6
  "files": [