@burdenoff/microfe-planmagnet 2026.930.12 → 2026.930.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +144 -128
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +231 -223
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/activity/activityDescribe.d.ts +38 -0
- package/dist/planmagnet/activity/activityDescribe.d.ts.map +1 -0
- package/dist/planmagnet/activity/activityDescribe.js +123 -0
- package/dist/planmagnet/activity/activityDescribe.js.map +1 -0
- package/dist/planmagnet/activity/relativeTime.d.ts +8 -0
- package/dist/planmagnet/activity/relativeTime.d.ts.map +1 -0
- package/dist/planmagnet/activity/relativeTime.js +38 -0
- package/dist/planmagnet/activity/relativeTime.js.map +1 -0
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +37 -37
- package/dist/planmagnet/automation/AutomationRuleFields.js +41 -41
- package/dist/planmagnet/board/BulkActions.js +6 -6
- package/dist/planmagnet/board/ProjectBoard.js +24 -24
- package/dist/planmagnet/budgets/BudgetControls.js +18 -18
- package/dist/planmagnet/comments/WorkItemActivity.d.ts.map +1 -1
- package/dist/planmagnet/comments/WorkItemActivity.js +35 -38
- package/dist/planmagnet/comments/WorkItemActivity.js.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.js +46 -46
- package/dist/planmagnet/controls/ObjectiveControls.js +11 -11
- package/dist/planmagnet/controls/ProgramControls.js +9 -9
- package/dist/planmagnet/controls/ProjectControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/ProjectControls.js +53 -46
- package/dist/planmagnet/controls/ProjectControls.js.map +1 -1
- package/dist/planmagnet/controls/WorkItemControls.js +27 -27
- package/dist/planmagnet/dependency/DependencyPanel.js +7 -7
- package/dist/planmagnet/pages/ActivityActivityPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ActivityActivityPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ActivityActivityPagePage.js +291 -0
- package/dist/planmagnet/pages/ActivityActivityPagePage.js.map +1 -0
- package/dist/planmagnet/pages/AiPlanPagePage.js +6 -6
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js +370 -221
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/AutomationAutomationRulesPagePage.js +15 -15
- package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.js +9 -9
- package/dist/planmagnet/pages/DashboardDashboardPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js +140 -135
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsEditRoadmapPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +118 -109
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProgramsEditProgramPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js +160 -108
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsBudgetsPagePage.js +10 -10
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +11 -11
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +6 -6
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +13 -13
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsWorkflowPagePage.js +30 -30
- package/dist/planmagnet/pages/RisksRiskDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.js +329 -0
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.js.map +1 -0
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +26 -26
- package/dist/planmagnet/pages/TeamCreateTeamPagePage.js +4 -4
- package/dist/planmagnet/pages/TeamTeamDetailPagePage.js +6 -6
- package/dist/planmagnet/pages/TeamTeamEditPagePage.js +6 -6
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts +14 -2
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js +173 -113
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts +8 -0
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js +211 -0
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js.map +1 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts +8 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.js +177 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.js.map +1 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts +7 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.js +137 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.js.map +1 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.d.ts +42 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.js +47 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.js.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.js +21 -21
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts +29 -0
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +1 -1
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapPresentation.d.ts +37 -0
- package/dist/planmagnet/roadmaps/RoadmapPresentation.d.ts.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapPresentation.js +210 -0
- package/dist/planmagnet/roadmaps/RoadmapPresentation.js.map +1 -0
- package/dist/planmagnet/team/TeamControls.d.ts.map +1 -1
- package/dist/planmagnet/team/TeamControls.js +134 -124
- package/dist/planmagnet/team/TeamControls.js.map +1 -1
- package/dist/planmagnet/time/TimeEntryControls.js +12 -12
- package/package.json +1 -1
|
@@ -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"}
|
|
@@ -2,9 +2,9 @@ import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
|
|
|
2
2
|
import { LEAVES_PAGE_CONTEXT as t, throwOnError as n } from "../utils/mutationResult.js";
|
|
3
3
|
import { ConfirmButton as r, ErrorLine as i } from "../controls/ConfirmButton.js";
|
|
4
4
|
import { enumLabel as a } from "../controls/WorkItemControls.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { detailPath as o } from "../utils/rowNavigation.js";
|
|
6
|
+
import { mutationErrorMessage as s } from "../utils/graphqlErrors.js";
|
|
7
|
+
import { endBeforeStart as c, parseIntField as l } from "../utils/formValidation.js";
|
|
8
8
|
import { useState as u } from "react";
|
|
9
9
|
import { BarChart3 as d, Pencil as f, Plus as p, Trash2 as m } from "lucide-react";
|
|
10
10
|
import { gql as h } from "@apollo/client";
|
|
@@ -66,7 +66,7 @@ var O = [
|
|
|
66
66
|
}
|
|
67
67
|
`, I = (e) => e ? e.slice(0, 10) : "";
|
|
68
68
|
function L({ roadmapId: e, item: t, lanes: r }) {
|
|
69
|
-
let
|
|
69
|
+
let o = {
|
|
70
70
|
title: t?.title ?? "",
|
|
71
71
|
description: t?.description ?? "",
|
|
72
72
|
status: t?.status ?? "PLANNED",
|
|
@@ -77,10 +77,10 @@ function L({ roadmapId: e, item: t, lanes: r }) {
|
|
|
77
77
|
confidence: t?.confidence == null ? "" : String(t.confidence),
|
|
78
78
|
riskLevel: t?.riskLevel ?? "",
|
|
79
79
|
riskNote: t?.riskNote ?? ""
|
|
80
|
-
}, [d, m] = u(!1), [h, P] = u(
|
|
80
|
+
}, [d, m] = u(!1), [h, P] = u(o), [F, L] = u(null), R = {
|
|
81
81
|
refetchQueries: j,
|
|
82
82
|
awaitRefetchQueries: !0
|
|
83
|
-
}, [z, B] = g(M, R), [V, H] = g(N, R), U = B.loading || H.loading, W =
|
|
83
|
+
}, [z, B] = g(M, R), [V, H] = g(N, R), U = B.loading || H.loading, W = c(h.startDate, h.endDate), G = l(h.confidence, {
|
|
84
84
|
min: 0,
|
|
85
85
|
max: 100
|
|
86
86
|
}), K = h.title.trim() !== "" && !W && !G.invalid && !U, q = O.includes(h.status) ? O : [h.status, ...O], J = k.includes(h.horizon) ? k : h.horizon ? [h.horizon, ...k] : k, Y = A.includes(h.riskLevel) ? A : h.riskLevel ? [h.riskLevel, ...A] : A, X = t ? `roadmap-item-${t.id}` : "roadmap-item-new", Z = async () => {
|
|
@@ -94,13 +94,13 @@ function L({ roadmapId: e, item: t, lanes: r }) {
|
|
|
94
94
|
try {
|
|
95
95
|
if (t) {
|
|
96
96
|
let e = {
|
|
97
|
-
...h.startDate !==
|
|
98
|
-
...h.endDate !==
|
|
97
|
+
...h.startDate !== o.startDate && { startDate: h.startDate || null },
|
|
98
|
+
...h.endDate !== o.endDate && { endDate: h.endDate || null }
|
|
99
99
|
}, i = {
|
|
100
|
-
...h.horizon !==
|
|
101
|
-
...h.confidence !==
|
|
102
|
-
...h.riskLevel !==
|
|
103
|
-
...h.riskNote.trim() !==
|
|
100
|
+
...h.horizon !== o.horizon && { horizon: h.horizon || null },
|
|
101
|
+
...h.confidence !== o.confidence && { confidence: G.value ?? null },
|
|
102
|
+
...h.riskLevel !== o.riskLevel && { riskLevel: h.riskLevel || null },
|
|
103
|
+
...h.riskNote.trim() !== o.riskNote.trim() && { riskNote: h.riskNote.trim() || null }
|
|
104
104
|
};
|
|
105
105
|
await n(V({ variables: {
|
|
106
106
|
id: t.id,
|
|
@@ -119,16 +119,16 @@ function L({ roadmapId: e, item: t, lanes: r }) {
|
|
|
119
119
|
confidence: G.value,
|
|
120
120
|
riskLevel: h.riskLevel || void 0,
|
|
121
121
|
riskNote: h.riskNote.trim() || void 0
|
|
122
|
-
} } })), P(
|
|
122
|
+
} } })), P(o);
|
|
123
123
|
m(!1);
|
|
124
124
|
} catch (e) {
|
|
125
|
-
L(
|
|
125
|
+
L(s(e, "The item could not be saved."));
|
|
126
126
|
}
|
|
127
127
|
}, Q = "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm";
|
|
128
128
|
return /* @__PURE__ */ v(x, {
|
|
129
129
|
open: d,
|
|
130
130
|
onOpenChange: (e) => {
|
|
131
|
-
m(e), e ? P(
|
|
131
|
+
m(e), e ? P(o) : L(null);
|
|
132
132
|
},
|
|
133
133
|
children: [/* @__PURE__ */ _(D, {
|
|
134
134
|
asChild: !0,
|
|
@@ -375,14 +375,14 @@ function R({ id: e, title: t }) {
|
|
|
375
375
|
}), s && /* @__PURE__ */ _(i, { message: s })]
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
|
-
function z({ roadmapId: a, name:
|
|
379
|
-
let
|
|
378
|
+
function z({ roadmapId: a, name: s }) {
|
|
379
|
+
let c = e(), [l, p] = g(F, {
|
|
380
380
|
refetchQueries: ["ListRoadmapsPage", "ListRoadmaps"],
|
|
381
381
|
context: t
|
|
382
382
|
}), [h, b] = u(null), x = async () => {
|
|
383
383
|
b(null);
|
|
384
384
|
try {
|
|
385
|
-
await n(l({ variables: { id: a } })),
|
|
385
|
+
await n(l({ variables: { id: a } })), c("/products/roadmaps-page");
|
|
386
386
|
} catch (e) {
|
|
387
387
|
b(e instanceof Error ? e.message : "The roadmap could not be deleted.");
|
|
388
388
|
}
|
|
@@ -396,21 +396,21 @@ function z({ roadmapId: a, name: o }) {
|
|
|
396
396
|
size: "sm",
|
|
397
397
|
variant: "outline",
|
|
398
398
|
"data-testid": "roadmap-edit",
|
|
399
|
-
onClick: () =>
|
|
399
|
+
onClick: () => c(o("/products/edit-roadmap-page", a)),
|
|
400
400
|
children: [/* @__PURE__ */ _(f, { className: "mr-1 h-4 w-4" }), "Edit"]
|
|
401
401
|
}),
|
|
402
402
|
/* @__PURE__ */ v(y, {
|
|
403
403
|
size: "sm",
|
|
404
404
|
variant: "outline",
|
|
405
405
|
"data-testid": "roadmap-analytics",
|
|
406
|
-
onClick: () =>
|
|
406
|
+
onClick: () => c(o("/products/roadmap-analytics-page", a)),
|
|
407
407
|
children: [/* @__PURE__ */ _(d, { className: "mr-1 h-4 w-4" }), "Analytics"]
|
|
408
408
|
}),
|
|
409
409
|
/* @__PURE__ */ _(r, {
|
|
410
410
|
label: "Delete",
|
|
411
411
|
variant: "outline",
|
|
412
412
|
icon: /* @__PURE__ */ _(m, { className: "mr-1 h-4 w-4" }),
|
|
413
|
-
title: `Delete ${
|
|
413
|
+
title: `Delete ${s}?`,
|
|
414
414
|
description: "The roadmap and its items are deleted. This cannot be undone here.",
|
|
415
415
|
confirmLabel: "Delete roadmap",
|
|
416
416
|
destructive: !0,
|
|
@@ -1,4 +1,33 @@
|
|
|
1
|
+
interface NnlItem {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
status: string;
|
|
5
|
+
startDate: string | null;
|
|
6
|
+
endDate: string | null;
|
|
7
|
+
horizon: 'NOW' | 'NEXT' | 'LATER' | null;
|
|
8
|
+
swimlane: string | null;
|
|
9
|
+
sortOrder: number;
|
|
10
|
+
confidence: number | null;
|
|
11
|
+
riskLevel: 'LOW' | 'MEDIUM' | 'HIGH' | null;
|
|
12
|
+
riskNote: string | null;
|
|
13
|
+
featureRequestDemand: {
|
|
14
|
+
requests: number;
|
|
15
|
+
votes: number;
|
|
16
|
+
} | null;
|
|
17
|
+
}
|
|
18
|
+
/** Icon + text label (never colour alone) for a risk level; the note (if any) shows on hover/focus via a
|
|
19
|
+
* tooltip, which is keyboard-reachable because the trigger is a real, focusable button. Exported for
|
|
20
|
+
* `roadmaps/RoadmapPresentation.tsx` (PRM-11), which reuses this exact chip rather than re-deriving risk styling. */
|
|
21
|
+
export declare function RiskIndicator({ level, note, }: {
|
|
22
|
+
level: NnlItem['riskLevel'];
|
|
23
|
+
note: string | null;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
/** Exported for `roadmaps/RoadmapPresentation.tsx` (PRM-11) — see `RiskIndicator` above. */
|
|
26
|
+
export declare function ConfidenceBadge({ confidence }: {
|
|
27
|
+
confidence: number | null;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
1
29
|
export declare function RoadmapNowNextLater({ roadmapId }: {
|
|
2
30
|
roadmapId: string;
|
|
3
31
|
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export {};
|
|
4
33
|
//# sourceMappingURL=RoadmapNowNextLater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoadmapNowNextLater.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/roadmaps/RoadmapNowNextLater.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RoadmapNowNextLater.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/roadmaps/RoadmapNowNextLater.tsx"],"names":[],"mappings":"AAmFA,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,oBAAoB,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAClE;AAqGD;;qHAEqH;AACrH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,GACL,EAAE;IACD,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,kDA4BA;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,kDAW5E;AAuJD,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CAkXvE"}
|
|
@@ -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 // 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,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,EAA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,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
|
+
{"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. Exported for\n * `roadmaps/RoadmapPresentation.tsx` (PRM-11), which reuses this exact chip rather than re-deriving risk styling. */\nexport function RiskIndicator({\n level,\n note,\n}: {\n level: NnlItem['riskLevel'];\n note: string | null;\n}) {\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\n/** Exported for `roadmaps/RoadmapPresentation.tsx` (PRM-11) — see `RiskIndicator` above. */\nexport function 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,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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AAS,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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Roadmap presentation mode (PRM-11): a full-screen, read-only walk-through of a roadmap, opened from its detail
|
|
3
|
+
* page. Deliberately takes the SAME items the detail page already loaded (`ProductsRoadmapDetailPagePage`'s
|
|
4
|
+
* `GET_ROADMAP` query) rather than firing one of its own — those items already carry `horizon`/`confidence`/
|
|
5
|
+
* `riskLevel`/`riskNote`/dates, and `RoadmapNowNextLater`'s own move mutation refetches that same query, so it
|
|
6
|
+
* never goes stale relative to the Now/Next/Later board.
|
|
7
|
+
*
|
|
8
|
+
* Grouping follows the detail page's OWN view toggle, not a fixed choice: Now/Next/Later when that view is
|
|
9
|
+
* active, one slide per calendar quarter (by `startDate`, falling back to `endDate`) when the Timeline view is
|
|
10
|
+
* active — matching "one slide per horizon … or per timeline quarter" from the ticket. An item that fits neither
|
|
11
|
+
* bucket (no horizon in nnl mode, no date in timeline mode) still gets its own slide rather than being silently
|
|
12
|
+
* left out.
|
|
13
|
+
*
|
|
14
|
+
* Built on `ResponsiveDialog*` (centred full-screen dialog on desktop, a bottom sheet below `md` — the design
|
|
15
|
+
* system's own convention, `no-restricted-imports` refuses the plain `Dialog*` primitives). Focus trap, initial
|
|
16
|
+
* focus, Escape-to-close and focus restored to the "Present" button on exit are Radix Dialog's own default
|
|
17
|
+
* behaviour either way — nothing here re-implements them. Only the left/right slide navigation is this
|
|
18
|
+
* component's own.
|
|
19
|
+
*/
|
|
20
|
+
export interface RoadmapPresentationItem {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
status: string;
|
|
24
|
+
startDate: string | null;
|
|
25
|
+
endDate: string | null;
|
|
26
|
+
horizon: 'NOW' | 'NEXT' | 'LATER' | null;
|
|
27
|
+
confidence: number | null;
|
|
28
|
+
riskLevel: 'LOW' | 'MEDIUM' | 'HIGH' | null;
|
|
29
|
+
riskNote: string | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function RoadmapPresentation({ roadmapName, roadmapDescription, view, items, }: {
|
|
32
|
+
roadmapName: string;
|
|
33
|
+
roadmapDescription: string | null;
|
|
34
|
+
view: 'timeline' | 'nnl';
|
|
35
|
+
items: RoadmapPresentationItem[];
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=RoadmapPresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoadmapPresentation.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/roadmaps/RoadmapPresentation.tsx"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACzC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAuFD,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,kBAAkB,EAClB,IAAI,EACJ,KAAK,GACN,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,IAAI,EAAE,UAAU,GAAG,KAAK,CAAC;IACzB,KAAK,EAAE,uBAAuB,EAAE,CAAC;CAClC,2CAgHA"}
|