@industry-theme/backlogmd-kanban-panel 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"KanbanPanel.d.ts","sourceRoot":"","sources":["../../src/panels/KanbanPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AA2MpD;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAMrD,CAAC"}
1
+ {"version":3,"file":"KanbanPanel.d.ts","sourceRoot":"","sources":["../../src/panels/KanbanPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAwRpD;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAMrD,CAAC"}
@@ -9,8 +9,24 @@ export interface ColumnState {
9
9
  }
10
10
  /** Source column names (directory-based) */
11
11
  export type SourceColumn = 'tasks' | 'completed';
12
- /** Display labels for source columns */
12
+ /** Status column names (for 3-column view) */
13
+ export type StatusColumn = 'todo' | 'in-progress' | 'completed';
14
+ /** Display labels for status columns */
15
+ export declare const STATUS_DISPLAY_LABELS: Record<StatusColumn, string>;
16
+ /** Display labels for source columns (legacy) */
13
17
  export declare const SOURCE_DISPLAY_LABELS: Record<SourceColumn, string>;
18
+ /** Status-based column state (computed from source data) */
19
+ export interface StatusColumnState {
20
+ tasks: Task[];
21
+ count: number;
22
+ }
23
+ /** Active tasks pagination state */
24
+ export interface ActiveTasksState {
25
+ total: number;
26
+ loaded: number;
27
+ hasMore: boolean;
28
+ isLoadingMore: boolean;
29
+ }
14
30
  export interface UseKanbanDataResult {
15
31
  tasks: Task[];
16
32
  /** Source columns: "tasks" and "completed" */
@@ -25,6 +41,14 @@ export interface UseKanbanDataResult {
25
41
  loadMore: (source: SourceColumn) => Promise<void>;
26
42
  refreshData: () => Promise<void>;
27
43
  updateTaskStatus: (taskId: string, newStatus: string) => Promise<void>;
44
+ /** Status columns for 3-column view */
45
+ statusColumns: StatusColumn[];
46
+ /** Tasks grouped by status (To Do, In Progress, Completed) */
47
+ tasksByStatus: Map<StatusColumn, StatusColumnState>;
48
+ /** Active tasks (To Do + In Progress) pagination state */
49
+ activeTasksState: ActiveTasksState;
50
+ /** Load more active tasks */
51
+ loadMoreActive: () => Promise<void>;
28
52
  }
29
53
  interface UseKanbanDataOptions {
30
54
  context?: PanelContextValue;
@@ -1 +1 @@
1
- {"version":3,"file":"useKanbanData.d.ts","sourceRoot":"","sources":["../../../../src/panels/kanban/hooks/useKanbanData.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,IAAI,EAAwB,MAAM,kBAAkB,CAAC;AAEzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEtE,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,4CAA4C;AAC5C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;AAEjD,wCAAwC;AACxC,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAG9D,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,8CAA8C;IAC9C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gBAAgB,EAAE,O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DAA0D;IAC1D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,6BAA6B;IAC7B,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,mBAAmB,CAmYrB"}
@@ -1507,9 +1507,10 @@ class PanelFileSystemAdapter {
1507
1507
  return path2.replace(/^\/+/, "").replace(/\/+$/, "").replace(/\/+/g, "/");
1508
1508
  }
1509
1509
  }
1510
- const SOURCE_DISPLAY_LABELS = {
1511
- tasks: "Active",
1512
- completed: "Completed"
1510
+ const STATUS_DISPLAY_LABELS = {
1511
+ "todo": "To Do",
1512
+ "in-progress": "In Progress",
1513
+ "completed": "Completed"
1513
1514
  };
1514
1515
  const DEFAULT_SOURCES = ["tasks", "completed"];
1515
1516
  const DEFAULT_TASKS_LIMIT = 20;
@@ -1768,6 +1769,30 @@ function useKanbanData(options) {
1768
1769
  },
1769
1770
  []
1770
1771
  );
1772
+ const statusColumns = ["todo", "in-progress", "completed"];
1773
+ const tasksByStatus = (() => {
1774
+ const result = /* @__PURE__ */ new Map();
1775
+ const activeTasks = tasksBySource.get("tasks") || [];
1776
+ const completedTasks = tasksBySource.get("completed") || [];
1777
+ const todoTasks = activeTasks.filter((t) => t.status === "To Do");
1778
+ const inProgressTasks = activeTasks.filter((t) => t.status === "In Progress");
1779
+ result.set("todo", { tasks: todoTasks, count: todoTasks.length });
1780
+ result.set("in-progress", { tasks: inProgressTasks, count: inProgressTasks.length });
1781
+ result.set("completed", { tasks: completedTasks, count: completedTasks.length });
1782
+ return result;
1783
+ })();
1784
+ const activeTasksState = (() => {
1785
+ const activeColumnState = columnStates.get("tasks");
1786
+ return {
1787
+ total: (activeColumnState == null ? void 0 : activeColumnState.total) || 0,
1788
+ loaded: (activeColumnState == null ? void 0 : activeColumnState.tasks.length) || 0,
1789
+ hasMore: (activeColumnState == null ? void 0 : activeColumnState.hasMore) || false,
1790
+ isLoadingMore: (activeColumnState == null ? void 0 : activeColumnState.isLoadingMore) || false
1791
+ };
1792
+ })();
1793
+ const loadMoreActive = useCallback(async () => {
1794
+ await loadMore("tasks");
1795
+ }, [loadMore]);
1771
1796
  return {
1772
1797
  tasks,
1773
1798
  sources,
@@ -1778,7 +1803,12 @@ function useKanbanData(options) {
1778
1803
  columnStates,
1779
1804
  loadMore,
1780
1805
  refreshData,
1781
- updateTaskStatus
1806
+ updateTaskStatus,
1807
+ // New 3-column view exports
1808
+ statusColumns,
1809
+ tasksByStatus,
1810
+ activeTasksState,
1811
+ loadMoreActive
1782
1812
  };
1783
1813
  }
1784
1814
  const KanbanColumn = ({
@@ -2324,7 +2354,17 @@ const KanbanPanelContent = ({
2324
2354
  var _a, _b;
2325
2355
  const { theme: theme2 } = useTheme();
2326
2356
  const [_selectedTask, setSelectedTask] = useState(null);
2327
- const { sources, tasksBySource, columnStates, loadMore, error, isBacklogProject, refreshData } = useKanbanData({
2357
+ const {
2358
+ statusColumns,
2359
+ tasksByStatus,
2360
+ columnStates,
2361
+ loadMore,
2362
+ activeTasksState,
2363
+ loadMoreActive,
2364
+ error,
2365
+ isBacklogProject,
2366
+ refreshData
2367
+ } = useKanbanData({
2328
2368
  context,
2329
2369
  actions,
2330
2370
  tasksLimit: 20,
@@ -2428,22 +2468,72 @@ const KanbanPanelContent = ({
2428
2468
  // Don't shrink header
2429
2469
  display: "flex",
2430
2470
  alignItems: "center",
2471
+ justifyContent: "space-between",
2431
2472
  gap: "12px",
2432
2473
  flexWrap: "wrap"
2433
2474
  },
2434
2475
  children: [
2435
- /* @__PURE__ */ jsx(Kanban, { size: 24, color: theme2.colors.primary }),
2436
- /* @__PURE__ */ jsx(
2437
- "h2",
2438
- {
2439
- style: {
2440
- margin: 0,
2441
- fontSize: theme2.fontSizes[4],
2442
- color: theme2.colors.text
2443
- },
2444
- children: "Kanban Board"
2445
- }
2446
- )
2476
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
2477
+ /* @__PURE__ */ jsx(Kanban, { size: 24, color: theme2.colors.primary }),
2478
+ /* @__PURE__ */ jsx(
2479
+ "h2",
2480
+ {
2481
+ style: {
2482
+ margin: 0,
2483
+ fontSize: theme2.fontSizes[4],
2484
+ color: theme2.colors.text
2485
+ },
2486
+ children: "Kanban Board"
2487
+ }
2488
+ )
2489
+ ] }),
2490
+ isBacklogProject && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "16px", flexWrap: "wrap" }, children: [
2491
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: statusColumns.map((status) => {
2492
+ const statusState = tasksByStatus.get(status);
2493
+ const count = (statusState == null ? void 0 : statusState.count) || 0;
2494
+ const completedState = columnStates.get("completed");
2495
+ const displayCount = status === "completed" && completedState ? `${count}/${completedState.total}` : count;
2496
+ return /* @__PURE__ */ jsxs(
2497
+ "span",
2498
+ {
2499
+ style: {
2500
+ fontSize: theme2.fontSizes[1],
2501
+ color: theme2.colors.textSecondary,
2502
+ background: theme2.colors.backgroundSecondary,
2503
+ padding: "4px 10px",
2504
+ borderRadius: theme2.radii[1],
2505
+ fontWeight: theme2.fontWeights.medium
2506
+ },
2507
+ children: [
2508
+ STATUS_DISPLAY_LABELS[status],
2509
+ ": ",
2510
+ displayCount
2511
+ ]
2512
+ },
2513
+ status
2514
+ );
2515
+ }) }),
2516
+ activeTasksState.hasMore && /* @__PURE__ */ jsx(
2517
+ "button",
2518
+ {
2519
+ onClick: loadMoreActive,
2520
+ disabled: activeTasksState.isLoadingMore,
2521
+ style: {
2522
+ background: theme2.colors.primary,
2523
+ color: theme2.colors.background,
2524
+ border: "none",
2525
+ borderRadius: theme2.radii[2],
2526
+ padding: "6px 12px",
2527
+ fontSize: theme2.fontSizes[1],
2528
+ fontWeight: theme2.fontWeights.medium,
2529
+ cursor: activeTasksState.isLoadingMore ? "wait" : "pointer",
2530
+ opacity: activeTasksState.isLoadingMore ? 0.7 : 1,
2531
+ transition: "opacity 0.2s ease"
2532
+ },
2533
+ children: activeTasksState.isLoadingMore ? "Loading..." : `Load more active (${activeTasksState.total - activeTasksState.loaded} remaining)`
2534
+ }
2535
+ )
2536
+ ] })
2447
2537
  ]
2448
2538
  }
2449
2539
  ),
@@ -2492,21 +2582,23 @@ const KanbanPanelContent = ({
2492
2582
  WebkitOverflowScrolling: "touch"
2493
2583
  // Smooth scrolling on iOS
2494
2584
  },
2495
- children: sources.map((source2) => {
2496
- const columnTasks = tasksBySource.get(source2) || [];
2497
- const columnState = columnStates.get(source2);
2585
+ children: statusColumns.map((status) => {
2586
+ const statusState = tasksByStatus.get(status);
2587
+ const columnTasks = (statusState == null ? void 0 : statusState.tasks) || [];
2588
+ const isCompleted = status === "completed";
2589
+ const completedState = columnStates.get("completed");
2498
2590
  return /* @__PURE__ */ jsx(
2499
2591
  KanbanColumn,
2500
2592
  {
2501
- status: SOURCE_DISPLAY_LABELS[source2],
2593
+ status: STATUS_DISPLAY_LABELS[status],
2502
2594
  tasks: columnTasks,
2503
- total: columnState == null ? void 0 : columnState.total,
2504
- hasMore: columnState == null ? void 0 : columnState.hasMore,
2505
- isLoadingMore: columnState == null ? void 0 : columnState.isLoadingMore,
2506
- onLoadMore: () => loadMore(source2),
2595
+ total: isCompleted ? completedState == null ? void 0 : completedState.total : void 0,
2596
+ hasMore: isCompleted ? completedState == null ? void 0 : completedState.hasMore : false,
2597
+ isLoadingMore: isCompleted ? completedState == null ? void 0 : completedState.isLoadingMore : false,
2598
+ onLoadMore: isCompleted ? () => loadMore("completed") : void 0,
2507
2599
  onTaskClick: handleTaskClick
2508
2600
  },
2509
- source2
2601
+ status
2510
2602
  );
2511
2603
  })
2512
2604
  }