@songsid/agend 2.4.0-beta.18 → 2.4.0-beta.19

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 (377) hide show
  1. package/dist/agent-cli-instructions.md +13 -7
  2. package/dist/agent-cli.js +149 -49
  3. package/dist/agent-cli.js.map +1 -1
  4. package/dist/agent-export.d.ts +3 -1
  5. package/dist/agent-export.js +18 -1
  6. package/dist/agent-export.js.map +1 -1
  7. package/dist/agent-whats-new.js +9 -0
  8. package/dist/agent-whats-new.js.map +1 -1
  9. package/dist/apply-job.d.ts +2 -2
  10. package/dist/auth-api.js +1 -1
  11. package/dist/auth-api.js.map +1 -1
  12. package/dist/backend/claude-code.d.ts +0 -6
  13. package/dist/backend/claude-code.js +23 -3
  14. package/dist/backend/claude-code.js.map +1 -1
  15. package/dist/backend/codex-precaution.js +3 -2
  16. package/dist/backend/codex-precaution.js.map +1 -1
  17. package/dist/backend/codex.js +1 -1
  18. package/dist/backend/codex.js.map +1 -1
  19. package/dist/backend/types.d.ts +6 -0
  20. package/dist/backend/types.js.map +1 -1
  21. package/dist/build-provenance.json +1 -1
  22. package/dist/channel/mcp-server.js +8 -2
  23. package/dist/channel/mcp-server.js.map +1 -1
  24. package/dist/channel/mcp-tools.d.ts +27 -1
  25. package/dist/channel/mcp-tools.js +77 -7
  26. package/dist/channel/mcp-tools.js.map +1 -1
  27. package/dist/chat-task-refs.d.ts +61 -0
  28. package/dist/chat-task-refs.js +112 -0
  29. package/dist/chat-task-refs.js.map +1 -0
  30. package/dist/classic-channel-manager.d.ts +1 -1
  31. package/dist/classic-channel-manager.js +6 -2
  32. package/dist/classic-channel-manager.js.map +1 -1
  33. package/dist/claude-credential-launch.d.ts +6 -0
  34. package/dist/claude-credential-launch.js +16 -3
  35. package/dist/claude-credential-launch.js.map +1 -1
  36. package/dist/claude-credential-runner.js +3 -1
  37. package/dist/claude-credential-runner.js.map +1 -1
  38. package/dist/claude-setup-token-transport.js +25 -3
  39. package/dist/claude-setup-token-transport.js.map +1 -1
  40. package/dist/cli-audited.js +5 -5
  41. package/dist/cli-audited.js.map +1 -1
  42. package/dist/composite-tools.d.ts +11 -0
  43. package/dist/composite-tools.js +29 -0
  44. package/dist/composite-tools.js.map +1 -0
  45. package/dist/config-validator.js +22 -1
  46. package/dist/config-validator.js.map +1 -1
  47. package/dist/config.js +11 -0
  48. package/dist/config.js.map +1 -1
  49. package/dist/contact-auth-policy.d.ts +1 -0
  50. package/dist/contact-auth-policy.js +2 -1
  51. package/dist/contact-auth-policy.js.map +1 -1
  52. package/dist/contact-auth-service.js +2 -0
  53. package/dist/contact-auth-service.js.map +1 -1
  54. package/dist/contact-auth-store.js +21 -6
  55. package/dist/contact-auth-store.js.map +1 -1
  56. package/dist/contact-auth-types.d.ts +2 -0
  57. package/dist/contact-auth-types.js.map +1 -1
  58. package/dist/daemon.js +4 -0
  59. package/dist/daemon.js.map +1 -1
  60. package/dist/darwin-memory.js +2 -1
  61. package/dist/darwin-memory.js.map +1 -1
  62. package/dist/dashboard-permissions.d.ts +1 -8
  63. package/dist/dashboard-permissions.js +8 -9
  64. package/dist/dashboard-permissions.js.map +1 -1
  65. package/dist/delivery-outbox.d.ts +0 -6
  66. package/dist/delivery-outbox.js +0 -25
  67. package/dist/delivery-outbox.js.map +1 -1
  68. package/dist/delivery-outbox.test.js +132 -96
  69. package/dist/delivery-outbox.test.js.map +1 -1
  70. package/dist/fleet-manager.d.ts +45 -7
  71. package/dist/fleet-manager.js +309 -99
  72. package/dist/fleet-manager.js.map +1 -1
  73. package/dist/fleet-windows-runtime.d.ts +1 -1
  74. package/dist/fleet-windows-runtime.js +8 -1
  75. package/dist/fleet-windows-runtime.js.map +1 -1
  76. package/dist/fleet-yaml-stringify.d.ts +1 -1
  77. package/dist/fleet-yaml-stringify.js +64 -11
  78. package/dist/fleet-yaml-stringify.js.map +1 -1
  79. package/dist/general-knowledge/skills/concepts/SKILL.md +53 -4
  80. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +4 -0
  81. package/dist/general-knowledge/skills/fleet-config/SKILL.md +21 -1
  82. package/dist/general-knowledge/skills/hub/SKILL.md +2 -0
  83. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +5 -1
  84. package/dist/general-knowledge/skills/model-discovery/SKILL.md +3 -2
  85. package/dist/general-knowledge/skills/persona-emoji/SKILL.md +3 -0
  86. package/dist/general-knowledge/skills/task-board/SKILL.md +63 -0
  87. package/dist/general-knowledge/skills/web-appearance/SKILL.md +25 -2
  88. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +38 -9
  89. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +4 -0
  90. package/dist/general-knowledge/steering/core-rules.md +15 -78
  91. package/dist/general-role-block.d.ts +19 -0
  92. package/dist/general-role-block.js +56 -0
  93. package/dist/general-role-block.js.map +1 -0
  94. package/dist/general-role.d.ts +1 -1
  95. package/dist/general-role.js +1 -0
  96. package/dist/general-role.js.map +1 -1
  97. package/dist/host-memory.d.ts +3 -0
  98. package/dist/host-memory.js.map +1 -1
  99. package/dist/host-monitoring/darwin/collector.d.ts +18 -0
  100. package/dist/host-monitoring/darwin/collector.js +65 -0
  101. package/dist/host-monitoring/darwin/collector.js.map +1 -0
  102. package/dist/host-monitoring/darwin/defaults.d.ts +2 -0
  103. package/dist/host-monitoring/darwin/defaults.js +9 -0
  104. package/dist/host-monitoring/darwin/defaults.js.map +1 -0
  105. package/dist/host-monitoring/darwin/interpretation.d.ts +20 -0
  106. package/dist/host-monitoring/darwin/interpretation.js +73 -0
  107. package/dist/host-monitoring/darwin/interpretation.js.map +1 -0
  108. package/dist/host-monitoring/linux/collector.d.ts +17 -0
  109. package/dist/host-monitoring/linux/collector.js +55 -0
  110. package/dist/host-monitoring/linux/collector.js.map +1 -0
  111. package/dist/host-monitoring/linux/defaults.d.ts +2 -0
  112. package/dist/host-monitoring/linux/defaults.js +9 -0
  113. package/dist/host-monitoring/linux/defaults.js.map +1 -0
  114. package/dist/host-monitoring/linux/interpretation.d.ts +22 -0
  115. package/dist/host-monitoring/linux/interpretation.js +76 -0
  116. package/dist/host-monitoring/linux/interpretation.js.map +1 -0
  117. package/dist/host-monitoring/transport.d.ts +42 -0
  118. package/dist/host-monitoring/transport.js +101 -0
  119. package/dist/host-monitoring/transport.js.map +1 -0
  120. package/dist/host-monitoring/wsl/collector.d.ts +19 -0
  121. package/dist/host-monitoring/wsl/collector.js +72 -0
  122. package/dist/host-monitoring/wsl/collector.js.map +1 -0
  123. package/dist/host-monitoring/wsl/defaults.d.ts +2 -0
  124. package/dist/host-monitoring/wsl/defaults.js +9 -0
  125. package/dist/host-monitoring/wsl/defaults.js.map +1 -0
  126. package/dist/host-monitoring/wsl/interpretation.d.ts +22 -0
  127. package/dist/host-monitoring/wsl/interpretation.js +77 -0
  128. package/dist/host-monitoring/wsl/interpretation.js.map +1 -0
  129. package/dist/host-monitoring-alert-policy.d.ts +2 -0
  130. package/dist/host-monitoring-alert-policy.js +4 -2
  131. package/dist/host-monitoring-alert-policy.js.map +1 -1
  132. package/dist/host-monitoring-alert-settings.d.ts +3 -1
  133. package/dist/host-monitoring-alert-settings.js +7 -2
  134. package/dist/host-monitoring-alert-settings.js.map +1 -1
  135. package/dist/host-monitoring-alerts.d.ts +3 -0
  136. package/dist/host-monitoring-alerts.js +18 -3
  137. package/dist/host-monitoring-alerts.js.map +1 -1
  138. package/dist/host-monitoring-defaults.d.ts +19 -0
  139. package/dist/host-monitoring-defaults.js +10 -0
  140. package/dist/host-monitoring-defaults.js.map +1 -0
  141. package/dist/host-monitoring-platform.d.ts +18 -70
  142. package/dist/host-monitoring-platform.js +14 -269
  143. package/dist/host-monitoring-platform.js.map +1 -1
  144. package/dist/host-monitoring.d.ts +13 -0
  145. package/dist/host-monitoring.js.map +1 -1
  146. package/dist/hub/agent-catalog-model.d.ts +21 -0
  147. package/dist/hub/agent-catalog-model.js +9 -1
  148. package/dist/hub/agent-catalog-model.js.map +1 -1
  149. package/dist/hub/agent-catalog.d.ts +4 -1
  150. package/dist/hub/agent-catalog.js +11 -0
  151. package/dist/hub/agent-catalog.js.map +1 -1
  152. package/dist/hub/catalog.js +12 -0
  153. package/dist/hub/catalog.js.map +1 -1
  154. package/dist/hub/client.js +4 -1
  155. package/dist/hub/client.js.map +1 -1
  156. package/dist/hub/compose/member.d.ts +5 -0
  157. package/dist/hub/compose/member.js +25 -5
  158. package/dist/hub/compose/member.js.map +1 -1
  159. package/dist/hub/compose/server.d.ts +2 -0
  160. package/dist/hub/compose/server.js +4 -2
  161. package/dist/hub/compose/server.js.map +1 -1
  162. package/dist/hub/http/compose.d.ts +5 -0
  163. package/dist/hub/http/compose.js +25 -2
  164. package/dist/hub/http/compose.js.map +1 -1
  165. package/dist/hub/http/deps.d.ts +2 -0
  166. package/dist/hub/http/schema.js +4 -0
  167. package/dist/hub/http/schema.js.map +1 -1
  168. package/dist/hub/lapse-carry.d.ts +45 -0
  169. package/dist/hub/lapse-carry.js +62 -0
  170. package/dist/hub/lapse-carry.js.map +1 -0
  171. package/dist/hub/member/agent-catalog.d.ts +4 -1
  172. package/dist/hub/member/agent-catalog.js +15 -4
  173. package/dist/hub/member/agent-catalog.js.map +1 -1
  174. package/dist/hub/member/agent-intro.d.ts +4 -3
  175. package/dist/hub/member/agent-intro.js +7 -0
  176. package/dist/hub/member/agent-intro.js.map +1 -1
  177. package/dist/hub/member/exposure-api.d.ts +2 -0
  178. package/dist/hub/member/exposure-api.js +8 -1
  179. package/dist/hub/member/exposure-api.js.map +1 -1
  180. package/dist/hub/member/room-post.d.ts +34 -6
  181. package/dist/hub/member/room-post.js +30 -0
  182. package/dist/hub/member/room-post.js.map +1 -1
  183. package/dist/hub/member/sharing.d.ts +2 -0
  184. package/dist/hub/member/sharing.js +9 -2
  185. package/dist/hub/member/sharing.js.map +1 -1
  186. package/dist/hub/protocol.d.ts +2 -0
  187. package/dist/hub/room-brief-model.js +2 -1
  188. package/dist/hub/room-brief-model.js.map +1 -1
  189. package/dist/hub/rooms/agents.d.ts +2 -0
  190. package/dist/hub/rooms/agents.js +16 -2
  191. package/dist/hub/rooms/agents.js.map +1 -1
  192. package/dist/hub/rooms/office.d.ts +82 -0
  193. package/dist/hub/rooms/office.js +46 -0
  194. package/dist/hub/rooms/office.js.map +1 -0
  195. package/dist/hub/rooms/service.d.ts +66 -1
  196. package/dist/hub/rooms/service.js +67 -11
  197. package/dist/hub/rooms/service.js.map +1 -1
  198. package/dist/hub/rooms/types.d.ts +4 -0
  199. package/dist/hub/runtime.d.ts +1 -1
  200. package/dist/hub/server.js +9 -2
  201. package/dist/hub/server.js.map +1 -1
  202. package/dist/hub/sharing-requests.d.ts +5 -2
  203. package/dist/hub/sharing-requests.js +19 -4
  204. package/dist/hub/sharing-requests.js.map +1 -1
  205. package/dist/instance-config-impact.js +1 -1
  206. package/dist/instance-config-impact.js.map +1 -1
  207. package/dist/instance-lifecycle.js +6 -7
  208. package/dist/instance-lifecycle.js.map +1 -1
  209. package/dist/instruction-file-sizes.d.ts +46 -0
  210. package/dist/instruction-file-sizes.js +115 -0
  211. package/dist/instruction-file-sizes.js.map +1 -0
  212. package/dist/instructions.d.ts +35 -1
  213. package/dist/instructions.js +59 -33
  214. package/dist/instructions.js.map +1 -1
  215. package/dist/locale.js +16 -4
  216. package/dist/locale.js.map +1 -1
  217. package/dist/log-steps.d.ts +5 -0
  218. package/dist/log-steps.js +6 -2
  219. package/dist/log-steps.js.map +1 -1
  220. package/dist/memory-guidance.d.ts +5 -0
  221. package/dist/memory-guidance.js +14 -0
  222. package/dist/memory-guidance.js.map +1 -0
  223. package/dist/model-defaults.d.ts +5 -0
  224. package/dist/model-defaults.js +6 -0
  225. package/dist/model-defaults.js.map +1 -0
  226. package/dist/native-mcp.d.ts +2 -0
  227. package/dist/native-mcp.js +16 -6
  228. package/dist/native-mcp.js.map +1 -1
  229. package/dist/needs-you-hub.d.ts +2 -0
  230. package/dist/needs-you-hub.js +6 -1
  231. package/dist/needs-you-hub.js.map +1 -1
  232. package/dist/needs-you.d.ts +13 -1
  233. package/dist/needs-you.js +5 -0
  234. package/dist/needs-you.js.map +1 -1
  235. package/dist/outbound-handlers.d.ts +3 -3
  236. package/dist/outbound-schemas.d.ts +3 -0
  237. package/dist/outbound-schemas.js +27 -26
  238. package/dist/outbound-schemas.js.map +1 -1
  239. package/dist/quickstart.d.ts +1 -1
  240. package/dist/quickstart.js +2 -3
  241. package/dist/quickstart.js.map +1 -1
  242. package/dist/remote-card-prompt.d.ts +1 -0
  243. package/dist/remote-card-prompt.js +1 -1
  244. package/dist/remote-card-prompt.js.map +1 -1
  245. package/dist/runtime-build-info.js +1 -1
  246. package/dist/runtime-build-info.js.map +1 -1
  247. package/dist/runtime-cli-install.js +5 -5
  248. package/dist/runtime-cli-install.js.map +1 -1
  249. package/dist/runtime-pane-mcp.js +7 -3
  250. package/dist/runtime-pane-mcp.js.map +1 -1
  251. package/dist/runtime-pane-native.js +2 -1
  252. package/dist/runtime-pane-native.js.map +1 -1
  253. package/dist/scheduler/db.js +2 -0
  254. package/dist/scheduler/db.js.map +1 -1
  255. package/dist/scheduler/task-board-mentions.d.ts +32 -0
  256. package/dist/scheduler/task-board-mentions.js +97 -0
  257. package/dist/scheduler/task-board-mentions.js.map +1 -0
  258. package/dist/scheduler/task-board-text.js +3 -0
  259. package/dist/scheduler/task-board-text.js.map +1 -1
  260. package/dist/scheduler/task-board.d.ts +199 -3
  261. package/dist/scheduler/task-board.js +492 -7
  262. package/dist/scheduler/task-board.js.map +1 -1
  263. package/dist/settings-api.d.ts +3 -1
  264. package/dist/settings-api.js +23 -4
  265. package/dist/settings-api.js.map +1 -1
  266. package/dist/settings-change.js +4 -2
  267. package/dist/settings-change.js.map +1 -1
  268. package/dist/settings-effect.js +1 -1
  269. package/dist/settings-effect.js.map +1 -1
  270. package/dist/settings-instance-patch.js +3 -1
  271. package/dist/settings-instance-patch.js.map +1 -1
  272. package/dist/setup-host.d.ts +2 -3
  273. package/dist/setup-host.js +3 -5
  274. package/dist/setup-host.js.map +1 -1
  275. package/dist/setup-wizard.js +0 -2
  276. package/dist/setup-wizard.js.map +1 -1
  277. package/dist/shared-default-adoption.d.ts +24 -0
  278. package/dist/shared-default-adoption.js +73 -0
  279. package/dist/shared-default-adoption.js.map +1 -0
  280. package/dist/subagent-records.d.ts +2 -0
  281. package/dist/subagent-records.js +11 -1
  282. package/dist/subagent-records.js.map +1 -1
  283. package/dist/subagent-service.d.ts +3 -0
  284. package/dist/subagent-service.js +24 -4
  285. package/dist/subagent-service.js.map +1 -1
  286. package/dist/task-board-tool.d.ts +31 -0
  287. package/dist/task-board-tool.js +31 -0
  288. package/dist/task-board-tool.js.map +1 -1
  289. package/dist/task-board-waker.d.ts +23 -30
  290. package/dist/task-board-waker.js +136 -97
  291. package/dist/task-board-waker.js.map +1 -1
  292. package/dist/types.d.ts +23 -0
  293. package/dist/ui/agent-details-settings.js +2 -2
  294. package/dist/ui/agent-export-dialog.js +4 -3
  295. package/dist/ui/agent-export-strings.js +4 -4
  296. package/dist/ui/agent-page-strings.js +18 -0
  297. package/dist/ui/chat-activity-groups.js +1 -1
  298. package/dist/ui/chat-activity.js +17 -0
  299. package/dist/ui/chat-store.js +13 -4
  300. package/dist/ui/chat-task-ref-strings.js +24 -0
  301. package/dist/ui/chat-task-refs.js +129 -0
  302. package/dist/ui/claude-setup-token.js +3 -3
  303. package/dist/ui/contact-auth-strings.js +33 -3
  304. package/dist/ui/contact-authorizations.js +17 -24
  305. package/dist/ui/contact-grant-editor.js +50 -0
  306. package/dist/ui/contact-permissions.js +21 -8
  307. package/dist/ui/fleet-office-card.js +18 -14
  308. package/dist/ui/fleet-office.js +29 -17
  309. package/dist/ui/fleet-task-activity.js +362 -0
  310. package/dist/ui/fleet-task-card.js +317 -314
  311. package/dist/ui/fleet-task-common.js +99 -9
  312. package/dist/ui/fleet-task-create.js +67 -0
  313. package/dist/ui/fleet-task-edit.js +204 -0
  314. package/dist/ui/fleet-task-follow.js +123 -0
  315. package/dist/ui/fleet-task-menu.js +1 -1
  316. package/dist/ui/fleet-task-owner.js +252 -0
  317. package/dist/ui/fleet-task-run.js +257 -0
  318. package/dist/ui/fleet-task-view.js +178 -39
  319. package/dist/ui/fleet-task-work.js +2 -2
  320. package/dist/ui/fleet-tasks.js +258 -130
  321. package/dist/ui/host-health.js +9 -6
  322. package/dist/ui/host-monitoring-darwin.js +6 -0
  323. package/dist/ui/host-monitoring-help.js +7 -0
  324. package/dist/ui/host-monitoring-linux.js +6 -0
  325. package/dist/ui/host-monitoring-wsl.js +6 -0
  326. package/dist/ui/hub-agent-copy.js +2 -0
  327. package/dist/ui/hub-client.js +4 -0
  328. package/dist/ui/hub-my-agents-strings.js +2 -0
  329. package/dist/ui/hub-my-agents.js +17 -1
  330. package/dist/ui/hub-room-composer.js +108 -5
  331. package/dist/ui/hub-room-members-strings.js +9 -2
  332. package/dist/ui/hub-room-members.js +72 -15
  333. package/dist/ui/hub-room-office.js +191 -0
  334. package/dist/ui/hub-room-purpose.js +18 -2
  335. package/dist/ui/hub-room-settings.js +8 -1
  336. package/dist/ui/hub-room-strings.js +15 -0
  337. package/dist/ui/hub-room-thread.js +51 -15
  338. package/dist/ui/hub-strings.js +1 -1
  339. package/dist/ui/log-row.js +7 -5
  340. package/dist/ui/native-instance-settings.js +4 -2
  341. package/dist/ui/panel-chat.js +96 -17
  342. package/dist/ui/panel-details.js +17 -0
  343. package/dist/ui/panel-fleet.js +1 -1
  344. package/dist/ui/panel-hub.js +4 -1
  345. package/dist/ui/panel-needs.js +11 -2
  346. package/dist/ui/panel-settings.js +57 -13
  347. package/dist/ui/settings-apply.js +8 -3
  348. package/dist/ui/settings-default-model-scope.js +40 -0
  349. package/dist/ui/settings-default-model-strings.js +43 -0
  350. package/dist/ui/settings-dialogs.js +9 -5
  351. package/dist/ui/settings-host-alerts.js +4 -3
  352. package/dist/ui/settings-host-monitoring.js +2 -1
  353. package/dist/ui/settings-hub.js +1 -1
  354. package/dist/ui/settings-layout.js +7 -2
  355. package/dist/ui/settings-model.js +9 -5
  356. package/dist/ui/settings-quota-notice.js +3 -3
  357. package/dist/ui/settings-registry.js +3 -0
  358. package/dist/ui/settings-shared-strings.js +22 -0
  359. package/dist/ui/settings-shared.js +59 -12
  360. package/dist/ui/settings-strings.js +2 -4
  361. package/dist/ui/shared/app-i18n.js +2 -2
  362. package/dist/ui/shared/app.css +124 -46
  363. package/dist/ui/shared/chat-composer.js +7 -6
  364. package/dist/ui/shared/chat-render.js +39 -1
  365. package/dist/ui/shared/chat-thread.js +8 -3
  366. package/dist/ui/shared/composer-focus.js +21 -0
  367. package/dist/ui/shared/hub-chat.css +30 -2
  368. package/dist/ui/shared/hub-rooms-u2.css +17 -0
  369. package/dist/ui/shared/task-board.css +406 -8
  370. package/dist/ui/trigger-complete.js +71 -0
  371. package/dist/web-api.d.ts +9 -0
  372. package/dist/web-api.js +128 -13
  373. package/dist/web-api.js.map +1 -1
  374. package/dist/windows-native-mcp.js +5 -2
  375. package/dist/windows-native-mcp.js.map +1 -1
  376. package/dist/workflow-templates/default.md +4 -6
  377. package/package.json +1 -1
