@songsid/agend 2.4.0-beta.22 → 2.4.0-beta.24

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 (284) hide show
  1. package/dist/agent-cli-instructions.md +4 -3
  2. package/dist/agent-cli.js +32 -2
  3. package/dist/agent-cli.js.map +1 -1
  4. package/dist/agent-file-read.js +2 -2
  5. package/dist/agent-file-read.js.map +1 -1
  6. package/dist/agent-whats-new.js +17 -1
  7. package/dist/agent-whats-new.js.map +1 -1
  8. package/dist/auth-api.d.ts +2 -0
  9. package/dist/auth-api.js +5 -2
  10. package/dist/auth-api.js.map +1 -1
  11. package/dist/authority/web-authority.d.ts +17 -3
  12. package/dist/authority/web-authority.js +56 -3
  13. package/dist/authority/web-authority.js.map +1 -1
  14. package/dist/backend/claude-code.d.ts +15 -0
  15. package/dist/backend/claude-code.js +8 -3
  16. package/dist/backend/claude-code.js.map +1 -1
  17. package/dist/backend/claude-mcp-carry.d.ts +63 -0
  18. package/dist/backend/claude-mcp-carry.js +242 -0
  19. package/dist/backend/claude-mcp-carry.js.map +1 -0
  20. package/dist/build-provenance.json +1 -1
  21. package/dist/channel/mcp-tools.js +15 -7
  22. package/dist/channel/mcp-tools.js.map +1 -1
  23. package/dist/classic-channel-manager.d.ts +1 -1
  24. package/dist/classic-channel-manager.js +2 -2
  25. package/dist/classic-channel-manager.js.map +1 -1
  26. package/dist/config-validator.js +6 -0
  27. package/dist/config-validator.js.map +1 -1
  28. package/dist/contact-auth-api.js +3 -1
  29. package/dist/contact-auth-api.js.map +1 -1
  30. package/dist/contact-auth-service.js +1 -1
  31. package/dist/contact-auth-service.js.map +1 -1
  32. package/dist/contact-auth-store.d.ts +28 -2
  33. package/dist/contact-auth-store.js +72 -4
  34. package/dist/contact-auth-store.js.map +1 -1
  35. package/dist/contact-change-proposals.d.ts +18 -1
  36. package/dist/contact-change-proposals.js +38 -4
  37. package/dist/contact-change-proposals.js.map +1 -1
  38. package/dist/contact-state-view.d.ts +103 -0
  39. package/dist/contact-state-view.js +80 -0
  40. package/dist/contact-state-view.js.map +1 -0
  41. package/dist/daemon.d.ts +11 -0
  42. package/dist/daemon.js +66 -15
  43. package/dist/daemon.js.map +1 -1
  44. package/dist/dashboard-permissions.d.ts +8 -0
  45. package/dist/dashboard-permissions.js +8 -0
  46. package/dist/dashboard-permissions.js.map +1 -1
  47. package/dist/delivery-outbox.d.ts +15 -1
  48. package/dist/delivery-outbox.js +60 -2
  49. package/dist/delivery-outbox.js.map +1 -1
  50. package/dist/fleet-manager.d.ts +157 -15
  51. package/dist/fleet-manager.js +522 -78
  52. package/dist/fleet-manager.js.map +1 -1
  53. package/dist/general-knowledge/skills/admin/SKILL.md +52 -0
  54. package/dist/general-knowledge/skills/concepts/SKILL.md +31 -21
  55. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +6 -0
  56. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -3
  57. package/dist/general-knowledge/skills/fleet-config/SKILL.md +3 -3
  58. package/dist/general-knowledge/skills/hub/SKILL.md +6 -1
  59. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
  60. package/dist/general-knowledge/skills/task-board/SKILL.md +17 -0
  61. package/dist/general-knowledge/skills/web-appearance/SKILL.md +4 -0
  62. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +75 -12
  63. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
  64. package/dist/general-role.d.ts +1 -1
  65. package/dist/general-role.js +1 -0
  66. package/dist/general-role.js.map +1 -1
  67. package/dist/hub/client.js +6 -1
  68. package/dist/hub/client.js.map +1 -1
  69. package/dist/hub/compose/member.d.ts +2 -1
  70. package/dist/hub/compose/member.js +3 -2
  71. package/dist/hub/compose/member.js.map +1 -1
  72. package/dist/hub/compose/server.js +2 -1
  73. package/dist/hub/compose/server.js.map +1 -1
  74. package/dist/hub/http/compose.js +5 -0
  75. package/dist/hub/http/compose.js.map +1 -1
  76. package/dist/hub/protocol.d.ts +21 -0
  77. package/dist/hub/protocol.js +3 -0
  78. package/dist/hub/protocol.js.map +1 -1
  79. package/dist/hub/question-close-model.d.ts +17 -0
  80. package/dist/hub/question-close-model.js +7 -0
  81. package/dist/hub/question-close-model.js.map +1 -0
  82. package/dist/hub/representative.d.ts +5 -0
  83. package/dist/hub/representative.js +51 -1
  84. package/dist/hub/representative.js.map +1 -1
  85. package/dist/hub/rooms/direct-view.js +1 -0
  86. package/dist/hub/rooms/direct-view.js.map +1 -1
  87. package/dist/hub/rooms/types.d.ts +1 -1
  88. package/dist/hub/rooms.d.ts +3 -0
  89. package/dist/hub/rooms.js +27 -1
  90. package/dist/hub/rooms.js.map +1 -1
  91. package/dist/hub/server.js +6 -1
  92. package/dist/hub/server.js.map +1 -1
  93. package/dist/hub/types.d.ts +2 -2
  94. package/dist/human-delivery-receipts.d.ts +12 -2
  95. package/dist/human-delivery-receipts.js +19 -4
  96. package/dist/human-delivery-receipts.js.map +1 -1
  97. package/dist/instance-lifecycle.d.ts +2 -0
  98. package/dist/instance-lifecycle.js +29 -1
  99. package/dist/instance-lifecycle.js.map +1 -1
  100. package/dist/instructions.d.ts +1 -1
  101. package/dist/instructions.js +1 -1
  102. package/dist/instructions.js.map +1 -1
  103. package/dist/locale.js +110 -12
  104. package/dist/locale.js.map +1 -1
  105. package/dist/needs-you-hub.d.ts +3 -0
  106. package/dist/needs-you-hub.js +31 -5
  107. package/dist/needs-you-hub.js.map +1 -1
  108. package/dist/needs-you.d.ts +16 -1
  109. package/dist/needs-you.js +7 -1
  110. package/dist/needs-you.js.map +1 -1
  111. package/dist/office-share-page.js +2 -2
  112. package/dist/office-share-page.js.map +1 -1
  113. package/dist/office-share.js +2 -1
  114. package/dist/office-share.js.map +1 -1
  115. package/dist/outbound-handlers.d.ts +4 -0
  116. package/dist/outbound-handlers.js +69 -11
  117. package/dist/outbound-handlers.js.map +1 -1
  118. package/dist/outbound-schemas.d.ts +5 -1
  119. package/dist/outbound-schemas.js +10 -7
  120. package/dist/outbound-schemas.js.map +1 -1
  121. package/dist/public-web-gateway.js +21 -0
  122. package/dist/public-web-gateway.js.map +1 -1
  123. package/dist/reply-buttons-controller.d.ts +2 -1
  124. package/dist/reply-buttons-controller.js +1 -1
  125. package/dist/reply-buttons-controller.js.map +1 -1
  126. package/dist/request-context-compatibility.d.ts +20 -0
  127. package/dist/request-context-compatibility.js +74 -0
  128. package/dist/request-context-compatibility.js.map +1 -0
  129. package/dist/request-context-protocol.d.ts +137 -0
  130. package/dist/request-context-protocol.js +38 -0
  131. package/dist/request-context-protocol.js.map +1 -0
  132. package/dist/request-context-store.d.ts +25 -0
  133. package/dist/request-context-store.js +137 -0
  134. package/dist/request-context-store.js.map +1 -0
  135. package/dist/scheduler/db.js +26 -0
  136. package/dist/scheduler/db.js.map +1 -1
  137. package/dist/scheduler/task-board-text.d.ts +2 -0
  138. package/dist/scheduler/task-board-text.js +12 -0
  139. package/dist/scheduler/task-board-text.js.map +1 -1
  140. package/dist/scheduler/task-board.d.ts +102 -2
  141. package/dist/scheduler/task-board.js +242 -24
  142. package/dist/scheduler/task-board.js.map +1 -1
  143. package/dist/scheduler/task-files.d.ts +80 -0
  144. package/dist/scheduler/task-files.js +357 -0
  145. package/dist/scheduler/task-files.js.map +1 -0
  146. package/dist/settings-api.d.ts +2 -0
  147. package/dist/settings-api.js +6 -1
  148. package/dist/settings-api.js.map +1 -1
  149. package/dist/settings-baseline.d.ts +1 -0
  150. package/dist/settings-baseline.js +1 -1
  151. package/dist/settings-baseline.js.map +1 -1
  152. package/dist/settings-effect.d.ts +2 -0
  153. package/dist/settings-effect.js +5 -1
  154. package/dist/settings-effect.js.map +1 -1
  155. package/dist/task-attach-client.d.ts +43 -0
  156. package/dist/task-attach-client.js +125 -0
  157. package/dist/task-attach-client.js.map +1 -0
  158. package/dist/task-board-tool.d.ts +12 -0
  159. package/dist/task-board-tool.js +107 -6
  160. package/dist/task-board-tool.js.map +1 -1
  161. package/dist/task-file-limits.d.ts +15 -0
  162. package/dist/task-file-limits.js +21 -0
  163. package/dist/task-file-limits.js.map +1 -0
  164. package/dist/tool-permissions.d.ts +32 -0
  165. package/dist/tool-permissions.js +64 -1
  166. package/dist/tool-permissions.js.map +1 -1
  167. package/dist/types.d.ts +6 -0
  168. package/dist/ui/accounts-keepalive.js +2 -1
  169. package/dist/ui/agent-details-settings.js +7 -5
  170. package/dist/ui/agent-who-can-use-strings.js +125 -0
  171. package/dist/ui/agent-who-can-use.js +238 -0
  172. package/dist/ui/chat-activity.js +2 -1
  173. package/dist/ui/chat-pins.js +2 -1
  174. package/dist/ui/claude-credentials.js +2 -1
  175. package/dist/ui/contact-auth-strings.js +28 -17
  176. package/dist/ui/contact-authorizations.js +6 -4
  177. package/dist/ui/contact-needs.js +6 -1
  178. package/dist/ui/contact-permissions.js +6 -4
  179. package/dist/ui/contact-tool-groups.js +1 -1
  180. package/dist/ui/contact-verify-need.js +46 -0
  181. package/dist/ui/fleet-cache.js +2 -1
  182. package/dist/ui/fleet-office-card.js +23 -5
  183. package/dist/ui/fleet-office-editor.js +5 -5
  184. package/dist/ui/fleet-office-pack.d.ts +10 -0
  185. package/dist/ui/fleet-office-pack.js +65 -2
  186. package/dist/ui/fleet-office-skin.js +52 -14
  187. package/dist/ui/fleet-office-store.js +33 -2
  188. package/dist/ui/fleet-office-vehicles.js +130 -0
  189. package/dist/ui/fleet-office-zones.js +27 -10
  190. package/dist/ui/fleet-office.js +128 -40
  191. package/dist/ui/fleet-org.js +6 -1
  192. package/dist/ui/fleet-tab-icons.js +19 -0
  193. package/dist/ui/fleet-task-activity.js +11 -83
  194. package/dist/ui/fleet-task-archive.js +111 -0
  195. package/dist/ui/fleet-task-card.js +6 -4
  196. package/dist/ui/fleet-task-common.js +2 -2
  197. package/dist/ui/fleet-task-edit.js +8 -1
  198. package/dist/ui/fleet-task-files.js +196 -0
  199. package/dist/ui/fleet-task-md.js +98 -0
  200. package/dist/ui/fleet-task-menu.js +1 -1
  201. package/dist/ui/fleet-task-stats.js +2 -2
  202. package/dist/ui/fleet-task-view.js +14 -9
  203. package/dist/ui/fleet-tasks.js +42 -18
  204. package/dist/ui/fleet-usage.js +2 -1
  205. package/dist/ui/hub-admin-overview.js +2 -1
  206. package/dist/ui/hub-agent-intro.js +2 -1
  207. package/dist/ui/hub-assistant-admin.js +2 -1
  208. package/dist/ui/hub-directory-notices.js +2 -1
  209. package/dist/ui/hub-enrolment-code.js +2 -1
  210. package/dist/ui/hub-my-agents.js +2 -1
  211. package/dist/ui/hub-quick-pairing.js +2 -1
  212. package/dist/ui/hub-role-audit.js +2 -1
  213. package/dist/ui/hub-role-forms.js +3 -2
  214. package/dist/ui/hub-role-view.js +3 -2
  215. package/dist/ui/hub-roles.js +2 -1
  216. package/dist/ui/hub-room-agent-strings.js +2 -1
  217. package/dist/ui/hub-room-list.js +2 -1
  218. package/dist/ui/hub-room-owner-requests.js +2 -1
  219. package/dist/ui/hub-room-pins.js +2 -1
  220. package/dist/ui/hub-room-strings.js +2 -2
  221. package/dist/ui/hub-room-thread.js +1 -1
  222. package/dist/ui/log-row.js +4 -3
  223. package/dist/ui/office-share-dialog.js +2 -1
  224. package/dist/ui/office-share-page.js +2 -1
  225. package/dist/ui/page-share-dialog.js +3 -2
  226. package/dist/ui/panel-chat.js +2 -1
  227. package/dist/ui/panel-details.js +5 -2
  228. package/dist/ui/panel-fleet.js +10 -5
  229. package/dist/ui/panel-hub.js +2 -1
  230. package/dist/ui/panel-needs.js +34 -6
  231. package/dist/ui/panel-notices.js +2 -1
  232. package/dist/ui/panel-runtimes.js +2 -1
  233. package/dist/ui/panel-settings.js +15 -1
  234. package/dist/ui/panel-windows-cli.js +3 -2
  235. package/dist/ui/runtime-cli-install.js +2 -1
  236. package/dist/ui/settings-appearance.js +2 -1
  237. package/dist/ui/settings-guests.js +4 -3
  238. package/dist/ui/settings-hub-member-address.js +2 -1
  239. package/dist/ui/settings-hub-setup.js +2 -1
  240. package/dist/ui/settings-hub-web-address.js +2 -1
  241. package/dist/ui/settings-hub.js +2 -1
  242. package/dist/ui/settings-registry.js +1 -0
  243. package/dist/ui/settings-shared-strings.js +9 -0
  244. package/dist/ui/settings-shared.js +6 -1
  245. package/dist/ui/settings-update.js +2 -1
  246. package/dist/ui/settings-web-authority.js +2 -1
  247. package/dist/ui/shared/agent-sheet.js +2 -1
  248. package/dist/ui/shared/app-i18n.js +2 -2
  249. package/dist/ui/shared/app-needs.js +8 -1
  250. package/dist/ui/shared/app-session.js +4 -3
  251. package/dist/ui/shared/app-shell.js +6 -2
  252. package/dist/ui/shared/app.css +93 -11
  253. package/dist/ui/shared/chat-strings.js +4 -4
  254. package/dist/ui/shared/chat-time.js +7 -4
  255. package/dist/ui/shared/clock-text.js +57 -0
  256. package/dist/ui/shared/device-roles.js +6 -5
  257. package/dist/ui/shared/instance-nav.js +17 -22
  258. package/dist/ui/shared/task-board.css +64 -0
  259. package/dist/ui/shared/usage-dialog.js +2 -1
  260. package/dist/ui/shared/view-strings.js +0 -14
  261. package/dist/ui/shared/web-authorize.js +3 -2
  262. package/dist/ui/subagent-row.js +2 -1
  263. package/dist/web-api.d.ts +18 -2
  264. package/dist/web-api.js +159 -27
  265. package/dist/web-api.js.map +1 -1
  266. package/dist/web-login.d.ts +6 -1
  267. package/dist/web-login.js +8 -3
  268. package/dist/web-login.js.map +1 -1
  269. package/dist/web-office-acts.d.ts +16 -0
  270. package/dist/web-office-acts.js +27 -9
  271. package/dist/web-office-acts.js.map +1 -1
  272. package/dist/web-office-pack-read.js +1 -1
  273. package/dist/web-office-pack-read.js.map +1 -1
  274. package/dist/web-office-skins.d.ts +5 -3
  275. package/dist/web-office-skins.js +20 -16
  276. package/dist/web-office-skins.js.map +1 -1
  277. package/dist/web-session-authorization.d.ts +3 -0
  278. package/dist/web-session-authorization.js +1 -1
  279. package/dist/web-session-authorization.js.map +1 -1
  280. package/dist/web-settings-patch.d.ts +27 -0
  281. package/dist/web-settings-patch.js +67 -0
  282. package/dist/web-settings-patch.js.map +1 -1
  283. package/dist/workflow-templates/default.md +1 -0
  284. package/package.json +1 -1
