@burdenoff/microfe-planmagnet 2026.930.11 → 2026.930.13

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 (60) hide show
  1. package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
  2. package/dist/planmagnet/PlanMagnetRoot.js +20 -11
  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 +227 -223
  6. package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
  7. package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +37 -37
  8. package/dist/planmagnet/automation/AutomationRuleFields.js +41 -41
  9. package/dist/planmagnet/board/BulkActions.js +6 -6
  10. package/dist/planmagnet/board/ProjectBoard.js +24 -24
  11. package/dist/planmagnet/budgets/BudgetControls.js +18 -18
  12. package/dist/planmagnet/controls/FeatureControls.js +24 -24
  13. package/dist/planmagnet/controls/ObjectiveControls.js +11 -11
  14. package/dist/planmagnet/controls/ProgramControls.js +9 -9
  15. package/dist/planmagnet/controls/WorkItemControls.js +27 -27
  16. package/dist/planmagnet/dependency/DependencyPanel.js +7 -7
  17. package/dist/planmagnet/pages/AiPlanPagePage.js +6 -6
  18. package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.d.ts.map +1 -1
  19. package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js +370 -221
  20. package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js.map +1 -1
  21. package/dist/planmagnet/pages/DashboardDashboardPagePage.d.ts.map +1 -1
  22. package/dist/planmagnet/pages/DashboardDashboardPagePage.js +140 -135
  23. package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
  24. package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.d.ts.map +1 -1
  25. package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js +160 -108
  26. package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js.map +1 -1
  27. package/dist/planmagnet/pages/ProjectsBudgetsPagePage.js +10 -10
  28. package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +5 -5
  29. package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js +4 -4
  30. package/dist/planmagnet/pages/ProjectsWorkflowPagePage.js +30 -30
  31. package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts +2 -0
  32. package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts.map +1 -0
  33. package/dist/planmagnet/pages/TasksMyDashboardPagePage.js +329 -0
  34. package/dist/planmagnet/pages/TasksMyDashboardPagePage.js.map +1 -0
  35. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +26 -26
  36. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts +14 -2
  37. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts.map +1 -1
  38. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js +173 -113
  39. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js.map +1 -1
  40. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts +8 -0
  41. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts.map +1 -0
  42. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js +211 -0
  43. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js.map +1 -0
  44. package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts +8 -0
  45. package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts.map +1 -0
  46. package/dist/planmagnet/pages/analytics/QualityMetricsCard.js +177 -0
  47. package/dist/planmagnet/pages/analytics/QualityMetricsCard.js.map +1 -0
  48. package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts +7 -0
  49. package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts.map +1 -0
  50. package/dist/planmagnet/pages/analytics/ThroughputCard.js +137 -0
  51. package/dist/planmagnet/pages/analytics/ThroughputCard.js.map +1 -0
  52. package/dist/planmagnet/pages/analytics/analyticsRange.d.ts +42 -0
  53. package/dist/planmagnet/pages/analytics/analyticsRange.d.ts.map +1 -0
  54. package/dist/planmagnet/pages/analytics/analyticsRange.js +47 -0
  55. package/dist/planmagnet/pages/analytics/analyticsRange.js.map +1 -0
  56. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
  57. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +12 -0
  58. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
  59. package/dist/planmagnet/time/TimeEntryControls.js +12 -12
  60. package/package.json +1 -1
