@tuturuuu/ui 0.17.0 → 0.18.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 (584) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/biome.json +1 -1
  3. package/package.json +76 -118
  4. package/src/components/ui/calendar-app/calendar-client-page.tsx +12 -3
  5. package/src/components/ui/calendar-app/calendar-page-shell.tsx +38 -28
  6. package/src/components/ui/custom/notification-popover-client.tsx +3 -3
  7. package/src/components/ui/tasks/progress/activity-heatmap.tsx +256 -0
  8. package/src/components/ui/tasks/progress/breakdown-bars.tsx +79 -0
  9. package/src/components/ui/tasks/progress/cumulative-progress-chart.tsx +185 -0
  10. package/src/components/ui/tasks/progress/daily-bar-chart.tsx +97 -0
  11. package/src/components/ui/tasks/progress/habit-gauge.tsx +92 -0
  12. package/src/components/ui/tasks/progress/mini-sparkline.tsx +56 -0
  13. package/src/components/ui/tasks/progress/weekday-distribution-chart.tsx +72 -0
  14. package/src/components/ui/text-editor/editor.tsx +7 -1
  15. package/src/components/ui/text-editor/extensions.ts +4 -1
  16. package/src/components/ui/text-editor/mention-extension.tsx +33 -121
  17. package/src/lib/workspace-actions.ts +15 -4
  18. package/src/components/ui/calendar-app/components/actions-dropdown.tsx +0 -269
  19. package/src/components/ui/calendar-app/components/auto-schedule-comprehensive-dialog.tsx +0 -220
  20. package/src/components/ui/calendar-app/components/calendar-header-actions.tsx +0 -67
  21. package/src/components/ui/calendar-app/components/experimental-feature-dialog.tsx +0 -56
  22. package/src/components/ui/calendar-app/components/habits-panel.tsx +0 -335
  23. package/src/components/ui/calendar-app/components/load-smart-scheduling-tasks.tsx +0 -143
  24. package/src/components/ui/calendar-app/components/priority-dropdown.tsx +0 -113
  25. package/src/components/ui/calendar-app/components/priority-view.tsx +0 -954
  26. package/src/components/ui/calendar-app/components/quick-task-dialog.tsx +0 -335
  27. package/src/components/ui/calendar-app/components/quick-task-timer.tsx +0 -112
  28. package/src/components/ui/calendar-app/components/scheduling-dialog.tsx +0 -664
  29. package/src/components/ui/calendar-app/components/sidebar/calendar-sidebar.tsx +0 -128
  30. package/src/components/ui/calendar-app/components/sidebar/index.tsx +0 -1
  31. package/src/components/ui/calendar-app/components/smart-schedule-button.tsx +0 -117
  32. package/src/components/ui/calendar-app/components/smart-schedule-preview-dialog.tsx +0 -845
  33. package/src/components/ui/calendar-app/components/smart-schedule-preview-panel.tsx +0 -941
  34. package/src/components/ui/calendar-app/components/task-fetcher.ts +0 -51
  35. package/src/components/ui/calendar-app/components/task-form.tsx +0 -132
  36. package/src/components/ui/calendar-app/components/task-list-form.tsx +0 -84
  37. package/src/components/ui/calendar-app/components/task-scheduler-panel.tsx +0 -494
  38. package/src/components/ui/calendar-app/components/tasks-sidebar-content.tsx +0 -232
  39. package/src/components/ui/calendar-app/components/tasks-sidebar.tsx +0 -31
  40. package/src/components/ui/calendar-app/components/time-tracker/components/active-session-card.tsx +0 -113
  41. package/src/components/ui/calendar-app/components/time-tracker/components/index.ts +0 -3
  42. package/src/components/ui/calendar-app/components/time-tracker/components/session-card.tsx +0 -153
  43. package/src/components/ui/calendar-app/components/time-tracker/components/stats-cards.tsx +0 -58
  44. package/src/components/ui/calendar-app/components/time-tracker/dialogs/create-task-dialog.tsx +0 -190
  45. package/src/components/ui/calendar-app/components/time-tracker/dialogs/delete-session-dialog.tsx +0 -52
  46. package/src/components/ui/calendar-app/components/time-tracker/dialogs/edit-session-dialog.tsx +0 -173
  47. package/src/components/ui/calendar-app/components/time-tracker/dialogs/index.ts +0 -3
  48. package/src/components/ui/calendar-app/components/time-tracker/hooks/index.ts +0 -2
  49. package/src/components/ui/calendar-app/components/time-tracker/hooks/use-sessions.ts +0 -191
  50. package/src/components/ui/calendar-app/components/time-tracker/hooks/use-time-tracker.ts +0 -408
  51. package/src/components/ui/calendar-app/components/time-tracker/index.tsx +0 -907
  52. package/src/components/ui/calendar-app/components/time-tracker/tabs/history-tab.tsx +0 -28
  53. package/src/components/ui/calendar-app/components/time-tracker/tabs/index.ts +0 -2
  54. package/src/components/ui/calendar-app/components/time-tracker/tabs/recent-sessions-tab.tsx +0 -173
  55. package/src/components/ui/calendar-app/components/time-tracker/time-tracker-trigger.tsx +0 -50
  56. package/src/components/ui/calendar-app/components/time-tracker/utils/category-colors.ts +0 -38
  57. package/src/components/ui/calendar-app/components/time-tracker/utils/format-time.ts +0 -26
  58. package/src/components/ui/calendar-app/components/time-tracker/utils/index.ts +0 -2
  59. package/src/components/ui/calendar-app/components/time-tracker.tsx +0 -2040
  60. package/src/components/ui/custom/settings/task-settings.tsx +0 -543
  61. package/src/components/ui/custom/settings/task-sound-settings.test.tsx +0 -146
  62. package/src/components/ui/text-editor/__tests__/task-mention-chip.test.tsx +0 -476
  63. package/src/components/ui/text-editor/task-mention-chip.tsx +0 -1397
  64. package/src/components/ui/text-editor/task-mention-resolution.ts +0 -235
  65. package/src/components/ui/text-editor/task-summary-popover.tsx +0 -360
  66. package/src/components/ui/tu-do/boards/__tests__/board-share-dialog.test.tsx +0 -286
  67. package/src/components/ui/tu-do/boards/__tests__/quick-create-board-dialog.test.tsx +0 -52
  68. package/src/components/ui/tu-do/boards/__tests__/task-board-form.test.tsx +0 -142
  69. package/src/components/ui/tu-do/boards/__tests__/workspace-projects-client-page.test.tsx +0 -169
  70. package/src/components/ui/tu-do/boards/analytics/GanttChart.tsx +0 -419
  71. package/src/components/ui/tu-do/boards/analytics/GanttControls.tsx +0 -123
  72. package/src/components/ui/tu-do/boards/analytics/GanttHeader.tsx +0 -48
  73. package/src/components/ui/tu-do/boards/analytics/GanttTimeline.tsx +0 -355
  74. package/src/components/ui/tu-do/boards/analytics/StatusDistribution.tsx +0 -130
  75. package/src/components/ui/tu-do/boards/analytics/TaskCreationAnalytics.tsx +0 -285
  76. package/src/components/ui/tu-do/boards/analytics/TaskDetailCard.tsx +0 -270
  77. package/src/components/ui/tu-do/boards/analytics/TaskGroup.tsx +0 -282
  78. package/src/components/ui/tu-do/boards/analytics/TaskWorkflowAnalytics.tsx +0 -280
  79. package/src/components/ui/tu-do/boards/board-public-link-section.tsx +0 -231
  80. package/src/components/ui/tu-do/boards/board-selector.tsx +0 -301
  81. package/src/components/ui/tu-do/boards/board-share-dialog.tsx +0 -69
  82. package/src/components/ui/tu-do/boards/board-share-settings-panel.tsx +0 -351
  83. package/src/components/ui/tu-do/boards/boardId/__tests__/list-actions.test.tsx +0 -199
  84. package/src/components/ui/tu-do/boards/boardId/board-column-external-retry.test.tsx +0 -185
  85. package/src/components/ui/tu-do/boards/boardId/board-column-initial-load.test.ts +0 -38
  86. package/src/components/ui/tu-do/boards/boardId/board-column.tsx +0 -922
  87. package/src/components/ui/tu-do/boards/boardId/board-text-utils.test.ts +0 -24
  88. package/src/components/ui/tu-do/boards/boardId/board-text-utils.ts +0 -11
  89. package/src/components/ui/tu-do/boards/boardId/enhanced-task-list.tsx +0 -543
  90. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/__tests__/bulk-mutations-external-workspaces.test.tsx +0 -392
  91. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/__tests__/bulk-mutations-move.test.tsx +0 -252
  92. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-actions-island.test.tsx +0 -57
  93. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-actions-island.tsx +0 -106
  94. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-actions-menu.tsx +0 -689
  95. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-custom-date-dialog.tsx +0 -82
  96. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-delete-dialog.tsx +0 -58
  97. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-clear-delete.ts +0 -418
  98. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-move.ts +0 -662
  99. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations-assignees.ts +0 -375
  100. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations-labels.ts +0 -278
  101. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations-projects.ts +0 -297
  102. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations.ts +0 -12
  103. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-updates.ts +0 -462
  104. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operation-i18n.ts +0 -524
  105. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operation-types.ts +0 -34
  106. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operation-utils.ts +0 -377
  107. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operations.ts +0 -348
  108. package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-personal-external-move.ts +0 -132
  109. package/src/components/ui/tu-do/boards/boardId/kanban/data/kanban-deadline-query.ts +0 -90
  110. package/src/components/ui/tu-do/boards/boardId/kanban/data/use-applied-sets.ts +0 -79
  111. package/src/components/ui/tu-do/boards/boardId/kanban/data/use-bulk-resources.ts +0 -112
  112. package/src/components/ui/tu-do/boards/boardId/kanban/data/use-filtered-resources.ts +0 -54
  113. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/__tests__/column-reorder.test.ts +0 -80
  114. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/auto-scroll.test.ts +0 -118
  115. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/auto-scroll.ts +0 -160
  116. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/column-reorder.ts +0 -65
  117. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/drag-preview.tsx +0 -117
  118. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/kanban-sort-helpers.ts +0 -76
  119. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-cache.ts +0 -367
  120. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-geometry.test.ts +0 -67
  121. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-geometry.ts +0 -94
  122. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-order.ts +0 -150
  123. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-pending.test.ts +0 -37
  124. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-pending.ts +0 -42
  125. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-preview.test.ts +0 -318
  126. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-preview.ts +0 -260
  127. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-types.ts +0 -39
  128. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-sort-key.ts +0 -47
  129. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/use-kanban-dnd.test.ts +0 -859
  130. package/src/components/ui/tu-do/boards/boardId/kanban/dnd/use-kanban-dnd.ts +0 -1659
  131. package/src/components/ui/tu-do/boards/boardId/kanban/kanban-column-collapse.ts +0 -16
  132. package/src/components/ui/tu-do/boards/boardId/kanban/kanban-constants.ts +0 -43
  133. package/src/components/ui/tu-do/boards/boardId/kanban/planner/__tests__/kanban-planner-island.test.tsx +0 -380
  134. package/src/components/ui/tu-do/boards/boardId/kanban/planner/kanban-planner-dialog.tsx +0 -204
  135. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-digest-panel.tsx +0 -61
  136. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-item-strip.tsx +0 -54
  137. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-plan-toolbar.tsx +0 -251
  138. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-scope-badge.tsx +0 -27
  139. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-section.tsx +0 -58
  140. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-share-dialog.tsx +0 -238
  141. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-target-controls.tsx +0 -143
  142. package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-utils.ts +0 -65
  143. package/src/components/ui/tu-do/boards/boardId/kanban/planner/use-kanban-planner-state.ts +0 -234
  144. package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-column-width.ts +0 -30
  145. package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-columns.test.tsx +0 -1077
  146. package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-columns.tsx +0 -447
  147. package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-deadline-panels.tsx +0 -703
  148. package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-deadline-tasks.test.ts +0 -267
  149. package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-deadline-tasks.ts +0 -112
  150. package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-skeleton.tsx +0 -113
  151. package/src/components/ui/tu-do/boards/boardId/kanban/selection/use-keyboard-shortcuts.ts +0 -137
  152. package/src/components/ui/tu-do/boards/boardId/kanban/selection/use-multi-select.ts +0 -119
  153. package/src/components/ui/tu-do/boards/boardId/kanban.tsx +0 -631
  154. package/src/components/ui/tu-do/boards/boardId/list-actions.tsx +0 -522
  155. package/src/components/ui/tu-do/boards/boardId/menus/__tests__/task-estimation-menu.test.tsx +0 -261
  156. package/src/components/ui/tu-do/boards/boardId/menus/__tests__/task-menus.test.tsx +0 -708
  157. package/src/components/ui/tu-do/boards/boardId/menus/index.ts +0 -12
  158. package/src/components/ui/tu-do/boards/boardId/menus/task-assignees-menu.tsx +0 -176
  159. package/src/components/ui/tu-do/boards/boardId/menus/task-blocking-menu.tsx +0 -304
  160. package/src/components/ui/tu-do/boards/boardId/menus/task-due-date-menu.tsx +0 -201
  161. package/src/components/ui/tu-do/boards/boardId/menus/task-estimation-menu.tsx +0 -103
  162. package/src/components/ui/tu-do/boards/boardId/menus/task-labels-menu.tsx +0 -134
  163. package/src/components/ui/tu-do/boards/boardId/menus/task-move-menu.tsx +0 -66
  164. package/src/components/ui/tu-do/boards/boardId/menus/task-parent-menu.tsx +0 -228
  165. package/src/components/ui/tu-do/boards/boardId/menus/task-picker-popover.tsx +0 -300
  166. package/src/components/ui/tu-do/boards/boardId/menus/task-priority-menu.tsx +0 -178
  167. package/src/components/ui/tu-do/boards/boardId/menus/task-projects-menu.tsx +0 -143
  168. package/src/components/ui/tu-do/boards/boardId/menus/task-related-menu.tsx +0 -242
  169. package/src/components/ui/tu-do/boards/boardId/menus/task-scheduling-menu.tsx +0 -465
  170. package/src/components/ui/tu-do/boards/boardId/menus/task-scheduling-utils.ts +0 -109
  171. package/src/components/ui/tu-do/boards/boardId/status-grouped-board.tsx +0 -533
  172. package/src/components/ui/tu-do/boards/boardId/status-section.tsx +0 -274
  173. package/src/components/ui/tu-do/boards/boardId/task-actions.tsx +0 -675
  174. package/src/components/ui/tu-do/boards/boardId/task-board-server-page.test.tsx +0 -209
  175. package/src/components/ui/tu-do/boards/boardId/task-board-server-page.tsx +0 -109
  176. package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardCheckbox.tsx +0 -50
  177. package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardDates.tsx +0 -123
  178. package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardHeader.tsx +0 -97
  179. package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardMetadata.tsx +0 -152
  180. package/src/components/ui/tu-do/boards/boardId/task-card/measured-task-card.tsx +0 -118
  181. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-archive-visibility.test.ts +0 -44
  182. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-archive-visibility.ts +0 -17
  183. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-checkbox-style.ts +0 -39
  184. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-comparator.test.ts +0 -104
  185. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-comparator.ts +0 -123
  186. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-completion-checkbox-visibility.test.ts +0 -31
  187. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-completion-checkbox-visibility.ts +0 -9
  188. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-identifier-row.test.tsx +0 -124
  189. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-identifier-row.tsx +0 -88
  190. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-label-options.ts +0 -24
  191. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-open-options.test.ts +0 -166
  192. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-open-options.ts +0 -148
  193. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-resource-context.test.ts +0 -113
  194. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-resource-context.ts +0 -50
  195. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-visibility.test.ts +0 -41
  196. package/src/components/ui/tu-do/boards/boardId/task-card/task-card-visibility.ts +0 -14
  197. package/src/components/ui/tu-do/boards/boardId/task-card/task-card.tsx +0 -2889
  198. package/src/components/ui/tu-do/boards/boardId/task-card/task-scheduling-badge.tsx +0 -174
  199. package/src/components/ui/tu-do/boards/boardId/task-dialogs/BoardEstimationConfigDialog.tsx +0 -499
  200. package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskCustomDateDialog.tsx +0 -109
  201. package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskDeleteDialog.tsx +0 -96
  202. package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskNewLabelDialog.tsx +0 -178
  203. package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskNewProjectDialog.tsx +0 -127
  204. package/src/components/ui/tu-do/boards/boardId/task-filter.test.tsx +0 -152
  205. package/src/components/ui/tu-do/boards/boardId/task-filter.tsx +0 -996
  206. package/src/components/ui/tu-do/boards/boardId/task-form.tsx +0 -498
  207. package/src/components/ui/tu-do/boards/boardId/task-list-drag-preview.test.ts +0 -101
  208. package/src/components/ui/tu-do/boards/boardId/task-list-form.tsx +0 -91
  209. package/src/components/ui/tu-do/boards/boardId/task-list.tsx +0 -535
  210. package/src/components/ui/tu-do/boards/boardId/task-parent-badge-state.test.ts +0 -64
  211. package/src/components/ui/tu-do/boards/boardId/task-parent-badge-state.ts +0 -31
  212. package/src/components/ui/tu-do/boards/boardId/task.tsx +0 -2
  213. package/src/components/ui/tu-do/boards/boardId/timeline/task-edit-dialog.tsx +0 -109
  214. package/src/components/ui/tu-do/boards/boardId/timeline/timeline-display.ts +0 -103
  215. package/src/components/ui/tu-do/boards/boardId/timeline/timeline-grid.tsx +0 -381
  216. package/src/components/ui/tu-do/boards/boardId/timeline/timeline-task-row.tsx +0 -339
  217. package/src/components/ui/tu-do/boards/boardId/timeline/timeline-toolbar.tsx +0 -356
  218. package/src/components/ui/tu-do/boards/boardId/timeline/timeline-utils.test.ts +0 -169
  219. package/src/components/ui/tu-do/boards/boardId/timeline/timeline-utils.ts +0 -517
  220. package/src/components/ui/tu-do/boards/boardId/timeline-board-open-task.test.tsx +0 -164
  221. package/src/components/ui/tu-do/boards/boardId/timeline-board.test.tsx +0 -217
  222. package/src/components/ui/tu-do/boards/boardId/timeline-board.tsx +0 -834
  223. package/src/components/ui/tu-do/boards/boards-list-skeleton.tsx +0 -62
  224. package/src/components/ui/tu-do/boards/columns.tsx +0 -159
  225. package/src/components/ui/tu-do/boards/copy-board-dialog.tsx +0 -156
  226. package/src/components/ui/tu-do/boards/enhanced-boards-view.tsx +0 -347
  227. package/src/components/ui/tu-do/boards/form.tsx +0 -264
  228. package/src/components/ui/tu-do/boards/quick-create-board-dialog.tsx +0 -75
  229. package/src/components/ui/tu-do/boards/row-actions.tsx +0 -397
  230. package/src/components/ui/tu-do/boards/share-section.tsx +0 -100
  231. package/src/components/ui/tu-do/boards/workspace-projects-client-page.tsx +0 -192
  232. package/src/components/ui/tu-do/boards/workspace-projects-page.tsx +0 -155
  233. package/src/components/ui/tu-do/cycles/task-cycles-client.tsx +0 -753
  234. package/src/components/ui/tu-do/cycles/task-cycles-page.tsx +0 -103
  235. package/src/components/ui/tu-do/drafts/draft-card.tsx +0 -204
  236. package/src/components/ui/tu-do/drafts/draft-convert-dialog.tsx +0 -195
  237. package/src/components/ui/tu-do/drafts/drafts-page.tsx +0 -122
  238. package/src/components/ui/tu-do/drafts/task-drafts-page.tsx +0 -90
  239. package/src/components/ui/tu-do/estimates/client.tsx +0 -292
  240. package/src/components/ui/tu-do/estimates/edit-estimation-dialog.tsx +0 -374
  241. package/src/components/ui/tu-do/estimates/task-estimates-page.tsx +0 -57
  242. package/src/components/ui/tu-do/estimates/use-task-estimates.ts +0 -324
  243. package/src/components/ui/tu-do/habits/client.tsx +0 -263
  244. package/src/components/ui/tu-do/habits/habit-card.tsx +0 -183
  245. package/src/components/ui/tu-do/habits/habit-form-dialog.tsx +0 -701
  246. package/src/components/ui/tu-do/habits/habits-page.tsx +0 -27
  247. package/src/components/ui/tu-do/hooks/__tests__/useDraftPersistence.test.ts +0 -494
  248. package/src/components/ui/tu-do/hooks/__tests__/useTaskDialog.test.tsx +0 -127
  249. package/src/components/ui/tu-do/hooks/__tests__/useTaskDialogState.test.ts +0 -217
  250. package/src/components/ui/tu-do/hooks/__tests__/useTaskLabelManagement.test.tsx +0 -572
  251. package/src/components/ui/tu-do/hooks/__tests__/useTaskProjectManagement.test.tsx +0 -144
  252. package/src/components/ui/tu-do/hooks/useDraftPersistence.ts +0 -199
  253. package/src/components/ui/tu-do/hooks/useTaskCardRelationships.ts +0 -340
  254. package/src/components/ui/tu-do/hooks/useTaskDialog.ts +0 -122
  255. package/src/components/ui/tu-do/hooks/useTaskDialogState.ts +0 -145
  256. package/src/components/ui/tu-do/hooks/useTaskFormState.ts +0 -206
  257. package/src/components/ui/tu-do/hooks/useTaskKeyboardShortcuts.ts +0 -58
  258. package/src/components/ui/tu-do/hooks/useTaskLabelManagement.ts +0 -425
  259. package/src/components/ui/tu-do/hooks/useTaskProjectManagement.ts +0 -454
  260. package/src/components/ui/tu-do/initiatives/task-initiatives-client.tsx +0 -889
  261. package/src/components/ui/tu-do/initiatives/task-initiatives-page.tsx +0 -116
  262. package/src/components/ui/tu-do/labels/client.tsx +0 -201
  263. package/src/components/ui/tu-do/labels/components/delete-label-dialog.tsx +0 -57
  264. package/src/components/ui/tu-do/labels/components/label-card.tsx +0 -86
  265. package/src/components/ui/tu-do/labels/components/label-dialog.tsx +0 -259
  266. package/src/components/ui/tu-do/labels/components/label-list.tsx +0 -83
  267. package/src/components/ui/tu-do/labels/hooks/use-task-labels.ts +0 -170
  268. package/src/components/ui/tu-do/labels/task-labels-page.tsx +0 -53
  269. package/src/components/ui/tu-do/labels/types.ts +0 -6
  270. package/src/components/ui/tu-do/logs/columns.tsx +0 -755
  271. package/src/components/ui/tu-do/logs/logs-client.tsx +0 -1006
  272. package/src/components/ui/tu-do/logs/logs-timeline.tsx +0 -2483
  273. package/src/components/ui/tu-do/logs/task-logs-page.tsx +0 -59
  274. package/src/components/ui/tu-do/my-tasks/__tests__/my-tasks-content.test.tsx +0 -408
  275. package/src/components/ui/tu-do/my-tasks/__tests__/use-my-tasks-query.test.ts +0 -469
  276. package/src/components/ui/tu-do/my-tasks/__tests__/use-my-tasks-state.test.ts +0 -1017
  277. package/src/components/ui/tu-do/my-tasks/__tests__/use-task-context-actions.test.ts +0 -584
  278. package/src/components/ui/tu-do/my-tasks/ai-credit-indicator.tsx +0 -143
  279. package/src/components/ui/tu-do/my-tasks/board-selector-dialog.tsx +0 -239
  280. package/src/components/ui/tu-do/my-tasks/command-bar.tsx +0 -1351
  281. package/src/components/ui/tu-do/my-tasks/label-project-filter.tsx +0 -194
  282. package/src/components/ui/tu-do/my-tasks/my-task-context-menu.tsx +0 -356
  283. package/src/components/ui/tu-do/my-tasks/my-tasks-content.tsx +0 -328
  284. package/src/components/ui/tu-do/my-tasks/my-tasks-data-loader.tsx +0 -17
  285. package/src/components/ui/tu-do/my-tasks/my-tasks-filters.tsx +0 -258
  286. package/src/components/ui/tu-do/my-tasks/my-tasks-header.tsx +0 -121
  287. package/src/components/ui/tu-do/my-tasks/my-tasks-page.tsx +0 -40
  288. package/src/components/ui/tu-do/my-tasks/personal-placement-dialog.tsx +0 -188
  289. package/src/components/ui/tu-do/my-tasks/task-filter.tsx +0 -235
  290. package/src/components/ui/tu-do/my-tasks/task-list-with-completion.tsx +0 -832
  291. package/src/components/ui/tu-do/my-tasks/task-list.tsx +0 -258
  292. package/src/components/ui/tu-do/my-tasks/task-preview-dialog.tsx +0 -1597
  293. package/src/components/ui/tu-do/my-tasks/task-section.tsx +0 -261
  294. package/src/components/ui/tu-do/my-tasks/use-my-tasks-query.ts +0 -149
  295. package/src/components/ui/tu-do/my-tasks/use-my-tasks-state.ts +0 -1037
  296. package/src/components/ui/tu-do/my-tasks/use-task-context-actions.ts +0 -474
  297. package/src/components/ui/tu-do/notes/note-edit-dialog.tsx +0 -118
  298. package/src/components/ui/tu-do/notes/note-list.tsx +0 -799
  299. package/src/components/ui/tu-do/notes/notes-content.tsx +0 -178
  300. package/src/components/ui/tu-do/notes/notes-page.tsx +0 -27
  301. package/src/components/ui/tu-do/progress/task-progress-import-panel.tsx +0 -60
  302. package/src/components/ui/tu-do/progress/task-progress-leaderboards-panel.tsx +0 -156
  303. package/src/components/ui/tu-do/progress/task-progress-page.tsx +0 -382
  304. package/src/components/ui/tu-do/progress/task-progress-panels.tsx +0 -303
  305. package/src/components/ui/tu-do/projects/components/index.ts +0 -11
  306. package/src/components/ui/tu-do/projects/components/project-actions-menu.tsx +0 -66
  307. package/src/components/ui/tu-do/projects/components/project-badges.tsx +0 -84
  308. package/src/components/ui/tu-do/projects/components/project-filter-menu.tsx +0 -170
  309. package/src/components/ui/tu-do/projects/components/project-grid-card.tsx +0 -198
  310. package/src/components/ui/tu-do/projects/components/project-list-item.tsx +0 -195
  311. package/src/components/ui/tu-do/projects/components/project-metrics.tsx +0 -87
  312. package/src/components/ui/tu-do/projects/components/project-progress-meter.tsx +0 -33
  313. package/src/components/ui/tu-do/projects/components/project-sort-menu.tsx +0 -71
  314. package/src/components/ui/tu-do/projects/components/projects-empty-state.tsx +0 -38
  315. package/src/components/ui/tu-do/projects/components/projects-loading-state.tsx +0 -26
  316. package/src/components/ui/tu-do/projects/components/projects-toolbar.tsx +0 -179
  317. package/src/components/ui/tu-do/projects/dialogs/create-project-dialog.tsx +0 -117
  318. package/src/components/ui/tu-do/projects/dialogs/edit-project-dialog.tsx +0 -125
  319. package/src/components/ui/tu-do/projects/dialogs/index.ts +0 -3
  320. package/src/components/ui/tu-do/projects/dialogs/manage-tasks-dialog.tsx +0 -205
  321. package/src/components/ui/tu-do/projects/hooks/index.ts +0 -2
  322. package/src/components/ui/tu-do/projects/hooks/use-project-filters.ts +0 -248
  323. package/src/components/ui/tu-do/projects/hooks/use-task-projects.ts +0 -238
  324. package/src/components/ui/tu-do/projects/projectId/components/__tests__/tasks-tab-layout.test.tsx +0 -169
  325. package/src/components/ui/tu-do/projects/projectId/components/documents-tab.tsx +0 -90
  326. package/src/components/ui/tu-do/projects/projectId/components/index.ts +0 -9
  327. package/src/components/ui/tu-do/projects/projectId/components/overview/description-card.tsx +0 -77
  328. package/src/components/ui/tu-do/projects/projectId/components/overview/linked-documents-card.tsx +0 -81
  329. package/src/components/ui/tu-do/projects/projectId/components/overview/linked-tasks-card.tsx +0 -85
  330. package/src/components/ui/tu-do/projects/projectId/components/overview/updates-card.tsx +0 -85
  331. package/src/components/ui/tu-do/projects/projectId/components/overview-tab.tsx +0 -35
  332. package/src/components/ui/tu-do/projects/projectId/components/project-configuration.tsx +0 -229
  333. package/src/components/ui/tu-do/projects/projectId/components/project-header.tsx +0 -115
  334. package/src/components/ui/tu-do/projects/projectId/components/project-lead-selector.tsx +0 -55
  335. package/src/components/ui/tu-do/projects/projectId/components/project-overview-context.tsx +0 -82
  336. package/src/components/ui/tu-do/projects/projectId/components/project-sidebar.tsx +0 -246
  337. package/src/components/ui/tu-do/projects/projectId/components/tasks-tab.tsx +0 -266
  338. package/src/components/ui/tu-do/projects/projectId/components/update-card.tsx +0 -162
  339. package/src/components/ui/tu-do/projects/projectId/components/updates-tab.tsx +0 -129
  340. package/src/components/ui/tu-do/projects/projectId/dialogs/index.ts +0 -1
  341. package/src/components/ui/tu-do/projects/projectId/dialogs/link-task-dialog.tsx +0 -114
  342. package/src/components/ui/tu-do/projects/projectId/hooks/index.ts +0 -4
  343. package/src/components/ui/tu-do/projects/projectId/hooks/use-animation-variants.ts +0 -68
  344. package/src/components/ui/tu-do/projects/projectId/hooks/use-project-form.ts +0 -214
  345. package/src/components/ui/tu-do/projects/projectId/hooks/use-project-updates.ts +0 -209
  346. package/src/components/ui/tu-do/projects/projectId/hooks/use-task-linking.ts +0 -101
  347. package/src/components/ui/tu-do/projects/projectId/task-project-detail-page-client.tsx +0 -93
  348. package/src/components/ui/tu-do/projects/projectId/task-project-detail-page.tsx +0 -78
  349. package/src/components/ui/tu-do/projects/projectId/task-project-detail.tsx +0 -367
  350. package/src/components/ui/tu-do/projects/projectId/types.ts +0 -51
  351. package/src/components/ui/tu-do/projects/task-projects-client.tsx +0 -270
  352. package/src/components/ui/tu-do/projects/task-projects-page.tsx +0 -97
  353. package/src/components/ui/tu-do/projects/types.ts +0 -62
  354. package/src/components/ui/tu-do/providers/__tests__/task-dialog-provider.test.tsx +0 -616
  355. package/src/components/ui/tu-do/providers/task-dialog-provider.tsx +0 -923
  356. package/src/components/ui/tu-do/providers/workspace-presence-provider.tsx +0 -88
  357. package/src/components/ui/tu-do/shared/AccessibleButton.tsx +0 -79
  358. package/src/components/ui/tu-do/shared/__tests__/assignee-select.test.tsx +0 -143
  359. package/src/components/ui/tu-do/shared/__tests__/board-client.test.tsx +0 -358
  360. package/src/components/ui/tu-do/shared/__tests__/board-header.test.tsx +0 -598
  361. package/src/components/ui/tu-do/shared/__tests__/board-query-cache.test.ts +0 -219
  362. package/src/components/ui/tu-do/shared/__tests__/board-switcher.test.tsx +0 -374
  363. package/src/components/ui/tu-do/shared/__tests__/board-views.test.tsx +0 -1288
  364. package/src/components/ui/tu-do/shared/__tests__/create-list-dialog.test.tsx +0 -118
  365. package/src/components/ui/tu-do/shared/__tests__/task-board-loading-state.test.tsx +0 -99
  366. package/src/components/ui/tu-do/shared/__tests__/task-cache-patches.test.ts +0 -147
  367. package/src/components/ui/tu-do/shared/__tests__/task-detail-page.test.tsx +0 -170
  368. package/src/components/ui/tu-do/shared/__tests__/task-dialog-manager.test.tsx +0 -945
  369. package/src/components/ui/tu-do/shared/__tests__/task-legacy-route-recovery.test.tsx +0 -101
  370. package/src/components/ui/tu-do/shared/__tests__/use-progressive-board-loader.test.tsx +0 -645
  371. package/src/components/ui/tu-do/shared/assignee-select.tsx +0 -592
  372. package/src/components/ui/tu-do/shared/board-broadcast-context.tsx +0 -45
  373. package/src/components/ui/tu-do/shared/board-client.tsx +0 -283
  374. package/src/components/ui/tu-do/shared/board-config-storage.ts +0 -94
  375. package/src/components/ui/tu-do/shared/board-header.tsx +0 -803
  376. package/src/components/ui/tu-do/shared/board-layout-settings.tsx +0 -1134
  377. package/src/components/ui/tu-do/shared/board-query-cache.ts +0 -157
  378. package/src/components/ui/tu-do/shared/board-switcher.tsx +0 -322
  379. package/src/components/ui/tu-do/shared/board-user-presence-avatars.tsx +0 -578
  380. package/src/components/ui/tu-do/shared/board-views.tsx +0 -1238
  381. package/src/components/ui/tu-do/shared/clear-menu-item.tsx +0 -34
  382. package/src/components/ui/tu-do/shared/create-list-dialog.tsx +0 -401
  383. package/src/components/ui/tu-do/shared/cursor-overlay-multi-wrapper.tsx +0 -245
  384. package/src/components/ui/tu-do/shared/cursor-overlay.tsx +0 -78
  385. package/src/components/ui/tu-do/shared/custom-date-picker/custom-date-picker-dialog.tsx +0 -157
  386. package/src/components/ui/tu-do/shared/description-overflow-warning-dialog.tsx +0 -68
  387. package/src/components/ui/tu-do/shared/edit-list-dialog.tsx +0 -383
  388. package/src/components/ui/tu-do/shared/empty-state-card.tsx +0 -46
  389. package/src/components/ui/tu-do/shared/estimation-mapping.test.ts +0 -32
  390. package/src/components/ui/tu-do/shared/estimation-mapping.ts +0 -74
  391. package/src/components/ui/tu-do/shared/estimation-utils.ts +0 -54
  392. package/src/components/ui/tu-do/shared/fade-setting-initializer.tsx +0 -61
  393. package/src/components/ui/tu-do/shared/label-chip.tsx +0 -46
  394. package/src/components/ui/tu-do/shared/list-view-context-menu.test.tsx +0 -203
  395. package/src/components/ui/tu-do/shared/list-view-sorting.test.ts +0 -50
  396. package/src/components/ui/tu-do/shared/list-view-sorting.ts +0 -108
  397. package/src/components/ui/tu-do/shared/list-view.tsx +0 -1248
  398. package/src/components/ui/tu-do/shared/mention-system/__tests__/mention-system.test.ts +0 -250
  399. package/src/components/ui/tu-do/shared/mention-system/mention-menu.tsx +0 -217
  400. package/src/components/ui/tu-do/shared/mention-system/types.ts +0 -141
  401. package/src/components/ui/tu-do/shared/mention-system/use-mention-suggestions.ts +0 -244
  402. package/src/components/ui/tu-do/shared/progressive-loader-context.tsx +0 -45
  403. package/src/components/ui/tu-do/shared/recent-sidebar-events.ts +0 -58
  404. package/src/components/ui/tu-do/shared/recycle-bin-panel.tsx +0 -651
  405. package/src/components/ui/tu-do/shared/relationship-task-identifier.ts +0 -14
  406. package/src/components/ui/tu-do/shared/slash-commands/__tests__/slash-commands.test.ts +0 -315
  407. package/src/components/ui/tu-do/shared/slash-commands/definitions.ts +0 -167
  408. package/src/components/ui/tu-do/shared/slash-commands/slash-command-menu.tsx +0 -114
  409. package/src/components/ui/tu-do/shared/special-task-list-pins.ts +0 -51
  410. package/src/components/ui/tu-do/shared/sync-warning-dialog.tsx +0 -133
  411. package/src/components/ui/tu-do/shared/task-board-errors.ts +0 -19
  412. package/src/components/ui/tu-do/shared/task-board-loading-state.tsx +0 -82
  413. package/src/components/ui/tu-do/shared/task-cache-patches.ts +0 -394
  414. package/src/components/ui/tu-do/shared/task-detail-page.tsx +0 -176
  415. package/src/components/ui/tu-do/shared/task-detail-server-page.tsx +0 -37
  416. package/src/components/ui/tu-do/shared/task-dialog-manager.tsx +0 -596
  417. package/src/components/ui/tu-do/shared/task-dialog-presentation.test.ts +0 -53
  418. package/src/components/ui/tu-do/shared/task-dialog-presentation.ts +0 -30
  419. package/src/components/ui/tu-do/shared/task-dialog-wrapper.tsx +0 -28
  420. package/src/components/ui/tu-do/shared/task-due-date-visibility.test.ts +0 -72
  421. package/src/components/ui/tu-do/shared/task-due-date-visibility.ts +0 -38
  422. package/src/components/ui/tu-do/shared/task-edit-dialog/components/compact-task-create-popover.test.tsx +0 -325
  423. package/src/components/ui/tu-do/shared/task-edit-dialog/components/compact-task-create-popover.tsx +0 -268
  424. package/src/components/ui/tu-do/shared/task-edit-dialog/components/mobile-floating-save-button.tsx +0 -46
  425. package/src/components/ui/tu-do/shared/task-edit-dialog/components/quick-settings-popover.tsx +0 -198
  426. package/src/components/ui/tu-do/shared/task-edit-dialog/components/smart-task-suggestions-panel.test.tsx +0 -129
  427. package/src/components/ui/tu-do/shared/task-edit-dialog/components/smart-task-suggestions-panel.tsx +0 -358
  428. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-description-editor.tsx +0 -496
  429. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-dialog-header.tsx +0 -545
  430. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-list-picker-panel.tsx +0 -220
  431. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-list-selector.tsx +0 -165
  432. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-list-trigger-styles.ts +0 -69
  433. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-name-input.test.tsx +0 -180
  434. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-name-input.tsx +0 -218
  435. package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-suggestion-menus.tsx +0 -148
  436. package/src/components/ui/tu-do/shared/task-edit-dialog/constants.ts +0 -18
  437. package/src/components/ui/tu-do/shared/task-edit-dialog/context-menu-guard.test.ts +0 -37
  438. package/src/components/ui/tu-do/shared/task-edit-dialog/description-diff-viewer.tsx +0 -1665
  439. package/src/components/ui/tu-do/shared/task-edit-dialog/description-versions.test.ts +0 -97
  440. package/src/components/ui/tu-do/shared/task-edit-dialog/description-versions.ts +0 -210
  441. package/src/components/ui/tu-do/shared/task-edit-dialog/field-diff-viewer.tsx +0 -716
  442. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-dialog-close.test.ts +0 -218
  443. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-dialog-keyboard-shortcuts.test.ts +0 -140
  444. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-mutations.test.tsx +0 -231
  445. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-overrides.test.ts +0 -412
  446. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-realtime-sync.test.tsx +0 -237
  447. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-yjs-sync.test.ts +0 -190
  448. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-update-shared-task.test.ts +0 -107
  449. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/task-api.test.ts +0 -171
  450. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/task-api.ts +0 -296
  451. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-editor-commands.ts +0 -314
  452. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-suggestion-menus.ts +0 -503
  453. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-change-detection.ts +0 -175
  454. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-data.ts +0 -401
  455. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-dependencies.ts +0 -773
  456. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-dialog-close.ts +0 -193
  457. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-dialog-keyboard-shortcuts.ts +0 -365
  458. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-form-reset.ts +0 -231
  459. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-form-state.ts +0 -307
  460. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-mutations.ts +0 -609
  461. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-overrides.ts +0 -134
  462. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-realtime-sync.ts +0 -270
  463. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-relationships.test.tsx +0 -212
  464. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-relationships.ts +0 -554
  465. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-revert.ts +0 -140
  466. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-save.test.ts +0 -289
  467. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-save.ts +0 -1473
  468. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-snapshot.ts +0 -59
  469. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-yjs-sync.ts +0 -224
  470. package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-update-shared-task.ts +0 -60
  471. package/src/components/ui/tu-do/shared/task-edit-dialog/personal-overrides-section.tsx +0 -368
  472. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/clickable-task-item.tsx +0 -90
  473. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/index.ts +0 -4
  474. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/subtask-action-buttons.tsx +0 -140
  475. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/tab-button.tsx +0 -76
  476. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/task-relationship-action-buttons.tsx +0 -178
  477. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/dependencies-section.tsx +0 -140
  478. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/index.ts +0 -35
  479. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/parent-section.tsx +0 -70
  480. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/related-section.tsx +0 -81
  481. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/subtasks-section.tsx +0 -87
  482. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/task-search-popover.tsx +0 -229
  483. package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/types/task-relationships.types.ts +0 -194
  484. package/src/components/ui/tu-do/shared/task-edit-dialog/selective-revert-panel.test.tsx +0 -91
  485. package/src/components/ui/tu-do/shared/task-edit-dialog/selective-revert-panel.tsx +0 -365
  486. package/src/components/ui/tu-do/shared/task-edit-dialog/task-activity-section.tsx +0 -802
  487. package/src/components/ui/tu-do/shared/task-edit-dialog/task-delete-dialog.tsx +0 -104
  488. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-change-dialog.test.tsx +0 -63
  489. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-change-dialog.tsx +0 -218
  490. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-restore-banner.tsx +0 -83
  491. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-version-restore-dialog.test.tsx +0 -120
  492. package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-version-restore-dialog.tsx +0 -180
  493. package/src/components/ui/tu-do/shared/task-edit-dialog/task-dialog-actions.test.tsx +0 -68
  494. package/src/components/ui/tu-do/shared/task-edit-dialog/task-dialog-actions.tsx +0 -239
  495. package/src/components/ui/tu-do/shared/task-edit-dialog/task-instances-section.tsx +0 -173
  496. package/src/components/ui/tu-do/shared/task-edit-dialog/task-properties-section.test.tsx +0 -303
  497. package/src/components/ui/tu-do/shared/task-edit-dialog/task-properties-section.tsx +0 -2213
  498. package/src/components/ui/tu-do/shared/task-edit-dialog/task-relationships-properties.tsx +0 -315
  499. package/src/components/ui/tu-do/shared/task-edit-dialog/task-snapshot-dialog.tsx +0 -167
  500. package/src/components/ui/tu-do/shared/task-edit-dialog/types/pending-relationship.test.ts +0 -52
  501. package/src/components/ui/tu-do/shared/task-edit-dialog/types/pending-relationship.ts +0 -134
  502. package/src/components/ui/tu-do/shared/task-edit-dialog/types.ts +0 -64
  503. package/src/components/ui/tu-do/shared/task-edit-dialog/user-display.test.ts +0 -58
  504. package/src/components/ui/tu-do/shared/task-edit-dialog/user-display.ts +0 -45
  505. package/src/components/ui/tu-do/shared/task-edit-dialog/utils/inline-task-target-list.test.ts +0 -98
  506. package/src/components/ui/tu-do/shared/task-edit-dialog/utils/inline-task-target-list.ts +0 -39
  507. package/src/components/ui/tu-do/shared/task-edit-dialog/utils.test.ts +0 -504
  508. package/src/components/ui/tu-do/shared/task-edit-dialog/utils.ts +0 -582
  509. package/src/components/ui/tu-do/shared/task-edit-dialog/yjs-prosemirror-compat.test.ts +0 -65
  510. package/src/components/ui/tu-do/shared/task-edit-dialog.tsx +0 -3196
  511. package/src/components/ui/tu-do/shared/task-estimation-display.tsx +0 -52
  512. package/src/components/ui/tu-do/shared/task-estimation-picker.tsx +0 -226
  513. package/src/components/ui/tu-do/shared/task-filter.types.ts +0 -65
  514. package/src/components/ui/tu-do/shared/task-label-selector.tsx +0 -217
  515. package/src/components/ui/tu-do/shared/task-labels-display.test.tsx +0 -51
  516. package/src/components/ui/tu-do/shared/task-labels-display.tsx +0 -119
  517. package/src/components/ui/tu-do/shared/task-legacy-route-recovery.tsx +0 -65
  518. package/src/components/ui/tu-do/shared/task-projects-display.tsx +0 -80
  519. package/src/components/ui/tu-do/shared/task-quick-create-target-list.ts +0 -20
  520. package/src/components/ui/tu-do/shared/task-resource-search-field.tsx +0 -49
  521. package/src/components/ui/tu-do/shared/task-resource-search-filters.ts +0 -27
  522. package/src/components/ui/tu-do/shared/task-row-actions-menu.test.tsx +0 -138
  523. package/src/components/ui/tu-do/shared/task-row-actions-menu.tsx +0 -402
  524. package/src/components/ui/tu-do/shared/task-share-dialog/components/share-link-settings.tsx +0 -86
  525. package/src/components/ui/tu-do/shared/task-share-dialog/components/shares-list.tsx +0 -85
  526. package/src/components/ui/tu-do/shared/task-share-dialog/hooks/use-task-sharing.ts +0 -296
  527. package/src/components/ui/tu-do/shared/task-share-dialog.tsx +0 -144
  528. package/src/components/ui/tu-do/shared/task-sound-effects.test.ts +0 -189
  529. package/src/components/ui/tu-do/shared/task-sound-effects.tsx +0 -468
  530. package/src/components/ui/tu-do/shared/task-url.ts +0 -56
  531. package/src/components/ui/tu-do/shared/text-diff-viewer.tsx +0 -55
  532. package/src/components/ui/tu-do/shared/types.ts +0 -14
  533. package/src/components/ui/tu-do/shared/unsaved-changes-warning-dialog.tsx +0 -71
  534. package/src/components/ui/tu-do/shared/use-progressive-board-loader.ts +0 -312
  535. package/src/components/ui/tu-do/shared/user-avatar.tsx +0 -46
  536. package/src/components/ui/tu-do/shared/user-presence-avatars.tsx +0 -415
  537. package/src/components/ui/tu-do/shared/utils/translate-task-list-display-name.ts +0 -28
  538. package/src/components/ui/tu-do/tasks-route-context.tsx +0 -50
  539. package/src/components/ui/tu-do/templates/client.tsx +0 -505
  540. package/src/components/ui/tu-do/templates/marketplace/client.tsx +0 -487
  541. package/src/components/ui/tu-do/templates/marketplace/task-marketplace-page.tsx +0 -169
  542. package/src/components/ui/tu-do/templates/save-as-template-dialog.tsx +0 -381
  543. package/src/components/ui/tu-do/templates/task-template-api.ts +0 -142
  544. package/src/components/ui/tu-do/templates/task-template-card.tsx +0 -118
  545. package/src/components/ui/tu-do/templates/task-template-client.test.tsx +0 -52
  546. package/src/components/ui/tu-do/templates/task-template-client.tsx +0 -258
  547. package/src/components/ui/tu-do/templates/task-template-dialogs.test.tsx +0 -167
  548. package/src/components/ui/tu-do/templates/task-template-dialogs.tsx +0 -376
  549. package/src/components/ui/tu-do/templates/task-templates-hub.test.tsx +0 -114
  550. package/src/components/ui/tu-do/templates/task-templates-hub.tsx +0 -53
  551. package/src/components/ui/tu-do/templates/task-templates-page.tsx +0 -157
  552. package/src/components/ui/tu-do/templates/templateId/client.tsx +0 -674
  553. package/src/components/ui/tu-do/templates/templateId/edit-template-dialog.tsx +0 -300
  554. package/src/components/ui/tu-do/templates/templateId/share-template-dialog.tsx +0 -261
  555. package/src/components/ui/tu-do/templates/templateId/task-template-detail-page-client.tsx +0 -127
  556. package/src/components/ui/tu-do/templates/templateId/task-template-detail-page.tsx +0 -89
  557. package/src/components/ui/tu-do/templates/templateId/use-template-dialog.tsx +0 -165
  558. package/src/components/ui/tu-do/templates/types.ts +0 -53
  559. package/src/components/ui/tu-do/utils/__tests__/label-colors.test.ts +0 -43
  560. package/src/components/ui/tu-do/utils/__tests__/taskColorUtils.test.ts +0 -267
  561. package/src/components/ui/tu-do/utils/__tests__/taskConstants.test.ts +0 -178
  562. package/src/components/ui/tu-do/utils/__tests__/taskDateUtils.test.ts +0 -226
  563. package/src/components/ui/tu-do/utils/__tests__/weekDateUtils.test.ts +0 -182
  564. package/src/components/ui/tu-do/utils/label-colors.test.ts +0 -15
  565. package/src/components/ui/tu-do/utils/label-colors.ts +0 -59
  566. package/src/components/ui/tu-do/utils/taskColorUtils.ts +0 -116
  567. package/src/components/ui/tu-do/utils/taskConstants.ts +0 -102
  568. package/src/components/ui/tu-do/utils/taskDateUtils.ts +0 -81
  569. package/src/components/ui/tu-do/utils/taskPriorityUtils.tsx +0 -80
  570. package/src/components/ui/tu-do/utils/weekDateUtils.ts +0 -64
  571. package/src/hooks/__tests__/use-task-actions.test.tsx +0 -2098
  572. package/src/hooks/__tests__/useBoardPresence.test.tsx +0 -191
  573. package/src/hooks/__tests__/useBoardRealtime.test.tsx +0 -1036
  574. package/src/hooks/__tests__/useCursorTracking.test.tsx +0 -212
  575. package/src/hooks/task-actions-personal-external.ts +0 -313
  576. package/src/hooks/use-task-actions.ts +0 -1910
  577. package/src/hooks/useBoardPresence.ts +0 -364
  578. package/src/hooks/useBoardRealtime.ts +0 -428
  579. package/src/hooks/useBoardRealtime.types.ts +0 -56
  580. package/src/hooks/useBoardRealtimeEventHandler.ts +0 -452
  581. package/src/hooks/useCursorTracking.ts +0 -402
  582. package/src/hooks/usePresence.ts +0 -272
  583. package/src/hooks/useTaskUserRealtime.ts +0 -340
  584. /package/src/{components/ui/tu-do/shared → lib}/task-open-events.ts +0 -0