@@ -0,0 +1,98 @@
1
+ // Markdown on a card: the chat's own renderer (AgendChatRender.renderMarkdown — it escapes the text FIRST and then adds only
2
+ // a fixed set of tags, so nothing a person or an agent writes becomes a tag, an attribute or a script; links are http(s) / mailto only),
3
+ // drawn for a comment, a progress note, and — in reading mode — a card's text fields (goal, scope, context, state, result, blocked reason).
4
+ // One module so the timeline, the card's fields and the files' previews draw it the same way, and its code blocks are decorated as the chat's.
5
+ import { html, useEffect, useRef } from "/assets/app-html.js";
6
+ import { t } from "/assets/app-i18n.js";
7
+ import "/assets/chat-render.js";
8
+ import "/assets/chat-strings.js";
9
+
10
+ /** A comment's text as the chat draws a message (Markdown, escaped first); the plain text when the renderer is not there. */
11
+ export const commentHtml = (text) => {
12
+ const r = globalThis.AgendChatRender;
13
+ return r && typeof r.renderMarkdown === "function" ? { __html: r.renderMarkdown(text) } : null;
14
+ };
15
+
16
+ /** The chat's copy: the clipboard, else a hidden text area (a plain-http page has no clipboard API). */
17
+ async function copyText(text) {
18
+ try { if (navigator.clipboard && globalThis.isSecureContext) { await navigator.clipboard.writeText(text); return true; } } catch { /* fall back */ }
19
+ const ta = document.createElement("textarea"); ta.value = text; ta.setAttribute("readonly", ""); ta.className = "offscreen";
20
+ document.body.appendChild(ta); ta.select();
21
+ let ok = false; try { ok = document.execCommand("copy"); } catch { ok = false; }
22
+ ta.remove();
23
+ return ok;
24
+ }
25
+ export const storedWrap = () => { try { return localStorage.getItem("agend_code_wrap") === "1"; } catch { return false; } };
26
+
27
+ /**
28
+ * Code blocks as the chat's thread draws them (chat-thread.js `decorateCode`, the same classes, so the same sheet styles them):
29
+ * a header with the language, Wrap and Copy, and a block of more than CODE_FOLD_LINES lines folded until opened. Built from nodes.
30
+ */
31
+ export function decorateCode(root) {
32
+ if (!root || typeof root.querySelectorAll !== "function") return;
33
+ const doc = root.ownerDocument;
34
+ const R = globalThis.AgendChatRender;
35
+ const limit = R && Number.isFinite(R.CODE_FOLD_LINES) ? R.CODE_FOLD_LINES : 30;
36
+ const lineCount = R && typeof R.lineCount === "function" ? R.lineCount : (c) => String(c).split("\n").length;
37
+ for (const pre of root.querySelectorAll("pre")) {
38
+ if (pre.parentNode && pre.parentNode.classList && pre.parentNode.classList.contains("codeblock")) continue;
39
+ const box = doc.createElement("div"); box.className = "codeblock";
40
+ const head = doc.createElement("div"); head.className = "cb-head";
41
+ const lang = doc.createElement("span"); lang.className = "cb-lang"; lang.textContent = pre.dataset.lang || "text";
42
+ const wrap = doc.createElement("button"); wrap.type = "button"; wrap.className = "chip-btn"; wrap.dataset.act = "toggleWrap"; wrap.textContent = t("chat.wrap");
43
+ const copy = doc.createElement("button"); copy.type = "button"; copy.className = "chip-btn"; copy.dataset.act = "copyCode"; copy.textContent = t("chat.copy");
44
+ head.append(lang, wrap, copy);
45
+ pre.replaceWith(box); box.append(head, pre);
46
+ const lines = lineCount(pre.textContent);
47
+ if (lines > limit) {
48
+ box.classList.add("folded");
49
+ const more = doc.createElement("button"); more.type = "button"; more.className = "cb-more"; more.dataset.act = "toggleFold";
50
+ more.dataset.lines = String(lines); more.textContent = t("chat.showAll", lines);
51
+ box.append(more);
52
+ }
53
+ }
54
+ }
55
+
56
+ /** A click on one of a decorated block's buttons (Copy, Wrap, Show all), as the chat's thread answers it. */
57
+ async function onCodeClick(e) {
58
+ const el = e.target && e.target.closest ? e.target.closest("[data-act]") : null;
59
+ if (!el) return;
60
+ const act = el.dataset.act;
61
+ if (act === "copyCode") {
62
+ const pre = el.closest(".codeblock") && el.closest(".codeblock").querySelector("pre");
63
+ if (!pre) return;
64
+ const ok = await copyText(pre.textContent);
65
+ const was = el.dataset.label || el.textContent; el.dataset.label = was;
66
+ el.textContent = t(ok ? "chat.copied" : "chat.copyFailed");
67
+ setTimeout(() => { el.textContent = was; }, 1200);
68
+ } else if (act === "toggleWrap") {
69
+ // The timeline (`.tl`) wraps all its code at once; elsewhere (a card's field, a file) the block's own Markdown box does.
70
+ const stream = el.closest(".tl") || el.closest(".md");
71
+ if (!stream) return;
72
+ const on = stream.classList.toggle("wrap-code");
73
+ try { localStorage.setItem("agend_code_wrap", on ? "1" : "0"); } catch { /* this page only */ }
74
+ } else if (act === "toggleFold") {
75
+ const box = el.closest(".codeblock");
76
+ if (!box) return;
77
+ const folded = box.classList.toggle("folded");
78
+ el.textContent = !folded ? t("chat.showLess") : t("chat.showAll", el.dataset.lines);
79
+ }
80
+ }
81
+
82
+ /** A comment's body: the chat's Markdown, its code blocks decorated as the chat's are. */
83
+ export function MdBody({ body, cls = "tl-body md", onActivate = null, title = undefined }) {
84
+ const ref = useRef(null);
85
+ useEffect(() => { decorateCode(ref.current); });
86
+ // `onActivate`: a click on the text itself (not on a link, a code block's buttons or a selection being made) — a card's field opens its editor.
87
+ const click = (e) => {
88
+ void onCodeClick(e);
89
+ if (!onActivate) return;
90
+ const inside = e.target && e.target.closest ? e.target.closest("a, button, summary, pre, [data-act]") : null;
91
+ const picked = typeof globalThis.getSelection === "function" && String(globalThis.getSelection() || "").length > 0;
92
+ if (!inside && !picked) onActivate(e);
93
+ };
94
+ return html`<div class=${cls} ref=${ref} title=${title} onClick=${click} dangerouslySetInnerHTML=${body}></div>`;
95
+ }
96
+
97
+ /** Plain text as Markdown for a card's field: the same object `dangerouslySetInnerHTML` takes, or null when the renderer is not there. */
98
+ export const mdOf = commentHtml;
@@ -17,7 +17,7 @@ register("taskmenu", {
17
17
  prev: "Previous card (K)", next: "Next card (J)", position: "{0} / {1}",
18
18
  },
19
19
  "zh-TW": {
20
- label: "{0}:動作", open: "打開", moveTo: "移到", assignee: "負責人", priority: "優先度",
20
+ label: "{0}:動作", open: "打開", moveTo: "移到", assignee: "負責人", priority: "優先級",
21
21
  copyLink: "複製連結", copyId: "複製卡號", copied: "已複製 {0}", cancel: "取消這張卡…",
22
22
  prev: "上一張(K)", next: "下一張(J)", position: "{0} / {1}",
23
23
  },
@@ -18,10 +18,10 @@ register("taskstats", {
18
18
  note: "It counts the cards the board shows: with its filter, and finished cards as the Done column has them (the last 7 days, or all).",
19
19
  },
20
20
  "zh-TW": {
21
- button: "統計", buttonTip: "統計這個專案的卡:依負責人、狀態、優先度或大小",
21
+ button: "統計", buttonTip: "統計這個專案的卡:依負責人、狀態、優先級或大小",
22
22
  title: "統計:{0}", count: "計算", countAll: "所有卡", countMain: "只算主任務",
23
23
  rows: "每一列", split: "細分", splitNone: "不細分",
24
- "field.assignee": "負責人", "field.status": "狀態", "field.priority": "優先度", "field.size": "大小",
24
+ "field.assignee": "負責人", "field.status": "狀態", "field.priority": "優先級", "field.size": "大小",
25
25
  total: "合計", cards: "{0} 張卡", empty: "這裡沒有可以統計的卡", chart: "{0},依{1}",
26
26
  note: "統計的是看板上顯示的卡:套用看板的篩選;已完成的卡照完成欄顯示的算(近 7 天或全部)。",
27
27
  },
@@ -10,9 +10,11 @@ import { t, register, lang } from "/assets/app-i18n.js";
10
10
  import { Icon } from "/assets/ui-icons.js";
11
11
  import { Menu } from "/assets/ui-menu.js";
12
12
  import { RunMark, runOf } from "./fleet-task-run.js";
13
+ import "./fleet-task-files.js";
13
14
  import { OwnerChip } from "./fleet-task-owner.js";
14
15
  import { COLUMNS, ProgressBar, UNASSIGNED, Who, readStored, recentlyDone, relTime, reviewLabel, waitsForYou, waitsList, waitsOn, wrapUpText, writeStored } from "./fleet-task-common.js";
15
16
  import { assetUrl } from "/assets/asset-url.js";
17
+ import { dateTimeText } from "/assets/clock-text.js";
16
18
 
17
19
  /** The task board's stylesheet, linked once (a tab opened before an upgrade has an app.css without these rules). */
18
20
  export function linkTaskBoardCss(doc = typeof document !== "undefined" ? document : null) {
@@ -53,15 +55,15 @@ register("taskview", {
53
55
  "zh-TW": {
54
56
  display: "顯示", displayTip: "看板或清單、分組、排序、已完成的卡", filter: "篩選", filterTip: "只看部分卡片",
55
57
  view: "檢視", board: "看板", list: "清單", groupBy: "分組", orderBy: "排序", finished: "已完成的卡", doneHide: "隱藏",
56
- "group.status": "狀態", "group.assignee": "負責人", "group.priority": "優先度", "group.none": "不分組",
57
- "order.manual": "看板順序", "order.priority": "優先度", "order.updated": "最近變動", "order.created": "最新建立", "order.title": "標題",
58
+ "group.status": "狀態", "group.assignee": "負責人", "group.priority": "優先級", "group.none": "不分組",
59
+ "order.manual": "看板順序", "order.priority": "優先級", "order.updated": "最近變動", "order.created": "最新建立", "order.title": "標題",
58
60
  subsRows: "子任務也各列一行",
59
- fieldstatus: "狀態", fieldassignee: "負責人", fieldpriority: "優先度", fieldsize: "大小",
61
+ fieldstatus: "狀態", fieldassignee: "負責人", fieldpriority: "優先級", fieldsize: "大小",
60
62
  filters: "篩選條件", is: "是", isNot: "不是", opTip: "切換「是」與「不是」", values: "{0}:選擇項目",
61
63
  nValues: "{0} 項", remove: "移除這個條件", clear: "清除篩選", changed: "{0}變動", inMain: "{0} {1} 的子任務",
62
64
  fieldwaits: "等我處理", waitsYou: "等我確認", viewLabel: "看板或清單", scrollColumns: "捲動欄位", columnsLeft: "左邊的欄位", columnsRight: "右邊的欄位", search: "搜尋", searchLabel: "搜尋這個專案的卡片(卡號、標題、欄位、完成定義)",
63
65
  "order.assignee": "負責人", "order.code": "卡號", sortBy: "依{0}排序", sortedBy: "{0},{1}排序", asc: "由小到大", desc: "由大到小",
64
- colId: "卡號", colTitle: "標題", colPriority: "優先度", colAssignee: "負責人", colUpdated: "更新",
66
+ colId: "卡號", colTitle: "標題", colPriority: "優先級", colAssignee: "負責人", colUpdated: "更新",
65
67
  collapse: "收合 {0}", expand: "展開 {0}", more: "卡片動作", statusTabs: "一次看一個狀態", noMatch: "沒有符合「{0}」的卡片", clearSearch: "清除搜尋",
66
68
  },
67
69
  });
@@ -261,7 +263,7 @@ export function FilterMenu({ cards, filters, onChange }) {
261
263
  }
262
264
 
263
265
  /** Display: the list's grouping, order and sub-task rows; which finished cards show (the board / list switch is the toolbar's). */
264
- export function DisplayMenu({ display, onChange }) {
266
+ export function DisplayMenu({ display, onChange, archiving = false }) {
265
267
  const d = display;
266
268
  const list = d.view === "list";
267
269
  const radio = (k, v, label) => ({ key: `${k}-${v}`, label, checked: d[k] === v, onSelect: () => onChange({ ...d, [k]: v }) });
@@ -272,7 +274,9 @@ export function DisplayMenu({ display, onChange }) {
272
274
  ...(list ? ORDERS.map((o) => ({ key: `order-${o}`, label: t(`taskview.order.${o}`), checked: d.order === o, onSelect: () => onChange({ ...d, order: o, dir: "asc" }) })) : []),
273
275
  list && { key: "subs", checkbox: true, checked: d.subs, label: t("taskview.subsRows"), onSelect: () => onChange({ ...d, subs: !d.subs }) },
274
276
  { key: "h-done", heading: true, label: t("taskview.finished") },
275
- radio("done", "recent", t("tasks.recent")), radio("done", "all", t("tasks.all")), radio("done", "hide", t("taskview.doneHide")),
277
+ // M-3668: with archiving on, finished cards show (their newest, the rest in the Archive) or hide — "All" is the Archive.
278
+ ...(archiving ? [{ key: "done-show", label: t("tasksArchive.doneShow"), checked: d.done !== "hide", onSelect: () => onChange({ ...d, done: "recent" }) }, radio("done", "hide", t("taskview.doneHide"))]
279
+ : [radio("done", "recent", t("tasks.recent")), radio("done", "all", t("tasks.all")), radio("done", "hide", t("taskview.doneHide"))]),
276
280
  ];
277
281
  // Pressed while it shows something other than the defaults (beyond board or list, which is plain to see).
278
282
  const changed = ["group", "order", "dir", "done", "subs"].some((k) => d[k] !== DEFAULT_DISPLAY[k]);
@@ -331,7 +335,7 @@ export function SearchField({ value, onChange, closed = false, inputRef = null,
331
335
  * the 🔍 (under the row); a search that holds words keeps its field open, and the 🔍 is marked. The 🔍 is not drawn on a desk,
332
336
  * where the field is always there (the page's CSS decides: the same markup serves both).
333
337
  */
334
- export function TaskToolbar({ cards, display, onDisplay, filters, onFilters, query, onQuery, scroller = null }) {
338
+ export function TaskToolbar({ cards, display, onDisplay, filters, onFilters, query, onQuery, scroller = null, archiving = false }) {
335
339
  const [asked, setAsked] = useState(false);
336
340
  const field = useRef(null);
337
341
  const focusNext = useRef(false);
@@ -352,7 +356,7 @@ export function TaskToolbar({ cards, display, onDisplay, filters, onFilters, que
352
356
  <${SearchField} value=${query} onChange=${onQuery} closed=${!open} inputRef=${field} onEmptyEscape=${() => setAsked(false)} />
353
357
  <div class="tb-view-actions">
354
358
  <${FilterMenu} cards=${cards} filters=${filters} onChange=${onFilters} />
355
- <${DisplayMenu} display=${display} onChange=${onDisplay} />
359
+ <${DisplayMenu} display=${display} onChange=${onDisplay} archiving=${archiving} />
356
360
  <button type="button" class=${`btn btn-sm tb-search-toggle${hasWords ? " active" : ""}`} aria-expanded=${open ? "true" : "false"} aria-controls="tb-find-input"
357
361
  aria-label=${t("taskview.searchLabel")} title=${t("taskview.searchLabel")} onClick=${toggle}><${Icon} name="search" size=${16} /></button>
358
362
  </div>
@@ -400,7 +404,7 @@ function groupHead(group, key) {
400
404
  return html`<span class=${`tb-tag p-${key}`}>${t(`tasks.${key}`)}</span>`;
401
405
  }
402
406
  const groupWord = (group, key) => (group === "assignee" ? (key === NONE ? t("tasks.nobody") : key) : t(`tasks.${key}`));
403
- const longTime = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d.toLocaleString(lang() === "zh-TW" ? "zh-TW" : "en") : ""; };
407
+ const longTime = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d, undefined, lang() === "zh-TW" ? "zh-TW" : "en") : ""; };
404
408
 
405
409
  // The groups a person folded away, remembered on this device, per project (by what heads them: "1/status:done",
406
410
  // "none/assignee:alpha" — the project's id, or "none" for No project).
@@ -497,6 +501,7 @@ function Row({ card, subs, main, flash, now, runs, subsAsRows, who, expanded, on
497
501
  ${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}
498
502
  ${waitsOn(card) ? html`<span title=${t("tasks.waitsFor", waitsList(card, ", "))}><${Icon} name="clock" size=${13} /></span>` : null}
499
503
  ${card.commentCount ? html`<span class=${replied ? "reply" : ""} title=${replied ? t("tasks.agentReplied") : t("tasks.comments")}><${Icon} name="chat" size=${13} />${card.commentCount}</span>` : null}
504
+ ${card.attachmentCount ? html`<span title=${t("taskfiles.title")}><${Icon} name="attach" size=${13} />${card.attachmentCount}</span>` : null}
500
505
  </span>
501
506
  <span class=${`tb-row-prio p-${card.priority}`}>${t(`tasks.${card.priority}`)}</span>
502
507
  ${who ? html`<span class="tb-row-who"><${OwnerChip} card=${card} cards=${cards} lead=${lead} canAssign=${writable && card.status !== "done" && card.status !== "cancelled"} onPick=${onOwner} /></span>` : null}
@@ -29,6 +29,7 @@ import { RunMark, inProgressBy, runOf, useRunContext } from "./fleet-task-run.js
29
29
  import { OwnerChip, otherWorkers, quietInfo } from "./fleet-task-owner.js";
30
30
  import { InsightsDialog } from "./fleet-task-stats.js";
31
31
  import { ToSort, sortCount } from "./fleet-task-sort.js";
32
+ import { ArchiveDialog, ArchivedLink, ArchivedTag, DONE_PAGE, newestDone, weekLabel } from "./fleet-task-archive.js";
32
33
 
33
34
  const PROJECT_KEY = "agend_tasks_project";
34
35
  const QUERY_KEY = "agend_tasks_query";
@@ -80,7 +81,7 @@ export function TaskBoardTab({ lease }) {
80
81
  const seq = useRef(0);
81
82
  const setAt = (v) => { setAtRaw(v); setQuery(""); writeStored(PROJECT_KEY, v === null ? null : String(v)); };
82
83
  const reload = (ifMoved = false) => setVersion((v) => ({ n: v.n + 1, ifMoved }));
83
- const shown = useRef({ rev: null, allDone: false });
84
+ const shown = useRef({ rev: null, epoch: null, allDone: false });
84
85
 
85
86
  useEffect(() => {
86
87
  const mine = ++seq.current;
@@ -89,13 +90,17 @@ export function TaskBoardTab({ lease }) {
89
90
  const q = new URLSearchParams();
90
91
  if (allDone) q.set("done", "all");
91
92
  // The same board at the same revision is not sent again.
92
- if (version.ifMoved && shown.current.rev !== null && shown.current.allDone === allDone) q.set("rev", String(shown.current.rev));
93
+ if (version.ifMoved && shown.current.rev !== null && shown.current.allDone === allDone) {
94
+ q.set("rev", String(shown.current.rev));
95
+ // #4428 review: and where time had left the board's lines (a card archived since is a new board).
96
+ if (shown.current.epoch !== null) q.set("epoch", shown.current.epoch);
97
+ }
93
98
  const qs = q.toString();
94
99
  const r = await lease.fetch(`/ui/tasks/board${qs ? `?${qs}` : ""}`, { method: "GET", headers: { "Content-Type": "application/json" } });
95
100
  if (!r.ok) throw new Error(`HTTP ${r.status}`);
96
101
  const d = await r.json();
97
102
  if (!lease.current() || mine !== seq.current || d.unchanged) return;
98
- shown.current = { rev: typeof d.rev === "number" ? d.rev : null, allDone };
103
+ shown.current = { rev: typeof d.rev === "number" ? d.rev : null, epoch: typeof d.epoch === "string" ? d.epoch : null, allDone };
99
104
  setState({ data: d });
100
105
  } catch { if (lease.current() && mine === seq.current) setState((s) => (s && s.data ? s : { error: true })); }
101
106
  })();
@@ -200,9 +205,12 @@ export function TaskBoardTab({ lease }) {
200
205
  // The server's numbers cover every card (finished ones are not all on the board); computed here only without them.
201
206
  const stats = (key) => (state.data.stats && state.data.stats[String(key)]) || projectStats(key, cards);
202
207
  const project = at === null ? null : at === NO_PROJECT ? NO_PROJECT : projects.find((p) => p.id === at) || null;
208
+ // M-3668: how many days after it finished a main task leaves the board (0: never; an older server says nothing).
209
+ const archiveDays = typeof state.data.archiveAfterDays === "number" ? state.data.archiveAfterDays : 0;
203
210
  const body = project === null
204
- ? html`<${Home} cards=${cards} projects=${projects} stats=${stats} writable=${writable} onOpenProject=${setAt} onOpen=${openCard} onDialog=${setDialog} onInstances=${showInstances} reload=${reload} />`
211
+ ? html`<${Home} cards=${cards} projects=${projects} stats=${stats} writable=${writable} onOpenProject=${setAt} onOpen=${openCard} onDialog=${setDialog} onInstances=${showInstances} reload=${reload} archiveDays=${archiveDays} />`
205
212
  : html`<${ProjectBoard} project=${project} cards=${cards} stats=${stats} flashed=${flashed} display=${display} filters=${filters} query=${query} writable=${writable}
213
+ archiveDays=${archiveDays} onArchive=${() => setDialog({ kind: "archive", project })}
206
214
  onDisplay=${setDisplay} onFilters=${setFilters} onQuery=${setQuery} onBack=${() => setAt(null)} onMore=${openMenuFor} onOwner=${openOwnerMenu}
207
215
  notSorted=${sortCount(cards, projects)} onOpenNoProject=${() => setAt(NO_PROJECT)}
208
216
  onOpen=${openCard} onCreate=${() => setDialog({ kind: "main", project: project === NO_PROJECT ? null : project.id })} onInstances=${showInstances} reload=${reload} />`;
@@ -302,6 +310,10 @@ export function TaskBoardTab({ lease }) {
302
310
  ${dialog && dialog.kind === "main" ? html`<${CreateMainDialog} projects=${projects} project=${dialog.project} boardOff=${boardOff} onClose=${() => setDialog(null)}
303
311
  onCreated=${(id) => { if (!lease.current()) return; setDialog(null); reload(); openCard(id); }} />` : null}
304
312
  ${dialog && dialog.kind === "instances" ? html`<${InstancesDrawer} tick=${tick} onClose=${() => setDialog(null)} onOpen=${(id) => { setDialog(null); openCard(id); }} />` : null}
313
+ ${dialog && dialog.kind === "archive" ? html`<${ArchiveDialog} project=${dialog.project === NO_PROJECT ? "none" : dialog.project.id}
314
+ name=${dialog.project === NO_PROJECT ? t("tasks.noProject") : dialog.project.name} days=${archiveDays} onClose=${() => setDialog(null)}
315
+ onOpen=${(c) => { setDialog(null); openCard(c.id); }}
316
+ fetchJson=${async (url) => { const r = await lease.fetch(url, { method: "GET" }); if (!r.ok) throw new Error(`HTTP ${r.status}`); return r.json(); }} />` : null}
305
317
  ${dialog && dialog.kind === "project" ? html`<${ProjectDialog} project=${dialog.project} leads=${leads} onClose=${() => setDialog(null)}
306
318
  onSaved=${(p) => { if (!lease.current()) return; setDialog(null); reload(); if (!dialog.project) setAt(p.id); }} />` : null}
307
319
  <${AskHost} />
@@ -316,7 +328,7 @@ function InstancesButton({ onClick }) {
316
328
  return html`<button type="button" class="btn" title=${t("tasks.instancesTip")} onClick=${onClick}><${Icon} name="team" size=${16} /><span class="tb-btn-label">${t("tasks.instances")}</span></button>`;
317
329
  }
318
330
 
319
- function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialog, onInstances, reload }) {
331
+ function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialog, onInstances, reload, archiveDays = 0 }) {
320
332
  const [showArchived, setShowArchived] = useState(false);
321
333
  const active = projects.filter((p) => !p.archived);
322
334
  const archived = projects.filter((p) => p.archived);
@@ -327,7 +339,7 @@ function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialo
327
339
  return html`<div class="tb-home">
328
340
  <div class="list-head tb-head s-page-head"><div class="s-page-title"><h2>${t("tasks.projects")}</h2></div>
329
341
  <div class="tb-head-actions">
330
- <${SearchBox} onOpen=${onOpen} />
342
+ <${SearchBox} onOpen=${onOpen} archiveDays=${archiveDays} />
331
343
  <${InstancesButton} onClick=${onInstances} />
332
344
  ${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>
333
345
  </div>
@@ -362,6 +374,7 @@ function ProjectTile({ project, stats, sorting = 0, onOpen, onDialog, reload })
362
374
  ${sorting ? html`<span class="tb-flag st-review tb-sort-flag">${t("tasksort.tileBadge", sorting)}</span>` : null}
363
375
  ${stats.waiting ? html`<span class="tb-flag st-review">${t("tasks.waiting", stats.waiting)}</span>` : null}
364
376
  ${stats.blocked ? html`<span class="tb-flag st-blocked">${t("tasks.blockedN", stats.blocked)}</span>` : null}
377
+ ${stats.archived ? html`<span class="muted tb-project-archived">${t("tasksArchive.tile", stats.archived)}</span>` : null}
365
378
  ${stats.lastActivity ? html`<span class="muted">${t("tasks.lastActivity", relTime(stats.lastActivity))}</span>` : null}
366
379
  ${project && project.leadInstance ? html`<span class="muted tb-project-lead-chip">${t("tasks.projectLeadChip", project.leadInstance)}</span>` : null}
367
380
  </span>
@@ -414,7 +427,7 @@ function Waiting({ cards, writable, onOpen, reload }) {
414
427
  </section>`;
415
428
  }
416
429
 
417
- function SearchBox({ onOpen }) {
430
+ function SearchBox({ onOpen, archiveDays = 0 }) {
418
431
  const [q, setQ] = useState("");
419
432
  const [results, setResults] = useState(null);
420
433
  const [active, setActive] = useState(0);
@@ -443,7 +456,7 @@ function SearchBox({ onOpen }) {
443
456
  ${results ? html`<ul class="tb-search-results" role="listbox">
444
457
  ${results.length ? results.map((r, i) => html`<li key=${r.card.id} role="option" aria-selected=${i === active ? "true" : "false"} class=${i === active ? "active" : ""}>
445
458
  <button type="button" onClick=${() => pick(r.card.id)}>
446
- <span class="tb-code">${r.card.id}</span><span class="tb-search-title">${r.card.title}</span><${StatusPill} status=${r.card.status} card=${r.card} />
459
+ <span class="tb-code">${r.card.id}</span><span class="tb-search-title">${r.card.title}</span><${StatusPill} status=${r.card.status} card=${r.card} />${r.archived ? html`<${ArchivedTag} days=${archiveDays} />` : null}
447
460
  <span class="tb-search-where muted">${[r.project, r.parentTitle].filter(Boolean).join(" › ")}${r.match ? ` · ${t("tasks.inField", t(`tasks.field${r.match.field}`))}: ${r.match.text}` : ""}</span>
448
461
  </button></li>`) : html`<li class="muted tb-search-none">${t("tasks.searchEmpty")}</li>`}
449
462
  </ul>` : null}
@@ -452,8 +465,10 @@ function SearchBox({ onOpen }) {
452
465
 
453
466
  // ── A project's board ─────────────────────────────────────
454
467
 
455
- function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filters, query, writable, notSorted = 0, onOpenNoProject, onDisplay, onFilters, onQuery, onBack, onOpen, onMore, onOwner, onCreate, onInstances, reload }) {
468
+ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filters, query, writable, notSorted = 0, onOpenNoProject, onDisplay, onFilters, onQuery, onBack, onOpen, onMore, onOwner, onCreate, onInstances, reload, archiveDays = 0, onArchive = null }) {
456
469
  const [expanded, setExpanded] = useState({});
470
+ // M-3668: the Done column (and the list's done rows) shows its newest DONE_PAGE, DONE_PAGE more at a time.
471
+ const [doneLimit, setDoneLimit] = useState(DONE_PAGE);
457
472
  // A phone shows one status at a time: the one picked here, else the first that has cards (the person's own first).
458
473
  const [phoneStatus, setPhoneStatus] = useState(null);
459
474
  const [drag, setDrag] = useState(null);
@@ -478,7 +493,12 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
478
493
  const live = cards.filter((c) => c.kind === "main" && projectKey(c) === key && c.status !== "cancelled");
479
494
  // What the filters offer: this project's main tasks and their sub tasks.
480
495
  const own = live.flatMap((c) => [c, ...(subsOf.get(c.id) || [])]);
481
- const mains = live.filter((c) => doneShown(c, display.done, now) && mainMatches(c, subsOf.get(c.id), filters, query));
496
+ const matched = live.filter((c) => doneShown(c, display.done, now) && mainMatches(c, subsOf.get(c.id), filters, query));
497
+ const doneAll = newestDone(matched.filter((c) => c.status === "done"));
498
+ const doneCut = new Set(doneAll.slice(doneLimit).map((c) => c.id));
499
+ // What the page draws: every unfinished main task, the newest finished ones; `matched` still counts them all.
500
+ const mains = matched.filter((c) => !doneCut.has(c.id));
501
+ const moreDone = doneCut.size ? html`<button type="button" class="btn btn-sm tb-done-more" onClick=${() => setDoneLimit((n) => n + DONE_PAGE)}>${t("tasksArchive.showMore", Math.min(DONE_PAGE, doneCut.size))}</button>` : null;
482
502
  const searching = filters.length > 0 || query.trim() !== "";
483
503
  // Finished cards hidden: no Done column (a card is still confirmed or finished from its dialog).
484
504
  const columns = display.done === "hide" ? COLUMNS.filter((s) => s !== "done") : COLUMNS;
@@ -490,12 +510,12 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
490
510
  // Insights counts what the page shows. A list with sub-task rows shows exactly its rows (each matched by the filter, a
491
511
  // finished one as Done shows it); the board, or a list without them, shows a main task with all its sub tasks.
492
512
  const insightCards = () => (display.view === "list" && display.subs
493
- ? listRows(mains, subsOf, display, filters, now, query)
494
- : mains.flatMap((c) => [c, ...(subsOf.get(c.id) || [])]));
513
+ ? listRows(matched, subsOf, display, filters, now, query)
514
+ : matched.flatMap((c) => [c, ...(subsOf.get(c.id) || [])]));
495
515
  const listBody = () => {
496
516
  const rows = listRows(mains, subsOf, display, filters, now, query);
497
517
  return rows.length === 0 ? empty() : html`<${ListView} rows=${rows} display=${display} subsOf=${subsOf} byId=${byId} flashed=${flashed} now=${now} runs=${runs}
498
- expanded=${expanded} onToggleSubs=${toggleSubs} onOpen=${onOpen} onMore=${onMore} onOwner=${onOwner} cards=${cards} lead=${lead} writable=${writable} onDisplay=${onDisplay} scope=${String(key)} />`;
518
+ expanded=${expanded} onToggleSubs=${toggleSubs} onOpen=${onOpen} onMore=${onMore} onOwner=${onOwner} cards=${cards} lead=${lead} writable=${writable} onDisplay=${onDisplay} scope=${String(key)} />${moreDone}`;
499
519
  };
500
520
 
501
521
  const dropping = useRef(false);
@@ -620,6 +640,7 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
620
640
  ${stats.blocked ? html`<span class="tb-flag st-blocked">${t("tasks.blockedN", stats.blocked)}</span>` : null}
621
641
  </div>
622
642
  ${project !== NO_PROJECT && notSorted ? html`<button type="button" class="tb-flag st-review tb-sort-link" title=${t("tasksort.headerLinkTip")} onClick=${onOpenNoProject}><${Icon} name="inbox" size=${16} /><span class="tb-sort-link-short">${t("tasksort.headerLink", notSorted)}</span><span class="tb-sort-link-long">${t("tasksort.title", notSorted)}</span><span class="tb-sort-link-go">${t("tasksort.go")}</span> →</button>` : null}
643
+ <${ArchivedLink} count=${stats.archived} days=${archiveDays} onOpen=${onArchive} />
623
644
  <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>
624
645
  </div>
625
646
  </div>
@@ -628,23 +649,24 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
628
649
  ${archived || !writable ? null : html`<button type="button" class="btn btn-primary" onClick=${onCreate}><${Icon} name="plus" size=${16} />${t("tasks.newMain")}</button>`}
629
650
  </div>
630
651
  </div>
631
- <${TaskToolbar} cards=${own} display=${display} onDisplay=${onDisplay} filters=${filters} onFilters=${onFilters} query=${query} onQuery=${onQuery}
652
+ <${TaskToolbar} cards=${own} display=${display} onDisplay=${onDisplay} filters=${filters} onFilters=${onFilters} query=${query} onQuery=${onQuery} archiving=${archiveDays > 0}
632
653
  scroller=${display.view === "list" ? null : { reach, by: scrollColumns }} />
633
654
  ${display.view === "list" ? listBody() : mains.length === 0 && !drag ? empty()
634
655
  : html`${html`<div class="tb-seg tb-status-seg" role="group" aria-label=${t("taskview.statusTabs")} ref=${pillRow}>${columns.map((status) => {
635
- const count = mains.filter((c) => c.status === status).length;
656
+ const count = (status === "done" ? doneAll : mains.filter((c) => c.status === status)).length;
636
657
  return html`<button key=${status} type="button" aria-pressed=${current === status ? "true" : "false"} class=${`tb-seg-btn${current === status ? " active" : ""}${count === 0 ? " is-empty" : ""}`}
637
658
  onClick=${() => setPhoneStatus(status)}><span class=${`tb-dot st-${status}`} aria-hidden="true"></span>${t(`tasks.${status}`)} <span class="tb-count">${count}</span></button>`;
638
659
  })}</div>`}
639
660
  <div class="tb-scroll" ref=${scrollEl}><div class="tb-columns">
640
661
  ${columns.map((status) => {
641
- const list = mains.filter((c) => c.status === status);
662
+ const list = status === "done" ? doneAll.slice(0, doneLimit) : mains.filter((c) => c.status === status);
642
663
  const line = spot && spot.status === status ? spot.index : -1;
643
664
  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}`)}
644
665
  onDragOver=${(e) => over(e, status)} onDrop=${(e) => dropOn(e, status, list)}>
645
666
  <h3 class="tb-col-head"><span class="tb-dot"></span>${t(`tasks.${status}`)}
646
- ${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}
647
- <span class="tb-count">${list.length}</span></h3>
667
+ ${status === "done" && archiveDays === 0 ? 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}
668
+ <span class="tb-count">${status === "done" ? doneAll.length : list.length}</span></h3>
669
+ ${status === "done" && archiveDays > 0 ? html`<p class="muted tb-done-week tb-done-week-line" title=${t("tasksArchive.weekTip")}>${weekLabel(stats)}</p>` : null}
648
670
  ${cellItems(list, drag ? drag.id : null, line, (card, dragging) => {
649
671
  const lit = Math.max(flashed.get(card.id) || 0, ...(subsOf.get(card.id) || []).map((s) => flashed.get(s.id) || 0));
650
672
  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}
@@ -652,6 +674,7 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
652
674
  onOpen=${onOpen} onMore=${onMore} onOwner=${onOwner} onKeyMove=${(e) => keyMove(card, e)}
653
675
  onDragStart=${(e) => { e.dataTransfer.setData("text/plain", card.id); e.dataTransfer.effectAllowed = "move"; setDrag(card); }} onDragEnd=${end} />`;
654
676
  })}
677
+ ${status === "done" ? moreDone : null}
655
678
  </section>`;
656
679
  })}
657
680
  </div></div>`}
@@ -751,6 +774,7 @@ function Tile({ card, dragging, flash, subs = [], runs, expanded, writable, card
751
774
  ${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}
752
775
  ${waitsOn(card) ? html`<span title=${t("tasks.waitsFor", waitsList(card, ", "))}><${Icon} name="clock" size=${13} /></span>` : null}
753
776
  ${card.commentCount ? html`<span class=${replied ? "reply" : ""} title=${replied ? t("tasks.agentReplied") : t("tasks.comments")}><${Icon} name="chat" size=${13} />${card.commentCount}</span>` : null}
777
+ ${card.attachmentCount ? html`<span title=${t("taskfiles.title")}><${Icon} name="attach" size=${13} />${card.attachmentCount}</span>` : null}
754
778
  </span>
755
779
  </div>
756
780
  </div>`;
@@ -9,6 +9,7 @@ import { t, register } from "/assets/app-i18n.js";
9
9
  import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
10
10
  import { Icon } from "/assets/ui-icons.js";
11
11
  import { money, tokens } from "./fleet-cache.js";
12
+ import { timeText } from "/assets/clock-text.js";
12
13
 
13
14
  register("fusage", {
14
15
  en: {
@@ -439,7 +440,7 @@ export function UsageReport({ report, choice, setChoice, refresh, fetchedAt }) {
439
440
  <p class="us-basis" role="note" title=${tu("basisMore")}>${tu("basis", report.pricesChecked)}</p>
440
441
  ${noDaily ? html`<p class="us-partial" role="status">${tu("noDaily")}</p>` : report.dailyTruncated ? html`<p class="us-partial" role="status">${tu("partialDays", report.dailyFrom)}</p>` : null}
441
442
  ${zones ? html`<p class="us-partial" role="status">${tu("zoneChanged", zones.join(", "), report.zone)}</p>` : null}
442
- <p class="note us-fresh">${tu("updated", new Date(fetchedAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }))} · ${Number.isFinite(since) ? tu("since", new Date(since).toLocaleDateString()) : tu("notYet")} · ${tu("zoneNote", report.zone)}${group === "team" ? ` ${tu("teamsNote")}` : ""}
443
+ <p class="note us-fresh">${tu("updated", timeText(fetchedAt, { hour: "2-digit", minute: "2-digit" }, []))} · ${Number.isFinite(since) ? tu("since", new Date(since).toLocaleDateString()) : tu("notYet")} · ${tu("zoneNote", report.zone)}${group === "team" ? ` ${tu("teamsNote")}` : ""}
443
444
  ${report.scanning.active && (!report.scanning.caughtUp || report.scanning.pendingBytes > 0) ? html` <span class="us-scan" role="status">${tu("scanning")} <button type="button" class="btn btn-sm" onClick=${refresh}>${tu("refresh")}</button></span>` : null}</p>
444
445
  ${empty ? html`<${Empty} icon="chart" title=${tu("empty")} hint=${tu("emptyHint")} />` : html`
445
446
  <dl class="us-totals card">
@@ -8,6 +8,7 @@
8
8
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
9
9
  import { register, t, lang } from "/assets/app-i18n.js";
10
10
  import { ErrorState, Skeleton } from "/assets/ui-states.js";
11
+ import { timeText } from "/assets/clock-text.js";
11
12
 
12
13
  register("hubOverview", {
13
14
  en: {
@@ -110,7 +111,7 @@ export function HubAdminOverview({ client, onOpen = () => {}, onGone = () => {}
110
111
  <div class="hub-ov-range" role="group" aria-label=${ho("rangeLabel")}>
111
112
  ${["today", "7d"].map((r) => html`<button key=${r} type="button" class=${`hub-ov-range-item${range === r ? " is-current" : ""}`} aria-pressed=${range === r ? "true" : "false"} onClick=${() => pick(r)}>${ho(r === "today" ? "today" : "week")}</button>`)}
112
113
  </div>
113
- ${at ? html`<span class="note hub-ov-updated">${ho("updated", new Date(at).toLocaleTimeString(lang() === "zh-TW" ? "zh-TW" : "en", { hour: "2-digit", minute: "2-digit" }))}</span>` : null}
114
+ ${at ? html`<span class="note hub-ov-updated">${ho("updated", timeText(at, { hour: "2-digit", minute: "2-digit" }, lang() === "zh-TW" ? "zh-TW" : "en"))}</span>` : null}
114
115
  </div>
115
116
  <p class="note hub-ov-privacy">${ho("privacy")}</p>`;
116
117
  if (!data) return html`<div class="hub-ov">${head}${error ? html`<${ErrorState} onRetry=${() => load(range)} />` : html`<${Skeleton} variant="rows" lines=${6} />`}</div>`;
@@ -1,5 +1,6 @@
1
1
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
2
2
  import { register, t } from "/assets/app-i18n.js";
3
+ import { dateTimeText } from "/assets/clock-text.js";
3
4
  register("hubIntro", {
4
5
  en: {title:"Introduction",hint:"One line about what this agent handles. Colleagues can see it. Up to 50 characters.",placeholder:"I handle…",save:"Save introduction",failed:"Could not save the introduction. Try again.",saved:"Saved. The agent can still change it later; this line shows who changed it last.",edit:"Edit",close:"Close",owner:"Last changed by the owner",agent:"Last changed by the agent",default:"From the Fleet description",review:"Colleagues will see this line. Check it and save.",cut:"Your earlier description was longer; only the first 50 characters are shown here.",assistant:"Hub assistant. Answers from this room's chat."},
5
6
  "zh-TW": {title:"自我介紹",hint:"用一句話說明這個 Agent 負責什麼,同仁會看到。最多 50 個字。",placeholder:"我負責…",save:"儲存自我介紹",failed:"無法儲存自我介紹,請再試一次。",saved:"已儲存。Agent 之後仍然可以更改;這一行會顯示最後是誰改的。",edit:"編輯",close:"關閉",owner:"最後由擁有者修改",agent:"最後由 Agent 修改",default:"來自 Fleet 說明",review:"同仁會看到這一行,請確認後儲存。",cut:"你之前的說明比較長,這裡只顯示前 50 個字。",assistant:"Hub 提供的助理,根據這個房間的對話回答。"}
@@ -20,7 +21,7 @@ export function AgentIntroEditor({exposure,client,onSaved=()=>{},embedded=false}
20
21
  const Body=embedded?"div":"form";
21
22
  return html`<section class=${embedded?"hub-agent-intro":"card hub-agent-intro"}>${embedded?null:html`<h3>${hi("title")}</h3>`}<${Body} class="form" onSubmit=${embedded?undefined:save}>
22
23
  <label class="field"><span>${hi("title")}</span><input value=${text} placeholder=${hi("placeholder")} disabled=${busy} onInput=${e=>setText(e.target.value)} aria-invalid=${count>50?"true":null} /><small class="note">${`${hi("hint")} ${count}/50`}</small></label>
23
- ${exposure.introBy?html`<p class="note">${hi(exposure.introBy)}${exposure.introAt?html` · <time datetime=${new Date(exposure.introAt).toISOString()}>${new Date(exposure.introAt).toLocaleString()}</time>`:null}</p>`:null}
24
+ ${exposure.introBy?html`<p class="note">${hi(exposure.introBy)}${exposure.introAt?html` · <time datetime=${new Date(exposure.introAt).toISOString()}>${dateTimeText(exposure.introAt)}</time>`:null}</p>`:null}
24
25
  <div class="field-row"><button type=${embedded?"button":"submit"} onClick=${embedded?save:undefined} class="btn btn-sm btn-primary" disabled=${busy||count>50||text===(exposure.intro??"")}>${hi("save")}</button></div>
25
26
  ${message?html`<p role="status">${message}</p>`:null}
26
27
  </${Body}></section>`;
@@ -2,6 +2,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
2
2
  import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
3
3
  import { hroom } from "./hub-room-strings.js";
4
4
  import { ha } from "./hub-assistant-admin-strings.js";
5
+ import { dateTimeText } from "/assets/clock-text.js";
5
6
 
6
7
  const fields = value => ({ enabled: value.enabled === true, backend: value.backend, account: value.account ?? null, cap: Number(value.cap), idleMinutes: Number(value.idleMinutes) });
7
8
  const validLimits = value => Number.isInteger(Number(value?.cap)) && Number(value.cap) >= 1 && Number(value.cap) <= 16 && Number.isInteger(Number(value?.idleMinutes)) && Number(value.idleMinutes) >= 1 && Number(value.idleMinutes) <= 240;
@@ -75,7 +76,7 @@ export function HubAssistantAdmin({ client }) {
75
76
  </form>
76
77
  </section>
77
78
  <section class="card" aria-label=${hroom("runningNow")}><div class="hub-card-head"><h3>${hroom("runningNow")}</h3><button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${() => load(false)}>${ha("refresh")}</button></div>
78
- ${running.length ? html`<div class="hub-rows">${running.map(row => html`<div class="s-row hub-row" key=${row.roomId}><span class="hub-row-text"><strong title=${row.roomName}>${row.roomName}</strong><small class="note">${hroom("lastUsed")} · ${new Date(row.lastUsed).toLocaleString(undefined, { dateStyle: "short", timeStyle: "short", hour12: false })}</small></span>
79
+ ${running.length ? html`<div class="hub-rows">${running.map(row => html`<div class="s-row hub-row" key=${row.roomId}><span class="hub-row-text"><strong title=${row.roomName}>${row.roomName}</strong><small class="note">${hroom("lastUsed")} · ${dateTimeText(row.lastUsed, { dateStyle: "short", timeStyle: "short", hour12: false })}</small></span>
79
80
  <span class=${`tag ${row.state === "failed" ? "warn" : ""}`}>${stateWord(row.state)}</span><button type="button" class="btn btn-sm" disabled=${busy || row.state === "stopping"} onClick=${() => stop(row.roomId)}>${hroom("stop")}</button></div>`)}</div>` : html`<p class="note">${ha("noneRunning")}</p>`}
80
81
  </section>
81
82
  <section class="card" aria-label=${hroom("usage")}><h3>${hroom("usage")}</h3><p class="note">${hroom("usageLead")}</p>
@@ -1,6 +1,7 @@
1
1
  /** Recipient-only history, fetched on this page only. No stream, polling, implicit ACK or global notice feed. */
2
2
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
3
3
  import { dn } from "./hub-directory-notice-strings.js";
4
+ import { dateTimeText } from "/assets/clock-text.js";
4
5
 
5
6
  export const DIRECTORY_NOTICE_FEATURE = "directory-security-notices-v1";
6
7
  export function directoryNoticesOffered(session, client) {
@@ -56,7 +57,7 @@ export function DirectoryNotices({ client, host = false }) {
56
57
  ${loaded && !errorKey && !rows.length ? html`<p class="muted">${dn("empty")}</p>` : null}
57
58
  ${rows.map(row => html`<article class="directory-notice" key=${row.id} data-directory-notice=${row.id}>
58
59
  <h3>${dn(row.kind === "directory-compensation" ? "restored" : "changed")}</h3>
59
- <p class="muted">${dn(row.actor?.kind === "host-owner" ? "host" : "admin")} · <time datetime=${new Date(row.at).toISOString()}>${new Date(row.at).toLocaleString()}</time></p>
60
+ <p class="muted">${dn(row.actor?.kind === "host-owner" ? "host" : "admin")} · <time datetime=${new Date(row.at).toISOString()}>${dateTimeText(row.at)}</time></p>
60
61
  <p>${(row.changes || []).map(key => dn(key)).join(" · ")}</p>
61
62
  ${row.acknowledged ? html`<span class="muted">${dn("acknowledged")}</span>` : html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => acknowledge(row.id)}>${dn(acking === row.id ? "acknowledging" : "acknowledge")}</button>`}
62
63
  </article>`)}
@@ -5,8 +5,9 @@ import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
5
5
  import { hubClient } from "./hub-client.js";
6
6
  import { he } from "./hub-enrolment-code-strings.js";
7
7
  import { jf } from "./hub-joincode-flow-strings.js";
8
+ import { dateTimeText } from "/assets/clock-text.js";
8
9
  export const enrolmentCodeV1 = true;
9
- const time = value => new Date(value).toLocaleString();
10
+ const time = value => dateTimeText(value);
10
11
  const supported = client => client?.enrolmentCodeV1 === true && ["enrolmentCodes", "createEnrolmentCode", "revokeEnrolmentCode"].every(key => typeof client[key] === "function");
11
12
  const integer = (value, max) => Number.isSafeInteger(Number(value)) && Number(value) >= 1 && Number(value) <= max;
12
13
  const errorText = (result, fallback) => result?.code === "backpressure" && result.reason === "live-code-limit" ? jf("liveLimit")
@@ -7,8 +7,9 @@ import { ms } from "./hub-my-agents-strings.js";
7
7
  import { rowAvailability, rowKey, shareRows, reconcileSharing } from "./hub-my-agents-model.js";
8
8
  import { HubGrantPicker } from "./hub-grant-picker.js";
9
9
  import { assetUrl } from "/assets/asset-url.js";
10
+ import { clockFormat } from "/assets/clock-text.js";
10
11
  const tone = name => { let h = 0; for (const c of name) h = (h * 31 + c.codePointAt(0)) >>> 0; return h % 6; };
11
- const shortSeen = at => Number.isFinite(at) ? new Intl.DateTimeFormat(lang() === "zh-TW" ? "zh-TW" : "en-GB", { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(at) : "—";
12
+ const shortSeen = at => Number.isFinite(at) ? clockFormat({ month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, lang() === "zh-TW" ? "zh-TW" : "en-GB").format(at) : "—";
12
13
  const Avatar = ({ name }) => html`<span class=${`hub-av sm t${tone(name)}`} aria-hidden="true">${[...name][0] || "?"}</span>`;
13
14
  const mc = (key, n) => ms(n === 1 ? `${key}One` : key, n);
14
15
  const STORE = "agend.hub.owner-sharing";
@@ -10,12 +10,13 @@ import { hq } from "./hub-quick-strings.js";
10
10
  import { hr } from "./hub-read-strings.js";
11
11
  import { linkHubCss } from "./hub-strings.js";
12
12
  import { linkHubOwnerCss } from "./hub-owner-strings.js";
13
+ import { dateTimeText } from "/assets/clock-text.js";
13
14
  /** A member Settings reader opts into code rows only alongside this renderer. */
14
15
  export const pairingNoticesV3 = true;
15
16
 
16
17
  const reason = (r) => hq(r.code === "expired" ? "expired" : r.code === "conflict" ? "conflict" : r.code === "backpressure" ? "limit"
17
18
  : r.code === "denied" || r.code === "revoked" ? "denied" : r.code === "unavailable" || r.code === "unreachable" ? "unavailable" : "failed");
18
- const time = (at) => { try { return new Date(at).toLocaleString(lang() === "zh-TW" ? "zh-TW" : "en", { dateStyle: "medium", timeStyle: "short" }); } catch { return new Date(at).toLocaleString(); } };
19
+ const time = (at) => { try { return dateTimeText(at, { dateStyle: "medium", timeStyle: "short" }, lang() === "zh-TW" ? "zh-TW" : "en"); } catch { return dateTimeText(at); } };
19
20
 
20
21
  /** The page controls its own attempt only. The separate fleet-local proof is never performed by this component. */
21
22
  export function QuickPairingGuide({ allowed = false, publishAllowed = false, onConnected = () => {} }) {
@@ -1,6 +1,7 @@
1
1
  import {html,useEffect,useRef,useState} from "/assets/app-html.js";
2
2
  import {hr} from "./hub-roles-strings.js";
3
3
  import {auditActor,auditAction,auditCsv,auditResult,auditSentence,valueLines,roleAuditActions} from "./hub-role-view.js";
4
+ import { dateTimeText } from "/assets/clock-text.js";
4
5
  export function RoleAudit({client}){
5
6
  const enhanced=client.roleAuditFiltersV1===true;
6
7
  const [page,setPage]=useState(null),[error,setError]=useState(null),[busy,setBusy]=useState(false),[exporting,setExporting]=useState(false),[filters,setFilters]=useState({}),[draft,setDraft]=useState({from:"",to:"",person:"",action:""}),[people,setPeople]=useState([]),[actions,setActions]=useState(()=>[...roleAuditActions]);
@@ -32,7 +33,7 @@ export function RoleAudit({client}){
32
33
  <label class="field"><span>${hr("filterAction")}</span><select value=${draft.action} disabled=${busy||exporting} onChange=${e=>setDraft({...draft,action:e.target.value})}><option value="">${hr("all")}</option>${actions.map(action=>html`<option key=${action} value=${action}>${auditAction(action)}</option>`)}</select></label><button type="submit" class="btn" disabled=${busy||exporting}>${hr("filter")}</button></form>`:null}
33
34
  ${error?html`<p class="err" role="alert">${error}</p><button type="button" class="btn" disabled=${busy||exporting} onClick=${()=>load(null,filters)}>${hr("retry")}</button>`:null}${!page&&!error?html`<p role="status">${hr("loading")}</p>`:null}
34
35
  <div class="hub-team-table-wrap"><table class="hub-team-table hub-role-audit"><thead><tr><th>${hr("when")}</th><th>${hr("who")}</th><th>${hr("action")}</th><th>${hr("result")}</th></tr></thead><tbody>
35
- ${page?.rows?.map(row=>html`<tr key=${row.id}><td class="hub-role-audit-when"><time datetime=${new Date(row.at).toISOString()}>${new Date(row.at).toLocaleString()}</time></td><td class="hub-role-audit-who">${auditActor(row)}</td><td class="hub-role-audit-action">
36
+ ${page?.rows?.map(row=>html`<tr key=${row.id}><td class="hub-role-audit-when"><time datetime=${new Date(row.at).toISOString()}>${dateTimeText(row.at)}</time></td><td class="hub-role-audit-who">${auditActor(row)}</td><td class="hub-role-audit-action">
36
37
  ${row.details?html`<details><summary>${auditSentence(row)}</summary><div class="grid2 hub-role-audit-values">${["before","after"].map(side=>html`<div key=${side}><strong>${hr(side)}</strong><ul>${valueLines(row.details[side]).map((line,i)=>html`<li key=${i}>${line}</li>`)}</ul></div>`)}</div></details>`:auditSentence(row)}</td>
37
38
  <td class="hub-role-audit-result"><span class=${`tag ${row.result==="denied"?"warn":["completed","allowed"].includes(row.result)?"ok":"danger"}`}>${auditResult(row.result)}</span></td></tr>`)}</tbody></table></div>
38
39
  ${page&&!page.rows.length?html`<p class="note">${hr("empty")}</p>`:null}${page?.nextCursor?html`<div class="hub-role-actions"><button type="button" class="btn" disabled=${busy||exporting} onClick=${()=>load(page.nextCursor)}>${hr("more")}</button></div>`:null}</section>`;