@@ -0,0 +1,137 @@
1
+ import { Legend as e } from "../../../node_modules/recharts/es6/component/Legend.js";
2
+ import { Tooltip as t } from "../../../node_modules/recharts/es6/component/Tooltip.js";
3
+ import { ResponsiveContainer as n } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
4
+ import { Bar as r } from "../../../node_modules/recharts/es6/cartesian/Bar.js";
5
+ import { CartesianGrid as i } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
6
+ import { XAxis as a } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
7
+ import { YAxis as o } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
8
+ import { BarChart as s } from "../../../node_modules/recharts/es6/chart/BarChart.js";
9
+ import { useState as c } from "react";
10
+ import { BarChart3 as l } from "lucide-react";
11
+ import { gql as u } from "@apollo/client";
12
+ import { useQuery as d } from "@apollo/client/react";
13
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
14
+ import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { Card as g, CardContent as _, CardHeader as v, CardTitle as y } from "@burdenoff/fe-libs/ui";
16
+ //#region src/planmagnet/pages/analytics/ThroughputCard.tsx
17
+ var b = u`
18
+ query GetAnalyticsThroughput(
19
+ $workspaceId: ID!
20
+ $projectId: ID!
21
+ $bucket: PlanmagnetThroughputBucket
22
+ $startDate: DateTime
23
+ $endDate: DateTime
24
+ ) {
25
+ planmagnetThroughput(
26
+ workspaceId: $workspaceId
27
+ projectId: $projectId
28
+ bucket: $bucket
29
+ startDate: $startDate
30
+ endDate: $endDate
31
+ ) {
32
+ bucket
33
+ points {
34
+ periodStart
35
+ completedCount
36
+ completedPoints
37
+ }
38
+ }
39
+ }
40
+ `;
41
+ function x(e) {
42
+ let t = new Date(e);
43
+ return `${t.getUTCMonth() + 1}/${t.getUTCDate()}`;
44
+ }
45
+ function S({ workspaceId: u, projectId: S, startDate: C, endDate: w }) {
46
+ let { t: T } = h(), [E, D] = c("WEEK"), { data: O, loading: k, error: A } = d(b, {
47
+ variables: {
48
+ workspaceId: u,
49
+ projectId: S,
50
+ bucket: E,
51
+ startDate: C,
52
+ endDate: w
53
+ },
54
+ skip: !u || !S
55
+ }), j = O?.planmagnetThroughput.points ?? [], M = j.map((e) => ({
56
+ period: x(e.periodStart),
57
+ count: e.completedCount,
58
+ points: e.completedPoints
59
+ })), N = j.reduce((e, t) => e + t.completedCount, 0), P = j.reduce((e, t) => e + t.completedPoints, 0);
60
+ return /* @__PURE__ */ m(g, {
61
+ "data-testid": "analytics-throughput",
62
+ children: [/* @__PURE__ */ m(v, { children: [/* @__PURE__ */ m("div", {
63
+ className: "flex flex-wrap items-center justify-between gap-2",
64
+ children: [/* @__PURE__ */ m(y, {
65
+ className: "flex items-center gap-2",
66
+ children: [/* @__PURE__ */ p(l, { className: "h-4 w-4" }), T("planmagnet.analytics.throughput.title", "Throughput")]
67
+ }), /* @__PURE__ */ p("div", {
68
+ className: "flex items-center gap-1 rounded-md border p-0.5",
69
+ role: "group",
70
+ "aria-label": T("planmagnet.analytics.throughput.bucketLabel", "Group by"),
71
+ "data-testid": "analytics-throughput-bucket",
72
+ children: ["DAY", "WEEK"].map((e) => /* @__PURE__ */ p("button", {
73
+ type: "button",
74
+ "aria-pressed": E === e,
75
+ onClick: () => D(e),
76
+ className: `px-2 py-1 text-xs rounded ${E === e ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted"}`,
77
+ children: e === "DAY" ? T("planmagnet.analytics.throughput.day", "Day") : T("planmagnet.analytics.throughput.week", "Week")
78
+ }, e))
79
+ })]
80
+ }), /* @__PURE__ */ p("p", {
81
+ className: "text-xs text-muted-foreground",
82
+ children: T("planmagnet.analytics.throughput.subtitle", "Work items completed per {{bucket}}, in the selected range.", { bucket: E === "DAY" ? T("planmagnet.analytics.throughput.day", "Day").toLowerCase() : T("planmagnet.analytics.throughput.week", "Week").toLowerCase() })
83
+ })] }), /* @__PURE__ */ p(_, { children: k && !O ? /* @__PURE__ */ p("div", {
84
+ className: "flex justify-center py-12",
85
+ children: /* @__PURE__ */ p("div", { className: "animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full" })
86
+ }) : A ? /* @__PURE__ */ p("p", {
87
+ className: "text-sm text-muted-foreground py-8 text-center",
88
+ children: T("planmagnet.analytics.throughput.unavailable", "Throughput is not available for this project.")
89
+ }) : M.length > 0 ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("p", {
90
+ className: "text-xs text-muted-foreground mb-2",
91
+ children: T("planmagnet.analytics.throughput.summary", "{{items}} item(s), {{points}} point(s) completed across {{periods}} period(s).", {
92
+ items: N,
93
+ points: P,
94
+ periods: M.length
95
+ })
96
+ }), /* @__PURE__ */ p(n, {
97
+ width: "100%",
98
+ height: 200,
99
+ children: /* @__PURE__ */ m(s, {
100
+ data: M,
101
+ children: [
102
+ /* @__PURE__ */ p(i, {
103
+ strokeDasharray: "3 3",
104
+ opacity: .2
105
+ }),
106
+ /* @__PURE__ */ p(a, {
107
+ dataKey: "period",
108
+ tick: { fontSize: 11 }
109
+ }),
110
+ /* @__PURE__ */ p(o, {
111
+ tick: { fontSize: 11 },
112
+ allowDecimals: !1
113
+ }),
114
+ /* @__PURE__ */ p(t, {}),
115
+ /* @__PURE__ */ p(e, { wrapperStyle: { fontSize: 12 } }),
116
+ /* @__PURE__ */ p(r, {
117
+ dataKey: "count",
118
+ name: T("planmagnet.analytics.throughput.items", "Items done"),
119
+ fill: "var(--color-chart-1)"
120
+ }),
121
+ /* @__PURE__ */ p(r, {
122
+ dataKey: "points",
123
+ name: T("planmagnet.analytics.throughput.points", "Points done"),
124
+ fill: "var(--color-chart-3)"
125
+ })
126
+ ]
127
+ })
128
+ })] }) : /* @__PURE__ */ p("p", {
129
+ className: "text-sm text-muted-foreground py-8 text-center",
130
+ children: T("planmagnet.analytics.throughput.empty", "No work completed in this range.")
131
+ }) })]
132
+ });
133
+ }
134
+ //#endregion
135
+ export { S as ThroughputCard };
136
+
137
+ //# sourceMappingURL=ThroughputCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThroughputCard.js","names":[],"sources":["../../../../src/planmagnet/pages/analytics/ThroughputCard.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { BarChart3 } from 'lucide-react';\nimport {\n Bar,\n BarChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\n\n/**\n * ANR-09: throughput on the Analytics page, with a day/week group-by — the group-by control the page's other\n * data doesn't otherwise support (a bucketed series is the one shape here that has more than one valid grouping).\n * `planmagnetThroughput` already existed for Reports (BOFF-8048); this reads the SAME field with the page's\n * shared date range instead of Reports' fixed trailing-12-weeks default.\n */\n\nconst GET_THROUGHPUT = gql`\n query GetAnalyticsThroughput(\n $workspaceId: ID!\n $projectId: ID!\n $bucket: PlanmagnetThroughputBucket\n $startDate: DateTime\n $endDate: DateTime\n ) {\n planmagnetThroughput(\n workspaceId: $workspaceId\n projectId: $projectId\n bucket: $bucket\n startDate: $startDate\n endDate: $endDate\n ) {\n bucket\n points {\n periodStart\n completedCount\n completedPoints\n }\n }\n }\n`;\n\ninterface ThroughputData {\n planmagnetThroughput: {\n bucket: 'DAY' | 'WEEK';\n points: Array<{ periodStart: string; completedCount: number; completedPoints: number }>;\n };\n}\n\nfunction formatPeriod(iso: string): string {\n const d = new Date(iso);\n return `${d.getUTCMonth() + 1}/${d.getUTCDate()}`;\n}\n\nexport function ThroughputCard({\n workspaceId,\n projectId,\n startDate,\n endDate,\n}: {\n workspaceId?: string | null;\n projectId: string;\n startDate: string;\n endDate: string;\n}) {\n const { t } = useI18n();\n const [bucket, setBucket] = useState<'DAY' | 'WEEK'>('WEEK');\n const { data, loading, error } = useQuery<ThroughputData>(GET_THROUGHPUT, {\n variables: { workspaceId, projectId, bucket, startDate, endDate },\n skip: !workspaceId || !projectId,\n });\n\n const points = data?.planmagnetThroughput.points ?? [];\n const chartData = points.map((p) => ({\n period: formatPeriod(p.periodStart),\n count: p.completedCount,\n points: p.completedPoints,\n }));\n const totalItems = points.reduce((sum, p) => sum + p.completedCount, 0);\n const totalPoints = points.reduce((sum, p) => sum + p.completedPoints, 0);\n\n return (\n <Card data-testid=\"analytics-throughput\">\n <CardHeader>\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <CardTitle className=\"flex items-center gap-2\">\n <BarChart3 className=\"h-4 w-4\" />\n {t('planmagnet.analytics.throughput.title', 'Throughput')}\n </CardTitle>\n <div\n className=\"flex items-center gap-1 rounded-md border p-0.5\"\n role=\"group\"\n aria-label={t('planmagnet.analytics.throughput.bucketLabel', 'Group by')}\n data-testid=\"analytics-throughput-bucket\"\n >\n {(['DAY', 'WEEK'] as const).map((b) => (\n <button\n key={b}\n type=\"button\"\n aria-pressed={bucket === b}\n onClick={() => setBucket(b)}\n className={`px-2 py-1 text-xs rounded ${\n bucket === b\n ? 'bg-primary text-primary-foreground'\n : 'text-muted-foreground hover:bg-muted'\n }`}\n >\n {b === 'DAY'\n ? t('planmagnet.analytics.throughput.day', 'Day')\n : t('planmagnet.analytics.throughput.week', 'Week')}\n </button>\n ))}\n </div>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'planmagnet.analytics.throughput.subtitle',\n 'Work items completed per {{bucket}}, in the selected range.',\n {\n bucket:\n bucket === 'DAY'\n ? t('planmagnet.analytics.throughput.day', 'Day').toLowerCase()\n : t('planmagnet.analytics.throughput.week', 'Week').toLowerCase(),\n }\n )}\n </p>\n </CardHeader>\n <CardContent>\n {loading && !data ? (\n <div className=\"flex justify-center py-12\">\n <div className=\"animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n ) : error ? (\n <p className=\"text-sm text-muted-foreground py-8 text-center\">\n {t(\n 'planmagnet.analytics.throughput.unavailable',\n 'Throughput is not available for this project.'\n )}\n </p>\n ) : chartData.length > 0 ? (\n <>\n {/* Accessible text restatement of the chart. */}\n <p className=\"text-xs text-muted-foreground mb-2\">\n {t(\n 'planmagnet.analytics.throughput.summary',\n '{{items}} item(s), {{points}} point(s) completed across {{periods}} period(s).',\n { items: totalItems, points: totalPoints, periods: chartData.length }\n )}\n </p>\n <ResponsiveContainer width=\"100%\" height={200}>\n <BarChart data={chartData}>\n <CartesianGrid strokeDasharray=\"3 3\" opacity={0.2} />\n <XAxis dataKey=\"period\" tick={{ fontSize: 11 }} />\n <YAxis tick={{ fontSize: 11 }} allowDecimals={false} />\n <Tooltip />\n <Legend wrapperStyle={{ fontSize: 12 }} />\n <Bar\n dataKey=\"count\"\n name={t('planmagnet.analytics.throughput.items', 'Items done')}\n fill=\"var(--color-chart-1)\"\n />\n <Bar\n dataKey=\"points\"\n name={t('planmagnet.analytics.throughput.points', 'Points done')}\n fill=\"var(--color-chart-3)\"\n />\n </BarChart>\n </ResponsiveContainer>\n </>\n ) : (\n <p className=\"text-sm text-muted-foreground py-8 text-center\">\n {t('planmagnet.analytics.throughput.empty', 'No work completed in this range.')}\n </p>\n )}\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA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A,EAEM,CAAA,CACT"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Date-range + project-scope helpers for Analytics (ANR-09), the Dashboard tiles that
3
+ * link into it, and My dashboard (ANR-08). Dates are plain "YYYY-MM-DD" strings in the
4
+ * UI and the URL — the DateTime scalar wants a full ISO instant, so `toRangeVariables`
5
+ * converts at the query boundary only, once, so every query sends the same UTC day
6
+ * boundaries instead of each caller rolling its own.
7
+ *
8
+ * Kept framework-free (no React) so it is trivially unit-testable and importable from
9
+ * any page without pulling in a component tree.
10
+ */
11
+ export type RangePreset = '7' | '30' | '90';
12
+ export declare const RANGE_PRESETS: readonly RangePreset[];
13
+ export interface DateRange {
14
+ /** YYYY-MM-DD, inclusive. */
15
+ from: string;
16
+ /** YYYY-MM-DD, inclusive. */
17
+ to: string;
18
+ }
19
+ export declare function toIsoDate(d: Date): string;
20
+ /** The trailing N days up to and including today, both ends as plain UTC dates. */
21
+ export declare function presetRange(preset: RangePreset): DateRange;
22
+ /** Well-formed dates with `from` on or before `to`. Never throws on garbage input. */
23
+ export declare function isValidRange(from: string, to: string): boolean;
24
+ /** Which preset (if any) a range currently matches — recomputed every call, never cached, so it can never drift
25
+ * out of sync with a range that moved for some other reason (e.g. a URL paste). */
26
+ export declare function activePreset(range: DateRange): RangePreset | 'custom';
27
+ /** DateTime query variables for a range: UTC start-of-day .. end-of-day, inclusive both ends. */
28
+ export declare function toRangeVariables(range: DateRange): {
29
+ startDate: string;
30
+ endDate: string;
31
+ };
32
+ export declare const DEFAULT_RANGE: DateRange;
33
+ /** Sentinel value for "every project" in a scope <select> — GraphQL project-scoped args are optional/omitted,
34
+ * never an empty string, so this never leaks into a query variable itself (see `scopeToProjectId`). */
35
+ export declare const ALL_PROJECTS = "all";
36
+ export declare function scopeToProjectId(scope: string): string | undefined;
37
+ /**
38
+ * The query string Analytics reads back (`?from=&to=&project=`), so a view stays linkable and a Dashboard tile
39
+ * can deep-link into it pre-filtered (ANR-09). `projectId` omitted or falsy means "every project".
40
+ */
41
+ export declare function analyticsSearch(range: DateRange, projectId?: string | null): string;
42
+ //# sourceMappingURL=analyticsRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyticsRange.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/pages/analytics/analyticsRange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAC5C,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAAsB,CAAC;AAEvE,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAID,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAEzC;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAI1D;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAI9D;AAED;oFACoF;AACpF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAMrE;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAKzF;AAED,eAAO,MAAM,aAAa,EAAE,SAA6B,CAAC;AAE1D;wGACwG;AACxG,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAInF"}
@@ -0,0 +1,47 @@
1
+ //#region src/planmagnet/pages/analytics/analyticsRange.ts
2
+ var e = [
3
+ "7",
4
+ "30",
5
+ "90"
6
+ ], t = /^\d{4}-\d{2}-\d{2}$/;
7
+ function n(e) {
8
+ return e.toISOString().slice(0, 10);
9
+ }
10
+ function r(e) {
11
+ let t = /* @__PURE__ */ new Date();
12
+ return {
13
+ from: n(/* @__PURE__ */ new Date(t.getTime() - (Number(e) - 1) * 864e5)),
14
+ to: n(t)
15
+ };
16
+ }
17
+ function i(e, n) {
18
+ return !t.test(e) || !t.test(n) ? !1 : e <= n;
19
+ }
20
+ function a(t) {
21
+ for (let n of e) {
22
+ let e = r(n);
23
+ if (e.from === t.from && e.to === t.to) return n;
24
+ }
25
+ return "custom";
26
+ }
27
+ function o(e) {
28
+ return {
29
+ startDate: `${e.from}T00:00:00.000Z`,
30
+ endDate: `${e.to}T23:59:59.999Z`
31
+ };
32
+ }
33
+ r("30");
34
+ function s(e) {
35
+ return e && e !== "all" ? e : void 0;
36
+ }
37
+ function c(e, t) {
38
+ let n = new URLSearchParams({
39
+ from: e.from,
40
+ to: e.to
41
+ });
42
+ return t && n.set("project", t), `?${n.toString()}`;
43
+ }
44
+ //#endregion
45
+ export { e as RANGE_PRESETS, a as activePreset, c as analyticsSearch, i as isValidRange, r as presetRange, s as scopeToProjectId, o as toRangeVariables };
46
+
47
+ //# sourceMappingURL=analyticsRange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyticsRange.js","names":[],"sources":["../../../../src/planmagnet/pages/analytics/analyticsRange.ts"],"sourcesContent":["/**\n * Date-range + project-scope helpers for Analytics (ANR-09), the Dashboard tiles that\n * link into it, and My dashboard (ANR-08). Dates are plain \"YYYY-MM-DD\" strings in the\n * UI and the URL — the DateTime scalar wants a full ISO instant, so `toRangeVariables`\n * converts at the query boundary only, once, so every query sends the same UTC day\n * boundaries instead of each caller rolling its own.\n *\n * Kept framework-free (no React) so it is trivially unit-testable and importable from\n * any page without pulling in a component tree.\n */\n\nexport type RangePreset = '7' | '30' | '90';\nexport const RANGE_PRESETS: readonly RangePreset[] = ['7', '30', '90'];\n\nexport interface DateRange {\n /** YYYY-MM-DD, inclusive. */\n from: string;\n /** YYYY-MM-DD, inclusive. */\n to: string;\n}\n\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nexport function toIsoDate(d: Date): string {\n return d.toISOString().slice(0, 10);\n}\n\n/** The trailing N days up to and including today, both ends as plain UTC dates. */\nexport function presetRange(preset: RangePreset): DateRange {\n const to = new Date();\n const from = new Date(to.getTime() - (Number(preset) - 1) * 86_400_000);\n return { from: toIsoDate(from), to: toIsoDate(to) };\n}\n\n/** Well-formed dates with `from` on or before `to`. Never throws on garbage input. */\nexport function isValidRange(from: string, to: string): boolean {\n if (!ISO_DATE.test(from) || !ISO_DATE.test(to)) return false;\n // ISO \"YYYY-MM-DD\" strings compare lexicographically in the same order as chronologically.\n return from <= to;\n}\n\n/** Which preset (if any) a range currently matches — recomputed every call, never cached, so it can never drift\n * out of sync with a range that moved for some other reason (e.g. a URL paste). */\nexport function activePreset(range: DateRange): RangePreset | 'custom' {\n for (const p of RANGE_PRESETS) {\n const r = presetRange(p);\n if (r.from === range.from && r.to === range.to) return p;\n }\n return 'custom';\n}\n\n/** DateTime query variables for a range: UTC start-of-day .. end-of-day, inclusive both ends. */\nexport function toRangeVariables(range: DateRange): { startDate: string; endDate: string } {\n return {\n startDate: `${range.from}T00:00:00.000Z`,\n endDate: `${range.to}T23:59:59.999Z`,\n };\n}\n\nexport const DEFAULT_RANGE: DateRange = presetRange('30');\n\n/** Sentinel value for \"every project\" in a scope <select> — GraphQL project-scoped args are optional/omitted,\n * never an empty string, so this never leaks into a query variable itself (see `scopeToProjectId`). */\nexport const ALL_PROJECTS = 'all';\n\nexport function scopeToProjectId(scope: string): string | undefined {\n return scope && scope !== ALL_PROJECTS ? scope : undefined;\n}\n\n/**\n * The query string Analytics reads back (`?from=&to=&project=`), so a view stays linkable and a Dashboard tile\n * can deep-link into it pre-filtered (ANR-09). `projectId` omitted or falsy means \"every project\".\n */\nexport function analyticsSearch(range: DateRange, projectId?: string | null): string {\n const params = new URLSearchParams({ from: range.from, to: range.to });\n if (projectId) params.set('project', projectId);\n return `?${params.toString()}`;\n}\n"],"mappings":";AAYA,IAAa,IAAwC;CAAC;CAAK;CAAM;CAAK,EAShE,IAAW;AAEjB,SAAgB,EAAU,GAAiB;AACzC,QAAO,EAAE,aAAa,CAAC,MAAM,GAAG,GAAG;;AAIrC,SAAgB,EAAY,GAAgC;CAC1D,IAAM,oBAAK,IAAI,MAAM;AAErB,QAAO;EAAE,MAAM,kBADF,IAAI,KAAK,EAAG,SAAS,IAAI,OAAO,EAAO,GAAG,KAAK,MAAW,CACzC;EAAE,IAAI,EAAU,EAAG;EAAE;;AAIrD,SAAgB,EAAa,GAAc,GAAqB;AAG9D,QAFI,CAAC,EAAS,KAAK,EAAK,IAAI,CAAC,EAAS,KAAK,EAAG,GAAS,KAEhD,KAAQ;;AAKjB,SAAgB,EAAa,GAA0C;AACrE,MAAK,IAAM,KAAK,GAAe;EAC7B,IAAM,IAAI,EAAY,EAAE;AACxB,MAAI,EAAE,SAAS,EAAM,QAAQ,EAAE,OAAO,EAAM,GAAI,QAAO;;AAEzD,QAAO;;AAIT,SAAgB,EAAiB,GAA0D;AACzF,QAAO;EACL,WAAW,GAAG,EAAM,KAAK;EACzB,SAAS,GAAG,EAAM,GAAG;EACtB;;AAGqC,EAAY,KAAK;AAMzD,SAAgB,EAAiB,GAAmC;AAClE,QAAO,KAAS,MAAA,QAAyB,IAAQ,KAAA;;AAOnD,SAAgB,EAAgB,GAAkB,GAAmC;CACnF,IAAM,IAAS,IAAI,gBAAgB;EAAE,MAAM,EAAM;EAAM,IAAI,EAAM;EAAI,CAAC;AAEtE,QADI,KAAW,EAAO,IAAI,WAAW,EAAU,EACxC,IAAI,EAAO,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"RoadmapNowNextLater.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/roadmaps/RoadmapNowNextLater.tsx"],"names":[],"mappings":"AAuYA,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CA+VvE"}
1
+ {"version":3,"file":"RoadmapNowNextLater.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/roadmaps/RoadmapNowNextLater.tsx"],"names":[],"mappings":"AAuYA,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CAkXvE"}
@@ -391,6 +391,18 @@ function B({ roadmapId: n }) {
391
391
  "aria-label": `${e.label} column`,
392
392
  "data-testid": `nnl-column-${e.key}`,
393
393
  className: "min-h-[120px] rounded-md border bg-muted/30 p-2",
394
+ onDragOver: (t) => {
395
+ !q || K || !J || (t.preventDefault(), t.dataTransfer.dropEffect = "move", R({
396
+ columnKey: e.key,
397
+ laneKey: M(J),
398
+ beforeId: null
399
+ }));
400
+ },
401
+ onDrop: (t) => {
402
+ if (!J) return;
403
+ let n = M(J);
404
+ Q(e.key, n, G[e.key][n] ?? [])(t);
405
+ },
394
406
  children: [
395
407
  /* @__PURE__ */ y("h3", {
396
408
  className: "mb-2 flex items-center gap-1.5 text-sm font-medium",
@@ -1 +1 @@
1
- {"version":3,"file":"RoadmapNowNextLater.js","names":[],"sources":["../../../src/planmagnet/roadmaps/RoadmapNowNextLater.tsx"],"sourcesContent":["import { useEffect, useMemo, useState, type DragEvent } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@burdenoff/fe-libs/ui';\nimport {\n AlertTriangle,\n Calendar,\n Gauge,\n Inbox,\n Loader2,\n ShieldAlert,\n ShieldCheck,\n} from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { throwOnError } from '../utils/mutationResult';\nimport { isForbidden, mutationErrorMessage } from '../utils/graphqlErrors';\nimport { enumLabel } from '../controls/WorkItemControls';\n\n/**\n * Now/Next/Later (PRM-06, PRM-09, PRM-10): a VIEW of a roadmap's items grouped by `horizon`, alongside the\n * existing Timeline view (`ProductsRoadmapDetailPagePage.tsx`) — not a separate roadmap type. Placement is\n * changed by dragging a card, or by the keyboard \"Move…\" select every card also carries (the same mutation\n * either way: `planmagnetMoveRoadmapItem`), never optimistically: the list shown is always what\n * `planmagnetRoadmapItems` last returned, so a refused move has nothing local to \"undo\" — the card simply never\n * left its column.\n *\n * `planmagnetMoveRoadmapItem`'s `index` is scoped to the (roadmap, horizon, **swimlane**) group, not to the\n * column as a whole — the same lane-scoping the Timeline view treats as first-class (`swimlaneGroups` there).\n * Each column therefore renders its cards **grouped by lane** (one sub-list per lane, in the same order in\n * every column), exactly like the Timeline view's per-lane cards. A drag/drop within a lane's sub-list, or a\n * \"Move…\" menu action, only ever computes an index against that same sub-list — so \"the end of this section\"\n * (what the user sees) and \"the end of this lane's server-side group\" (what the index means) are always the\n * same place, with no cross-lane ambiguity. Dropping a card onto a *different* lane's section is rejected (the\n * move never changes `swimlane`); the lane header is only shown once a roadmap actually uses more than one\n * lane, so a single-lane (the common case) or lane-less roadmap renders exactly one unlabelled section per\n * column — visually identical to a flat list.\n */\n\nconst ITEM_FIELDS = `\n id\n title\n status\n startDate\n endDate\n horizon\n swimlane\n sortOrder\n confidence\n riskLevel\n riskNote\n featureRequestDemand {\n requests\n votes\n }\n`;\n\nconst NNL_ITEMS = gql`\n query RoadmapNowNextLaterItems(\n $workspaceId: ID!\n $filter: PlanmagnetRoadmapItemFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetRoadmapItems(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n ${ITEM_FIELDS}\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n }\n }\n`;\n\nconst MOVE_ITEM = gql`\n mutation RoadmapNowNextLaterMove($id: ID!, $input: PlanmagnetMoveRoadmapItemInput!) {\n planmagnetMoveRoadmapItem(id: $id, input: $input) {\n ${ITEM_FIELDS}\n }\n }\n`;\n\ninterface NnlItem {\n id: string;\n title: string;\n status: string;\n startDate: string | null;\n endDate: string | null;\n horizon: 'NOW' | 'NEXT' | 'LATER' | null;\n swimlane: string | null;\n sortOrder: number;\n confidence: number | null;\n riskLevel: 'LOW' | 'MEDIUM' | 'HIGH' | null;\n riskNote: string | null;\n featureRequestDemand: { requests: number; votes: number } | null;\n}\n\ntype ColumnKey = 'UNPLACED' | 'NOW' | 'NEXT' | 'LATER';\ntype Horizon = 'NOW' | 'NEXT' | 'LATER' | null;\n\nconst COLUMNS: { key: ColumnKey; label: string; horizon: Horizon }[] = [\n { key: 'UNPLACED', label: 'Not placed', horizon: null },\n { key: 'NOW', label: 'Now', horizon: 'NOW' },\n { key: 'NEXT', label: 'Next', horizon: 'NEXT' },\n { key: 'LATER', label: 'Later', horizon: 'LATER' },\n];\nconst columnOf = (horizon: Horizon): ColumnKey => horizon ?? 'UNPLACED';\n\nconst PAGE_SIZE = 200;\n/** Items beyond this many are not loaded. Stated rather than silently dropped: a banner below the board says so\n * when the cap is actually hit, the same \"never silently stop\" convention as `controls/Pickers.tsx`. */\nconst MAX_ITEMS = 2000;\n\n/** Every item on the roadmap, paged through in full (never just the first page) up to `MAX_ITEMS`, ordered by\n * sortOrder then id — same pattern as `ProjectSelect` in `controls/Pickers.tsx`, generalized to a full board\n * rather than a picker list. */\nfunction useAllRoadmapItems(workspaceId: string | undefined, roadmapId: string) {\n const { data, loading, error, fetchMore } = useQuery<{\n planmagnetRoadmapItems: {\n items: NnlItem[];\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n totalCount: number;\n };\n }>(NNL_ITEMS, {\n variables: {\n workspaceId: workspaceId ?? '',\n filter: { roadmapId },\n pagination: { first: PAGE_SIZE },\n },\n skip: !workspaceId || !roadmapId,\n });\n const loaded = data?.planmagnetRoadmapItems.items ?? [];\n const hasNextPage = data?.planmagnetRoadmapItems.pageInfo.hasNextPage ?? false;\n const endCursor = data?.planmagnetRoadmapItems.pageInfo.endCursor ?? null;\n const totalCount = data?.planmagnetRoadmapItems.totalCount ?? 0;\n\n useEffect(() => {\n if (!hasNextPage || !endCursor || loaded.length >= MAX_ITEMS) return;\n fetchMore({\n variables: { pagination: { first: PAGE_SIZE, after: endCursor } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetRoadmapItems: {\n ...fetchMoreResult.planmagnetRoadmapItems,\n items: [\n ...prev.planmagnetRoadmapItems.items,\n ...fetchMoreResult.planmagnetRoadmapItems.items,\n ],\n },\n }),\n }).catch(() => {\n // A failed extra page leaves the items already loaded usable; `truncated` below still reports the gap.\n });\n }, [hasNextPage, endCursor, loaded.length, fetchMore]);\n\n return {\n items: loaded,\n loading: loading && !data,\n error,\n totalCount,\n truncated: hasNextPage && loaded.length >= MAX_ITEMS,\n };\n}\n\n/** An item's lane key for grouping — `null`/unset normalizes to `''` so it compares equal to itself. */\nconst laneKey = (item: NnlItem) => item.swimlane ?? '';\n/** Display label for a lane key, matching the Timeline view's own term for the unassigned bucket\n * (`ProductsRoadmapDetailPagePage.tsx`'s `swimlaneGroups`). */\nconst laneLabel = (key: string) => key || 'Uncategorized';\n\n/**\n * The 0-based index to send `planmagnetMoveRoadmapItem` so `movedItem` lands where the drop indicates.\n * `laneItems` MUST already be scoped to a single lane's section (the same list the card was dropped in/onto —\n * see the module docstring), so there is no cross-lane ambiguity left to resolve here: `beforeId` is the id of\n * the card the drop should land in front of within that section, or `null` for the end of it, which is exactly\n * the end of the (roadmap, horizon, lane) group the server indexes into.\n */\nfunction destinationIndex(\n laneItems: NnlItem[],\n movedItemId: string,\n beforeId: string | null\n): number {\n const others = laneItems.filter((it) => it.id !== movedItemId);\n if (beforeId === null) return others.length;\n const cut = others.findIndex((it) => it.id === beforeId);\n return cut === -1 ? others.length : cut;\n}\n\nconst RISK_META: Record<\n 'LOW' | 'MEDIUM' | 'HIGH',\n { Icon: typeof ShieldCheck; label: string; className: string }\n> = {\n LOW: { Icon: ShieldCheck, label: 'Low risk', className: 'text-muted-foreground' },\n MEDIUM: { Icon: AlertTriangle, label: 'Medium risk', className: 'text-status-warning-text' },\n HIGH: { Icon: ShieldAlert, label: 'High risk', className: 'text-status-error-text' },\n};\n\n/** Icon + text label (never colour alone) for a risk level; the note (if any) shows on hover/focus via a\n * tooltip, which is keyboard-reachable because the trigger is a real, focusable button. */\nfunction RiskIndicator({ level, note }: { level: NnlItem['riskLevel']; note: string | null }) {\n if (!level) return null;\n const meta = RISK_META[level];\n const badge = (\n <span\n data-testid=\"nnl-risk\"\n className={`inline-flex items-center gap-1 text-xs ${meta.className}`}\n >\n <meta.Icon className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n {meta.label}\n </span>\n );\n if (!note) return badge;\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className=\"rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {badge}\n </button>\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs\">{note}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n\nfunction ConfidenceBadge({ confidence }: { confidence: number | null }) {\n if (confidence === null) return null;\n return (\n <span\n data-testid=\"nnl-confidence\"\n className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\"\n >\n <Gauge className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n {confidence}% confident\n </span>\n );\n}\n\n/** The keyboard/menu equivalent of dragging: every horizon this card isn't already in, plus reorder-in-place.\n * A native `<select>` with a constant `value=\"\"` — the same \"Move…\" pattern `board/ProjectBoard.tsx` uses — so\n * it always shows the placeholder after an action instead of needing to be reset by hand. */\nfunction CardMoveMenu({\n item,\n columnKey,\n laneItems,\n disabled,\n onMoveTo,\n onShift,\n}: {\n item: NnlItem;\n columnKey: ColumnKey;\n laneItems: NnlItem[];\n disabled: boolean;\n onMoveTo: (target: ColumnKey) => void;\n onShift: (delta: -1 | 1) => void;\n}) {\n const pos = laneItems.findIndex((it) => it.id === item.id);\n const canUp = pos > 0;\n const canDown = pos !== -1 && pos < laneItems.length - 1;\n return (\n <select\n id={`nnl-move-${item.id}`}\n aria-label={`Move ${item.title}`}\n data-testid=\"nnl-card-move\"\n className=\"rounded border border-input bg-background px-1 py-0.5 text-[11px] disabled:opacity-60\"\n value=\"\"\n disabled={disabled}\n onChange={(e) => {\n const v = e.target.value;\n if (v === 'up') onShift(-1);\n else if (v === 'down') onShift(1);\n // Every other <option> value below is a literal ColumnKey from COLUMNS itself, so this is safe.\n else if (v) onMoveTo(v as ColumnKey);\n }}\n >\n <option value=\"\">Move…</option>\n {COLUMNS.filter((c) => c.key !== columnKey).map((c) => (\n <option key={c.key} value={c.key}>\n Move to {c.label}\n </option>\n ))}\n <option value=\"up\" disabled={!canUp}>\n Move up\n </option>\n <option value=\"down\" disabled={!canDown}>\n Move down\n </option>\n </select>\n );\n}\n\nfunction NnlCard({\n item,\n columnKey,\n laneItems,\n draggable,\n dragging,\n dropIndicator,\n moveDisabled,\n onDragStart,\n onDragEnd,\n onDragOverCard,\n onDropOnCard,\n onMoveTo,\n onShift,\n}: {\n item: NnlItem;\n columnKey: ColumnKey;\n laneItems: NnlItem[];\n draggable: boolean;\n dragging: boolean;\n dropIndicator: 'before' | 'after' | null;\n moveDisabled: boolean;\n onDragStart: (id: string) => void;\n onDragEnd: () => void;\n onDragOverCard: (e: DragEvent<HTMLLIElement>) => void;\n onDropOnCard: (e: DragEvent<HTMLLIElement>) => void;\n onMoveTo: (target: ColumnKey) => void;\n onShift: (delta: -1 | 1) => void;\n}) {\n const demand = item.featureRequestDemand;\n return (\n <li\n draggable={draggable}\n onDragStart={(e) => {\n e.dataTransfer.setData('text/plain', item.id);\n e.dataTransfer.effectAllowed = 'move';\n onDragStart(item.id);\n }}\n onDragEnd={onDragEnd}\n onDragOver={onDragOverCard}\n onDrop={onDropOnCard}\n data-testid=\"nnl-card\"\n className={[\n 'space-y-1.5 rounded-md border bg-background p-2 text-sm',\n draggable ? 'cursor-grab' : '',\n dragging ? 'opacity-50' : '',\n dropIndicator === 'before' ? 'border-t-2 border-t-primary' : '',\n dropIndicator === 'after' ? 'border-b-2 border-b-primary' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <p className=\"font-medium leading-tight\">{item.title}</p>\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\">\n <span>{enumLabel(item.status)}</span>\n {(item.startDate || item.endDate) && (\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" aria-hidden=\"true\" />\n {item.startDate ? new Date(item.startDate).toLocaleDateString() : '?'}\n {' - '}\n {item.endDate ? new Date(item.endDate).toLocaleDateString() : '?'}\n </span>\n )}\n </div>\n {demand && demand.requests > 0 && (\n <p className=\"text-xs text-muted-foreground\" data-testid=\"roadmap-item-demand\">\n {demand.requests} feature request{demand.requests === 1 ? '' : 's'} · {demand.votes} vote\n {demand.votes === 1 ? '' : 's'}\n </p>\n )}\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-1\">\n <ConfidenceBadge confidence={item.confidence} />\n <RiskIndicator level={item.riskLevel} note={item.riskNote} />\n </div>\n <div className=\"flex justify-end pt-0.5\">\n <CardMoveMenu\n item={item}\n columnKey={columnKey}\n laneItems={laneItems}\n disabled={moveDisabled}\n onMoveTo={onMoveTo}\n onShift={onShift}\n />\n </div>\n </li>\n );\n}\n\n/** Drop-target state: `laneKey` pins the drop to one column's one lane section, so hovering a different lane's\n * (rendered) section in the same column never gets confused with this one — see the module docstring. */\ninterface DropTarget {\n columnKey: ColumnKey;\n laneKey: string;\n beforeId: string | null;\n}\n\nexport function RoadmapNowNextLater({ roadmapId }: { roadmapId: string }) {\n const { workspaceId } = usePlanMagnet();\n const { items, loading, error, totalCount, truncated } = useAllRoadmapItems(\n workspaceId,\n roadmapId\n );\n const [move, moveState] = useMutation(MOVE_ITEM, {\n refetchQueries: [\n 'GetRoadmapDetailPage',\n 'GetRoadmapDetail',\n 'GetRoadmapAnalytics',\n 'RoadmapNowNextLaterItems',\n ],\n awaitRefetchQueries: true,\n });\n const [actionError, setActionError] = useState<string | null>(null);\n const [forbidden, setForbidden] = useState(false);\n const [announcement, setAnnouncement] = useState('');\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dropTarget, setDropTarget] = useState<DropTarget | null>(null);\n const [pendingFocusId, setPendingFocusId] = useState<string | null>(null);\n\n // Lane keys in first-appearance order across the WHOLE roadmap (not per column), so every column groups its\n // cards into the same lane sections in the same order — same convention as the Timeline view's\n // `swimlaneGroups`, generalized so it stays consistent across all four columns.\n const laneOrder = useMemo(() => {\n const seen = new Set<string>();\n const order: string[] = [];\n for (const item of items) {\n const key = laneKey(item);\n if (!seen.has(key)) {\n seen.add(key);\n order.push(key);\n }\n }\n return order;\n }, [items]);\n // Only disambiguate visually when there's something to disambiguate: a roadmap that never uses more than one\n // lane renders exactly one unlabelled section per column, identical to a flat list.\n const hasMultipleLanes = laneOrder.length > 1;\n\n const byColumn = useMemo(() => {\n const groups: Record<ColumnKey, NnlItem[]> = { UNPLACED: [], NOW: [], NEXT: [], LATER: [] };\n for (const item of items) groups[columnOf(item.horizon)].push(item);\n return groups;\n }, [items]);\n\n // Every (column, lane) pair's items, in sortOrder — the unit both rendering and move math operate on.\n const byColumnLane = useMemo(() => {\n const groups: Record<ColumnKey, Record<string, NnlItem[]>> = {\n UNPLACED: {},\n NOW: {},\n NEXT: {},\n LATER: {},\n };\n for (const key of laneOrder) {\n groups.UNPLACED[key] = [];\n groups.NOW[key] = [];\n groups.NEXT[key] = [];\n groups.LATER[key] = [];\n }\n for (const item of items) {\n const col = columnOf(item.horizon);\n const lane = laneKey(item);\n (groups[col][lane] ??= []).push(item);\n }\n return groups;\n }, [items, laneOrder]);\n\n // Focus the moved card's own \"Move…\" control once the board has re-rendered in its new position — a\n // horizon-changing move remounts the control in a different column's DOM subtree, which would otherwise drop\n // focus back to the document body with no notice to a keyboard/screen-reader user.\n useEffect(() => {\n if (!pendingFocusId) return;\n const id = pendingFocusId;\n const raf = requestAnimationFrame(() => {\n document.getElementById(`nnl-move-${id}`)?.focus();\n setPendingFocusId(null);\n });\n return () => cancelAnimationFrame(raf);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [items]);\n\n const busy = moveState.loading;\n const movesAllowed = !forbidden;\n const draggingItem = draggingId ? (items.find((it) => it.id === draggingId) ?? null) : null;\n\n const runMove = async (\n item: NnlItem,\n horizon: Horizon,\n index: number,\n resultLabel: string,\n focusAfter: boolean\n ) => {\n setActionError(null);\n if (focusAfter) setPendingFocusId(item.id);\n try {\n await throwOnError(move({ variables: { id: item.id, input: { horizon, index } } }));\n setAnnouncement(`Moved \"${item.title}\" to ${resultLabel}.`);\n } catch (e) {\n if (isForbidden(e)) {\n setForbidden(true);\n setActionError('Your role cannot reorder this roadmap.');\n setAnnouncement(`Move refused: your role cannot reorder this roadmap.`);\n } else {\n const msg = mutationErrorMessage(e, 'The item could not be moved.');\n setActionError(msg);\n setAnnouncement(`Move failed: ${msg}`);\n }\n }\n };\n\n /** `laneItems` is one (column, lane) section's own list — see the module docstring on why the move never\n * needs to consider any other lane's items. */\n const dropOnLane = (\n columnKey: ColumnKey,\n lane: string,\n laneItems: NnlItem[],\n draggedId: string,\n beforeId: string | null\n ) => {\n if (!movesAllowed || busy) return;\n const movedItem = items.find((it) => it.id === draggedId);\n if (!movedItem) return;\n // Defensive: the section's own onDragOver already refuses to arm a drop target for a foreign lane (and a\n // dragover that never calls preventDefault never gets a drop event at all), but a drop is rejected here too\n // in case that ever changes — the move must never silently reassign `swimlane`.\n if (laneKey(movedItem) !== lane) return;\n const column = COLUMNS.find((c) => c.key === columnKey);\n if (!column) return;\n const index = destinationIndex(laneItems, movedItem.id, beforeId);\n // No-op guard: `destinationIndex` already excludes the moved item from its own count, so \"drop just before\n // itself\" and \"drop just after itself\" both resolve to its current lane-relative index — a single equality\n // check catches both without needing to special-case direction.\n if (columnOf(movedItem.horizon) === columnKey) {\n const currentIndex = laneItems.findIndex((it) => it.id === movedItem.id);\n if (currentIndex === index) return;\n }\n void runMove(movedItem, column.horizon, index, column.label, false);\n };\n\n const laneCardDragOver =\n (columnKey: ColumnKey, lane: string, laneItems: NnlItem[]) =>\n (e: DragEvent<HTMLLIElement>, item: NnlItem, index: number) => {\n if (!movesAllowed || busy || !draggingItem || laneKey(draggingItem) !== lane) return;\n e.preventDefault();\n // Stop this from also bubbling to the lane section's own onDragOver, which would otherwise overwrite the\n // precise before/after target computed here with \"append at the end\" on every mousemove over a card.\n e.stopPropagation();\n e.dataTransfer.dropEffect = 'move';\n const rect = e.currentTarget.getBoundingClientRect();\n const before = e.clientY < rect.top + rect.height / 2;\n const beforeId = before ? item.id : (laneItems[index + 1]?.id ?? null);\n setDropTarget({ columnKey, laneKey: lane, beforeId });\n };\n\n const laneDrop =\n (columnKey: ColumnKey, lane: string, laneItems: NnlItem[]) => (e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n // Stop this from also bubbling to the section's own onDrop, which would otherwise run the same drop a\n // second time with the section-level (already-cleared) target.\n e.stopPropagation();\n const draggedId = e.dataTransfer.getData('text/plain');\n const beforeId =\n dropTarget?.columnKey === columnKey && dropTarget.laneKey === lane\n ? dropTarget.beforeId\n : null;\n setDropTarget(null);\n setDraggingId(null);\n if (draggedId) dropOnLane(columnKey, lane, laneItems, draggedId, beforeId);\n };\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\" data-testid=\"nnl-board\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" aria-hidden=\"true\" />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"p-6 text-destructive\" data-testid=\"nnl-board\">\n Failed to load roadmap items: {error.message}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-3\" data-testid=\"nnl-board\">\n <p className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {announcement}\n </p>\n {forbidden && (\n <p\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 p-2 text-sm text-destructive\"\n >\n Your role can view this roadmap but not reorder it. Moves are disabled below.\n </p>\n )}\n {!forbidden && actionError && (\n <p\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 p-2 text-sm text-destructive\"\n >\n {actionError}\n </p>\n )}\n {truncated && (\n <p className=\"text-xs text-muted-foreground\">\n Showing the first {MAX_ITEMS} of {totalCount} items.\n </p>\n )}\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-4\">\n {COLUMNS.map((column) => {\n const columnItems = byColumn[column.key];\n // Every lane's own list for this column, plus whether it should render at all: a roadmap using only\n // one lane always shows its (possibly empty) single section, exactly like the old flat list; once a\n // roadmap uses more than one lane, an EMPTY lane's section only appears while something from that\n // exact lane is being dragged (so it can serve as a drop target), keeping the common, non-dragging\n // view free of empty \"Lane — no items\" clutter.\n const laneSections = laneOrder\n .map((lane) => ({ lane, laneItems: byColumnLane[column.key][lane] ?? [] }))\n .filter(\n ({ lane, laneItems }) =>\n !hasMultipleLanes ||\n laneItems.length > 0 ||\n (draggingItem && laneKey(draggingItem) === lane)\n );\n return (\n <section\n key={column.key}\n aria-label={`${column.label} column`}\n data-testid={`nnl-column-${column.key}`}\n className=\"min-h-[120px] rounded-md border bg-muted/30 p-2\"\n >\n <h3 className=\"mb-2 flex items-center gap-1.5 text-sm font-medium\">\n {column.key === 'UNPLACED' && (\n <Inbox className=\"h-3.5 w-3.5 text-muted-foreground\" aria-hidden=\"true\" />\n )}\n {column.label}\n <span className=\"text-xs text-muted-foreground\">({columnItems.length})</span>\n </h3>\n {laneSections.length === 0 && (\n <p className=\"py-4 text-center text-xs text-muted-foreground\">No items</p>\n )}\n <div className=\"space-y-3\">\n {laneSections.map(({ lane, laneItems }) => {\n const isLaneDropTarget =\n dropTarget?.columnKey === column.key && dropTarget.laneKey === lane;\n return (\n <div key={lane || '(none)'} className=\"space-y-1\">\n {hasMultipleLanes && (\n <p\n data-testid=\"nnl-lane-label\"\n className=\"text-[11px] font-medium text-muted-foreground\"\n >\n {laneLabel(lane)}{' '}\n <span className=\"text-muted-foreground/70\">({laneItems.length})</span>\n </p>\n )}\n <ul\n className={`min-h-[48px] space-y-2 rounded-sm p-1 ${\n isLaneDropTarget && !dropTarget.beforeId ? 'ring-2 ring-primary' : ''\n }`}\n onDragOver={(e) => {\n if (\n !movesAllowed ||\n busy ||\n !draggingItem ||\n laneKey(draggingItem) !== lane\n )\n return;\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n setDropTarget({ columnKey: column.key, laneKey: lane, beforeId: null });\n }}\n onDrop={laneDrop(column.key, lane, laneItems)}\n >\n {laneItems.length === 0 && (\n <li\n className=\"py-2 text-center text-[11px] text-muted-foreground\"\n aria-hidden=\"true\"\n >\n Drop here\n </li>\n )}\n {laneItems.map((item, index) => {\n // 'before': the drop would land this card right in front of `item`. 'after': the drop\n // targets \"end of this lane's section\" (beforeId null) and `item` is that section's\n // last card, so the line belongs below it.\n const dropIndicator: 'before' | 'after' | null = !isLaneDropTarget\n ? null\n : dropTarget.beforeId === item.id\n ? 'before'\n : dropTarget.beforeId === null && index === laneItems.length - 1\n ? 'after'\n : null;\n return (\n <NnlCard\n key={item.id}\n item={item}\n columnKey={column.key}\n laneItems={laneItems}\n draggable={movesAllowed && !busy}\n dragging={draggingId === item.id}\n dropIndicator={dropIndicator}\n moveDisabled={!movesAllowed || busy}\n onDragStart={setDraggingId}\n onDragEnd={() => {\n setDraggingId(null);\n setDropTarget(null);\n }}\n onDragOverCard={(e) =>\n laneCardDragOver(column.key, lane, laneItems)(e, item, index)\n }\n onDropOnCard={laneDrop(column.key, lane, laneItems)}\n onMoveTo={(target) => {\n const targetColumn = COLUMNS.find((c) => c.key === target);\n if (!targetColumn) return;\n const targetLaneItems = byColumnLane[target][laneKey(item)] ?? [];\n const index2 = destinationIndex(targetLaneItems, item.id, null);\n void runMove(\n item,\n targetColumn.horizon,\n index2,\n targetColumn.label,\n true\n );\n }}\n onShift={(delta) => {\n const pos = laneItems.findIndex((it) => it.id === item.id);\n const target = pos + delta;\n if (pos === -1 || target < 0 || target >= laneItems.length) return;\n void runMove(item, item.horizon, target, column.label, true);\n }}\n />\n );\n })}\n </ul>\n </div>\n );\n })}\n </div>\n </section>\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAsCA,IAAM,IAAc,0LAkBd,IAAY,CAAG;;;;;;;;UAQX,EAAY;;;;;;;;;GAWhB,IAAY,CAAG;;;QAGb,EAAY;;;GAuBd,IAAiE;CACrE;EAAE,KAAK;EAAY,OAAO;EAAc,SAAS;EAAM;CACvD;EAAE,KAAK;EAAO,OAAO;EAAO,SAAS;EAAO;CAC5C;EAAE,KAAK;EAAQ,OAAO;EAAQ,SAAS;EAAQ;CAC/C;EAAE,KAAK;EAAS,OAAO;EAAS,SAAS;EAAS;CACnD,EACK,KAAY,MAAgC,KAAW,YAEvD,IAAY,KAGZ,IAAY;AAKlB,SAAS,EAAmB,GAAiC,GAAmB;CAC9E,IAAM,EAAE,SAAM,YAAS,UAAO,iBAAc,EAMzC,GAAW;EACZ,WAAW;GACT,aAAa,KAAe;GAC5B,QAAQ,EAAE,cAAW;GACrB,YAAY,EAAE,OAAO,GAAW;GACjC;EACD,MAAM,CAAC,KAAe,CAAC;EACxB,CAAC,EACI,IAAS,GAAM,uBAAuB,SAAS,EAAE,EACjD,IAAc,GAAM,uBAAuB,SAAS,eAAe,IACnE,IAAY,GAAM,uBAAuB,SAAS,aAAa,MAC/D,IAAa,GAAM,uBAAuB,cAAc;AAoB9D,QAlBA,QAAgB;AACV,GAAC,KAAe,CAAC,KAAa,EAAO,UAAU,KACnD,EAAU;GACR,WAAW,EAAE,YAAY;IAAE,OAAO;IAAW,OAAO;IAAW,EAAE;GACjE,cAAc,GAAM,EAAE,0BAAuB,EAC3C,wBAAwB;IACtB,GAAG,EAAgB;IACnB,OAAO,CACL,GAAG,EAAK,uBAAuB,OAC/B,G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AkBG,EAAU,WAAW,KACpB,kBAAC,MAAD;YACE,WAAU;YACV,eAAY;sBACb;YAEI,CAAA,EAEN,EAAU,KAAK,GAAM,MAAU;YAI9B,IAAM,IAA4C,IAE9C,EAAW,aAAa,EAAK,KAC3B,WACA,EAAW,aAAa,QAAQ,MAAU,EAAU,SAAS,IAC3D,UACA,OALJ;AAMJ,mBACE,kBAAC,GAAD;aAEQ;aACN,WAAW,EAAO;aACP;aACX,WAAW,KAAgB,CAAC;aAC5B,UAAU,MAAe,EAAK;aACf;aACf,cAAc,CAAC,KAAgB;aAC/B,aAAa;aACb,iBAAiB;AAEf,cADA,EAAc,KAAK,EACnB,EAAc,KAAK;;aAErB,iBAAiB,MACf,EAAiB,EAAO,KAAK,GAAM,EAAU,CAAC,GAAG,GAAM,EAAM;aAE/D,cAAc,EAAS,EAAO,KAAK,GAAM,EAAU;aACnD,WAAW,MAAW;cACpB,IAAM,IAAe,EAAQ,MAAM,MAAM,EAAE,QAAQ,EAAO;AAC1D,kBAAI,CAAC,EAAc;cAEnB,IAAM,IAAS,EADS,EAAa,GAAQ,EAAQ,EAAK,KAAK,EAAE,EAChB,EAAK,IAAI,KAAK;AAC1D,gBACH,GACA,EAAa,SACb,GACA,EAAa,OACb,GACD;;aAEH,UAAU,MAAU;cAClB,IAAM,IAAM,EAAU,WAAW,MAAO,EAAG,OAAO,EAAK,GAAG,EACpD,IAAS,IAAM;AACjB,oBAAQ,MAAM,IAAS,KAAK,KAAU,EAAU,UAC/C,EAAQ,GAAM,EAAK,SAAS,GAAQ,EAAO,OAAO,GAAK;;aAE9D,EApCK,EAAK,GAoCV;aAEJ,CACC;aACD;YAzFI,KAAQ,SAyFZ;UAER;QACE,CAAA;OACE;QAjHH,EAAO,IAiHJ;MAEZ;IACE,CAAA;GACF"}
1
+ {"version":3,"file":"RoadmapNowNextLater.js","names":[],"sources":["../../../src/planmagnet/roadmaps/RoadmapNowNextLater.tsx"],"sourcesContent":["import { useEffect, useMemo, useState, type DragEvent } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@burdenoff/fe-libs/ui';\nimport {\n AlertTriangle,\n Calendar,\n Gauge,\n Inbox,\n Loader2,\n ShieldAlert,\n ShieldCheck,\n} from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { throwOnError } from '../utils/mutationResult';\nimport { isForbidden, mutationErrorMessage } from '../utils/graphqlErrors';\nimport { enumLabel } from '../controls/WorkItemControls';\n\n/**\n * Now/Next/Later (PRM-06, PRM-09, PRM-10): a VIEW of a roadmap's items grouped by `horizon`, alongside the\n * existing Timeline view (`ProductsRoadmapDetailPagePage.tsx`) — not a separate roadmap type. Placement is\n * changed by dragging a card, or by the keyboard \"Move…\" select every card also carries (the same mutation\n * either way: `planmagnetMoveRoadmapItem`), never optimistically: the list shown is always what\n * `planmagnetRoadmapItems` last returned, so a refused move has nothing local to \"undo\" — the card simply never\n * left its column.\n *\n * `planmagnetMoveRoadmapItem`'s `index` is scoped to the (roadmap, horizon, **swimlane**) group, not to the\n * column as a whole — the same lane-scoping the Timeline view treats as first-class (`swimlaneGroups` there).\n * Each column therefore renders its cards **grouped by lane** (one sub-list per lane, in the same order in\n * every column), exactly like the Timeline view's per-lane cards. A drag/drop within a lane's sub-list, or a\n * \"Move…\" menu action, only ever computes an index against that same sub-list — so \"the end of this section\"\n * (what the user sees) and \"the end of this lane's server-side group\" (what the index means) are always the\n * same place, with no cross-lane ambiguity. Dropping a card onto a *different* lane's section is rejected (the\n * move never changes `swimlane`); the lane header is only shown once a roadmap actually uses more than one\n * lane, so a single-lane (the common case) or lane-less roadmap renders exactly one unlabelled section per\n * column — visually identical to a flat list.\n */\n\nconst ITEM_FIELDS = `\n id\n title\n status\n startDate\n endDate\n horizon\n swimlane\n sortOrder\n confidence\n riskLevel\n riskNote\n featureRequestDemand {\n requests\n votes\n }\n`;\n\nconst NNL_ITEMS = gql`\n query RoadmapNowNextLaterItems(\n $workspaceId: ID!\n $filter: PlanmagnetRoadmapItemFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetRoadmapItems(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n ${ITEM_FIELDS}\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n }\n }\n`;\n\nconst MOVE_ITEM = gql`\n mutation RoadmapNowNextLaterMove($id: ID!, $input: PlanmagnetMoveRoadmapItemInput!) {\n planmagnetMoveRoadmapItem(id: $id, input: $input) {\n ${ITEM_FIELDS}\n }\n }\n`;\n\ninterface NnlItem {\n id: string;\n title: string;\n status: string;\n startDate: string | null;\n endDate: string | null;\n horizon: 'NOW' | 'NEXT' | 'LATER' | null;\n swimlane: string | null;\n sortOrder: number;\n confidence: number | null;\n riskLevel: 'LOW' | 'MEDIUM' | 'HIGH' | null;\n riskNote: string | null;\n featureRequestDemand: { requests: number; votes: number } | null;\n}\n\ntype ColumnKey = 'UNPLACED' | 'NOW' | 'NEXT' | 'LATER';\ntype Horizon = 'NOW' | 'NEXT' | 'LATER' | null;\n\nconst COLUMNS: { key: ColumnKey; label: string; horizon: Horizon }[] = [\n { key: 'UNPLACED', label: 'Not placed', horizon: null },\n { key: 'NOW', label: 'Now', horizon: 'NOW' },\n { key: 'NEXT', label: 'Next', horizon: 'NEXT' },\n { key: 'LATER', label: 'Later', horizon: 'LATER' },\n];\nconst columnOf = (horizon: Horizon): ColumnKey => horizon ?? 'UNPLACED';\n\nconst PAGE_SIZE = 200;\n/** Items beyond this many are not loaded. Stated rather than silently dropped: a banner below the board says so\n * when the cap is actually hit, the same \"never silently stop\" convention as `controls/Pickers.tsx`. */\nconst MAX_ITEMS = 2000;\n\n/** Every item on the roadmap, paged through in full (never just the first page) up to `MAX_ITEMS`, ordered by\n * sortOrder then id — same pattern as `ProjectSelect` in `controls/Pickers.tsx`, generalized to a full board\n * rather than a picker list. */\nfunction useAllRoadmapItems(workspaceId: string | undefined, roadmapId: string) {\n const { data, loading, error, fetchMore } = useQuery<{\n planmagnetRoadmapItems: {\n items: NnlItem[];\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n totalCount: number;\n };\n }>(NNL_ITEMS, {\n variables: {\n workspaceId: workspaceId ?? '',\n filter: { roadmapId },\n pagination: { first: PAGE_SIZE },\n },\n skip: !workspaceId || !roadmapId,\n });\n const loaded = data?.planmagnetRoadmapItems.items ?? [];\n const hasNextPage = data?.planmagnetRoadmapItems.pageInfo.hasNextPage ?? false;\n const endCursor = data?.planmagnetRoadmapItems.pageInfo.endCursor ?? null;\n const totalCount = data?.planmagnetRoadmapItems.totalCount ?? 0;\n\n useEffect(() => {\n if (!hasNextPage || !endCursor || loaded.length >= MAX_ITEMS) return;\n fetchMore({\n variables: { pagination: { first: PAGE_SIZE, after: endCursor } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetRoadmapItems: {\n ...fetchMoreResult.planmagnetRoadmapItems,\n items: [\n ...prev.planmagnetRoadmapItems.items,\n ...fetchMoreResult.planmagnetRoadmapItems.items,\n ],\n },\n }),\n }).catch(() => {\n // A failed extra page leaves the items already loaded usable; `truncated` below still reports the gap.\n });\n }, [hasNextPage, endCursor, loaded.length, fetchMore]);\n\n return {\n items: loaded,\n loading: loading && !data,\n error,\n totalCount,\n truncated: hasNextPage && loaded.length >= MAX_ITEMS,\n };\n}\n\n/** An item's lane key for grouping — `null`/unset normalizes to `''` so it compares equal to itself. */\nconst laneKey = (item: NnlItem) => item.swimlane ?? '';\n/** Display label for a lane key, matching the Timeline view's own term for the unassigned bucket\n * (`ProductsRoadmapDetailPagePage.tsx`'s `swimlaneGroups`). */\nconst laneLabel = (key: string) => key || 'Uncategorized';\n\n/**\n * The 0-based index to send `planmagnetMoveRoadmapItem` so `movedItem` lands where the drop indicates.\n * `laneItems` MUST already be scoped to a single lane's section (the same list the card was dropped in/onto —\n * see the module docstring), so there is no cross-lane ambiguity left to resolve here: `beforeId` is the id of\n * the card the drop should land in front of within that section, or `null` for the end of it, which is exactly\n * the end of the (roadmap, horizon, lane) group the server indexes into.\n */\nfunction destinationIndex(\n laneItems: NnlItem[],\n movedItemId: string,\n beforeId: string | null\n): number {\n const others = laneItems.filter((it) => it.id !== movedItemId);\n if (beforeId === null) return others.length;\n const cut = others.findIndex((it) => it.id === beforeId);\n return cut === -1 ? others.length : cut;\n}\n\nconst RISK_META: Record<\n 'LOW' | 'MEDIUM' | 'HIGH',\n { Icon: typeof ShieldCheck; label: string; className: string }\n> = {\n LOW: { Icon: ShieldCheck, label: 'Low risk', className: 'text-muted-foreground' },\n MEDIUM: { Icon: AlertTriangle, label: 'Medium risk', className: 'text-status-warning-text' },\n HIGH: { Icon: ShieldAlert, label: 'High risk', className: 'text-status-error-text' },\n};\n\n/** Icon + text label (never colour alone) for a risk level; the note (if any) shows on hover/focus via a\n * tooltip, which is keyboard-reachable because the trigger is a real, focusable button. */\nfunction RiskIndicator({ level, note }: { level: NnlItem['riskLevel']; note: string | null }) {\n if (!level) return null;\n const meta = RISK_META[level];\n const badge = (\n <span\n data-testid=\"nnl-risk\"\n className={`inline-flex items-center gap-1 text-xs ${meta.className}`}\n >\n <meta.Icon className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n {meta.label}\n </span>\n );\n if (!note) return badge;\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className=\"rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {badge}\n </button>\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs\">{note}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n\nfunction ConfidenceBadge({ confidence }: { confidence: number | null }) {\n if (confidence === null) return null;\n return (\n <span\n data-testid=\"nnl-confidence\"\n className=\"inline-flex items-center gap-1 text-xs text-muted-foreground\"\n >\n <Gauge className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n {confidence}% confident\n </span>\n );\n}\n\n/** The keyboard/menu equivalent of dragging: every horizon this card isn't already in, plus reorder-in-place.\n * A native `<select>` with a constant `value=\"\"` — the same \"Move…\" pattern `board/ProjectBoard.tsx` uses — so\n * it always shows the placeholder after an action instead of needing to be reset by hand. */\nfunction CardMoveMenu({\n item,\n columnKey,\n laneItems,\n disabled,\n onMoveTo,\n onShift,\n}: {\n item: NnlItem;\n columnKey: ColumnKey;\n laneItems: NnlItem[];\n disabled: boolean;\n onMoveTo: (target: ColumnKey) => void;\n onShift: (delta: -1 | 1) => void;\n}) {\n const pos = laneItems.findIndex((it) => it.id === item.id);\n const canUp = pos > 0;\n const canDown = pos !== -1 && pos < laneItems.length - 1;\n return (\n <select\n id={`nnl-move-${item.id}`}\n aria-label={`Move ${item.title}`}\n data-testid=\"nnl-card-move\"\n className=\"rounded border border-input bg-background px-1 py-0.5 text-[11px] disabled:opacity-60\"\n value=\"\"\n disabled={disabled}\n onChange={(e) => {\n const v = e.target.value;\n if (v === 'up') onShift(-1);\n else if (v === 'down') onShift(1);\n // Every other <option> value below is a literal ColumnKey from COLUMNS itself, so this is safe.\n else if (v) onMoveTo(v as ColumnKey);\n }}\n >\n <option value=\"\">Move…</option>\n {COLUMNS.filter((c) => c.key !== columnKey).map((c) => (\n <option key={c.key} value={c.key}>\n Move to {c.label}\n </option>\n ))}\n <option value=\"up\" disabled={!canUp}>\n Move up\n </option>\n <option value=\"down\" disabled={!canDown}>\n Move down\n </option>\n </select>\n );\n}\n\nfunction NnlCard({\n item,\n columnKey,\n laneItems,\n draggable,\n dragging,\n dropIndicator,\n moveDisabled,\n onDragStart,\n onDragEnd,\n onDragOverCard,\n onDropOnCard,\n onMoveTo,\n onShift,\n}: {\n item: NnlItem;\n columnKey: ColumnKey;\n laneItems: NnlItem[];\n draggable: boolean;\n dragging: boolean;\n dropIndicator: 'before' | 'after' | null;\n moveDisabled: boolean;\n onDragStart: (id: string) => void;\n onDragEnd: () => void;\n onDragOverCard: (e: DragEvent<HTMLLIElement>) => void;\n onDropOnCard: (e: DragEvent<HTMLLIElement>) => void;\n onMoveTo: (target: ColumnKey) => void;\n onShift: (delta: -1 | 1) => void;\n}) {\n const demand = item.featureRequestDemand;\n return (\n <li\n draggable={draggable}\n onDragStart={(e) => {\n e.dataTransfer.setData('text/plain', item.id);\n e.dataTransfer.effectAllowed = 'move';\n onDragStart(item.id);\n }}\n onDragEnd={onDragEnd}\n onDragOver={onDragOverCard}\n onDrop={onDropOnCard}\n data-testid=\"nnl-card\"\n className={[\n 'space-y-1.5 rounded-md border bg-background p-2 text-sm',\n draggable ? 'cursor-grab' : '',\n dragging ? 'opacity-50' : '',\n dropIndicator === 'before' ? 'border-t-2 border-t-primary' : '',\n dropIndicator === 'after' ? 'border-b-2 border-b-primary' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <p className=\"font-medium leading-tight\">{item.title}</p>\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\">\n <span>{enumLabel(item.status)}</span>\n {(item.startDate || item.endDate) && (\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" aria-hidden=\"true\" />\n {item.startDate ? new Date(item.startDate).toLocaleDateString() : '?'}\n {' - '}\n {item.endDate ? new Date(item.endDate).toLocaleDateString() : '?'}\n </span>\n )}\n </div>\n {demand && demand.requests > 0 && (\n <p className=\"text-xs text-muted-foreground\" data-testid=\"roadmap-item-demand\">\n {demand.requests} feature request{demand.requests === 1 ? '' : 's'} · {demand.votes} vote\n {demand.votes === 1 ? '' : 's'}\n </p>\n )}\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-1\">\n <ConfidenceBadge confidence={item.confidence} />\n <RiskIndicator level={item.riskLevel} note={item.riskNote} />\n </div>\n <div className=\"flex justify-end pt-0.5\">\n <CardMoveMenu\n item={item}\n columnKey={columnKey}\n laneItems={laneItems}\n disabled={moveDisabled}\n onMoveTo={onMoveTo}\n onShift={onShift}\n />\n </div>\n </li>\n );\n}\n\n/** Drop-target state: `laneKey` pins the drop to one column's one lane section, so hovering a different lane's\n * (rendered) section in the same column never gets confused with this one — see the module docstring. */\ninterface DropTarget {\n columnKey: ColumnKey;\n laneKey: string;\n beforeId: string | null;\n}\n\nexport function RoadmapNowNextLater({ roadmapId }: { roadmapId: string }) {\n const { workspaceId } = usePlanMagnet();\n const { items, loading, error, totalCount, truncated } = useAllRoadmapItems(\n workspaceId,\n roadmapId\n );\n const [move, moveState] = useMutation(MOVE_ITEM, {\n refetchQueries: [\n 'GetRoadmapDetailPage',\n 'GetRoadmapDetail',\n 'GetRoadmapAnalytics',\n 'RoadmapNowNextLaterItems',\n ],\n awaitRefetchQueries: true,\n });\n const [actionError, setActionError] = useState<string | null>(null);\n const [forbidden, setForbidden] = useState(false);\n const [announcement, setAnnouncement] = useState('');\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dropTarget, setDropTarget] = useState<DropTarget | null>(null);\n const [pendingFocusId, setPendingFocusId] = useState<string | null>(null);\n\n // Lane keys in first-appearance order across the WHOLE roadmap (not per column), so every column groups its\n // cards into the same lane sections in the same order — same convention as the Timeline view's\n // `swimlaneGroups`, generalized so it stays consistent across all four columns.\n const laneOrder = useMemo(() => {\n const seen = new Set<string>();\n const order: string[] = [];\n for (const item of items) {\n const key = laneKey(item);\n if (!seen.has(key)) {\n seen.add(key);\n order.push(key);\n }\n }\n return order;\n }, [items]);\n // Only disambiguate visually when there's something to disambiguate: a roadmap that never uses more than one\n // lane renders exactly one unlabelled section per column, identical to a flat list.\n const hasMultipleLanes = laneOrder.length > 1;\n\n const byColumn = useMemo(() => {\n const groups: Record<ColumnKey, NnlItem[]> = { UNPLACED: [], NOW: [], NEXT: [], LATER: [] };\n for (const item of items) groups[columnOf(item.horizon)].push(item);\n return groups;\n }, [items]);\n\n // Every (column, lane) pair's items, in sortOrder — the unit both rendering and move math operate on.\n const byColumnLane = useMemo(() => {\n const groups: Record<ColumnKey, Record<string, NnlItem[]>> = {\n UNPLACED: {},\n NOW: {},\n NEXT: {},\n LATER: {},\n };\n for (const key of laneOrder) {\n groups.UNPLACED[key] = [];\n groups.NOW[key] = [];\n groups.NEXT[key] = [];\n groups.LATER[key] = [];\n }\n for (const item of items) {\n const col = columnOf(item.horizon);\n const lane = laneKey(item);\n (groups[col][lane] ??= []).push(item);\n }\n return groups;\n }, [items, laneOrder]);\n\n // Focus the moved card's own \"Move…\" control once the board has re-rendered in its new position — a\n // horizon-changing move remounts the control in a different column's DOM subtree, which would otherwise drop\n // focus back to the document body with no notice to a keyboard/screen-reader user.\n useEffect(() => {\n if (!pendingFocusId) return;\n const id = pendingFocusId;\n const raf = requestAnimationFrame(() => {\n document.getElementById(`nnl-move-${id}`)?.focus();\n setPendingFocusId(null);\n });\n return () => cancelAnimationFrame(raf);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [items]);\n\n const busy = moveState.loading;\n const movesAllowed = !forbidden;\n const draggingItem = draggingId ? (items.find((it) => it.id === draggingId) ?? null) : null;\n\n const runMove = async (\n item: NnlItem,\n horizon: Horizon,\n index: number,\n resultLabel: string,\n focusAfter: boolean\n ) => {\n setActionError(null);\n if (focusAfter) setPendingFocusId(item.id);\n try {\n await throwOnError(move({ variables: { id: item.id, input: { horizon, index } } }));\n setAnnouncement(`Moved \"${item.title}\" to ${resultLabel}.`);\n } catch (e) {\n if (isForbidden(e)) {\n setForbidden(true);\n setActionError('Your role cannot reorder this roadmap.');\n setAnnouncement(`Move refused: your role cannot reorder this roadmap.`);\n } else {\n const msg = mutationErrorMessage(e, 'The item could not be moved.');\n setActionError(msg);\n setAnnouncement(`Move failed: ${msg}`);\n }\n }\n };\n\n /** `laneItems` is one (column, lane) section's own list — see the module docstring on why the move never\n * needs to consider any other lane's items. */\n const dropOnLane = (\n columnKey: ColumnKey,\n lane: string,\n laneItems: NnlItem[],\n draggedId: string,\n beforeId: string | null\n ) => {\n if (!movesAllowed || busy) return;\n const movedItem = items.find((it) => it.id === draggedId);\n if (!movedItem) return;\n // Defensive: the section's own onDragOver already refuses to arm a drop target for a foreign lane (and a\n // dragover that never calls preventDefault never gets a drop event at all), but a drop is rejected here too\n // in case that ever changes — the move must never silently reassign `swimlane`.\n if (laneKey(movedItem) !== lane) return;\n const column = COLUMNS.find((c) => c.key === columnKey);\n if (!column) return;\n const index = destinationIndex(laneItems, movedItem.id, beforeId);\n // No-op guard: `destinationIndex` already excludes the moved item from its own count, so \"drop just before\n // itself\" and \"drop just after itself\" both resolve to its current lane-relative index — a single equality\n // check catches both without needing to special-case direction.\n if (columnOf(movedItem.horizon) === columnKey) {\n const currentIndex = laneItems.findIndex((it) => it.id === movedItem.id);\n if (currentIndex === index) return;\n }\n void runMove(movedItem, column.horizon, index, column.label, false);\n };\n\n const laneCardDragOver =\n (columnKey: ColumnKey, lane: string, laneItems: NnlItem[]) =>\n (e: DragEvent<HTMLLIElement>, item: NnlItem, index: number) => {\n if (!movesAllowed || busy || !draggingItem || laneKey(draggingItem) !== lane) return;\n e.preventDefault();\n // Stop this from also bubbling to the lane section's own onDragOver, which would otherwise overwrite the\n // precise before/after target computed here with \"append at the end\" on every mousemove over a card.\n e.stopPropagation();\n e.dataTransfer.dropEffect = 'move';\n const rect = e.currentTarget.getBoundingClientRect();\n const before = e.clientY < rect.top + rect.height / 2;\n const beforeId = before ? item.id : (laneItems[index + 1]?.id ?? null);\n setDropTarget({ columnKey, laneKey: lane, beforeId });\n };\n\n const laneDrop =\n (columnKey: ColumnKey, lane: string, laneItems: NnlItem[]) => (e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n // Stop this from also bubbling to the section's own onDrop, which would otherwise run the same drop a\n // second time with the section-level (already-cleared) target.\n e.stopPropagation();\n const draggedId = e.dataTransfer.getData('text/plain');\n const beforeId =\n dropTarget?.columnKey === columnKey && dropTarget.laneKey === lane\n ? dropTarget.beforeId\n : null;\n setDropTarget(null);\n setDraggingId(null);\n if (draggedId) dropOnLane(columnKey, lane, laneItems, draggedId, beforeId);\n };\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center p-12\" data-testid=\"nnl-board\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" aria-hidden=\"true\" />\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"p-6 text-destructive\" data-testid=\"nnl-board\">\n Failed to load roadmap items: {error.message}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-3\" data-testid=\"nnl-board\">\n <p className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {announcement}\n </p>\n {forbidden && (\n <p\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 p-2 text-sm text-destructive\"\n >\n Your role can view this roadmap but not reorder it. Moves are disabled below.\n </p>\n )}\n {!forbidden && actionError && (\n <p\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 p-2 text-sm text-destructive\"\n >\n {actionError}\n </p>\n )}\n {truncated && (\n <p className=\"text-xs text-muted-foreground\">\n Showing the first {MAX_ITEMS} of {totalCount} items.\n </p>\n )}\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-4\">\n {COLUMNS.map((column) => {\n const columnItems = byColumn[column.key];\n // Every lane's own list for this column, plus whether it should render at all: a roadmap using only\n // one lane always shows its (possibly empty) single section, exactly like the old flat list; once a\n // roadmap uses more than one lane, an EMPTY lane's section only appears while something from that\n // exact lane is being dragged (so it can serve as a drop target), keeping the common, non-dragging\n // view free of empty \"Lane — no items\" clutter.\n const laneSections = laneOrder\n .map((lane) => ({ lane, laneItems: byColumnLane[column.key][lane] ?? [] }))\n .filter(\n ({ lane, laneItems }) =>\n !hasMultipleLanes ||\n laneItems.length > 0 ||\n (draggingItem && laneKey(draggingItem) === lane)\n );\n return (\n <section\n key={column.key}\n aria-label={`${column.label} column`}\n data-testid={`nnl-column-${column.key}`}\n className=\"min-h-[120px] rounded-md border bg-muted/30 p-2\"\n // The whole column accepts a drop, not just its lane lists: a card dropped on the column's empty\n // space (below a short list, or on its header) goes to the END of its own lane in this column — the\n // lane never changes on a drop (see dropOnLane). The lists and cards handle their own, more precise\n // drops and stop them here.\n onDragOver={(e) => {\n if (!movesAllowed || busy || !draggingItem) return;\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n setDropTarget({\n columnKey: column.key,\n laneKey: laneKey(draggingItem),\n beforeId: null,\n });\n }}\n onDrop={(e) => {\n if (!draggingItem) return;\n const lane = laneKey(draggingItem);\n laneDrop(column.key, lane, byColumnLane[column.key][lane] ?? [])(e);\n }}\n >\n <h3 className=\"mb-2 flex items-center gap-1.5 text-sm font-medium\">\n {column.key === 'UNPLACED' && (\n <Inbox className=\"h-3.5 w-3.5 text-muted-foreground\" aria-hidden=\"true\" />\n )}\n {column.label}\n <span className=\"text-xs text-muted-foreground\">({columnItems.length})</span>\n </h3>\n {laneSections.length === 0 && (\n <p className=\"py-4 text-center text-xs text-muted-foreground\">No items</p>\n )}\n <div className=\"space-y-3\">\n {laneSections.map(({ lane, laneItems }) => {\n const isLaneDropTarget =\n dropTarget?.columnKey === column.key && dropTarget.laneKey === lane;\n return (\n <div key={lane || '(none)'} className=\"space-y-1\">\n {hasMultipleLanes && (\n <p\n data-testid=\"nnl-lane-label\"\n className=\"text-[11px] font-medium text-muted-foreground\"\n >\n {laneLabel(lane)}{' '}\n <span className=\"text-muted-foreground/70\">({laneItems.length})</span>\n </p>\n )}\n <ul\n className={`min-h-[48px] space-y-2 rounded-sm p-1 ${\n isLaneDropTarget && !dropTarget.beforeId ? 'ring-2 ring-primary' : ''\n }`}\n onDragOver={(e) => {\n if (\n !movesAllowed ||\n busy ||\n !draggingItem ||\n laneKey(draggingItem) !== lane\n )\n return;\n e.preventDefault();\n e.dataTransfer.dropEffect = 'move';\n setDropTarget({ columnKey: column.key, laneKey: lane, beforeId: null });\n }}\n onDrop={laneDrop(column.key, lane, laneItems)}\n >\n {laneItems.length === 0 && (\n <li\n className=\"py-2 text-center text-[11px] text-muted-foreground\"\n aria-hidden=\"true\"\n >\n Drop here\n </li>\n )}\n {laneItems.map((item, index) => {\n // 'before': the drop would land this card right in front of `item`. 'after': the drop\n // targets \"end of this lane's section\" (beforeId null) and `item` is that section's\n // last card, so the line belongs below it.\n const dropIndicator: 'before' | 'after' | null = !isLaneDropTarget\n ? null\n : dropTarget.beforeId === item.id\n ? 'before'\n : dropTarget.beforeId === null && index === laneItems.length - 1\n ? 'after'\n : null;\n return (\n <NnlCard\n key={item.id}\n item={item}\n columnKey={column.key}\n laneItems={laneItems}\n draggable={movesAllowed && !busy}\n dragging={draggingId === item.id}\n dropIndicator={dropIndicator}\n moveDisabled={!movesAllowed || busy}\n onDragStart={setDraggingId}\n onDragEnd={() => {\n setDraggingId(null);\n setDropTarget(null);\n }}\n onDragOverCard={(e) =>\n laneCardDragOver(column.key, lane, laneItems)(e, item, index)\n }\n onDropOnCard={laneDrop(column.key, lane, laneItems)}\n onMoveTo={(target) => {\n const targetColumn = COLUMNS.find((c) => c.key === target);\n if (!targetColumn) return;\n const targetLaneItems = byColumnLane[target][laneKey(item)] ?? [];\n const index2 = destinationIndex(targetLaneItems, item.id, null);\n void runMove(\n item,\n targetColumn.horizon,\n index2,\n targetColumn.label,\n true\n );\n }}\n onShift={(delta) => {\n const pos = laneItems.findIndex((it) => it.id === item.id);\n const target = pos + delta;\n if (pos === -1 || target < 0 || target >= laneItems.length) return;\n void runMove(item, item.horizon, target, column.label, true);\n }}\n />\n );\n })}\n </ul>\n </div>\n );\n })}\n </div>\n </section>\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAsCA,IAAM,IAAc,0LAkBd,IAAY,CAAG;;;;;;;;UAQX,EAAY;;;;;;;;;GAWhB,IAAY,CAAG;;;QAGb,EAAY;;;GAuBd,IAAiE;CACrE;EAAE,KAAK;EAAY,OAAO;EAAc,SAAS;EAAM;CACvD;EAAE,KAAK;EAAO,OAAO;EAAO,SAAS;EAAO;CAC5C;EAAE,KAAK;EAAQ,OAAO;EAAQ,SAAS;EAAQ;CAC/C;EAAE,KAAK;EAAS,OAAO;EAAS,SAAS;EAAS;CACnD,EACK,KAAY,M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,GAAD;aAEQ;aACN,WAAW,EAAO;aACP;aACX,WAAW,KAAgB,CAAC;aAC5B,UAAU,MAAe,EAAK;aACf;aACf,cAAc,CAAC,KAAgB;aAC/B,aAAa;aACb,iBAAiB;AAEf,cADA,EAAc,KAAK,EACnB,EAAc,KAAK;;aAErB,iBAAiB,MACf,EAAiB,EAAO,KAAK,GAAM,EAAU,CAAC,GAAG,GAAM,EAAM;aAE/D,cAAc,EAAS,EAAO,KAAK,GAAM,EAAU;aACnD,WAAW,MAAW;cACpB,IAAM,IAAe,EAAQ,MAAM,MAAM,EAAE,QAAQ,EAAO;AAC1D,kBAAI,CAAC,EAAc;cAEnB,IAAM,IAAS,EADS,EAAa,GAAQ,EAAQ,EAAK,KAAK,EAAE,EAChB,EAAK,IAAI,KAAK;AAC1D,gBACH,GACA,EAAa,SACb,GACA,EAAa,OACb,GACD;;aAEH,UAAU,MAAU;cAClB,IAAM,IAAM,EAAU,WAAW,MAAO,EAAG,OAAO,EAAK,GAAG,EACpD,IAAS,IAAM;AACjB,oBAAQ,MAAM,IAAS,KAAK,KAAU,EAAU,UAC/C,EAAQ,GAAM,EAAK,SAAS,GAAQ,EAAO,OAAO,GAAK;;aAE9D,EApCK,EAAK,GAoCV;aAEJ,CACC;aACD;YAzFI,KAAQ,SAyFZ;UAER;QACE,CAAA;OACE;QApIH,EAAO,IAoIJ;MAEZ;IACE,CAAA;GACF"}
@@ -1,7 +1,7 @@
1
1
  import { throwOnError as e } from "../utils/mutationResult.js";
2
2
  import { ConfirmButton as t, ErrorLine as n } from "../controls/ConfirmButton.js";
3
- import { ProjectSelect as r, WorkItemSearchSelect as i } from "../controls/Pickers.js";
4
- import { enumLabel as a } from "../controls/WorkItemControls.js";
3
+ import { enumLabel as r } from "../controls/WorkItemControls.js";
4
+ import { ProjectSelect as i, WorkItemSearchSelect as a } from "../controls/Pickers.js";
5
5
  import { BILLING_TYPES as o, hoursInputToMinutes as s, minutesToHoursInput as c, toDateInputValue as l, todayInputValue as u } from "./timeShared.js";
6
6
  import { useState as d } from "react";
7
7
  import { Clock as f, Pencil as p, Trash2 as m } from "lucide-react";
@@ -88,7 +88,7 @@ function P({ lock: t, refetchQueries: c, onLogged: l, triggerLabel: p = "Log tim
88
88
  children: "Project"
89
89
  }), /* @__PURE__ */ v("div", {
90
90
  className: "mt-1",
91
- children: /* @__PURE__ */ v(r, {
91
+ children: /* @__PURE__ */ v(i, {
92
92
  id: "log-time-project",
93
93
  value: j,
94
94
  onChange: (e) => {
@@ -101,7 +101,7 @@ function P({ lock: t, refetchQueries: c, onLogged: l, triggerLabel: p = "Log tim
101
101
  children: "Work item"
102
102
  }), /* @__PURE__ */ v("div", {
103
103
  className: "mt-1",
104
- children: /* @__PURE__ */ v(i, {
104
+ children: /* @__PURE__ */ v(a, {
105
105
  id: "log-time-work-item",
106
106
  projectId: j || void 0,
107
107
  value: F,
@@ -147,7 +147,7 @@ function P({ lock: t, refetchQueries: c, onLogged: l, triggerLabel: p = "Log tim
147
147
  onChange: (e) => H(e.target.value),
148
148
  children: o.map((e) => /* @__PURE__ */ v("option", {
149
149
  value: e,
150
- children: a(e)
150
+ children: r(e)
151
151
  }, e))
152
152
  })] }),
153
153
  /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
@@ -178,19 +178,19 @@ function P({ lock: t, refetchQueries: c, onLogged: l, triggerLabel: p = "Log tim
178
178
  })]
179
179
  });
180
180
  }
181
- function F({ entry: t, refetchQueries: r }) {
182
- let i = {
181
+ function F({ entry: t, refetchQueries: i }) {
182
+ let a = {
183
183
  description: t.description ?? "",
184
184
  hours: c(t.durationMinutes),
185
185
  date: l(t.date),
186
186
  billingType: t.billingType
187
- }, [u, f] = d(!1), [m, h] = d(i), [_, k] = d(null), [j, { loading: P }] = g(A, {
188
- refetchQueries: r,
187
+ }, [u, f] = d(!1), [m, h] = d(a), [_, k] = d(null), [j, { loading: P }] = g(A, {
188
+ refetchQueries: i,
189
189
  awaitRefetchQueries: !0
190
190
  }), F = s(m.hours), I = !P && F > 0 && !!m.date, L = async () => {
191
191
  k(null);
192
192
  let n = {};
193
- if (m.description.trim() !== i.description.trim() && (n.description = m.description.trim() || null), F !== t.durationMinutes && (n.durationMinutes = F), m.date !== i.date && (n.date = m.date), m.billingType !== i.billingType && (n.billingType = m.billingType), Object.keys(n).length === 0) {
193
+ if (m.description.trim() !== a.description.trim() && (n.description = m.description.trim() || null), F !== t.durationMinutes && (n.durationMinutes = F), m.date !== a.date && (n.date = m.date), m.billingType !== a.billingType && (n.billingType = m.billingType), Object.keys(n).length === 0) {
194
194
  f(!1);
195
195
  return;
196
196
  }
@@ -206,7 +206,7 @@ function F({ entry: t, refetchQueries: r }) {
206
206
  return /* @__PURE__ */ y(S, {
207
207
  open: u,
208
208
  onOpenChange: (e) => {
209
- f(e), e ? h(i) : k(null);
209
+ f(e), e ? h(a) : k(null);
210
210
  },
211
211
  children: [/* @__PURE__ */ v(O, {
212
212
  asChild: !0,
@@ -271,7 +271,7 @@ function F({ entry: t, refetchQueries: r }) {
271
271
  }),
272
272
  children: o.map((e) => /* @__PURE__ */ v("option", {
273
273
  value: e,
274
- children: a(e)
274
+ children: r(e)
275
275
  }, e))
276
276
  })] }),
277
277
  /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-planmagnet",
3
- "version": "2026.930.11",
3
+ "version": "2026.930.13",
4
4
  "description": "Burdenoff PlanMagnet Microfrontend",
5
5
  "type": "module",
6
6
  "files": [