@@ -1,1036 +0,0 @@
1
- /**
2
- * @vitest-environment jsdom
3
- */
4
-
5
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
6
- import { act, renderHook } from '@testing-library/react';
7
- import { createClient } from '@tuturuuu/supabase/next/client';
8
- import type { Task } from '@tuturuuu/types/primitives/Task';
9
- import type { TaskList } from '@tuturuuu/types/primitives/TaskList';
10
- import type { ReactNode } from 'react';
11
- import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
12
- import { useBoardRealtime } from '../useBoardRealtime';
13
-
14
- type BroadcastMessage = { payload: Record<string, unknown> };
15
- type BroadcastListener = (msg: BroadcastMessage) => void;
16
-
17
- type MockSupabaseClient = {
18
- channel: ReturnType<typeof vi.fn>;
19
- removeChannel: ReturnType<typeof vi.fn>;
20
- from: ReturnType<typeof vi.fn>;
21
- };
22
-
23
- type MockCreateClientFn = {
24
- (): MockSupabaseClient;
25
- mockReturnValue: (value: MockSupabaseClient) => void;
26
- };
27
-
28
- class MockBroadcastChannel {
29
- static instances: MockBroadcastChannel[] = [];
30
-
31
- close = vi.fn();
32
- name: string;
33
- onmessage: ((event: MessageEvent) => void) | null = null;
34
- postMessage = vi.fn((data: unknown) => {
35
- for (const instance of MockBroadcastChannel.instances) {
36
- if (instance !== this && instance.name === this.name) {
37
- instance.dispatch(data);
38
- }
39
- }
40
- });
41
-
42
- constructor(name: string) {
43
- this.name = name;
44
- MockBroadcastChannel.instances.push(this);
45
- }
46
-
47
- dispatch(data: unknown) {
48
- this.onmessage?.({ data } as MessageEvent);
49
- }
50
- }
51
-
52
- const { toastMock } = vi.hoisted(() => ({
53
- toastMock: vi.fn(),
54
- }));
55
-
56
- // Mock Supabase client
57
- vi.mock('@tuturuuu/supabase/next/client', () => ({
58
- createClient: vi.fn(),
59
- }));
60
-
61
- // Mock DEV_MODE constant
62
- vi.mock('@tuturuuu/utils/constants', () => ({
63
- DEV_MODE: false,
64
- }));
65
-
66
- vi.mock('../use-toast', () => ({
67
- toast: toastMock,
68
- }));
69
-
70
- vi.mock('next-intl', () => ({
71
- useTranslations: () => (key: string) => key,
72
- }));
73
-
74
- describe('useBoardRealtime', () => {
75
- let queryClient: QueryClient;
76
- let mockChannel: {
77
- on: ReturnType<typeof vi.fn>;
78
- subscribe: ReturnType<typeof vi.fn>;
79
- send: ReturnType<typeof vi.fn>;
80
- };
81
- let mockFrom: ReturnType<typeof vi.fn>;
82
- let mockRemoveChannel: ReturnType<typeof vi.fn>;
83
- let broadcastListeners: Map<string, BroadcastListener>;
84
- let subscribeCallback: ((status: string, err?: unknown) => void) | undefined;
85
-
86
- const mockTask: Task = {
87
- id: 'task-1',
88
- name: 'Test Task',
89
- list_id: 'list-1',
90
- created_at: '2025-01-01',
91
- } as Task;
92
-
93
- const mockTaskWithRelations: Task = {
94
- ...mockTask,
95
- assignees: [],
96
- labels: [],
97
- projects: [],
98
- } as Task;
99
-
100
- const mockList: TaskList = {
101
- id: 'list-1',
102
- name: 'Test List',
103
- board_id: 'board-1',
104
- created_at: '2025-01-01',
105
- } as TaskList;
106
-
107
- const wrapper = ({ children }: { children: ReactNode }) => (
108
- <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
109
- );
110
-
111
- beforeEach(async () => {
112
- vi.useFakeTimers();
113
- MockBroadcastChannel.instances = [];
114
- vi.stubGlobal('BroadcastChannel', MockBroadcastChannel);
115
-
116
- queryClient = new QueryClient({
117
- defaultOptions: {
118
- queries: { retry: false },
119
- mutations: { retry: false },
120
- },
121
- });
122
-
123
- broadcastListeners = new Map();
124
-
125
- mockChannel = {
126
- on: vi.fn(
127
- (
128
- type: string,
129
- config: { event?: string },
130
- callback: BroadcastListener
131
- ) => {
132
- if (type === 'broadcast' && config.event) {
133
- broadcastListeners.set(config.event, callback);
134
- }
135
- return mockChannel;
136
- }
137
- ),
138
- subscribe: vi.fn((callback?: (status: string, err?: unknown) => void) => {
139
- subscribeCallback = callback;
140
- return mockChannel;
141
- }),
142
- send: vi.fn(),
143
- };
144
-
145
- mockRemoveChannel = vi.fn();
146
- mockFrom = vi.fn();
147
-
148
- const mockCreateClient = createClient as unknown as MockCreateClientFn;
149
-
150
- mockCreateClient.mockReturnValue({
151
- channel: vi.fn(() => mockChannel),
152
- removeChannel: mockRemoveChannel,
153
- from: mockFrom,
154
- });
155
-
156
- vi.clearAllMocks();
157
- subscribeCallback = undefined;
158
- });
159
-
160
- afterEach(() => {
161
- vi.useRealTimers();
162
- vi.unstubAllGlobals();
163
- });
164
-
165
- describe('initialization and cleanup', () => {
166
- it('should subscribe to channel on mount', () => {
167
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
168
- wrapper,
169
- });
170
-
171
- expect(mockChannel.subscribe).toHaveBeenCalledTimes(1);
172
- });
173
-
174
- it('should create a private channel with self: false config', () => {
175
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
176
- wrapper,
177
- });
178
-
179
- const supabaseInstance = (
180
- createClient as unknown as MockCreateClientFn
181
- )();
182
- expect(supabaseInstance.channel).toHaveBeenCalledWith(
183
- 'board-realtime-board-1',
184
- { config: { broadcast: { self: false }, private: true } }
185
- );
186
- });
187
-
188
- it('should remove channel after deferred cleanup timeout on unmount', () => {
189
- const { unmount } = renderHook(
190
- () => useBoardRealtime('board-1', { enabled: true }),
191
- { wrapper }
192
- );
193
-
194
- unmount();
195
-
196
- // removeChannel is deferred — not called immediately
197
- expect(mockRemoveChannel).not.toHaveBeenCalled();
198
-
199
- // After 100ms deferred timeout, channel is cleaned up
200
- act(() => {
201
- vi.advanceTimersByTime(100);
202
- });
203
-
204
- expect(mockRemoveChannel).toHaveBeenCalledWith(mockChannel);
205
- });
206
-
207
- it('should not call removeChannel before deferred timeout elapses', () => {
208
- const { unmount } = renderHook(
209
- () => useBoardRealtime('board-1', { enabled: true }),
210
- { wrapper }
211
- );
212
-
213
- unmount();
214
-
215
- // Advance only 50ms — before the 100ms deferred timeout
216
- act(() => {
217
- vi.advanceTimersByTime(50);
218
- });
219
-
220
- expect(mockRemoveChannel).not.toHaveBeenCalled();
221
-
222
- // Now advance past the timeout
223
- act(() => {
224
- vi.advanceTimersByTime(50);
225
- });
226
-
227
- expect(mockRemoveChannel).toHaveBeenCalledWith(mockChannel);
228
- });
229
-
230
- it('should not subscribe when enabled is false', () => {
231
- renderHook(() => useBoardRealtime('board-1', { enabled: false }), {
232
- wrapper,
233
- });
234
-
235
- expect(mockChannel.subscribe).not.toHaveBeenCalled();
236
- });
237
-
238
- it('should not subscribe when boardId is empty', () => {
239
- renderHook(() => useBoardRealtime('', { enabled: true }), {
240
- wrapper,
241
- });
242
-
243
- expect(mockChannel.subscribe).not.toHaveBeenCalled();
244
- });
245
-
246
- it('shows a destructive toast when the realtime channel errors', () => {
247
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
248
- wrapper,
249
- });
250
-
251
- act(() => {
252
- subscribeCallback?.('CHANNEL_ERROR');
253
- });
254
-
255
- expect(toastMock).toHaveBeenCalledWith({
256
- description: 'realtime_connection_issue_description',
257
- title: 'realtime_connection_issue_title',
258
- variant: 'destructive',
259
- });
260
- });
261
- });
262
-
263
- describe('broadcast listener registration', () => {
264
- it('should register listeners for all 6 broadcast event types', () => {
265
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
266
- wrapper,
267
- });
268
-
269
- const events = [
270
- 'task:upsert',
271
- 'task:delete',
272
- 'list:upsert',
273
- 'list:delete',
274
- 'task:relations-changed',
275
- 'task:deps-changed',
276
- ];
277
- for (const event of events) {
278
- expect(mockChannel.on).toHaveBeenCalledWith(
279
- 'broadcast',
280
- { event },
281
- expect.any(Function)
282
- );
283
- }
284
- });
285
- });
286
-
287
- describe('task:upsert event', () => {
288
- it('should add new task to cache when task does not exist', async () => {
289
- queryClient.setQueryData(['tasks', 'board-1'], []);
290
-
291
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
292
- wrapper,
293
- });
294
-
295
- const listener = broadcastListeners.get('task:upsert')!;
296
-
297
- await act(async () => {
298
- listener({ payload: { task: mockTask } });
299
- });
300
-
301
- const cachedTasks = queryClient.getQueryData<Task[]>([
302
- 'tasks',
303
- 'board-1',
304
- ]);
305
- expect(cachedTasks).toHaveLength(1);
306
- expect(cachedTasks?.[0]).toEqual(
307
- expect.objectContaining({
308
- id: 'task-1',
309
- name: 'Test Task',
310
- assignees: [],
311
- labels: [],
312
- projects: [],
313
- })
314
- );
315
- });
316
-
317
- it('should update existing task in cache', async () => {
318
- queryClient.setQueryData(
319
- ['tasks', 'board-1'],
320
- [{ ...mockTaskWithRelations, name: 'Original Name' }]
321
- );
322
-
323
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
324
- wrapper,
325
- });
326
-
327
- const listener = broadcastListeners.get('task:upsert')!;
328
-
329
- await act(async () => {
330
- listener({ payload: { task: { id: 'task-1', name: 'Updated Name' } } });
331
- });
332
-
333
- const cachedTasks = queryClient.getQueryData<Task[]>([
334
- 'tasks',
335
- 'board-1',
336
- ]);
337
- expect(cachedTasks?.[0]?.name).toBe('Updated Name');
338
- // Preserve existing relations
339
- expect(cachedTasks?.[0]?.assignees).toEqual([]);
340
- });
341
-
342
- it('should update the full task cache when it exists', async () => {
343
- queryClient.setQueryData(
344
- ['tasks', 'board-1'],
345
- [{ ...mockTaskWithRelations, name: 'Original Name' }]
346
- );
347
- queryClient.setQueryData(
348
- ['tasks-full', 'board-1'],
349
- [{ ...mockTaskWithRelations, name: 'Original Name' }]
350
- );
351
-
352
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
353
- wrapper,
354
- });
355
-
356
- const listener = broadcastListeners.get('task:upsert')!;
357
-
358
- await act(async () => {
359
- listener({
360
- payload: { task: { id: 'task-1', name: 'Updated Name' } },
361
- });
362
- });
363
-
364
- expect(
365
- queryClient.getQueryData<Task[]>(['tasks', 'board-1'])?.[0]?.name
366
- ).toBe('Updated Name');
367
- expect(
368
- queryClient.getQueryData<Task[]>(['tasks-full', 'board-1'])?.[0]?.name
369
- ).toBe('Updated Name');
370
- });
371
-
372
- it('should not duplicate task if already exists in cache', async () => {
373
- queryClient.setQueryData(['tasks', 'board-1'], [mockTaskWithRelations]);
374
-
375
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
376
- wrapper,
377
- });
378
-
379
- const listener = broadcastListeners.get('task:upsert')!;
380
-
381
- await act(async () => {
382
- listener({ payload: { task: mockTask } });
383
- });
384
-
385
- const cachedTasks = queryClient.getQueryData<Task[]>([
386
- 'tasks',
387
- 'board-1',
388
- ]);
389
- expect(cachedTasks).toHaveLength(1);
390
- });
391
-
392
- it('should preserve relation payload on new task inserts', async () => {
393
- queryClient.setQueryData(['tasks', 'board-1'], []);
394
-
395
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
396
- wrapper,
397
- });
398
-
399
- const listener = broadcastListeners.get('task:upsert')!;
400
- const taskWithRelations: Partial<Task> & { id: string } = {
401
- id: 'task-2',
402
- name: 'Task With Relations',
403
- list_id: 'list-1',
404
- assignees: [
405
- { id: 'user-1', display_name: 'User 1', avatar_url: undefined },
406
- ],
407
- labels: [
408
- {
409
- id: 'label-1',
410
- name: 'Bug',
411
- color: 'red',
412
- created_at: '2025-01-01',
413
- },
414
- ],
415
- projects: [{ id: 'project-1', name: 'Project 1', status: 'active' }],
416
- };
417
-
418
- await act(async () => {
419
- listener({ payload: { task: taskWithRelations } });
420
- });
421
-
422
- const cachedTasks = queryClient.getQueryData<Task[]>([
423
- 'tasks',
424
- 'board-1',
425
- ]);
426
- const inserted = cachedTasks?.find((task) => task.id === 'task-2');
427
-
428
- expect(inserted?.assignees).toHaveLength(1);
429
- expect(inserted?.labels).toHaveLength(1);
430
- expect(inserted?.projects).toHaveLength(1);
431
- });
432
-
433
- it('should call onTaskChange with INSERT for new tasks', async () => {
434
- queryClient.setQueryData(['tasks', 'board-1'], []);
435
- const onTaskChange = vi.fn();
436
-
437
- renderHook(
438
- () => useBoardRealtime('board-1', { enabled: true, onTaskChange }),
439
- { wrapper }
440
- );
441
-
442
- const listener = broadcastListeners.get('task:upsert')!;
443
-
444
- await act(async () => {
445
- listener({ payload: { task: mockTask } });
446
- });
447
-
448
- expect(onTaskChange).toHaveBeenCalledWith(
449
- expect.objectContaining({ id: 'task-1' }),
450
- 'INSERT'
451
- );
452
- });
453
-
454
- it('should call onTaskChange with UPDATE for existing tasks', async () => {
455
- queryClient.setQueryData(['tasks', 'board-1'], [mockTaskWithRelations]);
456
- const onTaskChange = vi.fn();
457
-
458
- renderHook(
459
- () => useBoardRealtime('board-1', { enabled: true, onTaskChange }),
460
- { wrapper }
461
- );
462
-
463
- const listener = broadcastListeners.get('task:upsert')!;
464
-
465
- await act(async () => {
466
- listener({
467
- payload: { task: { id: 'task-1', name: 'Updated' } },
468
- });
469
- });
470
-
471
- expect(onTaskChange).toHaveBeenCalledWith(
472
- expect.objectContaining({ id: 'task-1' }),
473
- 'UPDATE'
474
- );
475
- });
476
-
477
- it('should initialize cache with task when cache is empty (undefined)', async () => {
478
- // Don't set any cache data — queryClient returns undefined
479
-
480
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
481
- wrapper,
482
- });
483
-
484
- const listener = broadcastListeners.get('task:upsert')!;
485
-
486
- await act(async () => {
487
- listener({ payload: { task: mockTask } });
488
- });
489
-
490
- const cachedTasks = queryClient.getQueryData<Task[]>([
491
- 'tasks',
492
- 'board-1',
493
- ]);
494
- expect(cachedTasks).toHaveLength(1);
495
- });
496
- });
497
-
498
- describe('task:delete event', () => {
499
- it('should remove task from cache', async () => {
500
- queryClient.setQueryData(['tasks', 'board-1'], [mockTaskWithRelations]);
501
-
502
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
503
- wrapper,
504
- });
505
-
506
- const listener = broadcastListeners.get('task:delete')!;
507
-
508
- await act(async () => {
509
- listener({ payload: { taskId: 'task-1' } });
510
- });
511
-
512
- const cachedTasks = queryClient.getQueryData<Task[]>([
513
- 'tasks',
514
- 'board-1',
515
- ]);
516
- expect(cachedTasks).toHaveLength(0);
517
- });
518
-
519
- it('should remove task from the full task cache when it exists', async () => {
520
- queryClient.setQueryData(['tasks', 'board-1'], [mockTaskWithRelations]);
521
- queryClient.setQueryData(
522
- ['tasks-full', 'board-1'],
523
- [mockTaskWithRelations]
524
- );
525
-
526
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
527
- wrapper,
528
- });
529
-
530
- const listener = broadcastListeners.get('task:delete')!;
531
-
532
- await act(async () => {
533
- listener({ payload: { taskId: 'task-1' } });
534
- });
535
-
536
- expect(
537
- queryClient.getQueryData<Task[]>(['tasks', 'board-1'])
538
- ).toHaveLength(0);
539
- expect(
540
- queryClient.getQueryData<Task[]>(['tasks-full', 'board-1'])
541
- ).toHaveLength(0);
542
- });
543
-
544
- it('should call onTaskChange with DELETE', async () => {
545
- queryClient.setQueryData(['tasks', 'board-1'], [mockTaskWithRelations]);
546
- const onTaskChange = vi.fn();
547
-
548
- renderHook(
549
- () => useBoardRealtime('board-1', { enabled: true, onTaskChange }),
550
- { wrapper }
551
- );
552
-
553
- const listener = broadcastListeners.get('task:delete')!;
554
-
555
- await act(async () => {
556
- listener({ payload: { taskId: 'task-1' } });
557
- });
558
-
559
- expect(onTaskChange).toHaveBeenCalledWith(
560
- expect.objectContaining({ id: 'task-1' }),
561
- 'DELETE'
562
- );
563
- });
564
-
565
- it('should not call onTaskChange if task was not in cache', async () => {
566
- queryClient.setQueryData(['tasks', 'board-1'], []);
567
- const onTaskChange = vi.fn();
568
-
569
- renderHook(
570
- () => useBoardRealtime('board-1', { enabled: true, onTaskChange }),
571
- { wrapper }
572
- );
573
-
574
- const listener = broadcastListeners.get('task:delete')!;
575
-
576
- await act(async () => {
577
- listener({ payload: { taskId: 'task-999' } });
578
- });
579
-
580
- expect(onTaskChange).not.toHaveBeenCalled();
581
- });
582
- });
583
-
584
- describe('list:upsert event', () => {
585
- it('should add new list to cache', async () => {
586
- queryClient.setQueryData(['task_lists', 'board-1'], []);
587
-
588
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
589
- wrapper,
590
- });
591
-
592
- const listener = broadcastListeners.get('list:upsert')!;
593
-
594
- await act(async () => {
595
- listener({ payload: { list: mockList } });
596
- });
597
-
598
- const cachedLists = queryClient.getQueryData<TaskList[]>([
599
- 'task_lists',
600
- 'board-1',
601
- ]);
602
- expect(cachedLists).toHaveLength(1);
603
- expect(cachedLists?.[0]).toEqual(
604
- expect.objectContaining({ id: 'list-1' })
605
- );
606
- });
607
-
608
- it('should update existing list in cache', async () => {
609
- queryClient.setQueryData(['task_lists', 'board-1'], [mockList]);
610
-
611
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
612
- wrapper,
613
- });
614
-
615
- const listener = broadcastListeners.get('list:upsert')!;
616
-
617
- await act(async () => {
618
- listener({
619
- payload: { list: { id: 'list-1', name: 'Updated List' } },
620
- });
621
- });
622
-
623
- const cachedLists = queryClient.getQueryData<TaskList[]>([
624
- 'task_lists',
625
- 'board-1',
626
- ]);
627
- expect(cachedLists?.[0]?.name).toBe('Updated List');
628
- });
629
-
630
- it('should call onListChange callback', async () => {
631
- queryClient.setQueryData(['task_lists', 'board-1'], []);
632
- const onListChange = vi.fn();
633
-
634
- renderHook(
635
- () => useBoardRealtime('board-1', { enabled: true, onListChange }),
636
- { wrapper }
637
- );
638
-
639
- const listener = broadcastListeners.get('list:upsert')!;
640
-
641
- await act(async () => {
642
- listener({ payload: { list: mockList } });
643
- });
644
-
645
- expect(onListChange).toHaveBeenCalledWith(
646
- expect.objectContaining({ id: 'list-1' }),
647
- 'INSERT'
648
- );
649
- });
650
- });
651
-
652
- describe('list:delete event', () => {
653
- it('should remove list from cache', async () => {
654
- queryClient.setQueryData(['task_lists', 'board-1'], [mockList]);
655
-
656
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
657
- wrapper,
658
- });
659
-
660
- const listener = broadcastListeners.get('list:delete')!;
661
-
662
- await act(async () => {
663
- listener({ payload: { listId: 'list-1' } });
664
- });
665
-
666
- const cachedLists = queryClient.getQueryData<TaskList[]>([
667
- 'task_lists',
668
- 'board-1',
669
- ]);
670
- expect(cachedLists).toHaveLength(0);
671
- });
672
-
673
- it('should also remove tasks belonging to deleted list', async () => {
674
- const task1 = {
675
- ...mockTaskWithRelations,
676
- id: 'task-1',
677
- list_id: 'list-1',
678
- };
679
- const task2 = {
680
- ...mockTaskWithRelations,
681
- id: 'task-2',
682
- list_id: 'list-2',
683
- };
684
- queryClient.setQueryData(['tasks', 'board-1'], [task1, task2]);
685
- queryClient.setQueryData(['task_lists', 'board-1'], [mockList]);
686
-
687
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
688
- wrapper,
689
- });
690
-
691
- const listener = broadcastListeners.get('list:delete')!;
692
-
693
- await act(async () => {
694
- listener({ payload: { listId: 'list-1' } });
695
- });
696
-
697
- const cachedTasks = queryClient.getQueryData<Task[]>([
698
- 'tasks',
699
- 'board-1',
700
- ]);
701
- expect(cachedTasks).toHaveLength(1);
702
- expect(cachedTasks?.[0]?.id).toBe('task-2');
703
- });
704
-
705
- it('should also remove full-cache tasks belonging to deleted list', async () => {
706
- const task1 = {
707
- ...mockTaskWithRelations,
708
- id: 'task-1',
709
- list_id: 'list-1',
710
- };
711
- const task2 = {
712
- ...mockTaskWithRelations,
713
- id: 'task-2',
714
- list_id: 'list-2',
715
- };
716
- queryClient.setQueryData(['tasks', 'board-1'], [task1, task2]);
717
- queryClient.setQueryData(['tasks-full', 'board-1'], [task1, task2]);
718
- queryClient.setQueryData(['task_lists', 'board-1'], [mockList]);
719
-
720
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
721
- wrapper,
722
- });
723
-
724
- const listener = broadcastListeners.get('list:delete')!;
725
-
726
- await act(async () => {
727
- listener({ payload: { listId: 'list-1' } });
728
- });
729
-
730
- const cachedFullTasks = queryClient.getQueryData<Task[]>([
731
- 'tasks-full',
732
- 'board-1',
733
- ]);
734
- expect(cachedFullTasks).toHaveLength(1);
735
- expect(cachedFullTasks?.[0]?.id).toBe('task-2');
736
- });
737
-
738
- it('should call onListChange with DELETE', async () => {
739
- queryClient.setQueryData(['task_lists', 'board-1'], [mockList]);
740
- const onListChange = vi.fn();
741
-
742
- renderHook(
743
- () => useBoardRealtime('board-1', { enabled: true, onListChange }),
744
- { wrapper }
745
- );
746
-
747
- const listener = broadcastListeners.get('list:delete')!;
748
-
749
- await act(async () => {
750
- listener({ payload: { listId: 'list-1' } });
751
- });
752
-
753
- expect(onListChange).toHaveBeenCalledWith(
754
- expect.objectContaining({ id: 'list-1' }),
755
- 'DELETE'
756
- );
757
- });
758
- });
759
-
760
- describe('task:relations-changed event', () => {
761
- it('reconciles relation-bearing queries without refetching visible board caches', async () => {
762
- queryClient.setQueryData(
763
- ['tasks', 'board-1'],
764
- [{ ...mockTaskWithRelations, id: 'task-1' }]
765
- );
766
- const invalidateQueriesSpy = vi.spyOn(queryClient, 'invalidateQueries');
767
-
768
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
769
- wrapper,
770
- });
771
-
772
- const listener = broadcastListeners.get('task:relations-changed')!;
773
-
774
- // Fire the listener — it debounces for 150ms before invalidating caches.
775
- await act(async () => {
776
- listener({ payload: { taskId: 'task-1' } });
777
- });
778
-
779
- // Advance past the 150ms receiver debounce.
780
- await act(async () => {
781
- vi.advanceTimersByTime(200);
782
- });
783
-
784
- expect(mockFrom).not.toHaveBeenCalled();
785
- expect(invalidateQueriesSpy).not.toHaveBeenCalledWith({
786
- queryKey: ['tasks', 'board-1'],
787
- });
788
- expect(invalidateQueriesSpy).not.toHaveBeenCalledWith({
789
- queryKey: ['tasks-full', 'board-1'],
790
- });
791
- expect(invalidateQueriesSpy).toHaveBeenCalledWith({
792
- queryKey: ['task-list-counts', 'board-1'],
793
- });
794
- });
795
-
796
- it('keeps the full task cache warm when relations change', async () => {
797
- queryClient.setQueryData(
798
- ['tasks', 'board-1'],
799
- [{ ...mockTaskWithRelations, id: 'task-1' }]
800
- );
801
- queryClient.setQueryData(
802
- ['tasks-full', 'board-1'],
803
- [{ ...mockTaskWithRelations, id: 'task-1' }]
804
- );
805
- const invalidateQueriesSpy = vi.spyOn(queryClient, 'invalidateQueries');
806
-
807
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
808
- wrapper,
809
- });
810
-
811
- const listener = broadcastListeners.get('task:relations-changed')!;
812
-
813
- await act(async () => {
814
- listener({ payload: { taskId: 'task-1' } });
815
- });
816
-
817
- await act(async () => {
818
- vi.advanceTimersByTime(200);
819
- });
820
-
821
- expect(invalidateQueriesSpy).not.toHaveBeenCalledWith({
822
- queryKey: ['tasks-full', 'board-1'],
823
- });
824
- expect(
825
- queryClient.getQueryData<Task[]>(['tasks-full', 'board-1'])?.[0]?.id
826
- ).toBe('task-1');
827
- });
828
-
829
- it('calls onTaskRelationsChange for Supabase relation broadcasts', async () => {
830
- const onTaskRelationsChange = vi.fn();
831
-
832
- renderHook(
833
- () =>
834
- useBoardRealtime('board-1', {
835
- enabled: true,
836
- onTaskRelationsChange,
837
- }),
838
- { wrapper }
839
- );
840
-
841
- const listener = broadcastListeners.get('task:relations-changed')!;
842
-
843
- await act(async () => {
844
- listener({ payload: { taskIds: ['task-1', 'task-2'] } });
845
- });
846
-
847
- expect(onTaskRelationsChange).toHaveBeenCalledWith(['task-1', 'task-2']);
848
- });
849
- });
850
-
851
- describe('returned broadcast function', () => {
852
- it('should return a broadcast function', () => {
853
- const { result } = renderHook(
854
- () => useBoardRealtime('board-1', { enabled: true }),
855
- { wrapper }
856
- );
857
-
858
- expect(result.current.broadcast).toBeInstanceOf(Function);
859
- });
860
-
861
- it('should call channel.send with correct format after debounce', () => {
862
- queryClient.setQueryData(['tasks', 'board-1'], []);
863
-
864
- const { result } = renderHook(
865
- () => useBoardRealtime('board-1', { enabled: true }),
866
- { wrapper }
867
- );
868
-
869
- act(() => {
870
- result.current.broadcast('task:upsert', {
871
- task: { id: 'task-1', name: 'Updated' },
872
- });
873
- });
874
-
875
- // Broadcast is debounced — should not have sent yet
876
- expect(mockChannel.send).not.toHaveBeenCalled();
877
-
878
- // Advance past the 50ms sender debounce
879
- act(() => {
880
- vi.advanceTimersByTime(50);
881
- });
882
-
883
- expect(mockChannel.send).toHaveBeenCalledWith({
884
- type: 'broadcast',
885
- event: 'task:upsert',
886
- payload: expect.objectContaining({
887
- __tuturuuuBoardRealtimeEventId: expect.any(String),
888
- __tuturuuuBoardRealtimeOrigin: expect.any(String),
889
- task: { id: 'task-1', name: 'Updated' },
890
- }),
891
- });
892
- expect(queryClient.getQueryData<Task[]>(['tasks', 'board-1'])).toEqual([
893
- expect.objectContaining({ id: 'task-1', name: 'Updated' }),
894
- ]);
895
- expect(
896
- MockBroadcastChannel.instances[0]?.postMessage
897
- ).toHaveBeenCalledWith({
898
- event: 'task:upsert',
899
- payload: expect.objectContaining({
900
- __tuturuuuBoardRealtimeEventId: expect.any(String),
901
- __tuturuuuBoardRealtimeOrigin: expect.any(String),
902
- task: { id: 'task-1', name: 'Updated' },
903
- }),
904
- });
905
- });
906
-
907
- it('should not throw when channel is not yet available', () => {
908
- const { result } = renderHook(
909
- () => useBoardRealtime('board-1', { enabled: false }),
910
- { wrapper }
911
- );
912
-
913
- // Should not throw even though channel is null (enabled=false → no channel created)
914
- expect(() => {
915
- result.current.broadcast('task:upsert', { task: { id: 'task-1' } });
916
- }).not.toThrow();
917
- });
918
-
919
- it('applies local tab broadcasts even when Supabase realtime is disabled', async () => {
920
- queryClient.setQueryData(['tasks', 'board-1'], []);
921
-
922
- renderHook(() => useBoardRealtime('board-1', { enabled: false }), {
923
- wrapper,
924
- });
925
-
926
- await act(async () => {
927
- MockBroadcastChannel.instances[0]?.dispatch({
928
- event: 'task:upsert',
929
- payload: {
930
- __tuturuuuBoardRealtimeEventId: 'local-event-1',
931
- task: mockTask,
932
- },
933
- });
934
- });
935
-
936
- expect(mockChannel.subscribe).not.toHaveBeenCalled();
937
- expect(queryClient.getQueryData<Task[]>(['tasks', 'board-1'])).toEqual([
938
- expect.objectContaining({ id: 'task-1' }),
939
- ]);
940
- });
941
-
942
- it('calls onTaskRelationsChange for local relation broadcasts when Supabase realtime is disabled', async () => {
943
- const onTaskRelationsChange = vi.fn();
944
-
945
- renderHook(
946
- () =>
947
- useBoardRealtime('board-1', {
948
- enabled: false,
949
- onTaskRelationsChange,
950
- }),
951
- { wrapper }
952
- );
953
-
954
- await act(async () => {
955
- MockBroadcastChannel.instances[0]?.dispatch({
956
- event: 'task:relations-changed',
957
- payload: {
958
- __tuturuuuBoardRealtimeEventId: 'local-relations-event-1',
959
- taskIds: ['task-1'],
960
- },
961
- });
962
- });
963
-
964
- expect(onTaskRelationsChange).toHaveBeenCalledWith(['task-1']);
965
- });
966
-
967
- it('delivers outgoing broadcasts to another local tab when Supabase realtime is disabled', () => {
968
- const receiverQueryClient = new QueryClient({
969
- defaultOptions: {
970
- queries: { retry: false },
971
- mutations: { retry: false },
972
- },
973
- });
974
- receiverQueryClient.setQueryData(['tasks', 'board-1'], []);
975
-
976
- const receiverWrapper = ({ children }: { children: ReactNode }) => (
977
- <QueryClientProvider client={receiverQueryClient}>
978
- {children}
979
- </QueryClientProvider>
980
- );
981
-
982
- const { result } = renderHook(
983
- () => useBoardRealtime('board-1', { enabled: false }),
984
- { wrapper }
985
- );
986
- renderHook(() => useBoardRealtime('board-1', { enabled: false }), {
987
- wrapper: receiverWrapper,
988
- });
989
-
990
- act(() => {
991
- result.current.broadcast('task:upsert', { task: mockTask });
992
- vi.advanceTimersByTime(50);
993
- });
994
-
995
- expect(mockChannel.subscribe).not.toHaveBeenCalled();
996
- expect(queryClient.getQueryData<Task[]>(['tasks', 'board-1'])).toEqual([
997
- expect.objectContaining({ id: 'task-1' }),
998
- ]);
999
- expect(
1000
- receiverQueryClient.getQueryData<Task[]>(['tasks', 'board-1'])
1001
- ).toEqual([expect.objectContaining({ id: 'task-1' })]);
1002
- });
1003
-
1004
- it('deduplicates the same event received locally and through Supabase', async () => {
1005
- queryClient.setQueryData(['tasks', 'board-1'], []);
1006
-
1007
- renderHook(() => useBoardRealtime('board-1', { enabled: true }), {
1008
- wrapper,
1009
- });
1010
-
1011
- await act(async () => {
1012
- MockBroadcastChannel.instances[0]?.dispatch({
1013
- event: 'task:upsert',
1014
- payload: {
1015
- __tuturuuuBoardRealtimeEventId: 'shared-event-1',
1016
- task: { ...mockTask, name: 'Local update' },
1017
- },
1018
- });
1019
- });
1020
-
1021
- const listener = broadcastListeners.get('task:upsert')!;
1022
- await act(async () => {
1023
- listener({
1024
- payload: {
1025
- __tuturuuuBoardRealtimeEventId: 'shared-event-1',
1026
- task: { id: 'task-1', name: 'Duplicate network update' },
1027
- },
1028
- });
1029
- });
1030
-
1031
- expect(
1032
- queryClient.getQueryData<Task[]>(['tasks', 'board-1'])?.[0]?.name
1033
- ).toBe('Local update');
1034
- });
1035
- });
1036
- });