@knotpad/app 0.1.0

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 (342) hide show
  1. package/README.md +167 -0
  2. package/app/(app)/calendar/page.tsx +57 -0
  3. package/app/(app)/error.tsx +35 -0
  4. package/app/(app)/graph/page.tsx +32 -0
  5. package/app/(app)/guide/page.tsx +21 -0
  6. package/app/(app)/kanban/loading.tsx +24 -0
  7. package/app/(app)/kanban/page.tsx +59 -0
  8. package/app/(app)/layout.tsx +122 -0
  9. package/app/(app)/list/loading.tsx +21 -0
  10. package/app/(app)/list/page.tsx +137 -0
  11. package/app/(app)/loading.tsx +18 -0
  12. package/app/(app)/notes/[noteId]/page.tsx +84 -0
  13. package/app/(app)/notes/layout.tsx +30 -0
  14. package/app/(app)/notes/page.tsx +39 -0
  15. package/app/(app)/page.tsx +5 -0
  16. package/app/(app)/settings/agent-token/page.tsx +59 -0
  17. package/app/(app)/settings/backup/page.tsx +49 -0
  18. package/app/(app)/settings/billing/page.tsx +53 -0
  19. package/app/(app)/settings/calendar/page.tsx +41 -0
  20. package/app/(app)/settings/layout.test.tsx +39 -0
  21. package/app/(app)/settings/layout.tsx +71 -0
  22. package/app/(app)/settings/page.tsx +4 -0
  23. package/app/(app)/settings/security/page.tsx +43 -0
  24. package/app/(app)/settings/team/page.tsx +74 -0
  25. package/app/(app)/settings/workspace/page.tsx +27 -0
  26. package/app/(app)/tasks/[taskId]/page.tsx +79 -0
  27. package/app/(auth)/forgot-password/page.tsx +106 -0
  28. package/app/(auth)/guest/page.tsx +56 -0
  29. package/app/(auth)/layout.tsx +13 -0
  30. package/app/(auth)/login/page.tsx +14 -0
  31. package/app/(auth)/register/page.tsx +193 -0
  32. package/app/(auth)/reset-password/page.tsx +138 -0
  33. package/app/api/account/claim/route.tsx +135 -0
  34. package/app/api/admin/backfill-encryption/route.tsx +43 -0
  35. package/app/api/admin/license/route.tsx +42 -0
  36. package/app/api/auth/2fa/route.tsx +148 -0
  37. package/app/api/auth/[...nextauth]/route.tsx +3 -0
  38. package/app/api/auth/change-password/route.tsx +61 -0
  39. package/app/api/auth/check-2fa/route.tsx +19 -0
  40. package/app/api/auth/forgot-password/route.tsx +65 -0
  41. package/app/api/auth/reset-password/route.tsx +52 -0
  42. package/app/api/auth/verify-2fa/route.tsx +88 -0
  43. package/app/api/backup/download/db/route.ts +29 -0
  44. package/app/api/backup/download/notes/route.ts +25 -0
  45. package/app/api/backup/settings/route.ts +92 -0
  46. package/app/api/billing/checkout/route.tsx +81 -0
  47. package/app/api/billing/migrate/route.tsx +163 -0
  48. package/app/api/billing/portal/route.tsx +24 -0
  49. package/app/api/billing/setup-intent/route.tsx +55 -0
  50. package/app/api/billing/status/route.tsx +36 -0
  51. package/app/api/billing/subscribe/route.tsx +85 -0
  52. package/app/api/billing/webhook/route.tsx +199 -0
  53. package/app/api/calendar-feeds/[feedId]/route.tsx +67 -0
  54. package/app/api/calendar-feeds/[feedId]/sync/route.tsx +37 -0
  55. package/app/api/calendar-feeds/events/route.tsx +82 -0
  56. package/app/api/calendar-feeds/route.tsx +52 -0
  57. package/app/api/calendar-feeds/sync-all/route.tsx +34 -0
  58. package/app/api/cron/calendar-feeds/route.tsx +31 -0
  59. package/app/api/cron/stale-tasks/route.tsx +51 -0
  60. package/app/api/cron/sync/route.tsx +34 -0
  61. package/app/api/devices/[deviceId]/route.tsx +25 -0
  62. package/app/api/devices/route.tsx +41 -0
  63. package/app/api/export/route.tsx +40 -0
  64. package/app/api/feedback/route.tsx +54 -0
  65. package/app/api/folders/[folderId]/route.tsx +51 -0
  66. package/app/api/folders/route.tsx +37 -0
  67. package/app/api/graph/route.tsx +242 -0
  68. package/app/api/guest/route.tsx +58 -0
  69. package/app/api/health/route.tsx +10 -0
  70. package/app/api/holidays/countries/route.tsx +14 -0
  71. package/app/api/holidays/route.tsx +49 -0
  72. package/app/api/holidays/states/route.tsx +21 -0
  73. package/app/api/invites/[token]/route.tsx +131 -0
  74. package/app/api/invites/route.tsx +74 -0
  75. package/app/api/mcp/generate-token/route.tsx +55 -0
  76. package/app/api/mcp/revoke-token/[tokenId]/route.tsx +30 -0
  77. package/app/api/mcp/update-alias/[tokenId]/route.tsx +22 -0
  78. package/app/api/notes/[noteId]/export/route.tsx +45 -0
  79. package/app/api/notes/[noteId]/route.tsx +360 -0
  80. package/app/api/notes/route.tsx +112 -0
  81. package/app/api/notifications/route.tsx +44 -0
  82. package/app/api/register/route.tsx +67 -0
  83. package/app/api/restore/route.tsx +148 -0
  84. package/app/api/sync/conflicts/[conflictId]/route.tsx +134 -0
  85. package/app/api/sync/conflicts/route.tsx +48 -0
  86. package/app/api/sync/status/route.tsx +49 -0
  87. package/app/api/sync/trigger/route.tsx +15 -0
  88. package/app/api/tasks/[taskId]/detail/route.tsx +68 -0
  89. package/app/api/tasks/[taskId]/route.tsx +259 -0
  90. package/app/api/tasks/bulk/route.tsx +133 -0
  91. package/app/api/tasks/route.tsx +36 -0
  92. package/app/api/workspace/active/route.tsx +39 -0
  93. package/app/api/workspace/create-team/route.tsx +42 -0
  94. package/app/api/workspace/kanban-statuses/route.tsx +71 -0
  95. package/app/api/workspace/members/[memberId]/route.tsx +69 -0
  96. package/app/api/workspace/route.tsx +24 -0
  97. package/app/download/page.tsx +170 -0
  98. package/app/favicon.ico +0 -0
  99. package/app/generated/prisma/client.d.ts +1 -0
  100. package/app/generated/prisma/client.js +5 -0
  101. package/app/generated/prisma/default.d.ts +1 -0
  102. package/app/generated/prisma/default.js +5 -0
  103. package/app/generated/prisma/edge.d.ts +1 -0
  104. package/app/generated/prisma/edge.js +497 -0
  105. package/app/generated/prisma/index-browser.js +523 -0
  106. package/app/generated/prisma/index.d.ts +46376 -0
  107. package/app/generated/prisma/index.js +497 -0
  108. package/app/generated/prisma/package.json +144 -0
  109. package/app/generated/prisma/query_compiler_fast_bg.js +2 -0
  110. package/app/generated/prisma/query_compiler_fast_bg.wasm +0 -0
  111. package/app/generated/prisma/query_compiler_fast_bg.wasm-base64.js +2 -0
  112. package/app/generated/prisma/runtime/client.d.ts +3386 -0
  113. package/app/generated/prisma/runtime/client.js +86 -0
  114. package/app/generated/prisma/runtime/index-browser.d.ts +90 -0
  115. package/app/generated/prisma/runtime/index-browser.js +6 -0
  116. package/app/generated/prisma/runtime/wasm-compiler-edge.js +76 -0
  117. package/app/generated/prisma/schema.prisma +456 -0
  118. package/app/generated/prisma/wasm-edge-light-loader.mjs +5 -0
  119. package/app/generated/prisma/wasm-worker-loader.mjs +5 -0
  120. package/app/globals.css +54 -0
  121. package/app/invite/[token]/page.tsx +52 -0
  122. package/app/layout.tsx +90 -0
  123. package/app/mcp/route.tsx +430 -0
  124. package/app/opengraph-image.tsx +120 -0
  125. package/app/page.tsx +398 -0
  126. package/app/privacy/page.tsx +69 -0
  127. package/app/robots.tsx +25 -0
  128. package/app/sitemap.tsx +36 -0
  129. package/app/terms/page.tsx +69 -0
  130. package/app/upgrade/page.tsx +75 -0
  131. package/auth.config.ts +33 -0
  132. package/auth.ts +79 -0
  133. package/bin/brief.js +224 -0
  134. package/components/auth/login-form.tsx +302 -0
  135. package/components/auth/password-checklist.tsx +31 -0
  136. package/components/auth/password-input.tsx +36 -0
  137. package/components/auth/switch-account-button.test.tsx +22 -0
  138. package/components/auth/switch-account-button.tsx +19 -0
  139. package/components/auth/two-factor-input.tsx +116 -0
  140. package/components/billing/billing-dashboard.tsx +265 -0
  141. package/components/billing/card-form.tsx +210 -0
  142. package/components/billing/claim-account-form.tsx +99 -0
  143. package/components/branding/app-logo.test.tsx +20 -0
  144. package/components/branding/app-logo.tsx +25 -0
  145. package/components/calendar/calendar-agenda.tsx +150 -0
  146. package/components/calendar/calendar-drag.test.tsx +177 -0
  147. package/components/calendar/calendar-grid.tsx +357 -0
  148. package/components/calendar/calendar-hooks.test.tsx +27 -0
  149. package/components/calendar/calendar-hooks.ts +351 -0
  150. package/components/calendar/calendar-toolbar.test.tsx +68 -0
  151. package/components/calendar/calendar-toolbar.tsx +291 -0
  152. package/components/calendar/calendar-types.ts +148 -0
  153. package/components/calendar/calendar-view.test.tsx +295 -0
  154. package/components/calendar/calendar-view.tsx +307 -0
  155. package/components/calendar/day-detail-popover.tsx +174 -0
  156. package/components/calendar/task-chip.tsx +86 -0
  157. package/components/command/command-palette.test.tsx +33 -0
  158. package/components/command/command-palette.tsx +310 -0
  159. package/components/download-cta.tsx +87 -0
  160. package/components/feedback/feedback-popup.tsx +207 -0
  161. package/components/graph/graph-draw.ts +337 -0
  162. package/components/graph/graph-overlays.tsx +160 -0
  163. package/components/graph/graph-page.test.tsx +131 -0
  164. package/components/graph/graph-page.tsx +263 -0
  165. package/components/graph/graph-types.ts +47 -0
  166. package/components/graph/graph-view.tsx +322 -0
  167. package/components/guide/guide-view.tsx +522 -0
  168. package/components/kanban/kanban-board.test.tsx +128 -0
  169. package/components/kanban/kanban-board.tsx +361 -0
  170. package/components/kanban/kanban-card-menu.tsx +102 -0
  171. package/components/kanban/kanban-card.tsx +227 -0
  172. package/components/kanban/kanban-column.tsx +49 -0
  173. package/components/kanban/kanban-status-context.tsx +28 -0
  174. package/components/landing/calendar-sandbox.test.tsx +15 -0
  175. package/components/landing/calendar-sandbox.tsx +107 -0
  176. package/components/landing/graph-sandbox.test.tsx +27 -0
  177. package/components/landing/graph-sandbox.tsx +80 -0
  178. package/components/landing/kanban-sandbox.test.tsx +24 -0
  179. package/components/landing/kanban-sandbox.tsx +101 -0
  180. package/components/landing/landing-showcase.test.tsx +21 -0
  181. package/components/landing/landing-showcase.tsx +54 -0
  182. package/components/landing/list-sandbox.tsx +86 -0
  183. package/components/landing/mock-workspace.ts +168 -0
  184. package/components/landing/notes-sandbox.test.tsx +14 -0
  185. package/components/landing/notes-sandbox.tsx +88 -0
  186. package/components/layout/app-shell.tsx +83 -0
  187. package/components/layout/backup-scheduler.tsx +122 -0
  188. package/components/layout/bottom-nav.tsx +43 -0
  189. package/components/layout/icon-bar.test.tsx +29 -0
  190. package/components/layout/icon-bar.tsx +118 -0
  191. package/components/layout/mobile-top-bar.tsx +68 -0
  192. package/components/layout/notes-panel-folder.tsx +127 -0
  193. package/components/layout/notes-panel-note-item.tsx +140 -0
  194. package/components/layout/notes-panel-task-tab.tsx +63 -0
  195. package/components/layout/notes-panel-types.ts +44 -0
  196. package/components/layout/notes-panel.tsx +476 -0
  197. package/components/layout/notification-bell.tsx +251 -0
  198. package/components/layout/paywall-screen.tsx +41 -0
  199. package/components/layout/pro-banner.tsx +76 -0
  200. package/components/layout/sw-register.tsx +27 -0
  201. package/components/layout/workspace-switcher.tsx +90 -0
  202. package/components/notes/mobile-bottom-sheet.tsx +99 -0
  203. package/components/notes/note-editor-context-menu.tsx +47 -0
  204. package/components/notes/note-editor-dom.ts +33 -0
  205. package/components/notes/note-editor-dropdowns.tsx +484 -0
  206. package/components/notes/note-editor-hooks.ts +692 -0
  207. package/components/notes/note-editor-keyboard.ts +305 -0
  208. package/components/notes/note-editor-overlay.tsx +90 -0
  209. package/components/notes/note-editor.test.tsx +372 -0
  210. package/components/notes/note-editor.tsx +662 -0
  211. package/components/notes/note-preview-pane.tsx +156 -0
  212. package/components/notes/note-tabs.tsx +120 -0
  213. package/components/notes/note-types.tsx +157 -0
  214. package/components/settings/accept-invite.tsx +108 -0
  215. package/components/settings/agent-token-settings.tsx +369 -0
  216. package/components/settings/backup-restore-settings.test.tsx +25 -0
  217. package/components/settings/backup-restore-settings.tsx +327 -0
  218. package/components/settings/calendar-feeds-settings.tsx +489 -0
  219. package/components/settings/calendar-general-settings.tsx +174 -0
  220. package/components/settings/confirm-danger-action.test.tsx +215 -0
  221. package/components/settings/confirm-danger-action.tsx +65 -0
  222. package/components/settings/security-settings.tsx +252 -0
  223. package/components/settings/settings-guidance.test.tsx +98 -0
  224. package/components/settings/team-settings.tsx +319 -0
  225. package/components/settings/two-factor-auth.tsx +296 -0
  226. package/components/settings/workspace-settings-client.tsx +363 -0
  227. package/components/settings/workspace-settings-form.tsx +73 -0
  228. package/components/sync/conflict-viewer.tsx +247 -0
  229. package/components/sync/sync-indicator.tsx +171 -0
  230. package/components/tasks/snippet-thread.tsx +119 -0
  231. package/components/tasks/status-dot.tsx +47 -0
  232. package/components/tasks/task-badge.tsx +43 -0
  233. package/components/tasks/task-detail.test.tsx +187 -0
  234. package/components/tasks/task-detail.tsx +458 -0
  235. package/components/tasks/task-list-filters.test.tsx +75 -0
  236. package/components/tasks/task-list-filters.tsx +163 -0
  237. package/components/tasks/task-list-types.ts +20 -0
  238. package/components/tasks/task-list.test.tsx +175 -0
  239. package/components/tasks/task-list.tsx +481 -0
  240. package/components/tasks/task-row.tsx +85 -0
  241. package/components/tasks/task-table-row.tsx +259 -0
  242. package/components/ui/skeleton.tsx +3 -0
  243. package/components/ui/toast.test.tsx +42 -0
  244. package/components/ui/toast.tsx +70 -0
  245. package/electron/main.ts +251 -0
  246. package/electron/preload.ts +56 -0
  247. package/instrumentation.tsx +23 -0
  248. package/lib/api-error.ts +50 -0
  249. package/lib/backup/backup-runner.test.ts +32 -0
  250. package/lib/backup/backup-runner.ts +19 -0
  251. package/lib/backup/backup-schedule.test.ts +23 -0
  252. package/lib/backup/backup-schedule.ts +55 -0
  253. package/lib/backup/backup-settings.test.ts +30 -0
  254. package/lib/backup/backup-settings.ts +27 -0
  255. package/lib/backup/export-notes-zip.test.ts +26 -0
  256. package/lib/backup/export-notes-zip.ts +82 -0
  257. package/lib/backup/export-workspace-backup.test.ts +17 -0
  258. package/lib/backup/export-workspace-backup.ts +77 -0
  259. package/lib/backup/restore-workspace-from-export.test.ts +18 -0
  260. package/lib/backup/restore-workspace-from-export.ts +183 -0
  261. package/lib/backup/types.ts +14 -0
  262. package/lib/brand-icons.ts +1 -0
  263. package/lib/calendar-feed-crypto.ts +38 -0
  264. package/lib/calendar-feed.ts +239 -0
  265. package/lib/client/online-status.ts +47 -0
  266. package/lib/conflict-resolver.test.ts +57 -0
  267. package/lib/conflict-resolver.ts +240 -0
  268. package/lib/db-init.ts +79 -0
  269. package/lib/email.ts +159 -0
  270. package/lib/encryption.test.ts +41 -0
  271. package/lib/encryption.ts +98 -0
  272. package/lib/extract-snippet.test.ts +123 -0
  273. package/lib/extract-snippet.ts +69 -0
  274. package/lib/kanban-status.ts +55 -0
  275. package/lib/license.ts +21 -0
  276. package/lib/limits.ts +31 -0
  277. package/lib/mcp-auth.test.ts +58 -0
  278. package/lib/mcp-auth.ts +65 -0
  279. package/lib/mcp-contract.test.ts +25 -0
  280. package/lib/mcp-contract.ts +210 -0
  281. package/lib/mcp-handler.ts +31 -0
  282. package/lib/mcp-url.test.ts +12 -0
  283. package/lib/mcp-url.ts +7 -0
  284. package/lib/mentions.test.ts +45 -0
  285. package/lib/mentions.ts +73 -0
  286. package/lib/note-crypto.ts +108 -0
  287. package/lib/note-sync.ts +201 -0
  288. package/lib/note-title.ts +93 -0
  289. package/lib/prisma.ts +193 -0
  290. package/lib/pro-flush.ts +292 -0
  291. package/lib/rate-limit.ts +57 -0
  292. package/lib/stripe.ts +38 -0
  293. package/lib/sync-worker.ts +388 -0
  294. package/lib/task-parser.test.ts +91 -0
  295. package/lib/task-parser.ts +81 -0
  296. package/lib/task-utils.ts +52 -0
  297. package/lib/use-is-electron.ts +19 -0
  298. package/lib/use-is-mobile.ts +22 -0
  299. package/lib/validation/calendar-feed.ts +31 -0
  300. package/lib/validation/note.ts +27 -0
  301. package/lib/validation/task.ts +26 -0
  302. package/lib/view-preferences.test.ts +54 -0
  303. package/lib/view-preferences.ts +28 -0
  304. package/lib/workspace.ts +66 -0
  305. package/next.config.ts +21 -0
  306. package/package.json +99 -0
  307. package/postcss.config.mjs +7 -0
  308. package/prisma/migrations/20260519021916_init/migration.sql +388 -0
  309. package/prisma/migrations/20260519061113_drop_sync_password/migration.sql +8 -0
  310. package/prisma/migrations/20260520065016_add_task_start_date/migration.sql +2 -0
  311. package/prisma/migrations/20260529010600_remove_encryption_fields/migration.sql +12 -0
  312. package/prisma/migrations/20260529020000_restore_encryption_salt/migration.sql +3 -0
  313. package/prisma/migrations/20260529030000_add_folders/migration.sql +17 -0
  314. package/prisma/migrations/20260605000000_deferred_fixes/migration.sql +31 -0
  315. package/prisma/migrations/20260605020806_add_pending_sync_to_note_and_task/migration.sql +5 -0
  316. package/prisma/migrations/20260605063634_add_stripe_webhook_event_sync_lock/migration.sql +14 -0
  317. package/prisma/migrations/20260605100000_add_prod_indexes/migration.sql +26 -0
  318. package/prisma/migrations/20260608081404_add_kanban_statuses/migration.sql +23 -0
  319. package/prisma/migrations/20260611032723_add_calendar_feeds/migration.sql +43 -0
  320. package/prisma/migrations/20260611040000_add_calendar_feed_color/migration.sql +2 -0
  321. package/prisma/migrations/20260611050000_add_task_priority/migration.sql +14 -0
  322. package/prisma/migrations/20260612060000_add_critical_priority/migration.sql +2 -0
  323. package/prisma/migrations/20260613090000_add_backup_settings/migration.sql +25 -0
  324. package/prisma/migrations/20260614160000_add_feedback/migration.sql +20 -0
  325. package/prisma/migrations/20260614210000_add_2fa/migration.sql +4 -0
  326. package/prisma/migrations/migration_lock.toml +3 -0
  327. package/prisma/schema.prisma +457 -0
  328. package/public/Logo_icon.svg +1 -0
  329. package/public/file.svg +1 -0
  330. package/public/globe.svg +1 -0
  331. package/public/icon-192.png +0 -0
  332. package/public/icon-512.png +0 -0
  333. package/public/icon.svg +4 -0
  334. package/public/icon_dark.svg +1 -0
  335. package/public/knotpad_icon.svg +1 -0
  336. package/public/knotpad_logo_full.svg +1 -0
  337. package/public/manifest.json +14 -0
  338. package/public/next.svg +1 -0
  339. package/public/sw.js +137 -0
  340. package/public/vercel.svg +1 -0
  341. package/public/window.svg +1 -0
  342. package/tsconfig.json +35 -0