@@ -1,29 +1,39 @@
1
1
  // The task board (Fleet › Tasks): projects → main tasks (M-) → sub tasks (S-), ported from taskhall (任務會所).
2
2
  // Home lists the projects and what waits for the person; a project is a board of its main tasks by status, each able to
3
- // open up its sub tasks; a card opens in a dialog (fleet-task-card.js). Every write goes through /ui/tasks/* as the
3
+ // open up its sub tasks; a card opens as a page of its own (fleet-task-card.js). Every write goes through /ui/tasks/* as the
4
4
  // signed-in person, under the same rules an instance's task tool meets (scheduler/task-board.ts). A change from anywhere
5
5
  // (an agent's tool, another tab) arrives as a "tasks" stream event with the board's revision; the board reads again
6
6
  // when its revision moved. Over the temporary public link the board is read-only (the server refuses its writes there).
7
- // A card moves by drag, by Alt+arrow keys on its title, or by its dialog ("Move to…", up and down) — touch and keyboard
8
- // need no drag. A project shows as the board or as a list, and filters stack (fleet-task-view.js). A right click on a
9
- // card (or the menu key) opens its menu; its dialog steps to the previous / next card (fleet-task-menu.js).
7
+ // A card moves by drag, by Alt+arrow keys on its title, by its ⋯ menu or its page's Status chip, up and down — touch and
8
+ // keyboard need no drag. A project shows as the board or as a list (a switch in the toolbar, with search and filters in
9
+ // the same row, fleet-task-view.js); on a phone the board shows one status at a time. A card's ⋯ (or a right click, or the
10
+ // menu key) opens its menu; its page steps to the previous / next card (fleet-task-menu.js). The open card is in the
11
+ // address (`?card=`): opening one adds a history entry, so Back returns to the board or the list.
10
12
  import { html, useEffect, useMemo, useRef, useState } from "/assets/app-html.js";
