@burdenoff/microfe-planmagnet 2026.930.8 → 2026.930.10

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 (39) hide show
  1. package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
  2. package/dist/planmagnet/PlanMagnetRoot.js +126 -120
  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 +83 -75
  6. package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
  7. package/dist/planmagnet/dependency/DependencyGraph.d.ts +43 -0
  8. package/dist/planmagnet/dependency/DependencyGraph.d.ts.map +1 -0
  9. package/dist/planmagnet/dependency/DependencyGraph.js +225 -0
  10. package/dist/planmagnet/dependency/DependencyGraph.js.map +1 -0
  11. package/dist/planmagnet/dependency/DependencyPanel.d.ts.map +1 -1
  12. package/dist/planmagnet/dependency/DependencyPanel.js +136 -90
  13. package/dist/planmagnet/dependency/DependencyPanel.js.map +1 -1
  14. package/dist/planmagnet/dependency/GanttChart.d.ts +40 -0
  15. package/dist/planmagnet/dependency/GanttChart.d.ts.map +1 -0
  16. package/dist/planmagnet/dependency/GanttChart.js +326 -0
  17. package/dist/planmagnet/dependency/GanttChart.js.map +1 -0
  18. package/dist/planmagnet/dependency/useProjectWorkItemsGraph.d.ts +40 -0
  19. package/dist/planmagnet/dependency/useProjectWorkItemsGraph.d.ts.map +1 -0
  20. package/dist/planmagnet/dependency/useProjectWorkItemsGraph.js +106 -0
  21. package/dist/planmagnet/dependency/useProjectWorkItemsGraph.js.map +1 -0
  22. package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.d.ts.map +1 -1
  23. package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js +169 -100
  24. package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js.map +1 -1
  25. package/dist/planmagnet/pages/ProjectsGanttPagePage.d.ts +2 -0
  26. package/dist/planmagnet/pages/ProjectsGanttPagePage.d.ts.map +1 -0
  27. package/dist/planmagnet/pages/ProjectsGanttPagePage.js +143 -0
  28. package/dist/planmagnet/pages/ProjectsGanttPagePage.js.map +1 -0
  29. package/dist/planmagnet/pages/TasksTasksPagePage.d.ts.map +1 -1
  30. package/dist/planmagnet/pages/TasksTasksPagePage.js +63 -48
  31. package/dist/planmagnet/pages/TasksTasksPagePage.js.map +1 -1
  32. package/dist/planmagnet/utils/rowNavigation.d.ts +7 -2
  33. package/dist/planmagnet/utils/rowNavigation.d.ts.map +1 -1
  34. package/dist/planmagnet/utils/rowNavigation.js.map +1 -1
  35. package/dist/planmagnet/utils/statusColor.d.ts +26 -0
  36. package/dist/planmagnet/utils/statusColor.d.ts.map +1 -0
  37. package/dist/planmagnet/utils/statusColor.js +51 -0
  38. package/dist/planmagnet/utils/statusColor.js.map +1 -0
  39. package/package.json +1 -1