@@ -0,0 +1,20 @@
1
+ export type Task = {
2
+ id: string;
3
+ title: string;
4
+ status: string;
5
+ priority?: string | null;
6
+ startDate: string | Date | null;
7
+ dueDate: string | Date | null;
8
+ assigneeType: "HUMAN" | "AGENT";
9
+ claimedBy: string | null;
10
+ claimedByAlias: string | null;
11
+ assignee: { id: string; name: string | null; email: string | null; image: string | null } | null;
12
+ note: { id: string; title: string; folder?: { id: string; name: string } | null };
13
+ createdAt?: string | Date;
14
+ updatedAt?: string | Date;
15
+ };
16
+
17
+ export type SortField = "title" | "status" | "dueDate" | "priority" | "assignee" | "note" | "updatedAt";
18
+ export type SortDirection = "asc" | "desc";
19
+
20
+ export type Props = { tasks: Task[]; groupBy?: "status" | "note" };
@@ -0,0 +1,175 @@
1
+ // @vitest-environment jsdom
2
+ import { cleanup, render, screen } from "@testing-library/react";
3
+ import userEvent from "@testing-library/user-event";
4
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
5
+ import { TaskList } from "@/components/tasks/task-list";
6
+ import type { Task } from "@/components/tasks/task-list-types";
7
+
8
+ const pushMock = vi.fn();
9
+ const refreshMock = vi.fn();
10
+ let pathname = "/list";
11
+ let searchParams = new URLSearchParams();
12
+
13
+ vi.mock("next/navigation", () => ({
14
+ useRouter: () => ({ push: pushMock, refresh: refreshMock }),
15
+ usePathname: () => pathname,
16
+ useSearchParams: () => searchParams,
17
+ }));
18
+
19
+ vi.mock("@/components/kanban/kanban-status-context", () => ({
20
+ useKanbanStatuses: () => [
21
+ { key: "TODO", label: "To Do", isVisible: true },
22
+ { key: "DONE", label: "Done", isVisible: true },
23
+ ],
24
+ }));
25
+
26
+ vi.mock("@/components/tasks/task-table-row", () => ({
27
+ TaskTableRow: ({
28
+ task,
29
+ detailHref,
30
+ isSelected,
31
+ onSelect,
32
+ }: {
33
+ task: Task;
34
+ detailHref?: string;
35
+ isSelected: boolean;
36
+ onSelect: () => void;
37
+ }) => (
38
+ <tr data-testid="task-row" data-selected={isSelected ? "true" : "false"}>
39
+ <td>
40
+ <input
41
+ aria-label={`Select ${task.title}`}
42
+ type="checkbox"
43
+ checked={isSelected}
44
+ onChange={onSelect}
45
+ />
46
+ </td>
47
+ <td>
48
+ {detailHref ? <a href={detailHref}>{task.title}</a> : task.title}
49
+ </td>
50
+ </tr>
51
+ ),
52
+ }));
53
+
54
+ vi.mock("@/components/tasks/task-row", () => ({
55
+ TaskRow: () => <div data-testid="task-row" />,
56
+ }));
57
+
58
+ function makeTask(overrides: Partial<Task>): Task {
59
+ return {
60
+ id: overrides.id ?? "t1",
61
+ title: overrides.title ?? "Task",
62
+ status: overrides.status ?? "TODO",
63
+ priority: overrides.priority ?? "medium",
64
+ startDate: overrides.startDate ?? null,
65
+ dueDate: overrides.dueDate ?? null,
66
+ assigneeType: overrides.assigneeType ?? "HUMAN",
67
+ claimedBy: overrides.claimedBy ?? null,
68
+ claimedByAlias: overrides.claimedByAlias ?? null,
69
+ assignee: overrides.assignee ?? null,
70
+ note: overrides.note ?? { id: "n1", title: "Launch" },
71
+ createdAt: overrides.createdAt,
72
+ updatedAt: overrides.updatedAt,
73
+ };
74
+ }
75
+
76
+ beforeEach(() => {
77
+ pushMock.mockReset();
78
+ refreshMock.mockReset();
79
+ pathname = "/list";
80
+ searchParams = new URLSearchParams();
81
+ window.localStorage.clear();
82
+ });
83
+
84
+ afterEach(() => {
85
+ cleanup();
86
+ });
87
+
88
+ describe("TaskList", () => {
89
+ it("shows a clearer bulk-selection bar after selecting a task", async () => {
90
+ const user = userEvent.setup();
91
+
92
+ render(<TaskList tasks={[makeTask({ id: "t1", title: "Alpha" })]} />);
93
+
94
+ await user.click(screen.getByLabelText("Select Alpha"));
95
+
96
+ expect(screen.getByText("1 task selected")).toBeInTheDocument();
97
+ });
98
+
99
+ it("applies the overdue saved view preset", async () => {
100
+ const user = userEvent.setup();
101
+
102
+ render(
103
+ <TaskList
104
+ tasks={[
105
+ makeTask({ id: "t1", title: "Overdue task", dueDate: "2026-06-01T00:00:00.000Z" }),
106
+ makeTask({ id: "t2", title: "Fresh task", dueDate: "2026-06-20T00:00:00.000Z" }),
107
+ ]}
108
+ />
109
+ );
110
+
111
+ await user.click(screen.getByRole("button", { name: "Overdue" }));
112
+
113
+ expect(screen.getAllByTestId("task-row")).toHaveLength(1);
114
+ expect(screen.getByText("Overdue task")).toBeInTheDocument();
115
+ expect(screen.queryByText("Fresh task")).not.toBeInTheDocument();
116
+ });
117
+
118
+ it("loads saved sort preferences on first render", () => {
119
+ window.localStorage.setItem("brief:list-sort-field", JSON.stringify("updatedAt"));
120
+ window.localStorage.setItem("brief:list-sort-direction", JSON.stringify("desc"));
121
+
122
+ render(
123
+ <TaskList
124
+ tasks={[
125
+ makeTask({ id: "t1", title: "Older task", updatedAt: "2026-06-10T10:00:00.000Z" }),
126
+ makeTask({ id: "t2", title: "Newer task", updatedAt: "2026-06-12T10:00:00.000Z" }),
127
+ ]}
128
+ />
129
+ );
130
+
131
+ expect(screen.getAllByTestId("task-row").map((row) => row.textContent)).toEqual([
132
+ "Newer task",
133
+ "Older task",
134
+ ]);
135
+ });
136
+
137
+ it("persists sort preferences after a user changes the table sort", async () => {
138
+ const user = userEvent.setup();
139
+
140
+ render(
141
+ <TaskList
142
+ tasks={[
143
+ makeTask({ id: "t1", title: "Bravo" }),
144
+ makeTask({ id: "t2", title: "Alpha" }),
145
+ ]}
146
+ />
147
+ );
148
+
149
+ await user.click(screen.getByRole("columnheader", { name: /title/i }));
150
+ await user.click(screen.getByRole("columnheader", { name: /title/i }));
151
+
152
+ expect(window.localStorage.getItem("brief:list-sort-field")).toBe(JSON.stringify("title"));
153
+ expect(window.localStorage.getItem("brief:list-sort-direction")).toBe(JSON.stringify("desc"));
154
+ });
155
+
156
+ it("shows filtered empty-state guidance when no tasks match the current view", () => {
157
+ searchParams = new URLSearchParams("status=DONE");
158
+
159
+ render(<TaskList tasks={[]} />);
160
+
161
+ expect(screen.getByText("No tasks match this view.")).toBeInTheDocument();
162
+ expect(
163
+ screen.getByText("Clear one or more filters, or create tasks from a note.")
164
+ ).toBeInTheDocument();
165
+ });
166
+
167
+ it("passes a task detail link for the title", () => {
168
+ render(<TaskList tasks={[makeTask({ id: "t1", title: "Alpha" })]} />);
169
+
170
+ expect(screen.getByRole("link", { name: "Alpha" })).toHaveAttribute(
171
+ "href",
172
+ "/tasks/t1?from=%2Flist%3F"
173
+ );
174
+ });
175
+ });
@@ -0,0 +1,481 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+ import Link from "next/link";
5
+ import { usePathname, useSearchParams, useRouter } from "next/navigation";
6
+ import { useKanbanStatuses } from "@/components/kanban/kanban-status-context";
7
+ import { isOverdue } from "@/lib/task-utils";
8
+ import { loadPreference, savePreference } from "@/lib/view-preferences";
9
+ import { TaskRow } from "./task-row";
10
+ import { TaskTableRow } from "./task-table-row";
11
+ import type { Task, SortField, SortDirection, Props } from "./task-list-types";
12
+
13
+ type SavedView = "all" | "overdue" | "unscheduled" | "agent";
14
+
15
+ // Table header component with sort indicators
16
+ function TableHeader({ field, label, className = "", sortField, sortDirection, onSortClick }: {
17
+ field: SortField;
18
+ label: string;
19
+ className?: string;
20
+ sortField: SortField;
21
+ sortDirection: SortDirection;
22
+ onSortClick: (field: SortField) => void;
23
+ }) {
24
+ const isActive = sortField === field;
25
+ return (
26
+ <th
27
+ onClick={() => onSortClick(field)}
28
+ className={`cursor-pointer px-4 py-3 text-left text-xs font-medium text-zinc-400 hover:text-zinc-200 transition-colors ${className}`}
29
+ >
30
+ <div className="flex items-center gap-1">
31
+ {label}
32
+ {isActive && (
33
+ <span className="text-zinc-300">
34
+ {sortDirection === "asc" ? "↑" : "↓"}
35
+ </span>
36
+ )}
37
+ </div>
38
+ </th>
39
+ );
40
+ }
41
+
42
+ export function TaskList({ tasks, groupBy = "status" }: Props) {
43
+ const router = useRouter();
44
+ const pathname = usePathname();
45
+ const searchParams = useSearchParams();
46
+ const kanbanStatuses = useKanbanStatuses();
47
+ const statusOrder = kanbanStatuses.filter((s) => s.isVisible).map((s) => s.key);
48
+ const statusOptions = kanbanStatuses.map((s) => s.key);
49
+ const [optimistic, setOptimistic] = useState<Record<string, string>>({});
50
+ const [updating, setUpdating] = useState<string | null>(null);
51
+ const [statusError, setStatusError] = useState<string | null>(null);
52
+
53
+ // Sorting state
54
+ const [sortField, setSortField] = useState<SortField>(() =>
55
+ loadPreference("brief:list-sort-field", "dueDate")
56
+ );
57
+ const [sortDirection, setSortDirection] = useState<SortDirection>(() =>
58
+ loadPreference("brief:list-sort-direction", "asc")
59
+ );
60
+ const [savedView, setSavedView] = useState<SavedView>(() =>
61
+ loadPreference("brief:list-saved-view", "all")
62
+ );
63
+
64
+ // Selected tasks for bulk actions
65
+ const [selectedTasks, setSelectedTasks] = useState<Set<string>>(new Set());
66
+
67
+ useEffect(() => {
68
+ savePreference("brief:list-sort-field", sortField);
69
+ savePreference("brief:list-sort-direction", sortDirection);
70
+ }, [sortDirection, sortField]);
71
+
72
+ useEffect(() => {
73
+ savePreference("brief:list-saved-view", savedView);
74
+ }, [savedView]);
75
+
76
+ useEffect(() => {
77
+ setSelectedTasks(new Set());
78
+ }, [savedView]);
79
+
80
+ function getStatus(t: Task): string {
81
+ return optimistic[t.id] ?? t.status;
82
+ }
83
+
84
+ function taskDetailHref(taskId: string) {
85
+ const from = `${pathname}?${searchParams.toString()}`;
86
+ return `/tasks/${taskId}?from=${encodeURIComponent(from)}`;
87
+ }
88
+
89
+ // Sorting function
90
+ function sortTasks(tasksToSort: Task[]): Task[] {
91
+ return [...tasksToSort].sort((a, b) => {
92
+ let comparison = 0;
93
+
94
+ switch (sortField) {
95
+ case "title":
96
+ comparison = a.title.localeCompare(b.title);
97
+ break;
98
+ case "status":
99
+ const aStatusIndex = statusOrder.indexOf(getStatus(a));
100
+ const bStatusIndex = statusOrder.indexOf(getStatus(b));
101
+ comparison = (aStatusIndex === -1 ? 999 : aStatusIndex) - (bStatusIndex === -1 ? 999 : bStatusIndex);
102
+ break;
103
+ case "dueDate":
104
+ const aDue = a.dueDate ? new Date(a.dueDate).getTime() : Infinity;
105
+ const bDue = b.dueDate ? new Date(b.dueDate).getTime() : Infinity;
106
+ comparison = aDue - bDue;
107
+ break;
108
+ case "priority":
109
+ const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
110
+ const aPriority = priorityOrder[(a.priority?.toLowerCase() || "medium") as keyof typeof priorityOrder] ?? 2;
111
+ const bPriority = priorityOrder[(b.priority?.toLowerCase() || "medium") as keyof typeof priorityOrder] ?? 2;
112
+ comparison = aPriority - bPriority;
113
+ break;
114
+ case "assignee":
115
+ const aAssignee = a.assignee?.name || a.claimedByAlias || "";
116
+ const bAssignee = b.assignee?.name || b.claimedByAlias || "";
117
+ comparison = aAssignee.localeCompare(bAssignee);
118
+ break;
119
+ case "note":
120
+ comparison = a.note.title.localeCompare(b.note.title);
121
+ break;
122
+ case "updatedAt":
123
+ const aUpdated = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
124
+ const bUpdated = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
125
+ comparison = aUpdated - bUpdated;
126
+ break;
127
+ }
128
+
129
+ return sortDirection === "asc" ? comparison : -comparison;
130
+ });
131
+ }
132
+
133
+ // Handle column header click for sorting
134
+ function handleSortClick(field: SortField) {
135
+ if (sortField === field) {
136
+ setSortDirection(sortDirection === "asc" ? "desc" : "asc");
137
+ } else {
138
+ setSortField(field);
139
+ setSortDirection("asc");
140
+ }
141
+ }
142
+
143
+ // Toggle task selection
144
+ function toggleTaskSelection(taskId: string) {
145
+ const newSelected = new Set(selectedTasks);
146
+ if (newSelected.has(taskId)) {
147
+ newSelected.delete(taskId);
148
+ } else {
149
+ newSelected.add(taskId);
150
+ }
151
+ setSelectedTasks(newSelected);
152
+ }
153
+
154
+ // Select/deselect all tasks
155
+ function toggleAllTasks() {
156
+ if (selectedTasks.size === filteredTasks.length) {
157
+ setSelectedTasks(new Set());
158
+ } else {
159
+ setSelectedTasks(new Set(filteredTasks.map((task) => task.id)));
160
+ }
161
+ }
162
+
163
+ async function changeStatus(taskId: string, newStatus: string) {
164
+ const prevStatus = getStatus(tasks.find((t) => t.id === taskId)!);
165
+ setOptimistic((prev) => ({ ...prev, [taskId]: newStatus }));
166
+ setUpdating(taskId);
167
+ setStatusError(null);
168
+ try {
169
+ const res = await fetch(`/api/tasks/${taskId}`, {
170
+ method: "PATCH",
171
+ headers: { "Content-Type": "application/json" },
172
+ body: JSON.stringify({ status: newStatus }),
173
+ });
174
+ if (!res.ok) throw new Error(`${res.status}`);
175
+ router.refresh();
176
+ } catch {
177
+ // Revert optimistic state and surface the error
178
+ setOptimistic((prev) => ({ ...prev, [taskId]: prevStatus }));
179
+ setStatusError("Couldn't update status — please try again.");
180
+ } finally {
181
+ setUpdating(null);
182
+ }
183
+ }
184
+
185
+ // Inline edit handlers (Tasks 2.3.1-2.3.3)
186
+ async function updateDueDate(taskId: string, dueDate: string | null) {
187
+ try {
188
+ const res = await fetch(`/api/tasks/${taskId}`, {
189
+ method: "PATCH",
190
+ headers: { "Content-Type": "application/json" },
191
+ body: JSON.stringify({ dueDate }),
192
+ });
193
+ if (!res.ok) throw new Error(`${res.status}`);
194
+ router.refresh();
195
+ } catch {
196
+ setStatusError("Couldn't update due date — please try again.");
197
+ }
198
+ }
199
+
200
+ async function updateAssignee(taskId: string, assigneeType: "HUMAN" | "AGENT", assigneeId?: string) {
201
+ try {
202
+ const body: Record<string, unknown> = { assigneeType };
203
+ if (assigneeType === "AGENT") {
204
+ body.assigneeId = null;
205
+ } else {
206
+ // Explicitly send assigneeId (or null to unassign)
207
+ body.assigneeId = assigneeId ?? null;
208
+ }
209
+ const res = await fetch(`/api/tasks/${taskId}`, {
210
+ method: "PATCH",
211
+ headers: { "Content-Type": "application/json" },
212
+ body: JSON.stringify(body),
213
+ });
214
+ if (!res.ok) throw new Error(`${res.status}`);
215
+ router.refresh();
216
+ } catch {
217
+ setStatusError("Couldn't update assignee — please try again.");
218
+ }
219
+ }
220
+
221
+ const errorBanner = statusError ? (
222
+ <div className="flex items-center justify-between gap-2 border-b border-red-800/40 bg-red-950/40 px-3 md:px-6 py-2">
223
+ <span className="text-sm text-red-300">{statusError}</span>
224
+ <button onClick={() => setStatusError(null)} className="text-zinc-500 hover:text-zinc-300 text-xs">✕</button>
225
+ </div>
226
+ ) : null;
227
+
228
+ const hasActiveFilters = [
229
+ "note",
230
+ "folder",
231
+ "status",
232
+ "assigneeType",
233
+ "overdue",
234
+ "hasDueDate",
235
+ ].some((key) => {
236
+ const value = searchParams.get(key);
237
+ return value !== null && value !== "";
238
+ });
239
+
240
+ const filteredTasks = tasks.filter((task) => {
241
+ if (savedView === "overdue") {
242
+ return isOverdue({ ...task, status: getStatus(task) });
243
+ }
244
+
245
+ if (savedView === "unscheduled") {
246
+ return !task.startDate && !task.dueDate;
247
+ }
248
+
249
+ if (savedView === "agent") {
250
+ return task.assigneeType === "AGENT";
251
+ }
252
+
253
+ return true;
254
+ });
255
+
256
+ const showFilteredEmptyState = hasActiveFilters || savedView !== "all";
257
+ const savedViewOptions: { key: SavedView; label: string }[] = [
258
+ { key: "all", label: "All" },
259
+ { key: "overdue", label: "Overdue" },
260
+ { key: "unscheduled", label: "Unscheduled" },
261
+ { key: "agent", label: "Agent" },
262
+ ];
263
+
264
+ const savedViewBar = (
265
+ <div className="flex flex-wrap items-center gap-2 border-b border-zinc-800/60 px-3 py-3 md:px-6">
266
+ <span className="text-xs uppercase tracking-wide text-zinc-500">Views</span>
267
+ <div className="inline-flex flex-wrap rounded-md border border-zinc-800 bg-zinc-950 p-1">
268
+ {savedViewOptions.map((option) => (
269
+ <button
270
+ key={option.key}
271
+ type="button"
272
+ onClick={() => setSavedView(option.key)}
273
+ className={
274
+ savedView === option.key
275
+ ? "rounded px-2 py-1 text-xs bg-zinc-800 text-zinc-200"
276
+ : "rounded px-2 py-1 text-xs text-zinc-500 hover:text-zinc-300"
277
+ }
278
+ >
279
+ {option.label}
280
+ </button>
281
+ ))}
282
+ </div>
283
+ </div>
284
+ );
285
+
286
+ if (filteredTasks.length === 0) {
287
+ return (
288
+ <>
289
+ {errorBanner}
290
+ {savedViewBar}
291
+ <div className="flex flex-col items-center justify-center gap-3 py-24 text-center">
292
+ {showFilteredEmptyState ? (
293
+ <>
294
+ <p className="text-zinc-500">No tasks match this view.</p>
295
+ <p className="text-sm text-zinc-600">
296
+ Clear one or more filters, or create tasks from a note.
297
+ </p>
298
+ </>
299
+ ) : (
300
+ <>
301
+ <p className="text-zinc-500">No tasks yet.</p>
302
+ <p className="text-sm text-zinc-600">
303
+ Write{" "}
304
+ <code className="rounded bg-zinc-800 px-1 py-0.5 text-xs text-zinc-400">
305
+ - [ ] task
306
+ </code>{" "}
307
+ in a note to create tasks automatically.
308
+ </p>
309
+ </>
310
+ )}
311
+ </div>
312
+ </>
313
+ );
314
+ }
315
+
316
+ if (groupBy === "note") {
317
+ const noteMap = new Map<string, { title: string; tasks: Task[] }>();
318
+ for (const t of filteredTasks) {
319
+ if (!noteMap.has(t.note.id)) {
320
+ noteMap.set(t.note.id, { title: t.note.title, tasks: [] });
321
+ }
322
+ noteMap.get(t.note.id)!.tasks.push(t);
323
+ }
324
+
325
+ return (
326
+ <>
327
+ {errorBanner}
328
+ {savedViewBar}
329
+ <div className="divide-y divide-zinc-800/60">
330
+ {[...noteMap.entries()].map(([noteId, { title, tasks: noteTasks }]) => (
331
+ <div key={noteId} className="px-3 md:px-6 py-4">
332
+ <div className="mb-3 flex items-center gap-2">
333
+ <Link href={`/notes/${noteId}`} className="text-sm font-medium text-zinc-300 hover:text-white">
334
+ {title}
335
+ </Link>
336
+ <span className="text-xs text-zinc-600">{noteTasks.length}</span>
337
+ </div>
338
+ <div className="space-y-1">
339
+ {noteTasks
340
+ .sort((a, b) => statusOrder.indexOf(getStatus(a)) - statusOrder.indexOf(getStatus(b)))
341
+ .map((task) => (
342
+ <TaskRow
343
+ key={task.id}
344
+ task={task}
345
+ status={getStatus(task)}
346
+ overdue={isOverdue({ ...task, status: getStatus(task) })}
347
+ updating={updating === task.id}
348
+ detailHref={taskDetailHref(task.id)}
349
+ onStatusChange={changeStatus}
350
+ />
351
+ ))}
352
+ </div>
353
+ </div>
354
+ ))}
355
+ </div>
356
+ </>
357
+ );
358
+ }
359
+
360
+ // When groupBy === "status", show sortable table view
361
+ // Collect orphaned tasks (status not in visible statusOrder) so they aren't shown twice
362
+ const visibleTasks = filteredTasks.filter((t) => statusOrder.includes(getStatus(t)));
363
+ const orphanedTasks = filteredTasks.filter((t) => !statusOrder.includes(getStatus(t)));
364
+ const sortedTasks = sortTasks(visibleTasks);
365
+ const sortedOrphanedTasks = sortTasks(orphanedTasks);
366
+
367
+ // Return sortable table view for status grouping
368
+ return (
369
+ <>
370
+ {errorBanner}
371
+ {savedViewBar}
372
+
373
+ {/* Bulk action bar */}
374
+ {selectedTasks.size > 0 && (
375
+ <div className="sticky top-0 z-10 flex items-center gap-4 border-b border-blue-900/30 bg-blue-950/30 px-4 py-3">
376
+ <span className="text-sm text-blue-100">
377
+ {selectedTasks.size} task{selectedTasks.size === 1 ? "" : "s"} selected
378
+ </span>
379
+ <div className="flex items-center gap-2">
380
+ <select
381
+ onChange={(e) => {
382
+ if (e.target.value) {
383
+ // Bulk status change - would need API endpoint
384
+ alert(`Would change ${selectedTasks.size} tasks to ${e.target.value}`);
385
+ e.target.value = "";
386
+ }
387
+ }}
388
+ className="rounded border border-blue-900/40 bg-zinc-900 px-2 py-1 text-xs text-zinc-200"
389
+ >
390
+ <option value="">Set status...</option>
391
+ {statusOptions.map((s) => (
392
+ <option key={s} value={s}>{s}</option>
393
+ ))}
394
+ </select>
395
+ <button
396
+ onClick={() => setSelectedTasks(new Set())}
397
+ className="text-xs text-blue-200/80 hover:text-blue-100"
398
+ >
399
+ Clear
400
+ </button>
401
+ </div>
402
+ </div>
403
+ )}
404
+
405
+ {/* Sortable Table View */}
406
+ <div className="overflow-x-auto">
407
+ <table className="w-full">
408
+ <thead className="border-b border-zinc-800 bg-zinc-900/50">
409
+ <tr>
410
+ <th className="px-3 py-3 w-8">
411
+ <input
412
+ type="checkbox"
413
+ checked={selectedTasks.size === filteredTasks.length && filteredTasks.length > 0}
414
+ onChange={toggleAllTasks}
415
+ className="rounded border-zinc-600 bg-zinc-800 text-blue-600"
416
+ />
417
+ </th>
418
+ <TableHeader field="title" label="Title" className="w-[35%]" sortField={sortField} sortDirection={sortDirection} onSortClick={handleSortClick} />
419
+ <TableHeader field="status" label="Status" sortField={sortField} sortDirection={sortDirection} onSortClick={handleSortClick} />
420
+ <TableHeader field="dueDate" label="Due" sortField={sortField} sortDirection={sortDirection} onSortClick={handleSortClick} />
421
+ <TableHeader field="priority" label="Priority" sortField={sortField} sortDirection={sortDirection} onSortClick={handleSortClick} />
422
+ <TableHeader field="assignee" label="Assignee" sortField={sortField} sortDirection={sortDirection} onSortClick={handleSortClick} />
423
+ <TableHeader field="note" label="Note/Folder" sortField={sortField} sortDirection={sortDirection} onSortClick={handleSortClick} />
424
+ <TableHeader field="updatedAt" label="Updated" sortField={sortField} sortDirection={sortDirection} onSortClick={handleSortClick} />
425
+ </tr>
426
+ </thead>
427
+ <tbody className="divide-y divide-zinc-800/60">
428
+ {sortedTasks.map((task) => (
429
+ <TaskTableRow
430
+ key={task.id}
431
+ task={task}
432
+ status={getStatus(task)}
433
+ overdue={isOverdue({ ...task, status: getStatus(task) })}
434
+ updating={updating === task.id}
435
+ onStatusChange={changeStatus}
436
+ isSelected={selectedTasks.has(task.id)}
437
+ onSelect={() => toggleTaskSelection(task.id)}
438
+ kanbanStatuses={kanbanStatuses}
439
+ detailHref={taskDetailHref(task.id)}
440
+ onUpdateDueDate={updateDueDate}
441
+ onUpdateAssignee={updateAssignee}
442
+ />
443
+ ))}
444
+ </tbody>
445
+ </table>
446
+ </div>
447
+
448
+ {/* Orphaned tasks section */}
449
+ {sortedOrphanedTasks.length > 0 && (
450
+ <div className="mt-6 border-t border-zinc-800">
451
+ <div className="px-4 py-3 bg-zinc-900/30">
452
+ <span className="inline-flex items-center rounded border border-zinc-600 bg-zinc-800/60 px-2 py-0.5 text-xs font-medium text-zinc-400">
453
+ Uncategorized
454
+ </span>
455
+ <span className="ml-2 text-xs text-zinc-600">{sortedOrphanedTasks.length} tasks with custom status</span>
456
+ </div>
457
+ <table className="w-full">
458
+ <tbody className="divide-y divide-zinc-800/60">
459
+ {sortedOrphanedTasks.map((task) => (
460
+ <TaskTableRow
461
+ key={task.id}
462
+ task={task}
463
+ status={getStatus(task)}
464
+ overdue={isOverdue({ ...task, status: getStatus(task) })}
465
+ updating={updating === task.id}
466
+ onStatusChange={changeStatus}
467
+ isSelected={selectedTasks.has(task.id)}
468
+ onSelect={() => toggleTaskSelection(task.id)}
469
+ kanbanStatuses={kanbanStatuses}
470
+ detailHref={taskDetailHref(task.id)}
471
+ onUpdateDueDate={updateDueDate}
472
+ onUpdateAssignee={updateAssignee}
473
+ />
474
+ ))}
475
+ </tbody>
476
+ </table>
477
+ </div>
478
+ )}
479
+ </>
480
+ );
481
+ }