11
13
  import { t } from "/assets/app-i18n.js";
12
14
  import { recordEdit } from "/assets/text-undo.js";
13
- import { appStore, useStore } from "/assets/app-store.js";
15
+ import { appStore } from "/assets/app-store.js";
14
16
  import { Dialog } from "/assets/ui-dialog.js";
15
17
  import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
16
18
  import { Icon } from "/assets/ui-icons.js";
17
19
  import { Menu } from "/assets/ui-menu.js";
18
20
  import { toast } from "/assets/ui-toast.js";
19
- import { AskHost, AssigneeOption, COLUMNS, NO_PROJECT, ProgressBar, StatusPill, Who, answerBlocked, askText, boardApi, currentWork, dropNeighbours, errorText, followsSubs, moveCard, notesForPeople, onPublicLink, projectKey, projectStats, readStored, relTime, reviewLabel, waitsForYou, workersOf, wrapUpText, writeStored } from "./fleet-task-common.js";
20
- import { CardDialog } from "./fleet-task-card.js";
21
+ import { AskHost, BoardOffNote, COLUMNS, NO_PROJECT, boardReadOnly, ProgressBar, StatusPill, Who, answerBlocked, askText, boardApi, currentWork, dropNeighbours, errorText, followsSubs, moveCard, notesForPeople, onPublicLink, projectKey, projectStats, readStored, relTime, scrollBox, tileStatus, waitsForYou, waitsList, waitsOn, workersOf, wrapUpText, writeStored } from "./fleet-task-common.js";
22
+ import { CardPage, assigneeItems } from "./fleet-task-card.js";
21
23
  import { CardMenu, cardAt, cardMenuItems, pageOrder, stepsOf } from "./fleet-task-menu.js";
22
- import { DisplayMenu, FilterBar, FilterMenu, ListView, SubList, doneShown, formatFilters, keepFilters, listRows, mainMatches, readDisplay, startFilters, writeDisplay } from "./fleet-task-view.js";
24
+ import { ListView, NO_REACH, SubList, TaskToolbar, doneShown, formatFilters, keepFilters, listRows, mainMatches, readDisplay, scrollReach, startFilters, writeDisplay } from "./fleet-task-view.js";
25
+ import { CreateMainDialog } from "./fleet-task-create.js";
23
26
  import { InstancesDrawer } from "./fleet-task-work.js";
27
+ import { RunMark, inProgressBy, runOf, useRunContext } from "./fleet-task-run.js";
28
+ import { OwnerChip, otherWorkers, quietInfo } from "./fleet-task-owner.js";
24
29
  import { InsightsDialog } from "./fleet-task-stats.js";
25
30
 
26
31
  const PROJECT_KEY = "agend_tasks_project";
32
+ const QUERY_KEY = "agend_tasks_query";
33
+
34
+ /** The card the address names (`?card=`), or null. */
35
+ const cardInAddress = () => { try { return new URLSearchParams(globalThis.location?.search || "").get("card") || null; } catch { return null; } };
36
+
27
37
 
28
38
  // ── The tab ───────────────────────────────────────────────
29
39
 