@@ -0,0 +1,143 @@
1
+ import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
2
+ import { ProjectSelect as n } from "../controls/Pickers.js";
3
+ import { useEntityId as r } from "../hooks/useEntityId.js";
4
+ import { criticalEdgeIdsFromPath as i, useProjectWorkItemsGraph as a } from "../dependency/useProjectWorkItemsGraph.js";
5
+ import { GanttChart as o } from "../dependency/GanttChart.js";
6
+ import { useState as s } from "react";
7
+ import { SquareGanttChart as c } from "lucide-react";
8
+ import { gql as l } from "@apollo/client";
9
+ import { useQuery as u } from "@apollo/client/react";
10
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
+ import { Card as p, CardContent as m } from "@burdenoff/fe-libs/ui";
12
+ //#region src/planmagnet/pages/ProjectsGanttPagePage.tsx
13
+ var h = l`
14
+ query GetGanttProject($id: ID!) {
15
+ planmagnetProject(id: $id) {
16
+ id
17
+ name
18
+ }
19
+ }
20
+ `, g = l`
21
+ query GetGanttCriticalPath($workspaceId: ID!, $projectId: ID) {
22
+ planmagnetCriticalPath(workspaceId: $workspaceId, projectId: $projectId) {
23
+ path {
24
+ id
25
+ }
26
+ }
27
+ }
28
+ `;
29
+ function _() {
30
+ let l = r(), { workspaceId: _ } = e(), v = t(), [y, b] = s(""), [x, S] = s("week"), { data: C } = u(h, {
31
+ variables: { id: l },
32
+ skip: !l
33
+ }), { data: w } = u(g, {
34
+ variables: {
35
+ workspaceId: _ ?? "",
36
+ projectId: l
37
+ },
38
+ skip: !_ || !l
39
+ }), { items: T, totalCount: E, loading: D, error: O, moreError: k, truncated: A } = a(l);
40
+ if (!l) return /* @__PURE__ */ f("div", {
41
+ className: "space-y-6 p-6",
42
+ "data-testid": "gantt-page",
43
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h1", {
44
+ className: "text-2xl font-semibold flex items-center gap-2",
45
+ children: [/* @__PURE__ */ d(c, { className: "h-5 w-5 text-primary" }), "Gantt"]
46
+ }), /* @__PURE__ */ d("p", {
47
+ className: "text-sm text-muted-foreground",
48
+ children: "Choose a project to see its timeline."
49
+ })] }), /* @__PURE__ */ d(p, { children: /* @__PURE__ */ f(m, {
50
+ className: "pt-6 space-y-3",
51
+ children: [
52
+ /* @__PURE__ */ d("label", {
53
+ htmlFor: "gantt-project",
54
+ className: "text-sm font-medium",
55
+ children: "Project"
56
+ }),
57
+ /* @__PURE__ */ d(n, {
58
+ id: "gantt-project",
59
+ value: y,
60
+ onChange: b,
61
+ noneLabel: "Choose a project…"
62
+ }),
63
+ /* @__PURE__ */ d("button", {
64
+ type: "button",
65
+ className: "text-sm text-primary hover:underline disabled:pointer-events-none disabled:opacity-50",
66
+ disabled: !y,
67
+ onClick: () => v(`/projects/gantt-page/${encodeURIComponent(y)}`),
68
+ children: "View timeline →"
69
+ })
70
+ ]
71
+ }) })]
72
+ });
73
+ if (D && T.length === 0 && !O) return /* @__PURE__ */ d("div", {
74
+ className: "flex items-center justify-center p-12",
75
+ "data-testid": "gantt-page",
76
+ children: /* @__PURE__ */ d("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
77
+ });
78
+ if (O) return /* @__PURE__ */ f("div", {
79
+ className: "p-6 text-red-500",
80
+ "data-testid": "gantt-page",
81
+ children: ["Error loading the project's work items: ", O.message]
82
+ });
83
+ let j = C?.planmagnetProject?.name, M = new Set((w?.planmagnetCriticalPath.path ?? []).map((e) => e.id)), N = i(w?.planmagnetCriticalPath.path ?? [], T);
84
+ return /* @__PURE__ */ f("div", {
85
+ className: "space-y-6 p-6",
86
+ "data-testid": "gantt-page",
87
+ children: [
88
+ /* @__PURE__ */ f("div", {
89
+ className: "flex flex-wrap items-center justify-between gap-3",
90
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h1", {
91
+ className: "text-2xl font-semibold flex items-center gap-2",
92
+ children: [/* @__PURE__ */ d(c, { className: "h-5 w-5 text-primary" }), "Gantt"]
93
+ }), /* @__PURE__ */ f("p", {
94
+ className: "text-sm text-muted-foreground",
95
+ children: [
96
+ j ?? "This project",
97
+ " — ",
98
+ E,
99
+ " work item",
100
+ E === 1 ? "" : "s",
101
+ ". Bars are derived from each item's due date and estimate (there is no separate start date field yet); an item with only a due date shows as a milestone."
102
+ ]
103
+ })] }), /* @__PURE__ */ d("div", {
104
+ className: "flex gap-1",
105
+ "data-testid": "gantt-zoom",
106
+ children: ["week", "month"].map((e) => /* @__PURE__ */ d("button", {
107
+ type: "button",
108
+ "aria-pressed": x === e,
109
+ className: `px-3 py-1.5 text-xs rounded-md capitalize ${x === e ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted"}`,
110
+ onClick: () => S(e),
111
+ children: e
112
+ }, e))
113
+ })]
114
+ }),
115
+ k && /* @__PURE__ */ f("p", {
116
+ role: "alert",
117
+ className: "text-sm text-destructive",
118
+ children: ["Some work items could not be loaded, so this timeline may be incomplete: ", k]
119
+ }),
120
+ A && /* @__PURE__ */ f("p", {
121
+ className: "text-sm text-muted-foreground",
122
+ children: [
123
+ "This project has more than ",
124
+ T.length,
125
+ " work items — only the first ",
126
+ T.length,
127
+ " are shown."
128
+ ]
129
+ }),
130
+ /* @__PURE__ */ d(o, {
131
+ items: T,
132
+ criticalIds: M,
133
+ criticalEdgeIds: N,
134
+ zoom: x,
135
+ onActivateRow: (e) => v(`/tasks/task-detail-page?taskId=${encodeURIComponent(e)}`)
136
+ })
137
+ ]
138
+ });
139
+ }
140
+ //#endregion
141
+ export { _ as ProjectsGanttPagePage };
142
+
143
+ //# sourceMappingURL=ProjectsGanttPagePage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectsGanttPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProjectsGanttPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent } from '@burdenoff/fe-libs/ui';\nimport { SquareGanttChart } from 'lucide-react';\nimport { useEntityId } from '../hooks/useEntityId';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { ProjectSelect } from '../controls/Pickers';\nimport { GanttChart } from '../dependency/GanttChart';\nimport {\n criticalEdgeIdsFromPath,\n useProjectWorkItemsGraph,\n} from '../dependency/useProjectWorkItemsGraph';\n\n/**\n * Gantt timeline for a project's work items (ANR-24). See dependency/GanttChart.tsx for the render (including\n * the note on why bar starts are DERIVED — WorkItem has no persisted start date today) and\n * dependency/useProjectWorkItemsGraph.ts for the full, paged item+dependency fetch this and the critical-path\n * page's \"Graph\" view (PDM-27) share.\n */\n\nconst GET_GANTT_PROJECT = gql`\n query GetGanttProject($id: ID!) {\n planmagnetProject(id: $id) {\n id\n name\n }\n }\n`;\n\nconst GET_GANTT_CRITICAL_PATH = gql`\n query GetGanttCriticalPath($workspaceId: ID!, $projectId: ID) {\n planmagnetCriticalPath(workspaceId: $workspaceId, projectId: $projectId) {\n path {\n id\n }\n }\n }\n`;\n\ntype Zoom = 'week' | 'month';\n\nexport function ProjectsGanttPagePage() {\n const projectId = useEntityId();\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [pickerProjectId, setPickerProjectId] = useState('');\n const [zoom, setZoom] = useState<Zoom>('week');\n\n const { data: projectData } = useQuery<{\n planmagnetProject: { id: string; name: string } | null;\n }>(GET_GANTT_PROJECT, { variables: { id: projectId }, skip: !projectId });\n\n const { data: cpData } = useQuery<{\n planmagnetCriticalPath: { path: { id: string }[] };\n }>(GET_GANTT_CRITICAL_PATH, {\n variables: { workspaceId: workspaceId ?? '', projectId },\n skip: !workspaceId || !projectId,\n });\n\n const { items, totalCount, loading, error, moreError, truncated } =\n useProjectWorkItemsGraph(projectId);\n\n if (!projectId) {\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"gantt-page\">\n <div>\n <h1 className=\"text-2xl font-semibold flex items-center gap-2\">\n <SquareGanttChart className=\"h-5 w-5 text-primary\" />\n Gantt\n </h1>\n <p className=\"text-sm text-muted-foreground\">Choose a project to see its timeline.</p>\n </div>\n <Card>\n <CardContent className=\"pt-6 space-y-3\">\n <label htmlFor=\"gantt-project\" className=\"text-sm font-medium\">\n Project\n </label>\n <ProjectSelect\n id=\"gantt-project\"\n value={pickerProjectId}\n onChange={setPickerProjectId}\n noneLabel=\"Choose a project…\"\n />\n <button\n type=\"button\"\n className=\"text-sm text-primary hover:underline disabled:pointer-events-none disabled:opacity-50\"\n disabled={!pickerProjectId}\n onClick={() =>\n navigate(`/projects/gantt-page/${encodeURIComponent(pickerProjectId)}`)\n }\n >\n View timeline →\n </button>\n </CardContent>\n </Card>\n </div>\n );\n }\n\n // Only before the first load: a refetch must not blank the page.\n if (loading && items.length === 0 && !error) {\n return (\n <div className=\"flex items-center justify-center p-12\" data-testid=\"gantt-page\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n if (error) {\n return (\n <div className=\"p-6 text-red-500\" data-testid=\"gantt-page\">\n Error loading the project&apos;s work items: {error.message}\n </div>\n );\n }\n\n const projectName = projectData?.planmagnetProject?.name;\n const criticalIds = new Set((cpData?.planmagnetCriticalPath.path ?? []).map((n) => n.id));\n const criticalEdgeIds = criticalEdgeIdsFromPath(cpData?.planmagnetCriticalPath.path ?? [], items);\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"gantt-page\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold flex items-center gap-2\">\n <SquareGanttChart className=\"h-5 w-5 text-primary\" />\n Gantt\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {projectName ?? 'This project'} — {totalCount} work item{totalCount === 1 ? '' : 's'}.\n Bars are derived from each item&apos;s due date and estimate (there is no separate start\n date field yet); an item with only a due date shows as a milestone.\n </p>\n </div>\n <div className=\"flex gap-1\" data-testid=\"gantt-zoom\">\n {(['week', 'month'] as const).map((z) => (\n <button\n key={z}\n type=\"button\"\n aria-pressed={zoom === z}\n className={`px-3 py-1.5 text-xs rounded-md capitalize ${zoom === z ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted'}`}\n onClick={() => setZoom(z)}\n >\n {z}\n </button>\n ))}\n </div>\n </div>\n\n {moreError && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n Some work items could not be loaded, so this timeline may be incomplete: {moreError}\n </p>\n )}\n {truncated && (\n <p className=\"text-sm text-muted-foreground\">\n This project has more than {items.length} work items — only the first {items.length} are\n shown.\n </p>\n )}\n\n <GanttChart\n items={items}\n criticalIds={criticalIds}\n criticalEdgeIds={criticalEdgeIds}\n zoom={zoom}\n onActivateRow={(id) => navigate(`/tasks/task-detail-page?taskId=${encodeURIComponent(id)}`)}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,IAAM,IAAoB,CAAG;;;;;;;GASvB,IAA0B,CAAG;;;;;;;;;AAYnC,SAAgB,IAAwB;CACtC,IAAM,IAAY,GAAa,EACzB,EAAE,mBAAgB,GAAe,EACjC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IV,IAAM,IAAc,GAAa,mBAAmB,MAC9C,IAAc,IAAI,KAAK,GAAQ,uBAAuB,QAAQ,EAAE,EAAE,KAAK,MAAM,EAAE,GAAG,CAAC,EACnF,IAAkB,EAAwB,GAAQ,uBAAuB,QAAQ,EAAE,EAAE,EAAM;AAEjG,QACE,kBAAC,OAAD;EAAK,WAAU;EAAgB,eAAY;YAA3C;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eAAd,CACE,kBAAC,GAAD,EAAkB,WAAU,wBAAyB,CAAA,EAAA,QAElD;QACL,kBAAC,KAAD;KAAG,WAAU;eAAb;MACG,KAAe;MAAe;MAAI;MAAW;MAAW,MAAe,IAAI,KAAK;MAAI;MAGnF;OACA,EAAA,CAAA,EACN,kBAAC,OAAD;KAAK,WAAU;KAAa,eAAY;eACpC,CAAC,QAAQ,QAAQ,CAAW,KAAK,MACjC,kBAAC,UAAD;MAEE,MAAK;MACL,gBAAc,MAAS;MACvB,WAAW,6CAA6C,MAAS,IAAI,uCAAuC;MAC5G,eAAe,EAAQ,EAAE;gBAExB;MACM,EAPF,EAOE,CACT;KACE,CAAA,CACF;;GAEL,KACC,kBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;cAA1B,CAAqD,6EACuB,EACxE;;GAEL,KACC,kBAAC,KAAD;IAAG,WAAU;cAAb;KAA6C;KACf,EAAM;KAAO;KAA8B,EAAM;KAAO;KAElF;;GAGN,kBAAC,GAAD;IACS;IACM;IACI;IACX;IACN,gBAAgB,MAAO,EAAS,kCAAkC,mBAAmB,EAAG,GAAG;IAC3F,CAAA;GACE"}
@@ -1 +1 @@
1
- {"version":3,"file":"TasksTasksPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/TasksTasksPagePage.tsx"],"names":[],"mappings":"AA0IA,wBAAgB,kBAAkB,4CA6QjC"}
1
+ {"version":3,"file":"TasksTasksPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/TasksTasksPagePage.tsx"],"names":[],"mappings":"AAoJA,wBAAgB,kBAAkB,4CAgSjC"}
@@ -2,8 +2,9 @@ import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/Pla
2
2
  import { PersonName as n } from "../people/People.js";
3
3
  import { countLabel as r } from "../hooks/useCounts.js";