@@ -36,7 +46,9 @@ export function TaskBoardTab({ lease }) {
36
46
  const [state, setState] = useState(null);
37
47
  // `ifMoved`: a refresh that only wants the board if its revision moved (a stream event, a reconnect).
38
48
  const [version, setVersion] = useState({ n: 0, ifMoved: false });
39
- const writable = true; // M-3278: the public link's admin too (the host refuses a read-only session)
49
+ // Whether this page changes the board. A guest and a read-only session over the public link only read — nothing that edits, creates or moves is
50
+ // drawn for them (the host refuses their writes too); an admin session over the link writes as itself (M-3278), as the dashboard does.
51
+ const writable = !boardReadOnly();
40
52
  const [at, setAtRaw] = useState(() => {
41
53
  let v = readStored(PROJECT_KEY, "");
42
54
  try { v = new URLSearchParams(globalThis.location?.search || "").get("tp") ?? v; } catch { /* no address bar */ }
@@ -50,16 +62,21 @@ export function TaskBoardTab({ lease }) {
50
62
  const [dialog, setDialog] = useState(null);
51
63
  // A card's menu ({ card, x, y, el }), and the cards the page showed when a card's dialog opened (its Previous / Next).
52
64
  const [menu, setMenu] = useState(null);
53
- const [trail, setTrail] = useState([]);
65
+ // The assignee picker a tile's or a row's avatar opens ({ id, x, y, el, names }), the card page's list of choices.
66
+ const [ownerMenu, setOwnerMenu] = useState(null);
67
+ const [trail, setTrail] = useState(() => []);
54
68
  // How a project shows (board or list, …) and its filters: remembered on this device, the filters also in the address.
55
69
  const [display, setDisplayRaw] = useState(readDisplay);
56
70
  const [filters, setFiltersRaw] = useState(() => startFilters(globalThis.location?.search));
71
+ // The project's search words, kept on this device with the filters and the view (and cleared on the way to another project).
72
+ const [query, setQueryRaw] = useState(() => readStored(QUERY_KEY, ""));
73
+ const setQuery = (q) => { setQueryRaw(q); writeStored(QUERY_KEY, q === "" ? null : q); };
57
74
  const setDisplay = (d) => { setDisplayRaw(d); writeDisplay(d); };
58
75
  const setFilters = (f) => { setFiltersRaw(f); keepFilters(f); };
59
76
  // Finished cards "All": every done main task is read only when asked for (the server keeps recent ones otherwise).
60
77
  const allDone = display.done === "all";
61
78
  const seq = useRef(0);
62
- const setAt = (v) => { setAtRaw(v); writeStored(PROJECT_KEY, v === null ? null : String(v)); };
79
+ const setAt = (v) => { setAtRaw(v); setQuery(""); writeStored(PROJECT_KEY, v === null ? null : String(v)); };
63
80
  const reload = (ifMoved = false) => setVersion((v) => ({ n: v.n + 1, ifMoved }));
64
81
  const shown = useRef({ rev: null, allDone: false });
65
82
 
@@ -114,18 +131,58 @@ export function TaskBoardTab({ lease }) {
114
131
  } catch { /* no address bar */ }
115
132
  }, [at, filters]);
116
133
 
117
- const openCard = (id) => {
134
+ // The open card is in the address. Opening one from the board adds a history entry (Back returns to the board or the
135
+ // list), and so does opening another from the card (a sub task, a dependency); stepping to the previous / next card
136
+ // replaces it. The entry says how many cards deep it is, so "Back" on the page can go all the way to the board.
137
+ const depthNow = () => { try { const d = globalThis.history.state && globalThis.history.state.tbCard; return Number.isInteger(d) ? d : 0; } catch { return 0; } };
138
+ const putCard = (id, replace) => {
139
+ try {
140
+ const u = new URL(globalThis.location.href);
141
+ if (id === null) u.searchParams.delete("card"); else u.searchParams.set("card", id);
142
+ const depth = id === null ? 0 : replace ? Math.max(1, depthNow()) : depthNow() + 1;
143
+ const state = id === null ? null : { ...(globalThis.history.state || {}), tbCard: depth };
144
+ if (replace || id === null) globalThis.history.replaceState(state, "", u); else globalThis.history.pushState(state, "", u);
145
+ } catch { /* no address bar */ }
146
+ };
147
+ const openCard = (id, replace = false) => {
148
+ if (!openId) { setTrail(pageOrder()); rememberScroll(); } // the cards the page shows now are the walk (Previous / Next)
118
149
  setOpenId(id);
119
- try { const u = new URL(globalThis.location.href); u.searchParams.set("card", id); globalThis.history.replaceState(globalThis.history.state, "", u); } catch { /* no address bar */ }
150
+ putCard(id, replace && !!openId);
120
151
  };
152
+ const stepToCard = (id) => openCard(id, true);
153
+ const lastOpen = useRef(null); // the card whose page was just left: its tile or row takes the focus back
154
+ const openRef = useRef(openId);
155
+ openRef.current = openId;
121
156
  const closeCard = () => {
122
- setOpenId(null);
157
+ const depth = depthNow();
158
+ lastOpen.current = openId;
123
159
  setTrail([]);
124
- try { const u = new URL(globalThis.location.href); u.searchParams.delete("card"); globalThis.history.replaceState(globalThis.history.state, "", u); } catch { /* no address bar */ }
160
+ if (depth > 0) { try { globalThis.history.go(-depth); return; } catch { /* fall through: just drop the address */ } }
161
+ setOpenId(null);
162
+ putCard(null, true);
125
163
  };
126
-
127
- // A card's dialog walks the page's cards in the order shown when it opened (read once the page is drawn).
128
- useEffect(() => { if (openId && !trail.length) setTrail(pageOrder()); }, [openId, state]);
164
+ // Back and Forward bring the card the address names (or the board).
165
+ useEffect(() => {
166
+ const onPop = () => { const id = cardInAddress(); if (!id && openRef.current) lastOpen.current = openRef.current; setOpenId(id); if (!id) setTrail([]); };
167
+ if (typeof window === "undefined") return undefined;
168
+ window.addEventListener("popstate", onPop);
169
+ return () => window.removeEventListener("popstate", onPop);
170
+ }, []);
171
+ // The board is where it was left when Back brings it again.
172
+ const scrolled = useRef(null);
173
+ const rememberScroll = () => { try { scrolled.current = scrollBox()?.scrollTop ?? null; } catch { scrolled.current = null; } };
174
+ useEffect(() => {
175
+ if (openId) return;
176
+ if (scrolled.current !== null) {
177
+ const box = scrollBox(), top = scrolled.current;
178
+ scrolled.current = null;
179
+ if (box) box.scrollTop = top;
180
+ }
181
+ const id = lastOpen.current;
182
+ if (!id) return;
183
+ const at = document.querySelector(`[data-tile="${id}"] .tb-tile-title, [data-row="${id}"] .tb-row-title`);
184
+ if (at) { lastOpen.current = null; at.focus({ preventScroll: true }); }
185
+ }, [openId, state]);
129
186
 
130
187
  // #2246 step 3: who works on what — the drawer gives way to a card opened from it (one drawer at a time).
131
188
  const showInstances = () => setDialog({ kind: "instances" });
@@ -143,8 +200,8 @@ export function TaskBoardTab({ lease }) {
143
200
  const project = at === null ? null : at === NO_PROJECT ? NO_PROJECT : projects.find((p) => p.id === at) || null;
144
201
  const body = project === null
145
202
  ? html`<${Home} cards=${cards} projects=${projects} stats=${stats} writable=${writable} onOpenProject=${setAt} onOpen=${openCard} onDialog=${setDialog} onInstances=${showInstances} reload=${reload} />`
146
- : html`<${ProjectBoard} project=${project} cards=${cards} stats=${stats} flashed=${flashed} display=${display} filters=${filters} writable=${writable}
147
- onDisplay=${setDisplay} onFilters=${setFilters} onBack=${() => setAt(null)}
203
+ : html`<${ProjectBoard} project=${project} cards=${cards} stats=${stats} flashed=${flashed} display=${display} filters=${filters} query=${query} writable=${writable}
204
+ onDisplay=${setDisplay} onFilters=${setFilters} onQuery=${setQuery} onBack=${() => setAt(null)} onMore=${openMenuFor} onOwner=${openOwnerMenu}
148
205
  onOpen=${openCard} onCreate=${() => setDialog({ kind: "main", project: project === NO_PROJECT ? null : project.id })} onInstances=${showInstances} reload=${reload} />`;
149
206
 
150
207
  /** A right click on a card, or the keyboard's menu key on it (no pointer: the menu goes under the card). */
@@ -157,10 +214,42 @@ export function TaskBoardTab({ lease }) {
157
214
  if (!x && !y && typeof hit.el.getBoundingClientRect === "function") { const r = hit.el.getBoundingClientRect(); x = r.left + 8; y = r.bottom; }
158
215
  setMenu({ id: card.id, x, y, el: hit.el });
159
216
  }
217
+ /** A card's ⋯ button (board tile, list row): the same menu as a right click, under the button — for touch, which has no right click. */
218
+ function openMenuFor(card, el) {
219
+ const r = el && typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect() : { left: 0, bottom: 0 };
220
+ setMenu({ id: card.id, x: r.left, y: r.bottom, el });
221
+ }
222
+ /** The avatar of a tile or a row: the card page's assignee picker, under the button (the instances as the page knows them now). */
223
+ function openOwnerMenu(card, el) {
224
+ const r = el && typeof el.getBoundingClientRect === "function" ? el.getBoundingClientRect() : { left: 0, bottom: 0 };
225
+ const names = (appStore.get().instances || []).map((i) => i.name);
226
+ setMenu(null);
227
+ setOwnerMenu({ id: card.id, x: r.left, y: r.bottom, el, names });
228
+ }
229
+ function closeOwnerMenu(refocus) {
230
+ const el = ownerMenu && ownerMenu.el;
231
+ setOwnerMenu(null);
232
+ if (refocus && el && document.contains?.(el)) { quietInfo(); el.focus?.(); }
233
+ }
234
+ /**
235
+ * A new assignee for a card (a name, null for nobody, or "\u0000other" to ask for any name) — the menu's and the avatar's, one
236
+ * write with the version the board showed: a card changed since (409) says so as the card page does, and the board reads again.
237
+ */
238
+ async function assignTo(card, value) {
239
+ try {
240
+ const name = value === "\u0000other" ? await askText({ title: t("taskcard.otherTitle"), label: t("taskcard.otherLabel"), required: true }) : value;
241
+ if (value === "\u0000other" && !name) return;
242
+ const r = await boardApi.update(card.id, { assignee: name, version: card.version });
243
+ for (const n of notesForPeople(r.notes)) toast(n);
244
+ reload();
245
+ } catch (err) {
246
+ if (err.status === 409) { toast(t("taskowner.conflict", card.id), false); reload(); } else toast(errorText(err), false);
247
+ }
248
+ }
160
249
  function closeMenu(refocus) {
161
250
  const el = menu && menu.el;
162
251
  setMenu(null);
163
- if (refocus && el && document.contains?.(el)) (el.querySelector("button") || el).focus?.();
252
+ if (refocus && el && document.contains?.(el)) (el.querySelector(".tb-tile-title, .tb-row-title, .tb-wait-title") || el.querySelector("button") || el).focus?.();
164
253
  }
165
254
  /** A menu choice, through the calls and questions the card's dialog uses. */
166
255
  async function menuAct(card, a) {
@@ -172,10 +261,10 @@ export function TaskBoardTab({ lease }) {
172
261
  else if (a.kind === "answer") after(await answerBlocked(card), "tasks.answered");
173
262
  else if (a.kind === "move") after(await moveCard(card, a.to));
174
263
  else if (a.kind === "cancel") after(await moveCard(card, "cancelled"));
175
- else if (a.kind === "assign" || a.kind === "assignOther" || a.kind === "priority") {
176
- const value = a.kind === "assignOther" ? await askText({ title: t("taskcard.otherTitle"), label: t("taskcard.otherLabel"), required: true }) : a.value;
177
- if (a.kind === "assignOther" && !value) return;
178
- const r = await boardApi.update(card.id, { [a.kind === "priority" ? "priority" : "assignee"]: value, version: card.version });
264
+ else if (a.kind === "assign") await assignTo(card, a.value);
265
+ else if (a.kind === "assignOther") await assignTo(card, "\u0000other");
266
+ else if (a.kind === "priority") {
267
+ const r = await boardApi.update(card.id, { priority: a.value, version: card.version });
179
268
  for (const n of notesForPeople(r.notes)) toast(n);
180
269
  reload();
181
270
  } else if (a.kind === "copyLink" || a.kind === "copyId") {
@@ -188,16 +277,25 @@ export function TaskBoardTab({ lease }) {
188
277
  } catch (err) { toast(errorText(err), false); }
189
278
  }
190
279
  const menuCard = menu ? cards.find((c) => c.id === menu.id) : null;
280
+ const ownerCard = ownerMenu ? cards.find((c) => c.id === ownerMenu.id) : null;
191
281
  // The assignees a card's menu offers: who has cards in its project (Other… names anyone else).
192
282
  const names = menuCard ? cards.filter((c) => projectKey(c) === projectKey(menuCard) && c.assignee).map((c) => c.assignee) : [];
193
283
 
284
+ // The card's breadcrumb: its project (a sub task's is its main task's).
285
+ const openCardRow = openId ? cards.find((c) => c.id === openId) : null;
286
+ const rootRow = openCardRow && openCardRow.kind === "sub" ? cards.find((c) => c.id === openCardRow.parentId) : openCardRow;
287
+ const where = rootRow ? (rootRow.projectId === null || rootRow.projectId === undefined ? t("tasks.noProject") : (projects.find((p) => p.id === rootRow.projectId) || {}).name || null) : null;
288
+
194
289
  return html`<div class="tb" onContextMenu=${onMenu}>
195
290
  ${writable ? null : html`<p class="tb-readonly" role="note"><${Icon} name="eye" size=${16} />${t("tasks.readOnly")}</p>`}
196
- ${body}
291
+ ${writable && !openId ? html`<${BoardOffNote} names=${boardOff} />` : null}
292
+ ${openId ? html`<${CardPage} key=${openId} id=${openId} tick=${tick} projects=${projects} cards=${cards} boardOff=${boardOff} doing=${inProgressBy(cards)} writable=${writable} place=${writable ? placeOf(cards, openId, reload) : null}
293
+ steps=${stepsOf(trail, openId, cards)} where=${where} back=${t(display.view === "list" ? "taskcard.backList" : "taskcard.backBoard")}
294
+ onBack=${closeCard} onOpen=${openCard} onStep=${stepToCard} reloadBoard=${reload} />` : body}
197
295
  ${menuCard ? html`<${CardMenu} at=${{ x: menu.x, y: menu.y }} label=${t("taskmenu.label", menuCard.id)} onClose=${closeMenu}
198
296
  items=${cardMenuItems(menuCard, { writable, names, act: (a) => menuAct(menuCard, a) })} />` : null}
199
- ${openId ? html`<${CardDialog} key=${openId} id=${openId} tick=${tick} projects=${projects} boardOff=${boardOff} writable=${writable} place=${writable ? placeOf(cards, openId, reload) : null}
200
- steps=${stepsOf(trail, openId, cards)} onClose=${closeCard} onOpen=${openCard} reloadBoard=${reload} />` : null}
297
+ ${ownerCard ? html`<${CardMenu} at=${{ x: ownerMenu.x, y: ownerMenu.y }} label=${t("taskowner.changeOf", ownerCard.assignee || t("tasks.nobody"))} onClose=${closeOwnerMenu}
298
+ items=${assigneeItems(ownerCard, ownerMenu.names, boardOff, (v) => void assignTo(ownerCard, v))} />` : null}
201
299
  ${dialog && dialog.kind === "main" ? html`<${CreateMainDialog} projects=${projects} project=${dialog.project} boardOff=${boardOff} onClose=${() => setDialog(null)}
202
300
  onCreated=${(id) => { if (!lease.current()) return; setDialog(null); reload(); openCard(id); }} />` : null}
203
301
  ${dialog && dialog.kind === "instances" ? html`<${InstancesDrawer} tick=${tick} onClose=${() => setDialog(null)} onOpen=${(id) => { setDialog(null); openCard(id); }} />` : null}
@@ -220,11 +318,12 @@ function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialo
220
318
  const archived = projects.filter((p) => p.archived);
221
319
  const loose = stats(NO_PROJECT).mains > 0;
222
320
  return html`<div class="tb-home">
223
- <div class="list-head tb-head"><span>${t("tasks.projects")}</span>
224
- <span class="tb-grow"></span>
225
- <${SearchBox} onOpen=${onOpen} />
226
- <${InstancesButton} onClick=${onInstances} />
227
- ${writable ? html`<button type="button" class="btn btn-primary" onClick=${() => onDialog({ kind: "project", project: null })}><${Icon} name="plus" size=${16} />${t("tasks.newProject")}</button>` : null}</div>
321
+ <div class="list-head tb-head s-page-head"><div class="s-page-title"><h2>${t("tasks.projects")}</h2></div>
322
+ <div class="tb-head-actions">
323
+ <${SearchBox} onOpen=${onOpen} />
324
+ <${InstancesButton} onClick=${onInstances} />
325
+ ${writable ? html`<button type="button" class="btn btn-primary" onClick=${() => onDialog({ kind: "project", project: null })}><${Icon} name="plus" size=${16} />${t("tasks.newProject")}</button>` : null}</div>
326
+ </div>
228
327
  <${Waiting} cards=${cards} writable=${writable} onOpen=${onOpen} reload=${reload} />
229
328
  ${active.length || loose ? html`<div class="tb-projects">
230
329
  ${active.map((p) => html`<${ProjectTile} key=${p.id} project=${p} stats=${stats(p.id)} onOpen=${() => onOpenProject(p.id)} onDialog=${writable ? onDialog : null} reload=${reload} />`)}
@@ -343,11 +442,15 @@ function SearchBox({ onOpen }) {
343
442
 
344
443
  // ── A project's board ─────────────────────────────────────
345
444
 
346
- function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filters, writable, onDisplay, onFilters, onBack, onOpen, onCreate, onInstances, reload }) {
445
+ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filters, query, writable, onDisplay, onFilters, onQuery, onBack, onOpen, onMore, onOwner, onCreate, onInstances, reload }) {
347
446
  const [expanded, setExpanded] = useState({});
447
+ // A phone shows one status at a time: the one picked here, else the first that has cards (the person's own first).
448
+ const [phoneStatus, setPhoneStatus] = useState(null);
348
449
  const [drag, setDrag] = useState(null);
349
450
  const [spot, setSpot] = useState(null);
350
451
  const key = project === NO_PROJECT ? NO_PROJECT : project.id;
452
+ // The project's lead instance (the owner info card says so of the instance that is it).
453
+ const lead = project === NO_PROJECT ? null : project.leadInstance || null;
351
454
  const archived = project !== NO_PROJECT && project.archived;
352
455
  const [insights, setInsights] = useState(false);
353
456
  const stats = statsOf(key);
@@ -359,23 +462,30 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
359
462
  return m;
360
463
  }, [cards]);
361
464
  const byId = useMemo(() => new Map(cards.map((c) => [c.id, c])), [cards]);
465
+ // What each instance with a card in progress is doing, and how many cards it has — one read of the store for
466
+ // the whole board; a tile or row says "running" only when it is the instance's one.
467
+ const runs = useRunContext(cards);
362
468
  const live = cards.filter((c) => c.kind === "main" && projectKey(c) === key && c.status !== "cancelled");
363
469
  // What the filters offer: this project's main tasks and their sub tasks.
364
470
  const own = live.flatMap((c) => [c, ...(subsOf.get(c.id) || [])]);
365
- const mains = live.filter((c) => doneShown(c, display.done, now) && mainMatches(c, subsOf.get(c.id), filters));
471
+ const mains = live.filter((c) => doneShown(c, display.done, now) && mainMatches(c, subsOf.get(c.id), filters, query));
472
+ const searching = filters.length > 0 || query.trim() !== "";
366
473
  // Finished cards hidden: no Done column (a card is still confirmed or finished from its dialog).
367
474
  const columns = display.done === "hide" ? COLUMNS.filter((s) => s !== "done") : COLUMNS;
475
+ const current = columns.includes(phoneStatus) ? phoneStatus : ["review", "claimed", "blocked", "open", "done"].find((s) => columns.includes(s) && mains.some((c) => c.status === s)) || columns[0];
368
476
  const toggleSubs = (id) => setExpanded({ ...expanded, [id]: !expanded[id] });
369
- const empty = () => html`<${Empty} icon="tasks" title=${filters.length ? t("tasks.emptyFiltered") : t("tasks.emptyBoard")} hint=${filters.length || archived ? undefined : t("tasks.emptyBoardHint")} />`;
477
+ // Nothing left by a search says so, with the way out (the search is kept on the device, so a reload would show it again).
478
+ const empty = () => html`<${Empty} icon="tasks" title=${searching ? t("tasks.emptyFiltered") : t("tasks.emptyBoard")} hint=${searching || archived ? undefined : t("tasks.emptyBoardHint")}
479
+ action=${query.trim() !== "" ? html`<button type="button" class="btn" onClick=${() => onQuery("")}>${t("taskview.clearSearch")}</button>` : null} />`;
370
480
  // Insights counts what the page shows. A list with sub-task rows shows exactly its rows (each matched by the filter, a
371
481
  // finished one as Done shows it); the board, or a list without them, shows a main task with all its sub tasks.
372
482
  const insightCards = () => (display.view === "list" && display.subs
373
- ? listRows(mains, subsOf, display, filters, now)
483
+ ? listRows(mains, subsOf, display, filters, now, query)
374
484
  : mains.flatMap((c) => [c, ...(subsOf.get(c.id) || [])]));
375
485
  const listBody = () => {
376
- const rows = listRows(mains, subsOf, display, filters, now);
377
- return rows.length === 0 ? empty() : html`<${ListView} rows=${rows} display=${display} subsOf=${subsOf} byId=${byId} flashed=${flashed} now=${now}
378
- expanded=${expanded} onToggleSubs=${toggleSubs} onOpen=${onOpen} />`;
486
+ const rows = listRows(mains, subsOf, display, filters, now, query);
487
+ return rows.length === 0 ? empty() : html`<${ListView} rows=${rows} display=${display} subsOf=${subsOf} byId=${byId} flashed=${flashed} now=${now} runs=${runs}
488
+ expanded=${expanded} onToggleSubs=${toggleSubs} onOpen=${onOpen} onMore=${onMore} onOwner=${onOwner} cards=${cards} lead=${lead} writable=${writable} onDisplay=${onDisplay} scope=${String(key)} />`;
379
489
  };
380
490
 
381
491
  const dropping = useRef(false);
@@ -390,6 +500,32 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
390
500
  const lost = !document.activeElement || document.activeElement === document.body;
391
501
  if (el && lost) el.focus();
392
502
  });
503
+ // The columns scroll sideways when they do not fit (at 1366 px the fourth is cut and the fifth is out of sight). A platform may hide its
504
+ // scrollbar until it is used, so while some columns are out of sight the toolbar has buttons that scroll them.
505
+ const scrollEl = useRef(null);
506
+ const [reach, setReach] = useState(NO_REACH);
507
+ const showsColumns = display.view !== "list" && mains.length > 0;
508
+ useEffect(() => {
509
+ const el = scrollEl.current;
510
+ if (!showsColumns || !el) { setReach(NO_REACH); return undefined; }
511
+ const measure = () => {
512
+ const next = scrollReach(el);
513
+ setReach((r) => (r.over === next.over && r.left === next.left && r.right === next.right ? r : next));
514
+ };
515
+ measure();
516
+ el.addEventListener("scroll", measure, { passive: true });
517
+ const watch = typeof ResizeObserver === "function" ? new ResizeObserver(measure) : null;
518
+ if (watch) { watch.observe(el); if (el.firstElementChild) watch.observe(el.firstElementChild); }
519
+ return () => { el.removeEventListener("scroll", measure); if (watch) watch.disconnect(); };
520
+ }, [showsColumns, columns.length]);
521
+ const scrollColumns = (direction) => {
522
+ const el = scrollEl.current;
523
+ if (!el) return;
524
+ const step = Math.max(272, Math.round(el.clientWidth * 0.8));
525
+ const calm = !!(globalThis.matchMedia && globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches);
526
+ if (typeof el.scrollBy === "function") el.scrollBy({ left: direction * step, behavior: calm ? "auto" : "smooth" });
527
+ else el.scrollLeft += direction * step;
528
+ };
393
529
  async function drop(card, to, after, before) {
394
530
  if (dropping.current) return;
395
531
  dropping.current = true;
@@ -441,44 +577,47 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
441
577
  }