4
4
  import { rowLinkProps as i } from "../utils/rowNavigation.js";
5
- import { ProjectBoard as a } from "../board/ProjectBoard.js";
6
- import { ExportWorkItemsButton as o } from "../export/ExportWorkItemsButton.js";
5
+ import { readViewIdFromUrl as a } from "../board/boardViewConfig.js";
6
+ import { ProjectBoard as o } from "../board/ProjectBoard.js";
7
+ import { ExportWorkItemsButton as ee } from "../export/ExportWorkItemsButton.js";
7
8
  import { useState as s } from "react";
8
9
  import { Bot as c, FileUp as l, Filter as u } from "lucide-react";
9
10
  import { gql as d } from "@apollo/client";
@@ -85,44 +86,54 @@ var y = d`
85
86
  TESTING: "border-t-teal-400",
86
87
  DONE: "border-t-green-400",
87
88
  CANCELLED: "border-t-muted-foreground"
88
- }, E = {
89
+ }, te = {
89
90
  LOW: "bg-gray-100 text-gray-700",
90
91
  MEDIUM: "bg-blue-100 text-blue-700",
91
92
  HIGH: "bg-orange-100 text-orange-700",
92
93
  CRITICAL: "bg-red-100 text-red-700"
93
- }, D = {
94
+ }, ne = {
94
95
  STORY: "bg-green-100 text-green-700",
95
96
  BUG: "bg-red-100 text-red-700",
96
97
  TASK: "bg-blue-100 text-blue-700",
97
98
  EPIC: "bg-purple-100 text-purple-700",
98
99
  SUB_TASK: "bg-gray-100 text-gray-700"
99
- };
100
- function O() {
101
- let { workspaceId: d } = e(), O = t(), [k, A] = s("all"), [j, M] = s("all"), [N, P] = s(null), { data: F } = f(S, {
100
+ }, E = d`
101
+ query TasksLinkedBoardView($id: ID!) {
102
+ planmagnetBoardView(id: $id) {
103
+ id
104
+ projectId
105
+ }
106
+ }
107
+ `;
108
+ function D() {
109
+ let { workspaceId: d } = e(), D = t(), [O, k] = s("all"), [A, j] = s("all"), [M, N] = s(null), { data: P } = f(S, {
102
110
  variables: { workspaceId: d },
103
111
  skip: !d
104
- }), I = F?.planmagnetProjects?.items ?? [], L = N ?? I[0]?.id ?? "", R = I.find((e) => e.id === L)?.name ?? "", z = {
105
- ...k !== "all" && { priority: k.toUpperCase() },
106
- ...j !== "all" && { type: j.toUpperCase() }
107
- }, [B, V] = s(!1), { data: H, loading: U, error: W, fetchMore: G } = f(y, {
112
+ }), F = P?.planmagnetProjects?.items ?? [], [I] = s(a), { data: L, error: R } = f(E, {
113
+ variables: { id: I ?? "" },
114
+ skip: !I || M !== null
115
+ }), z = L?.planmagnetBoardView?.projectId ?? null, B = !!I && M === null && !L && !R, V = M ?? z ?? (B ? "" : F[0]?.id ?? ""), H = F.find((e) => e.id === V)?.name ?? "", U = {
116
+ ...O !== "all" && { priority: O.toUpperCase() },
117
+ ...A !== "all" && { type: A.toUpperCase() }
118
+ }, [W, G] = s(!1), { data: K, loading: q, error: J, fetchMore: Y } = f(y, {
108
119
  variables: {
109
120
  workspaceId: d,
110
- filter: z,
121
+ filter: U,
111
122
  pagination: { first: x }
112
123
  },
113
- skip: !d || !!L
114
- }), { data: K } = f(b, {
124
+ skip: !d || !!V || B
125
+ }), { data: X } = f(b, {
115
126
  variables: {
116
127
  workspaceId: d,
117
- filter: L ? { projectId: L } : z
128
+ filter: V ? { projectId: V } : U
118
129
  },
119
130
  skip: !d
120
- }), q = async () => {
121
- let e = H?.planmagnetWorkItems?.pageInfo?.endCursor;
131
+ }), re = async () => {
132
+ let e = K?.planmagnetWorkItems?.pageInfo?.endCursor;
122
133
  if (e) {
123
- V(!0);
134
+ G(!0);
124
135
  try {
125
- await G({
136
+ await Y({
126
137
  variables: { pagination: {
127
138
  first: x,
128
139
  after: e
@@ -133,19 +144,19 @@ function O() {
133
144
  } })
134
145
  });
135
146
  } finally {
136
- V(!1);
147
+ G(!1);
137
148
  }
138
149
  }
139
150
  };
140
- if (U && !H) return /* @__PURE__ */ m("div", {
151
+ if (q && !K) return /* @__PURE__ */ m("div", {
141
152
  className: "flex items-center justify-center p-12",
142
153
  children: /* @__PURE__ */ m("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
143
154
  });
144
- if (W) return /* @__PURE__ */ h("div", {
155
+ if (J) return /* @__PURE__ */ h("div", {
145
156
  className: "p-6 text-red-500",
146
- children: ["Error: ", W.message]
157
+ children: ["Error: ", J.message]
147
158
  });
148
- let J = H?.planmagnetWorkItems?.items ?? [], Y = K?.planmagnetWorkItemCounts, X = Y?.total ?? (L ? void 0 : H?.planmagnetWorkItems?.totalCount), Z = (e) => Y ? Y.byStatus.find((t) => t.status === e)?.count ?? 0 : void 0, Q = H?.planmagnetWorkItems?.pageInfo?.hasNextPage ?? !1;
159
+ let Z = K?.planmagnetWorkItems?.items ?? [], Q = X?.planmagnetWorkItemCounts, $ = Q?.total ?? (V ? void 0 : K?.planmagnetWorkItems?.totalCount), ie = (e) => Q ? Q.byStatus.find((t) => t.status === e)?.count ?? 0 : void 0, ae = K?.planmagnetWorkItems?.pageInfo?.hasNextPage ?? !1;
149
160
  return /* @__PURE__ */ h("div", {
150
161
  className: "space-y-4 p-6",
151
162
  children: [/* @__PURE__ */ m("div", {
@@ -163,9 +174,9 @@ function O() {
163
174
  /* @__PURE__ */ h("select", {
164
175
  id: "task-board-project",
165
176
  className: "mt-2 rounded-md border border-input bg-background px-2 py-1 text-sm",
166
- value: L,
167
- onChange: (e) => P(e.target.value),
168
- children: [I.map((e) => /* @__PURE__ */ m("option", {
177
+ value: V,
178
+ onChange: (e) => N(e.target.value),
179
+ children: [F.map((e) => /* @__PURE__ */ m("option", {
169
180
  value: e.id,
170
181
  children: e.name
171
182
  }, e.id)), /* @__PURE__ */ m("option", {
@@ -176,19 +187,19 @@ function O() {
176
187
  /* @__PURE__ */ h("div", {
177
188
  className: "mt-2 flex flex-wrap gap-2",
178
189
  children: [
179
- /* @__PURE__ */ m(o, { projectId: L || void 0 }),
190
+ /* @__PURE__ */ m(ee, { projectId: V || void 0 }),
180
191
  /* @__PURE__ */ h(g, {
181
192
  size: "sm",
182
193
  variant: "outline",
183
194
  "data-testid": "import-linear",
184
- onClick: () => O("/tasks/import-page"),
195
+ onClick: () => D("/tasks/import-page"),
185
196
  children: [/* @__PURE__ */ m(l, { className: "mr-1 h-4 w-4" }), "Import from Linear"]
186
197
  }),
187
198
  /* @__PURE__ */ h(g, {
188
199
  size: "sm",
189
200
  variant: "outline",
190
201
  "data-testid": "task-board-automation",
191
- onClick: () => O("/automation/automation-rules-page"),
202
+ onClick: () => D("/automation/automation-rules-page"),
192
203
  children: [/* @__PURE__ */ m(c, { className: "mr-1 h-4 w-4" }), "Automation rules"]
193
204
  })
194
205
  ]
@@ -196,12 +207,16 @@ function O() {
196
207
  /* @__PURE__ */ m("p", {
197
208
  className: "text-sm text-muted-foreground",
198
209
  "data-testid": "task-board-total",
199
- children: X === void 0 ? "Counting tasks…" : L ? `${X} ${X === 1 ? "task" : "tasks"} in ${R}` : `${X} tasks across all projects${J.length < X ? ` · showing ${J.length}` : ""}`
210
+ children: $ === void 0 ? "Counting tasks…" : V ? `${$} ${$ === 1 ? "task" : "tasks"} in ${H}` : `${$} tasks across all projects${Z.length < $ ? ` · showing ${Z.length}` : ""}`
200
211
  })
201
212
  ] })
202
- }), L ? /* @__PURE__ */ m(a, {
203
- projectId: L,
204
- projectName: R
213
+ }), B ? /* @__PURE__ */ m("p", {
214
+ className: "text-sm text-muted-foreground",
215
+ "data-testid": "task-board-opening-view",
216
+ children: "Opening the shared view…"
217
+ }) : V ? /* @__PURE__ */ m(o, {
218
+ projectId: V,
219
+ projectName: H
205
220
  }) : /* @__PURE__ */ h(p, { children: [
206
221
  /* @__PURE__ */ h("div", {
207
222
  className: "flex gap-4 items-center flex-wrap",
@@ -217,8 +232,8 @@ function O() {
217
232
  "high",
218
233
  "critical"
219
234
  ].map((e) => /* @__PURE__ */ m("button", {
220
- onClick: () => A(e),
221
- className: `px-2 py-1 text-xs rounded capitalize ${k === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`,
235
+ onClick: () => k(e),
236
+ className: `px-2 py-1 text-xs rounded capitalize ${O === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`,
222
237
  children: e
223
238
  }, e))
224
239
  }),
@@ -232,8 +247,8 @@ function O() {
232
247
  "epic",
233
248
  "sub_task"
234
249
  ].map((e) => /* @__PURE__ */ m("button", {
235
- onClick: () => M(e),
236
- className: `px-2 py-1 text-xs rounded capitalize ${j === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`,
250
+ onClick: () => j(e),
251
+ className: `px-2 py-1 text-xs rounded capitalize ${A === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`,
237
252
  children: e === "sub_task" ? "sub-task" : e
238
253
  }, e))
239
254
  })
@@ -242,7 +257,7 @@ function O() {
242
257
  /* @__PURE__ */ m("div", {
243
258
  className: "grid grid-cols-7 gap-3 overflow-x-auto",
244
259
  children: C.map((e) => {
245
- let t = J.filter((t) => t.status === e);
260
+ let t = Z.filter((t) => t.status === e);
246
261
  return /* @__PURE__ */ h("div", {
247
262
  className: "min-w-[200px]",
248
263
  children: [/* @__PURE__ */ m("div", {
@@ -255,13 +270,13 @@ function O() {
255
270
  }), /* @__PURE__ */ m("span", {
256
271
  className: "text-xs bg-muted rounded-full px-1.5",
257
272
  "data-testid": `task-col-count-${e}`,
258
- children: r(Z(e))
273
+ children: r(ie(e))
259
274
  })]
260
275
  })
261
276
  }), /* @__PURE__ */ m("div", {
262
277
  className: "space-y-2 mt-2",
263
278
  children: t.map((e) => /* @__PURE__ */ m(_, {
264
- ...i(() => O(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`), e.title),
279
+ ...i(() => D(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`), e.title),
265
280
  children: /* @__PURE__ */ h(v, {
266
281
  className: "p-3 space-y-2",
267
282
  children: [
@@ -276,10 +291,10 @@ function O() {
276
291
  /* @__PURE__ */ h("div", {
277
292
  className: "flex gap-1 flex-wrap",
278
293
  children: [/* @__PURE__ */ m("span", {
279
- className: `text-[10px] px-1.5 py-0.5 rounded-full capitalize ${E[e.priority] ?? ""}`,
294
+ className: `text-[10px] px-1.5 py-0.5 rounded-full capitalize ${te[e.priority] ?? ""}`,
280
295
  children: e.priority.toLowerCase()
281
296
  }), /* @__PURE__ */ m("span", {
282
- className: `text-[10px] px-1.5 py-0.5 rounded-full capitalize ${D[e.type] ?? ""}`,
297
+ className: `text-[10px] px-1.5 py-0.5 rounded-full capitalize ${ne[e.type] ?? ""}`,
283
298
  children: e.type.toLowerCase()
284
299
  })]
285
300
  }),
@@ -310,21 +325,21 @@ function O() {
310
325
  }, e);
311
326
  })
312
327
  }),
313
- Q && /* @__PURE__ */ m("div", {
328
+ ae && /* @__PURE__ */ m("div", {
314
329
  className: "flex justify-center",
315
330
  children: /* @__PURE__ */ m("button", {
316
331
  type: "button",
317
- onClick: q,
318
- disabled: B,
332
+ onClick: re,
333
+ disabled: W,
319
334
  className: "px-3 py-1.5 text-sm rounded-md bg-muted text-foreground hover:bg-muted/80 disabled:opacity-50",
320
335
  "data-testid": "task-board-load-more",
321
- children: B ? "Loading…" : `Load more (${J.length} of ${X})`
336
+ children: W ? "Loading…" : `Load more (${Z.length} of ${$})`
322
337
  })
323
338
  })
324
339
  ] })]
325
340
  });
326
341
  }
327
342
  //#endregion
328
- export { O as TasksTasksPagePage };
343
+ export { D as TasksTasksPagePage };
329
344
 
330
345
  //# sourceMappingURL=TasksTasksPagePage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TasksTasksPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/TasksTasksPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Button, Card, CardContent } from '@burdenoff/fe-libs/ui';\nimport { Bot, FileUp, Filter } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { countLabel } from '../hooks/useCounts';\nimport { rowLinkProps } from '../utils/rowNavigation';\nimport { PersonName } from '../people/People';\nimport { ProjectBoard } from '../board/ProjectBoard';\nimport { ExportWorkItemsButton } from '../export/ExportWorkItemsButton';\n\nconst GET_WORK_ITEMS = gql`\n query GetWorkItems(\n $workspaceId: ID!\n $filter: PlanmagnetWorkItemFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetWorkItems(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n id\n title\n type\n status\n priority\n key\n assigneeId\n reporterId\n sprintId\n storyPoints\n estimateMinutes\n dueDate\n labels\n tags\n createdAt\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n }\n }\n`;\n\n// Server-side counts (QA H2): the list returns at most 100 rows per page, so\n// counting the loaded page undercounted every workspace past 100 items.\nconst GET_WORK_ITEM_COUNTS = gql`\n query GetWorkItemCounts($workspaceId: ID!, $filter: PlanmagnetWorkItemFilter) {\n planmagnetWorkItemCounts(workspaceId: $workspaceId, filter: $filter) {\n total\n byStatus {\n status\n count\n }\n }\n }\n`;\n\nconst PAGE_SIZE = 100;\n\nconst GET_BOARD_PROJECTS = gql`\n query GetBoardProjects($workspaceId: ID!) {\n planmagnetProjects(workspaceId: $workspaceId, pagination: { first: 100 }) {\n items {\n id\n name\n }\n }\n }\n`;\n\ninterface WorkItemNode {\n id: string;\n title: string;\n type: string;\n status: string;\n priority: string;\n key: string;\n assigneeId: string | null;\n reporterId: string | null;\n sprintId: string | null;\n storyPoints: number | null;\n estimateMinutes: number | null;\n dueDate: string | null;\n labels: string[];\n tags: string[];\n createdAt: string;\n}\n\nconst columns = [\n 'BACKLOG',\n 'TODO',\n 'IN_PROGRESS',\n 'IN_REVIEW',\n 'TESTING',\n 'DONE',\n 'CANCELLED',\n] as const;\n\nconst colLabel: Record<string, string> = {\n BACKLOG: 'Backlog',\n TODO: 'To Do',\n IN_PROGRESS: 'In Progress',\n IN_REVIEW: 'In Review',\n TESTING: 'Testing',\n DONE: 'Done',\n CANCELLED: 'Cancelled',\n};\n\nconst colColor: Record<string, string> = {\n BACKLOG: 'border-t-gray-400',\n TODO: 'border-t-blue-400',\n IN_PROGRESS: 'border-t-yellow-400',\n IN_REVIEW: 'border-t-purple-400',\n TESTING: 'border-t-teal-400',\n DONE: 'border-t-green-400',\n CANCELLED: 'border-t-muted-foreground',\n};\n\nconst priorityColor: Record<string, string> = {\n LOW: 'bg-gray-100 text-gray-700',\n MEDIUM: 'bg-blue-100 text-blue-700',\n HIGH: 'bg-orange-100 text-orange-700',\n CRITICAL: 'bg-red-100 text-red-700',\n};\n\nconst typeColor: Record<string, string> = {\n STORY: 'bg-green-100 text-green-700',\n BUG: 'bg-red-100 text-red-700',\n TASK: 'bg-blue-100 text-blue-700',\n EPIC: 'bg-purple-100 text-purple-700',\n // The API serves SUB_TASK (the stored SUBTASK is mapped by the service), so the old SUBTASK key never matched.\n SUB_TASK: 'bg-gray-100 text-gray-700',\n};\n\nexport function TasksTasksPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [priorityFilter, setPriorityFilter] = useState<string>('all');\n const [typeFilter, setTypeFilter] = useState<string>('all');\n // P1.2: the Task Board is a project's real board (server-side placement,\n // drag-and-drop, WIP limits). null = not chosen yet -> the first project;\n // '' = the cross-project status overview, which is NOT a board.\n const [boardProject, setBoardProject] = useState<string | null>(null);\n const { data: projectsData } = useQuery(GET_BOARD_PROJECTS, {\n variables: { workspaceId },\n skip: !workspaceId,\n });\n const boardProjects = projectsData?.planmagnetProjects?.items ?? [];\n const selectedProject = boardProject ?? boardProjects[0]?.id ?? '';\n const selectedProjectName = boardProjects.find((p) => p.id === selectedProject)?.name ?? '';\n\n // Filters go to the server so the loaded items AND the counts both reflect\n // every matching item, not just the first page.\n const filter = {\n ...(priorityFilter !== 'all' && { priority: priorityFilter.toUpperCase() }),\n ...(typeFilter !== 'all' && { type: typeFilter.toUpperCase() }),\n };\n const [loadingMore, setLoadingMore] = useState(false);\n\n const { data, loading, error, fetchMore } = useQuery<{\n planmagnetWorkItems: {\n items: WorkItemNode[];\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n totalCount: number;\n };\n }>(GET_WORK_ITEMS, {\n variables: { workspaceId, filter, pagination: { first: PAGE_SIZE } },\n // The list only feeds the cross-project overview; a board loads its own cards.\n skip: !workspaceId || !!selectedProject,\n });\n const { data: countsData } = useQuery<{\n planmagnetWorkItemCounts: { total: number; byStatus: { status: string; count: number }[] };\n }>(GET_WORK_ITEM_COUNTS, {\n // On a project board the header counts THAT project, without the overview's priority/type filters (their\n // buttons are hidden there, but their state survived and silently narrowed the count). It used to count the\n // whole workspace above a single project's board (BOFF-7943).\n variables: { workspaceId, filter: selectedProject ? { projectId: selectedProject } : filter },\n skip: !workspaceId,\n });\n\n const loadMore = async () => {\n const after = data?.planmagnetWorkItems?.pageInfo?.endCursor;\n if (!after) return;\n setLoadingMore(true);\n try {\n await fetchMore({\n variables: { pagination: { first: PAGE_SIZE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetWorkItems: {\n ...fetchMoreResult.planmagnetWorkItems,\n items: [\n ...prev.planmagnetWorkItems.items,\n ...fetchMoreResult.planmagnetWorkItems.items,\n ],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n // Only before the first load: a refetch or a filter change must not blank the board.\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-red-500\">Error: {error.message}</div>;\n }\n\n const tasks = data?.planmagnetWorkItems?.items ?? [];\n\n const counts = countsData?.planmagnetWorkItemCounts;\n // Never fall back to the loaded page's length: on a board nothing is loaded here, so that read \"0 tasks\".\n const total: number | undefined =\n counts?.total ?? (selectedProject ? undefined : data?.planmagnetWorkItems?.totalCount);\n // Never fall back to the loaded page (BOFF-7997): counts.byStatus omits statuses with zero items, so an\n // absent entry once `counts` HAS loaded really is 0 — but while the counts query is loading or failed,\n // `counts` itself is undefined and this must show the same unknown state as the header total above,\n // never a number derived from these <=100 loaded rows.\n const countFor = (status: string): number | undefined =>\n counts ? (counts.byStatus.find((c) => c.status === status)?.count ?? 0) : undefined;\n const hasMore = data?.planmagnetWorkItems?.pageInfo?.hasNextPage ?? false;\n\n return (\n <div className=\"space-y-4 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Task Board</h1>\n <label className=\"sr-only\" htmlFor=\"task-board-project\">\n Project\n </label>\n <select\n id=\"task-board-project\"\n className=\"mt-2 rounded-md border border-input bg-background px-2 py-1 text-sm\"\n value={selectedProject}\n onChange={(e) => setBoardProject(e.target.value)}\n >\n {boardProjects.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n <option value=\"\">All projects — status overview</option>\n </select>\n <div className=\"mt-2 flex flex-wrap gap-2\">\n <ExportWorkItemsButton projectId={selectedProject || undefined} />\n {/* BUILD_PLAN P1.4: the Linear importer had no way in. */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"import-linear\"\n onClick={() => navigate('/tasks/import-page')}\n >\n <FileUp className=\"mr-1 h-4 w-4\" />\n Import from Linear\n </Button>\n {/* BOFF-8047: automation rules act on this board's work items (status/assign/label/priority). */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"task-board-automation\"\n onClick={() => navigate('/automation/automation-rules-page')}\n >\n <Bot className=\"mr-1 h-4 w-4\" />\n Automation rules\n </Button>\n </div>\n <p className=\"text-sm text-muted-foreground\" data-testid=\"task-board-total\">\n {total === undefined\n ? 'Counting tasks…'\n : selectedProject\n ? `${total} ${total === 1 ? 'task' : 'tasks'} in ${selectedProjectName}`\n : `${total} tasks across all projects${tasks.length < total ? ` · showing ${tasks.length}` : ''}`}\n </p>\n </div>\n </div>\n {selectedProject ? (\n <ProjectBoard projectId={selectedProject} projectName={selectedProjectName} />\n ) : (\n <>\n <div className=\"flex gap-4 items-center flex-wrap\">\n <Filter className=\"h-4 w-4 text-muted-foreground\" />\n <div className=\"flex gap-1\">\n {/* 'none' included: a NONE-priority task matched no chip (BOFF-7985). */}\n {['all', 'none', 'low', 'medium', 'high', 'critical'].map((p) => (\n <button\n key={p}\n onClick={() => setPriorityFilter(p)}\n className={`px-2 py-1 text-xs rounded capitalize ${priorityFilter === p ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {p}\n </button>\n ))}\n </div>\n <div className=\"flex gap-1\">\n {/* sub_task → SUB_TASK: filtering by it works since svc 1f4db8e (it was a masked 500). */}\n {['all', 'story', 'bug', 'task', 'epic', 'sub_task'].map((t) => (\n <button\n key={t}\n onClick={() => setTypeFilter(t)}\n className={`px-2 py-1 text-xs rounded capitalize ${typeFilter === t ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {t === 'sub_task' ? 'sub-task' : t}\n </button>\n ))}\n </div>\n </div>\n <div className=\"grid grid-cols-7 gap-3 overflow-x-auto\">\n {columns.map((col) => {\n const colTasks = tasks.filter((t) => t.status === col);\n return (\n <div key={col} className=\"min-w-[200px]\">\n <div className={`border-t-2 ${colColor[col]} rounded-t-md p-2 bg-muted/50`}>\n <div className=\"flex justify-between items-center\">\n <span className=\"text-sm font-medium\">{colLabel[col]}</span>\n <span\n className=\"text-xs bg-muted rounded-full px-1.5\"\n data-testid={`task-col-count-${col}`}\n >\n {countLabel(countFor(col))}\n </span>\n </div>\n </div>\n <div className=\"space-y-2 mt-2\">\n {colTasks.map((task) => (\n <Card\n key={task.id}\n {...rowLinkProps(\n () =>\n navigate(\n `/tasks/task-detail-page?taskId=${encodeURIComponent(task.id)}`\n ),\n task.title\n )}\n >\n <CardContent className=\"p-3 space-y-2\">\n <p className=\"text-sm font-medium leading-tight\">{task.title}</p>\n <p className=\"text-xs text-muted-foreground\">{task.key}</p>\n <div className=\"flex gap-1 flex-wrap\">\n <span\n className={`text-[10px] px-1.5 py-0.5 rounded-full capitalize ${priorityColor[task.priority] ?? ''}`}\n >\n {task.priority.toLowerCase()}\n </span>\n <span\n className={`text-[10px] px-1.5 py-0.5 rounded-full capitalize ${typeColor[task.type] ?? ''}`}\n >\n {task.type.toLowerCase()}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex gap-1\">\n {(task.labels ?? []).slice(0, 2).map((l) => (\n <span key={l} className=\"text-[9px] px-1 py-0.5 rounded bg-muted\">\n {l}\n </span>\n ))}\n </div>\n <div className=\"flex items-center gap-1\">\n <span className=\"text-[10px] font-medium bg-primary/10 text-primary rounded-full h-5 w-5 flex items-center justify-center\">\n {task.storyPoints ?? 0}\n </span>\n </div>\n </div>\n <div className=\"flex justify-between text-[10px] text-muted-foreground\">\n <span>\n {task.assigneeId ? <PersonName id={task.assigneeId} /> : 'Unassigned'}\n </span>\n <span>\n {task.dueDate ? new Date(task.dueDate).toLocaleDateString() : ''}\n </span>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n );\n })}\n </div>\n {hasMore && (\n <div className=\"flex justify-center\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loadingMore}\n className=\"px-3 py-1.5 text-sm rounded-md bg-muted text-foreground hover:bg-muted/80 disabled:opacity-50\"\n data-testid=\"task-board-load-more\"\n >\n {loadingMore ? 'Loading…' : `Load more (${tasks.length} of ${total})`}\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCpB,IAAuB,CAAG;;;;;;;;;;GAY1B,IAAY,KAEZ,IAAqB,CAAG;;;;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AAD;aAAc,WAAU;uBACrB;aACI,EAFI,EAEJ,CACP;YACE,CAAA,EACN,kBAAC,OAAD;YAAK,WAAU;sBACb,kBAAC,QAAD;aAAM,WAAU;uBACb,EAAK,eAAe;aAChB,CAAA;YACH,CAAA,CACF;;UACN,kBAAC,OAAD;WAAK,WAAU;qBAAf,CACE,kBAAC,QAAD,EAAA,UACG,EAAK,aAAa,kBAAC,GAAD,EAAY,IAAI,EAAK,YAAc,CAAA,GAAG,cACpD,CAAA,EACP,kBAAC,QAAD,EAAA,UACG,EAAK,UAAU,IAAI,KAAK,EAAK,QAAQ,CAAC,oBAAoB,GAAG,IACzD,CAAA,CACH;;UACM;;QACT,EA/CA,EAAK,GA+CL,CACP;OACE,CAAA,CACF;QAjEI,EAiEJ;MAER;IACE,CAAA;GACL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;KACV,eAAY;eAEX,IAAc,aAAa,cAAc,EAAM,OAAO,MAAM,EAAM;KAC5D,CAAA;IACL,CAAA;GAEP,EAAA,CAAA,CAED"}
1
+ {"version":3,"file":"TasksTasksPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/TasksTasksPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Button, Card, CardContent } from '@burdenoff/fe-libs/ui';\nimport { Bot, FileUp, Filter } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { countLabel } from '../hooks/useCounts';\nimport { rowLinkProps } from '../utils/rowNavigation';\nimport { PersonName } from '../people/People';\nimport { ProjectBoard } from '../board/ProjectBoard';\nimport { readViewIdFromUrl } from '../board/boardViewConfig';\nimport { ExportWorkItemsButton } from '../export/ExportWorkItemsButton';\n\nconst GET_WORK_ITEMS = gql`\n query GetWorkItems(\n $workspaceId: ID!\n $filter: PlanmagnetWorkItemFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetWorkItems(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n id\n title\n type\n status\n priority\n key\n assigneeId\n reporterId\n sprintId\n storyPoints\n estimateMinutes\n dueDate\n labels\n tags\n createdAt\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n }\n }\n`;\n\n// Server-side counts (QA H2): the list returns at most 100 rows per page, so\n// counting the loaded page undercounted every workspace past 100 items.\nconst GET_WORK_ITEM_COUNTS = gql`\n query GetWorkItemCounts($workspaceId: ID!, $filter: PlanmagnetWorkItemFilter) {\n planmagnetWorkItemCounts(workspaceId: $workspaceId, filter: $filter) {\n total\n byStatus {\n status\n count\n }\n }\n }\n`;\n\nconst PAGE_SIZE = 100;\n\nconst GET_BOARD_PROJECTS = gql`\n query GetBoardProjects($workspaceId: ID!) {\n planmagnetProjects(workspaceId: $workspaceId, pagination: { first: 100 }) {\n items {\n id\n name\n }\n }\n }\n`;\n\ninterface WorkItemNode {\n id: string;\n title: string;\n type: string;\n status: string;\n priority: string;\n key: string;\n assigneeId: string | null;\n reporterId: string | null;\n sprintId: string | null;\n storyPoints: number | null;\n estimateMinutes: number | null;\n dueDate: string | null;\n labels: string[];\n tags: string[];\n createdAt: string;\n}\n\nconst columns = [\n 'BACKLOG',\n 'TODO',\n 'IN_PROGRESS',\n 'IN_REVIEW',\n 'TESTING',\n 'DONE',\n 'CANCELLED',\n] as const;\n\nconst colLabel: Record<string, string> = {\n BACKLOG: 'Backlog',\n TODO: 'To Do',\n IN_PROGRESS: 'In Progress',\n IN_REVIEW: 'In Review',\n TESTING: 'Testing',\n DONE: 'Done',\n CANCELLED: 'Cancelled',\n};\n\nconst colColor: Record<string, string> = {\n BACKLOG: 'border-t-gray-400',\n TODO: 'border-t-blue-400',\n IN_PROGRESS: 'border-t-yellow-400',\n IN_REVIEW: 'border-t-purple-400',\n TESTING: 'border-t-teal-400',\n DONE: 'border-t-green-400',\n CANCELLED: 'border-t-muted-foreground',\n};\n\nconst priorityColor: Record<string, string> = {\n LOW: 'bg-gray-100 text-gray-700',\n MEDIUM: 'bg-blue-100 text-blue-700',\n HIGH: 'bg-orange-100 text-orange-700',\n CRITICAL: 'bg-red-100 text-red-700',\n};\n\nconst typeColor: Record<string, string> = {\n STORY: 'bg-green-100 text-green-700',\n BUG: 'bg-red-100 text-red-700',\n TASK: 'bg-blue-100 text-blue-700',\n EPIC: 'bg-purple-100 text-purple-700',\n // The API serves SUB_TASK (the stored SUBTASK is mapped by the service), so the old SUBTASK key never matched.\n SUB_TASK: 'bg-gray-100 text-gray-700',\n};\n\nconst GET_LINKED_VIEW_PROJECT = gql`\n query TasksLinkedBoardView($id: ID!) {\n planmagnetBoardView(id: $id) {\n id\n projectId\n }\n }\n`;\n\nexport function TasksTasksPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [priorityFilter, setPriorityFilter] = useState<string>('all');\n const [typeFilter, setTypeFilter] = useState<string>('all');\n // P1.2: the Task Board is a project's real board (server-side placement,\n // drag-and-drop, WIP limits). null = not chosen yet -> the first project;\n // '' = the cross-project status overview, which is NOT a board.\n const [boardProject, setBoardProject] = useState<string | null>(null);\n const { data: projectsData } = useQuery(GET_BOARD_PROJECTS, {\n variables: { workspaceId },\n skip: !workspaceId,\n });\n const boardProjects = projectsData?.planmagnetProjects?.items ?? [];\n // PDM-N04: a shared `?view=<id>` link opens on the VIEW's project (its board then applies the view), not on\n // whichever project happens to be first — otherwise the link silently shows another project's board. Read\n // once; an explicit project choice (boardProject) always wins afterwards.\n const [linkedViewId] = useState(readViewIdFromUrl);\n const { data: linkedViewData, error: linkedViewError } = useQuery<{\n planmagnetBoardView: { id: string; projectId: string } | null;\n }>(GET_LINKED_VIEW_PROJECT, {\n variables: { id: linkedViewId ?? '' },\n skip: !linkedViewId || boardProject !== null,\n });\n const linkedViewProject = linkedViewData?.planmagnetBoardView?.projectId ?? null;\n // A missing/private view (null) or a failed lookup falls back to the default project rather than waiting forever.\n const waitingForLinkedView =\n !!linkedViewId && boardProject === null && !linkedViewData && !linkedViewError;\n const selectedProject =\n boardProject ?? linkedViewProject ?? (waitingForLinkedView ? '' : (boardProjects[0]?.id ?? ''));\n const selectedProjectName = boardProjects.find((p) => p.id === selectedProject)?.name ?? '';\n\n // Filters go to the server so the loaded items AND the counts both reflect\n // every matching item, not just the first page.\n const filter = {\n ...(priorityFilter !== 'all' && { priority: priorityFilter.toUpperCase() }),\n ...(typeFilter !== 'all' && { type: typeFilter.toUpperCase() }),\n };\n const [loadingMore, setLoadingMore] = useState(false);\n\n const { data, loading, error, fetchMore } = useQuery<{\n planmagnetWorkItems: {\n items: WorkItemNode[];\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n totalCount: number;\n };\n }>(GET_WORK_ITEMS, {\n variables: { workspaceId, filter, pagination: { first: PAGE_SIZE } },\n // The list only feeds the cross-project overview; a board loads its own cards.\n skip: !workspaceId || !!selectedProject || waitingForLinkedView,\n });\n const { data: countsData } = useQuery<{\n planmagnetWorkItemCounts: { total: number; byStatus: { status: string; count: number }[] };\n }>(GET_WORK_ITEM_COUNTS, {\n // On a project board the header counts THAT project, without the overview's priority/type filters (their\n // buttons are hidden there, but their state survived and silently narrowed the count). It used to count the\n // whole workspace above a single project's board (BOFF-7943).\n variables: { workspaceId, filter: selectedProject ? { projectId: selectedProject } : filter },\n skip: !workspaceId,\n });\n\n const loadMore = async () => {\n const after = data?.planmagnetWorkItems?.pageInfo?.endCursor;\n if (!after) return;\n setLoadingMore(true);\n try {\n await fetchMore({\n variables: { pagination: { first: PAGE_SIZE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetWorkItems: {\n ...fetchMoreResult.planmagnetWorkItems,\n items: [\n ...prev.planmagnetWorkItems.items,\n ...fetchMoreResult.planmagnetWorkItems.items,\n ],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n // Only before the first load: a refetch or a filter change must not blank the board.\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-red-500\">Error: {error.message}</div>;\n }\n\n const tasks = data?.planmagnetWorkItems?.items ?? [];\n\n const counts = countsData?.planmagnetWorkItemCounts;\n // Never fall back to the loaded page's length: on a board nothing is loaded here, so that read \"0 tasks\".\n const total: number | undefined =\n counts?.total ?? (selectedProject ? undefined : data?.planmagnetWorkItems?.totalCount);\n // Never fall back to the loaded page (BOFF-7997): counts.byStatus omits statuses with zero items, so an\n // absent entry once `counts` HAS loaded really is 0 — but while the counts query is loading or failed,\n // `counts` itself is undefined and this must show the same unknown state as the header total above,\n // never a number derived from these <=100 loaded rows.\n const countFor = (status: string): number | undefined =>\n counts ? (counts.byStatus.find((c) => c.status === status)?.count ?? 0) : undefined;\n const hasMore = data?.planmagnetWorkItems?.pageInfo?.hasNextPage ?? false;\n\n return (\n <div className=\"space-y-4 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Task Board</h1>\n <label className=\"sr-only\" htmlFor=\"task-board-project\">\n Project\n </label>\n <select\n id=\"task-board-project\"\n className=\"mt-2 rounded-md border border-input bg-background px-2 py-1 text-sm\"\n value={selectedProject}\n onChange={(e) => setBoardProject(e.target.value)}\n >\n {boardProjects.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n <option value=\"\">All projects — status overview</option>\n </select>\n <div className=\"mt-2 flex flex-wrap gap-2\">\n <ExportWorkItemsButton projectId={selectedProject || undefined} />\n {/* BUILD_PLAN P1.4: the Linear importer had no way in. */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"import-linear\"\n onClick={() => navigate('/tasks/import-page')}\n >\n <FileUp className=\"mr-1 h-4 w-4\" />\n Import from Linear\n </Button>\n {/* BOFF-8047: automation rules act on this board's work items (status/assign/label/priority). */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"task-board-automation\"\n onClick={() => navigate('/automation/automation-rules-page')}\n >\n <Bot className=\"mr-1 h-4 w-4\" />\n Automation rules\n </Button>\n </div>\n <p className=\"text-sm text-muted-foreground\" data-testid=\"task-board-total\">\n {total === undefined\n ? 'Counting tasks…'\n : selectedProject\n ? `${total} ${total === 1 ? 'task' : 'tasks'} in ${selectedProjectName}`\n : `${total} tasks across all projects${tasks.length < total ? ` · showing ${tasks.length}` : ''}`}\n </p>\n </div>\n </div>\n {waitingForLinkedView ? (\n <p className=\"text-sm text-muted-foreground\" data-testid=\"task-board-opening-view\">\n Opening the shared view…\n </p>\n ) : selectedProject ? (\n <ProjectBoard projectId={selectedProject} projectName={selectedProjectName} />\n ) : (\n <>\n <div className=\"flex gap-4 items-center flex-wrap\">\n <Filter className=\"h-4 w-4 text-muted-foreground\" />\n <div className=\"flex gap-1\">\n {/* 'none' included: a NONE-priority task matched no chip (BOFF-7985). */}\n {['all', 'none', 'low', 'medium', 'high', 'critical'].map((p) => (\n <button\n key={p}\n onClick={() => setPriorityFilter(p)}\n className={`px-2 py-1 text-xs rounded capitalize ${priorityFilter === p ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {p}\n </button>\n ))}\n </div>\n <div className=\"flex gap-1\">\n {/* sub_task → SUB_TASK: filtering by it works since svc 1f4db8e (it was a masked 500). */}\n {['all', 'story', 'bug', 'task', 'epic', 'sub_task'].map((t) => (\n <button\n key={t}\n onClick={() => setTypeFilter(t)}\n className={`px-2 py-1 text-xs rounded capitalize ${typeFilter === t ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {t === 'sub_task' ? 'sub-task' : t}\n </button>\n ))}\n </div>\n </div>\n <div className=\"grid grid-cols-7 gap-3 overflow-x-auto\">\n {columns.map((col) => {\n const colTasks = tasks.filter((t) => t.status === col);\n return (\n <div key={col} className=\"min-w-[200px]\">\n <div className={`border-t-2 ${colColor[col]} rounded-t-md p-2 bg-muted/50`}>\n <div className=\"flex justify-between items-center\">\n <span className=\"text-sm font-medium\">{colLabel[col]}</span>\n <span\n className=\"text-xs bg-muted rounded-full px-1.5\"\n data-testid={`task-col-count-${col}`}\n >\n {countLabel(countFor(col))}\n </span>\n </div>\n </div>\n <div className=\"space-y-2 mt-2\">\n {colTasks.map((task) => (\n <Card\n key={task.id}\n {...rowLinkProps(\n () =>\n navigate(\n `/tasks/task-detail-page?taskId=${encodeURIComponent(task.id)}`\n ),\n task.title\n )}\n >\n <CardContent className=\"p-3 space-y-2\">\n <p className=\"text-sm font-medium leading-tight\">{task.title}</p>\n <p className=\"text-xs text-muted-foreground\">{task.key}</p>\n <div className=\"flex gap-1 flex-wrap\">\n <span\n className={`text-[10px] px-1.5 py-0.5 rounded-full capitalize ${priorityColor[task.priority] ?? ''}`}\n >\n {task.priority.toLowerCase()}\n </span>\n <span\n className={`text-[10px] px-1.5 py-0.5 rounded-full capitalize ${typeColor[task.type] ?? ''}`}\n >\n {task.type.toLowerCase()}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <div className=\"flex gap-1\">\n {(task.labels ?? []).slice(0, 2).map((l) => (\n <span key={l} className=\"text-[9px] px-1 py-0.5 rounded bg-muted\">\n {l}\n </span>\n ))}\n </div>\n <div className=\"flex items-center gap-1\">\n <span className=\"text-[10px] font-medium bg-primary/10 text-primary rounded-full h-5 w-5 flex items-center justify-center\">\n {task.storyPoints ?? 0}\n </span>\n </div>\n </div>\n <div className=\"flex justify-between text-[10px] text-muted-foreground\">\n <span>\n {task.assigneeId ? <PersonName id={task.assigneeId} /> : 'Unassigned'}\n </span>\n <span>\n {task.dueDate ? new Date(task.dueDate).toLocaleDateString() : ''}\n </span>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n );\n })}\n </div>\n {hasMore && (\n <div className=\"flex justify-center\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loadingMore}\n className=\"px-3 py-1.5 text-sm rounded-md bg-muted text-foreground hover:bg-muted/80 disabled:opacity-50\"\n data-testid=\"task-board-load-more\"\n >\n {loadingMore ? 'Loading…' : `Load more (${tasks.length} of ${total})`}\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCpB,IAAuB,CAAG;;;;;;;;;;GAY1B,IAAY,KAEZ,IAAqB,CAAG;;;;;;;;;GA6BxB,IAAU;CACd;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAmC;CACvC,SAAS;CACT,MAAM;CACN,aAAa;CACb,WAAW;CACX,SAAS;CACT,MAAM;CACN,WAAW;CACZ,EAEK,IAAmC;CACvC,SAAS;CACT,MAAM;CACN,aAAa;CACb,WAAW;CACX,SAAS;CACT,MAAM;CACN,WAAW;CACZ,EAEK,KAAwC;CAC5C,KAAK;CACL,QAAQ;CACR,MAAM;CACN,UAAU;CACX,EAEK,KAAoC;CACxC,OAAO;CACP,KAAK;CACL,MAAM;CACN,MAAM;CAEN,UAAU;CACX,EAEK,IAA0B,CAAG;;;;;;;;AASnC,SAAgB,IAAqB;CACnC,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAW,GAAuB,EAClC,CAAC,GAAgB,KAAqB,EAAiB,MAAM,EAC7D,CAAC,GAAY,KAAiB,EAAiB,MAAM,EAIrD,CAAC,GAAc,KAAmB,EAAwB,KAAK,EAC/D,EAAE,MAAM,MAAiB,EAAS,GAAoB;EAC1D,WAAW,EAAE,gBAAa;EAC1B,MAAM,CAAC;EACR,CAAC,EACI,IAAgB,GAAc,oBAAoB,SAAS,EAAE,EAI7D,CAAC,KAAgB,EAAS,EAAkB,EAC5C,EAAE,MAAM,GAAgB,OAAO,MAAoB,EAEtD,GAAyB;EAC1B,WAAW,EAAE,IAAI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QAjEI,EAiEJ;MAER;IACE,CAAA;GACL,MACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;KACV,eAAY;eAEX,IAAc,aAAa,cAAc,EAAM,OAAO,MAAM,EAAM;KAC5D,CAAA;IACL,CAAA;GAEP,EAAA,CAAA,CAED"}
@@ -9,13 +9,18 @@ import { KeyboardEvent, MouseEvent } from 'react';
9
9
  */
10
10
  /** The row-link look, for rows that also need their own layout classes. */
11
11
  export declare const ROW_LINK_CLASS: string;
12
- export declare function rowLinkProps(onActivate: () => void, label?: string): {
12
+ /**
13
+ * `T` defaults to `HTMLElement` for every existing (div/li/...) call site; the dependency graph spreads this
14
+ * onto an SVG `<g>` and passes `SVGGElement` explicitly — `KeyboardEvent<HTMLElement>` is not assignable there
15
+ * (SVGGElement and HTMLElement are unrelated siblings of Element, not one a subtype of the other).
16
+ */
17
+ export declare function rowLinkProps<T extends Element = HTMLElement>(onActivate: () => void, label?: string): {
13
18
  role: "button";
14
19
  tabIndex: number;
15
20
  'aria-label': string | undefined;
16
21
  className: string;
17
22
  onClick: () => void;
18
- onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
23
+ onKeyDown: (event: KeyboardEvent<T>) => void;
19
24
  };
20
25
  /**
21
26
  * Stops a click on a nested control (a button, a menu) from also activating the row
@@ -1 +1 @@
1
- {"version":3,"file":"rowNavigation.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;;;GAMG;AACH,2EAA2E;AAC3E,eAAO,MAAM,cAAc,QAEiD,CAAC;AAE7E,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM;;;;;;uBAO5C,aAAa,CAAC,WAAW,CAAC;EAOhD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,QAE/D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAE/E"}
1
+ {"version":3,"file":"rowNavigation.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;;;GAMG;AACH,2EAA2E;AAC3E,eAAO,MAAM,cAAc,QAEiD,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,GAAG,WAAW,EAC1D,UAAU,EAAE,MAAM,IAAI,EACtB,KAAK,CAAC,EAAE,MAAM;;;;;;uBAQO,aAAa,CAAC,CAAC,CAAC;EAOtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,QAE/D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAE/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"rowNavigation.js","names":[],"sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * Props that turn a non-interactive container (a Card, a table row) into an\n * activatable one, so a list row can open its detail page by click OR keyboard.\n *\n * Kept as a props factory rather than a wrapper component so it can be spread onto\n * whatever element a given list already renders, without changing that list's layout.\n */\n/** The row-link look, for rows that also need their own layout classes. */\nexport const ROW_LINK_CLASS =\n 'cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none ' +\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';\n\nexport function rowLinkProps(onActivate: () => void, label?: string) {\n return {\n role: 'button' as const,\n tabIndex: 0,\n 'aria-label': label,\n className: ROW_LINK_CLASS,\n onClick: () => onActivate(),\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => {\n // Enter and Space are the two activation keys a role=\"button\" must honour.\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n onActivate();\n },\n };\n}\n\n/**\n * Stops a click on a nested control (a button, a menu) from also activating the row\n * it sits inside. Spread onto the nested control, not the row.\n */\nexport function stopRowActivation(event: MouseEvent<HTMLElement>) {\n event.stopPropagation();\n}\n\n/**\n * Builds the path to a detail page that reads its id from a \":id\" route segment.\n * Returns the bare path when no id is available, so a missing id degrades to the\n * list-style page rather than producing a path ending in \"undefined\".\n */\nexport function detailPath(route: string, id: string | null | undefined): string {\n return id ? `${route}/${encodeURIComponent(id)}` : route;\n}\n"],"mappings":";AAUA,IAAa,IACX;AAGF,SAAgB,EAAa,GAAwB,GAAgB;AACnE,QAAO;EACL,MAAM;EACN,UAAU;EACV,cAAc;EACd,WAAW;EACX,eAAe,GAAY;EAC3B,YAAY,MAAsC;AAE5C,KAAM,QAAQ,WAAW,EAAM,QAAQ,QAC3C,EAAM,gBAAgB,EACtB,GAAY;;EAEf;;AAOH,SAAgB,EAAkB,GAAgC;AAChE,GAAM,iBAAiB;;AAQzB,SAAgB,EAAW,GAAe,GAAuC;AAC/E,QAAO,IAAK,GAAG,EAAM,GAAG,mBAAmB,EAAG,KAAK"}
1
+ {"version":3,"file":"rowNavigation.js","names":[],"sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * Props that turn a non-interactive container (a Card, a table row) into an\n * activatable one, so a list row can open its detail page by click OR keyboard.\n *\n * Kept as a props factory rather than a wrapper component so it can be spread onto\n * whatever element a given list already renders, without changing that list's layout.\n */\n/** The row-link look, for rows that also need their own layout classes. */\nexport const ROW_LINK_CLASS =\n 'cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none ' +\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';\n\n/**\n * `T` defaults to `HTMLElement` for every existing (div/li/...) call site; the dependency graph spreads this\n * onto an SVG `<g>` and passes `SVGGElement` explicitly — `KeyboardEvent<HTMLElement>` is not assignable there\n * (SVGGElement and HTMLElement are unrelated siblings of Element, not one a subtype of the other).\n */\nexport function rowLinkProps<T extends Element = HTMLElement>(\n onActivate: () => void,\n label?: string\n) {\n return {\n role: 'button' as const,\n tabIndex: 0,\n 'aria-label': label,\n className: ROW_LINK_CLASS,\n onClick: () => onActivate(),\n onKeyDown: (event: KeyboardEvent<T>) => {\n // Enter and Space are the two activation keys a role=\"button\" must honour.\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n onActivate();\n },\n };\n}\n\n/**\n * Stops a click on a nested control (a button, a menu) from also activating the row\n * it sits inside. Spread onto the nested control, not the row.\n */\nexport function stopRowActivation(event: MouseEvent<HTMLElement>) {\n event.stopPropagation();\n}\n\n/**\n * Builds the path to a detail page that reads its id from a \":id\" route segment.\n * Returns the bare path when no id is available, so a missing id degrades to the\n * list-style page rather than producing a path ending in \"undefined\".\n */\nexport function detailPath(route: string, id: string | null | undefined): string {\n return id ? `${route}/${encodeURIComponent(id)}` : route;\n}\n"],"mappings":";AAUA,IAAa,IACX;AAQF,SAAgB,EACd,GACA,GACA;AACA,QAAO;EACL,MAAM;EACN,UAAU;EACV,cAAc;EACd,WAAW;EACX,eAAe,GAAY;EAC3B,YAAY,MAA4B;AAElC,KAAM,QAAQ,WAAW,EAAM,QAAQ,QAC3C,EAAM,gBAAgB,EACtB,GAAY;;EAEf;;AAOH,SAAgB,EAAkB,GAAgC;AAChE,GAAM,iBAAiB;;AAQzB,SAAgB,EAAW,GAAe,GAAuC;AAC/E,QAAO,IAAK,GAAG,EAAM,GAAG,mBAAmB,EAAG,KAAK"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * One fixed chart color per WorkItemStatus (PDM-27 dependency graph, ANR-24 Gantt): both visualizations color by
3
+ * status, so they share this single mapping rather than each re-deriving one. The order is FIXED and never
4
+ * re-assigned from whichever statuses happen to appear in a given project/graph — a categorical channel keeps the
5
+ * same color for the same identity everywhere it shows up.
6
+ *
7
+ * Values are complete literal Tailwind class names (never built with a template string): Tailwind's build scans
8
+ * source text for whole class-name tokens, so `` `fill-${status}` `` would never be picked up and would ship
9
+ * invisible/unstyled in production while every check here still passes.
10
+ *
11
+ * Colors come from fe-libs' chart token ramp (`chart-1`..`chart-12`), not the `status-*` tokens — those are
12
+ * reserved for good/warning/serious/critical severity (see `dev/skills` dataviz guidance) and workflow status is
13
+ * an identity dimension, not a severity one.
14
+ */
15
+ export interface StatusVisual {
16
+ /** Fill class for the node/bar body. */
17
+ fill: string;
18
+ /** Stroke class matching `fill`, for outlines and edge/line marks of the same status. */
19
+ stroke: string;
20
+ /** Solid swatch class for a small legend dot. */
21
+ swatch: string;
22
+ }
23
+ export declare function statusVisual(status: string): StatusVisual;
24
+ /** Every status with an assigned visual, in the fixed legend order. */
25
+ export declare const STATUS_LEGEND_ORDER: readonly string[];
26
+ //# sourceMappingURL=statusColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusColor.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/utils/statusColor.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAoBD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAEzD;AAED,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAuB,CAAC"}