442
578
 
443
579
  return html`<div class="tb-board-page">
444
- <div class="tb-bar-head">
445
- <button type="button" class="btn btn-ghost btn-sm" onClick=${onBack}><${Icon} name="back" size=${16} />${t("tasks.back")}</button>
446
- <div class="tb-title">
447
- <h2>${project === NO_PROJECT ? t("tasks.noProject") : project.name}</h2>
448
- ${archived ? html`<span class="tb-flag">${t("tasks.archived")}</span>` : null}
449
- ${project !== NO_PROJECT && project.description ? html`<span class="tb-project-desc">${project.description}</span>` : null}
580
+ <div class="tb-bar-head s-page-head">
581
+ <div class="tb-head-main">
582
+ <div class="tb-title s-page-title">
583
+ <button type="button" class="btn btn-ghost btn-sm tb-head-back" onClick=${onBack}><${Icon} name="back" size=${16} />${t("tasks.back")}</button>
584
+ <h2>${project === NO_PROJECT ? t("tasks.noProject") : project.name}</h2>
585
+ ${archived ? html`<span class="s-scope">${t("tasks.archived")}</span>` : null}
586
+ </div>
587
+ ${project !== NO_PROJECT && project.description ? html`<p class="s-page-lead tb-head-lead">${project.description}</p>` : null}
588
+ <div class="tb-stats" title=${t("tasks.percentTitle")}>
589
+ <span class="tb-pct">${stats.percent}%</span><${ProgressBar} progress=${stats.units} />
590
+ <span class="muted">${stats.mains === 1 ? t("tasks.mainOne") : t("tasks.mainCount", stats.mains)}</span>
591
+ ${stats.waiting ? html`<span class="tb-flag st-review">${t("tasks.waiting", stats.waiting)}</span>` : null}
592
+ ${stats.blocked ? html`<span class="tb-flag st-blocked">${t("tasks.blockedN", stats.blocked)}</span>` : null}
593
+ <button type="button" class="btn btn-ghost btn-sm tb-insights" title=${t("taskstats.buttonTip")} onClick=${() => setInsights(true)}><${Icon} name="chart" size=${16} />${t("taskstats.button")}</button>
594
+ </div>
450
595
  </div>
451
- <div class="tb-stats" title=${t("tasks.percentTitle")}>
452
- <span class="tb-pct">${stats.percent}%</span><${ProgressBar} progress=${stats.units} />
453
- <span class="muted">${stats.mains === 1 ? t("tasks.mainOne") : t("tasks.mainCount", stats.mains)}</span>
454
- ${stats.waiting ? html`<span class="tb-flag st-review">${t("tasks.waiting", stats.waiting)}</span>` : null}
455
- ${stats.blocked ? html`<span class="tb-flag st-blocked">${t("tasks.blockedN", stats.blocked)}</span>` : null}
456
- <button type="button" class="btn btn-ghost btn-sm tb-insights" title=${t("taskstats.buttonTip")} onClick=${() => setInsights(true)}><${Icon} name="chart" size=${16} />${t("taskstats.button")}</button>
596
+ <div class="tb-head-actions">
597
+ <${InstancesButton} onClick=${onInstances} />
598
+ ${archived || !writable ? null : html`<button type="button" class="btn btn-primary" onClick=${onCreate}><${Icon} name="plus" size=${16} />${t("tasks.newMain")}</button>`}
457
599
  </div>
458
- <span class="tb-grow"></span>
459
- <${InstancesButton} onClick=${onInstances} />
460
- ${archived || !writable ? null : html`<button type="button" class="btn btn-primary" onClick=${onCreate}><${Icon} name="plus" size=${16} />${t("tasks.newMain")}</button>`}
461
- </div>
462
- <div class="tb-view-bar">
463
- <${FilterMenu} cards=${own} filters=${filters} onChange=${onFilters} />
464
- <${DisplayMenu} display=${display} onChange=${onDisplay} />
465
- <${FilterBar} cards=${own} filters=${filters} onChange=${onFilters} />
466
600
  </div>
601
+ <${TaskToolbar} cards=${own} display=${display} onDisplay=${onDisplay} filters=${filters} onFilters=${onFilters} query=${query} onQuery=${onQuery}
602
+ scroller=${display.view === "list" ? null : { reach, by: scrollColumns }} />
467
603
  ${display.view === "list" ? listBody() : mains.length === 0 && !drag ? empty()
468
- : html`<div class="tb-scroll"><div class=${`tb-columns${columns.length < COLUMNS.length ? " no-done" : ""}`}>
604
+ : html`${html`<div class="tb-seg tb-status-seg" role="group" aria-label=${t("taskview.statusTabs")}>${columns.map((status) =>
605
+ html`<button key=${status} type="button" aria-pressed=${current === status ? "true" : "false"} class=${`tb-seg-btn${current === status ? " active" : ""}`}
606
+ onClick=${() => setPhoneStatus(status)}><span class=${`tb-dot st-${status}`} aria-hidden="true"></span>${t(`tasks.${status}`)} <span class="tb-count">${mains.filter((c) => c.status === status).length}</span></button>`)}</div>`}
607
+ <div class="tb-scroll" ref=${scrollEl}><div class="tb-columns">
469
608
  ${columns.map((status) => {
470
609
  const list = mains.filter((c) => c.status === status);
471
610
  const line = spot && spot.status === status ? spot.index : -1;
472
- return html`<section key=${status} class=${`tb-col st-${status}${drag ? " can-drop" : ""}${line >= 0 ? " over" : ""}`} aria-label=${t(`tasks.${status}`)}
611
+ return html`<section key=${status} class=${`tb-col st-${status}${status === current ? " is-current" : ""}${drag ? " can-drop" : ""}${line >= 0 ? " over" : ""}`} aria-label=${t(`tasks.${status}`)}
473
612
  onDragOver=${(e) => over(e, status)} onDrop=${(e) => dropOn(e, status, list)}>
474
613
  <h3 class="tb-col-head"><span class="tb-dot"></span>${t(`tasks.${status}`)}
475
614
  ${status === "done" ? html`<button type="button" class="tb-link" title=${t("tasks.toggleDone")} onClick=${() => onDisplay({ ...display, done: display.done === "all" ? "recent" : "all" })}>${display.done === "all" ? t("tasks.all") : t("tasks.recent")}</button>` : null}
476
615
  <span class="tb-count">${list.length}</span></h3>
477
616
  ${cellItems(list, drag ? drag.id : null, line, (card, dragging) => {
478
617
  const lit = Math.max(flashed.get(card.id) || 0, ...(subsOf.get(card.id) || []).map((s) => flashed.get(s.id) || 0));
479
- return html`<${Tile} key=${card.id} card=${card} dragging=${dragging} flash=${now - lit < 4000} subs=${subsOf.get(card.id)} writable=${writable}
618
+ return html`<${Tile} key=${card.id} card=${card} dragging=${dragging} flash=${now - lit < 4000} subs=${subsOf.get(card.id)} runs=${runs} writable=${writable} cards=${cards} lead=${lead}
480
619
  expanded=${!!expanded[card.id]} onToggleSubs=${() => toggleSubs(card.id)}
481
- onOpen=${onOpen} onKeyMove=${(e) => keyMove(card, e)}
620
+ onOpen=${onOpen} onMore=${onMore} onOwner=${onOwner} onKeyMove=${(e) => keyMove(card, e)}
482
621
  onDragStart=${(e) => { e.dataTransfer.setData("text/plain", card.id); e.dataTransfer.effectAllowed = "move"; setDrag(card); }} onDragEnd=${end} />`;
483
622
  })}
484
623
  </section>`;
@@ -505,8 +644,21 @@ function cellItems(list, draggingId, lineAt, render) {
505
644
  return items;
506
645
  }
507
646
 
508
- /** A card on the board: a main task shows its sub-task progress, and can open up the list. */
509
- function Tile({ card, dragging, flash, subs = [], expanded, writable, onToggleSubs, onOpen, onKeyMove, onDragStart, onDragEnd }) {
647
+ /** A main task's sub task at work, blocked or next, in one line: its label, number and title (+ how many more). */
648
+ function NowLine({ now, label = true }) {
649
+ return html`<div class="tb-tile-now" title=${now.cards.map((c) => `${c.id} ${c.title}`).join("\n")}>
650
+ ${label ? html`<span class=${`tb-now-label st-${now.tone}`}>${t(now.label)}</span>` : null}<span class="tb-code">${now.cards[0].id}</span>
651
+ <span class="tb-now-title">${now.cards[0].title}</span>${now.cards.length > 1 ? html`<span class="muted">${t("tasks.moreCards", now.cards.length - 1)}</span>` : null}</div>`;
652
+ }
653
+
654
+ /**
655
+ * A card on the board: rows from the top — the number, the priority and the size (and ⋯); the title (two lines at
656
+ * most, its whole text the tooltip); ONE line of status (`tileStatus`: why it is stuck, whom it waits for, what runs, what is
657
+ * next, the sub tasks' progress); the foot with the assignee (a button: the card page's picker, and an info card on hover) and
658
+ * the counts. The tile is as tall as its content; a main task can open up its sub tasks. No coloured bar at its left edge.
659
+ * A card whose agent is running says so with the "Running" mark in its status line (and keeps its accent edge and tint).
660
+ */
661
+ function Tile({ card, dragging, flash, subs = [], runs, expanded, writable, cards, lead, onToggleSubs, onOpen, onMore, onOwner, onKeyMove, onDragStart, onDragEnd }) {
510
662
  const accepted = card.acceptance.filter((a) => a.done).length;
511
663
  const progress = card.progress;
512
664
  const hasSubs = !!progress && progress.total > 0;
@@ -516,87 +668,63 @@ function Tile({ card, dragging, flash, subs = [], expanded, writable, onToggleSu
516
668
  const gap = card.status === "review" ? wrapUpText(card) : "";
517
669
  // Who works on a main task now (a step may be its reviewer's), rather than who owns it.
518
670
  const now = hasSubs ? currentWork(card, subs) : null;
519
- const workers = now ? workersOf(now.cards) : [];
671
+ const workers = now ? otherWorkers(workersOf(now.cards), card.assignee || "") : [];
672
+ // Its assignee (or, for a main task, a sub task's) is working on it now.
673
+ const run = runOf(card, runs, subs);
674
+ const running = !!run && run.state === "working" && !run.shared;
675
+ const status = tileStatus(card, { now, run, hasSubs });
676
+ const toggle = (e) => { e.stopPropagation(); onToggleSubs(); };
677
+ const toggleTitle = expanded ? t("tasks.hideSubs") : t("tasks.showSubs");
520
678
  // The tile is a group, not a button: its title is the control (keyboard, screen readers); a click anywhere opens it.
521
- return html`<div class=${`tb-tile st-${card.status}${dragging ? " dragging" : ""}${flash ? " flash" : ""}`} data-tile=${card.id}
679
+ return html`<div class=${`tb-tile st-${card.status}${dragging ? " dragging" : ""}${flash ? " flash" : ""}${running ? " running" : ""}`} data-tile=${card.id}
522
680
  draggable=${writable} onDragStart=${writable ? onDragStart : undefined} onDragEnd=${writable ? onDragEnd : undefined}
523
- onClick=${() => onOpen(card.id)}>
681
+ onClick=${(e) => { if (e.target && e.target.closest && e.target.closest(".tb-owner-pop")) return; onOpen(card.id); }}>
524
682
  <div class="tb-tile-top">
525
683
  <span class="tb-code">${card.id}</span>
526
684
  ${card.priority === "urgent" || card.priority === "high" ? html`<span class=${`tb-tag p-${card.priority}`}>${t(card.priority === "urgent" ? "tasks.urgentTag" : "tasks.highTag")}</span>` : null}
527
- ${card.kind === "sub" && card.needsReview && card.status !== "done" ? html`<span class="tb-tag st-review" title=${t("tasks.needsReviewTitle")}>${t("tasks.needsReview")}</span>` : null}
528
- ${gap ? html`<span class="tb-tag wrapup" title=${t("tasks.wrapLine", gap)}>${t("tasks.wrapTag")}</span>` : null}
685
+ <span class="tb-tile-tags">
686
+ ${card.kind === "sub" && card.needsReview && card.status !== "done" ? html`<span class="tb-tag st-review" title=${t("tasks.needsReviewTitle")}>${t("tasks.needsReview")}</span>` : null}
687
+ ${gap ? html`<span class="tb-tag wrapup" title=${t("tasks.wrapLine", gap)}>${t("tasks.wrapTag")}</span>` : null}
688
+ </span>
529
689
  <span class="tb-grow"></span>
530
690
  ${card.size ? html`<span class="tb-size" title=${t("tasks.size")}>${t(`tasks.size${card.size}`)}</span>` : null}
691
+ ${onMore ? html`<button type="button" class="icon-btn tb-more tb-tile-more" aria-label=${t("taskview.more")} title=${t("taskview.more")}
692
+ onClick=${(e) => { e.stopPropagation(); onMore(card, e.currentTarget); }}><${Icon} name="more" size=${16} /></button>` : null}
531
693
  </div>
532
- <button type="button" class="tb-tile-title" title=${writable ? t("tasks.tileHint") : undefined}
533
- onClick=${(e) => { e.stopPropagation(); onOpen(card.id); }} onKeyDown=${onKeyMove}>${card.title}</button>
534
- ${card.status === "blocked" && card.blockedReason ? html`<div class="tb-tile-note st-blocked"><${Icon} name="alert" size=${13} /><span>${card.blockedReason}</span></div>` : null}
535
- ${hasSubs ? html`<button type="button" class="tb-tile-progress" aria-expanded=${expanded ? "true" : "false"} title=${expanded ? t("tasks.hideSubs") : t("tasks.showSubs")}
536
- onClick=${(e) => { e.stopPropagation(); onToggleSubs(); }}>
537
- <${ProgressBar} progress=${progress} wide />
538
- <span>${t("tasks.subProgress", progress.done, progress.total)}</span>
539
- ${progress.blocked ? html`<span class="tb-flag st-blocked"><${Icon} name="alert" size=${12} />${progress.blocked}</span>` : null}
540
- <${Icon} name="chevron" size=${14} cls=${expanded ? "tb-chev open" : "tb-chev"} />
541
- </button>` : null}
694
+ <button type="button" class="tb-tile-title" title=${writable ? `${card.title}\n${t("tasks.tileHint")}` : card.title}
695
+ onClick=${(e) => { e.stopPropagation(); onOpen(card.id); }} onKeyDown=${onKeyMove}><span>${card.title}</span></button>
696
+ ${status ? html`<div class=${`tb-tile-status k-${status.kind}`}>
697
+ ${status.kind === "blocked" ? (status.reason
698
+ ? html`<div class="tb-tile-note st-blocked" title=${status.reason}><${Icon} name="alert" size=${13} /><span>${status.reason}</span></div>`
699
+ : html`<${NowLine} now=${status.now} />`)
700
+ : status.kind === "review" ? html`<div class=${`tb-tile-waits${status.you ? " you" : ""}`} title=${status.label}>${status.label}</div>`
701
+ : status.kind === "running" ? (status.run
702
+ ? html`<div class="tb-tile-run"><${RunMark} run=${status.run} />${status.now ? html`<${NowLine} now=${status.now} label=${false} />` : null}</div>`
703
+ : html`<${NowLine} now=${status.now} />`)
704
+ : status.kind === "next" ? html`<${NowLine} now=${status.now} />`
705
+ : html`<button type="button" class="tb-tile-progress" aria-expanded=${expanded ? "true" : "false"} title=${toggleTitle} onClick=${toggle}>
706
+ <${ProgressBar} progress=${progress} wide />
707
+ <span>${t("tasks.subProgress", progress.done, progress.total)}</span>
708
+ ${progress.blocked ? html`<span class="tb-flag st-blocked"><${Icon} name="alert" size=${12} />${progress.blocked}</span>` : null}
709
+ <${Icon} name="chevron" size=${14} cls=${expanded ? "tb-chev open" : "tb-chev"} />
710
+ </button>`}
711
+ </div>` : null}
542
712
  ${hasSubs && expanded ? html`<${SubList} subs=${subs} older=${older} onOpen=${onOpen} />` : null}
543
- ${now ? html`<div class="tb-tile-now" title=${now.cards.map((c) => `${c.id} ${c.title}`).join("\n")}>
544
- <span class=${`tb-now-label st-${now.tone}`}>${t(now.label)}</span><span class="tb-code">${now.cards[0].id}</span>
545
- <span class="tb-now-title">${now.cards[0].title}</span>${now.cards.length > 1 ? html`<span class="muted">${t("tasks.moreCards", now.cards.length - 1)}</span>` : null}</div>` : null}
546
- ${card.status === "review" && !hasSubs ? html`<div class=${`tb-tile-waits${waitsForYou(card) ? " you" : ""}`}>${reviewLabel(card)}</div>` : null}
547
713
  <div class="tb-tile-foot">
548
- ${now ? html`<span class="tb-people">${workers.map((w) => html`<${Who} key=${w} name=${w} empty=${t("tasks.nobody")} title=${t("tasks.ownerTip", card.assignee || t("tasks.nobody"))} />`)}</span>`
549
- : hasSubs && card.status === "review" ? html`<span class="tb-who tb-now-label st-review" title=${t("tasks.ownerTip", card.assignee || t("tasks.nobody"))}>${reviewLabel(card)}</span>`
550
- : html`<${Who} name=${card.assignee} empty=${t("tasks.nobody")} />`}
714
+ <${OwnerChip} card=${card} cards=${cards} lead=${lead} canAssign=${writable && card.status !== "done" && card.status !== "cancelled"} onPick=${onOwner} />
715
+ ${workers.length ? html`<span class="tb-people" title=${t("tasks.subWorkers")}><span class="tb-people-sep" aria-hidden="true">›</span>${workers.map((w) => html`<${Who} key=${w} name=${w} empty=${t("tasks.nobody")} />`)}</span>` : null}
551
716
  <span class="tb-tile-stats">
717
+ ${hasSubs && status && status.kind !== "progress" ? html`<button type="button" class=${`tb-tile-subs${progress.blocked ? " has-blocked" : ""}`} aria-expanded=${expanded ? "true" : "false"} title=${toggleTitle} onClick=${toggle}>
718
+ <${Icon} name="chevron" size=${13} cls=${expanded ? "tb-chev open" : "tb-chev"} />${progress.done}/${progress.total}${progress.blocked ? html`<${Icon} name="alert" size=${12} />` : null}</button>` : null}
552
719
  ${card.acceptance.length ? html`<span class=${accepted === card.acceptance.length ? "all" : ""} title=${t(card.kind === "main" ? "tasks.definition" : "tasks.acceptance")}><${Icon} name="check" size=${13} />${accepted}/${card.acceptance.length}</span>` : null}
553
- ${card.unmetDeps.length ? html`<span title=${t("tasks.waitsFor", card.unmetDeps.join(", "))}><${Icon} name="clock" size=${13} /></span>` : null}
720
+ ${waitsOn(card) ? html`<span title=${t("tasks.waitsFor", waitsList(card, ", "))}><${Icon} name="clock" size=${13} /></span>` : null}
554
721
  ${card.commentCount ? html`<span class=${replied ? "reply" : ""} title=${replied ? t("tasks.agentReplied") : t("tasks.comments")}><${Icon} name="chat" size=${13} />${card.commentCount}</span>` : null}
555
722
  </span>
556
723
  </div>
557
724
  </div>`;
558
725
  }
559
726
 
560
- // ── Dialogs: a new main task, a project ───────────────────
561
-
562
- function CreateMainDialog({ projects, project, boardOff = [], onClose, onCreated }) {
563
- const { instances } = useStore(appStore);
564
- const active = projects.filter((p) => !p.archived);
565
- const [f, setF] = useState({ project: project === null || project === undefined ? "" : String(project), title: "", goal: "", scope: "", acceptance: "", context: "", size: "", priority: "normal", assignee: "", needsReview: true });
566
- const [busy, setBusy] = useState(false);
567
- const set = (k) => (e) => { const v = e.target.type === "checkbox" ? e.target.checked : e.target.value; setF((cur) => ({ ...cur, [k]: v })); };
568
- async function submit() {
569
- if (!f.title.trim()) { toast(t("tasks.titleRequired"), false); return; }
570
- setBusy(true);
571
- try {
572
- const { card } = await boardApi.create({
573
- kind: "main", project: f.project === "" ? null : Number(f.project), title: f.title, goal: f.goal, scope: f.scope,
574
- acceptance: f.acceptance.split("\n").map((l) => l.trim()).filter(Boolean), context: f.context,
575
- size: f.size || null, priority: f.priority, assignee: f.assignee.trim() || null, needsReview: f.needsReview,
576
- });
577
- toast(t("tasks.created", card.id));
578
- onCreated(card.id);
579
- } catch (err) { toast(errorText(err), false); setBusy(false); }
580
- }
581
- const field = (label, input) => html`<label class="field"><span>${label}</span>${input}</label>`;
582
- return html`<${Dialog} title=${t("tasks.createMain")} onClose=${onClose} busy=${busy} wide
583
- actions=${html`<button type="button" class="btn" onClick=${onClose} disabled=${busy}>${t("tasks.cancel")}</button>
584
- <button type="button" class="btn btn-primary" onClick=${submit} disabled=${busy || !f.title.trim()}>${t("tasks.create")}</button>`}>
585
- <form class="form" onSubmit=${(e) => { e.preventDefault(); submit(); }}><fieldset class="form" disabled=${busy}>
586
- ${field(`${t("tasks.title")} *`, html`<input value=${f.title} maxlength="100" placeholder=${t("tasks.titleHint")} onInput=${set("title")} required />`)}
587
- ${field(t("tasks.project"), html`<select value=${f.project} onChange=${set("project")}><option value="">${t("tasks.noProject")}</option>${active.map((p) => html`<option key=${p.id} value=${String(p.id)}>${p.name}</option>`)}</select>`)}
588
- ${field(t("tasks.goal"), html`<textarea rows="2" maxlength="300" placeholder=${t("tasks.goalHint")} value=${f.goal} onInput=${set("goal")}></textarea>`)}
589
- ${field(t("tasks.scope"), html`<textarea rows="2" maxlength="600" placeholder=${t("tasks.scopeHint")} value=${f.scope} onInput=${set("scope")}></textarea>`)}
590
- ${field(t("tasks.definition"), html`<textarea rows="3" placeholder=${t("tasks.definitionHint")} value=${f.acceptance} onInput=${set("acceptance")}></textarea>`)}
591
- ${field(t("tasks.context"), html`<textarea rows="2" maxlength="1000" placeholder=${t("tasks.contextHint")} value=${f.context} onInput=${set("context")}></textarea>`)}
592
- <div class="tb-form-row">
593
- ${field(t("tasks.assignee"), html`<select value=${f.assignee} onChange=${set("assignee")}><option value="">${t("tasks.nobody")}</option>${instances.map((i) => html`<${AssigneeOption} key=${i.name} name=${i.name} boardOff=${boardOff} />`)}</select>`)}
594
- ${field(t("tasks.size"), html`<select value=${f.size} onChange=${set("size")}><option value="">${t("tasks.sizeNone")}</option><option value="S">${t("tasks.sizeS")}</option><option value="M">${t("tasks.sizeM")}</option><option value="L">${t("tasks.sizeL")}</option></select>`)}
595
- ${field(t("tasks.priority"), html`<select value=${f.priority} onChange=${set("priority")}>${["urgent", "high", "normal", "low"].map((p) => html`<option key=${p} value=${p}>${t(`tasks.${p}`)}</option>`)}</select>`)}
596
- </div>
597
- <label class="tb-check"><input type="checkbox" checked=${f.needsReview} onChange=${set("needsReview")} />${t("tasks.reviewBox")}</label>
598
- </fieldset></form></${Dialog}>`;
599
- }
727
+ // ── Dialogs: a project (a new main task: fleet-task-create.js) ──
600
728
 
601
729
  /**
602
730
  * #2355 review: what an edit of a project sends — its fields, and its lead only when it changed (an unchanged retired
@@ -645,7 +773,7 @@ function placeOf(cards, id, reload) {
645
773
  const card = cards.find((c) => c.id === id);
646
774
  if (!card || card.status === "cancelled") return null;
647
775
  const column = cards.filter((c) => c.status !== "cancelled" && (card.kind === "sub"
648
- ? c.kind === "sub" && c.parentId === card.parentId
776
+ ? c.kind === "sub" && !!card.parentId && c.parentId === card.parentId
649
777
  : c.kind === "main" && projectKey(c) === projectKey(card) && c.status === card.status)).sort((a, b) => a.sort - b.sort);
650
778
  const i = column.findIndex((c) => c.id === id);
651
779
  const go = (after, before) => async () => { try { await boardApi.reorder(id, after, before); reload(); } catch (err) { toast(errorText(err), false); } };