@songsid/agend 2.4.0-beta.20 → 2.4.0-beta.22
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.
- package/dist/agent-cli-instructions.md +1 -1
- package/dist/backend/claude-carry.d.ts +11 -0
- package/dist/backend/claude-carry.js +88 -6
- package/dist/backend/claude-carry.js.map +1 -1
- package/dist/backend/claude-code.js +3 -0
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/cache-ledger.d.ts +23 -21
- package/dist/cache-ledger.js +70 -6
- package/dist/cache-ledger.js.map +1 -1
- package/dist/cache-prices.d.ts +8 -6
- package/dist/cache-prices.js +12 -5
- package/dist/cache-prices.js.map +1 -1
- package/dist/cache-service.d.ts +9 -5
- package/dist/cache-service.js +202 -50
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/mcp-tools.js +6 -4
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cli-audited.js +2 -1
- package/dist/cli-audited.js.map +1 -1
- package/dist/cli.js +4 -1
- package/dist/cli.js.map +1 -1
- package/dist/contact-auth-policy.js +1 -1
- package/dist/contact-auth-policy.js.map +1 -1
- package/dist/contact-auth-service.js +8 -2
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.d.ts +3 -0
- package/dist/contact-auth-store.js +34 -8
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-auth-types.d.ts +3 -2
- package/dist/contact-auth-types.js.map +1 -1
- package/dist/contact-change-proposals.d.ts +47 -0
- package/dist/contact-change-proposals.js +132 -0
- package/dist/contact-change-proposals.js.map +1 -0
- package/dist/daemon.d.ts +31 -0
- package/dist/daemon.js +149 -2
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +10 -0
- package/dist/delivery-outbox.js +21 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +65 -1
- package/dist/fleet-manager.js +338 -20
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +2 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +45 -5
- package/dist/general-knowledge/skills/task-board/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +1 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +16 -6
- package/dist/hub/agent-pictures-model.d.ts +275 -0
- package/dist/hub/agent-pictures-model.js +103 -0
- package/dist/hub/agent-pictures-model.js.map +1 -0
- package/dist/hub/agent-pictures.d.ts +64 -0
- package/dist/hub/agent-pictures.js +255 -0
- package/dist/hub/agent-pictures.js.map +1 -0
- package/dist/hub/client.d.ts +4 -0
- package/dist/hub/client.js +23 -2
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +14 -3
- package/dist/hub/compose/member.js +46 -10
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +6 -5
- package/dist/hub/compose/server.js +7 -3
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/direct-posts-model.d.ts +1 -0
- package/dist/hub/direct-posts-model.js +2 -0
- package/dist/hub/direct-posts-model.js.map +1 -0
- package/dist/hub/direct-posts.d.ts +36 -0
- package/dist/hub/direct-posts.js +145 -0
- package/dist/hub/direct-posts.js.map +1 -0
- package/dist/hub/http/compose.d.ts +5 -0
- package/dist/hub/http/compose.js +158 -20
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +9 -1
- package/dist/hub/http/core.js +21 -1
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/http/schema.js +7 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/init/text.js +1 -1
- package/dist/hub/join/service.d.ts +2 -0
- package/dist/hub/join/service.js +7 -3
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/member/agent-pictures.d.ts +76 -0
- package/dist/hub/member/agent-pictures.js +196 -0
- package/dist/hub/member/agent-pictures.js.map +1 -0
- package/dist/hub/member/direct-rooms.d.ts +9 -0
- package/dist/hub/member/direct-rooms.js +14 -0
- package/dist/hub/member/direct-rooms.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +22 -1
- package/dist/hub/member/room-ask.js +99 -5
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-asker-store.d.ts +48 -0
- package/dist/hub/member/room-asker-store.js +181 -0
- package/dist/hub/member/room-asker-store.js.map +1 -0
- package/dist/hub/member/room-post.d.ts +11 -10
- package/dist/hub/member/room-post.js +51 -7
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/policy.d.ts +11 -2
- package/dist/hub/policy.js +60 -7
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +254 -1
- package/dist/hub/protocol.js +20 -8
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/representative.d.ts +38 -0
- package/dist/hub/representative.js +140 -12
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/room-asker-identity-model.d.ts +53 -0
- package/dist/hub/room-asker-identity-model.js +14 -0
- package/dist/hub/room-asker-identity-model.js.map +1 -0
- package/dist/hub/room-asker-identity.d.ts +22 -0
- package/dist/hub/room-asker-identity.js +43 -0
- package/dist/hub/room-asker-identity.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +2 -0
- package/dist/hub/rooms/agents.js +30 -3
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/asker-identity.d.ts +21 -0
- package/dist/hub/rooms/asker-identity.js +86 -0
- package/dist/hub/rooms/asker-identity.js.map +1 -0
- package/dist/hub/rooms/direct-view.d.ts +3 -2
- package/dist/hub/rooms/direct-view.js +23 -8
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/office.d.ts +27 -0
- package/dist/hub/rooms/office.js +12 -2
- package/dist/hub/rooms/office.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +38 -1
- package/dist/hub/rooms/service.js +56 -3
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +5 -2
- package/dist/hub/rooms.d.ts +9 -0
- package/dist/hub/rooms.js +97 -26
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +24 -2
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +1 -0
- package/dist/hub/session-directory-transition.js +15 -9
- package/dist/hub/session-directory-transition.js.map +1 -1
- package/dist/hub/session-limits.d.ts +58 -0
- package/dist/hub/session-limits.js +121 -0
- package/dist/hub/session-limits.js.map +1 -0
- package/dist/hub/sessions.d.ts +1 -1
- package/dist/hub/sessions.js +13 -7
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-directory-decision.js +1 -1
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/types.d.ts +9 -2
- package/dist/hub-character-plan.d.ts +47 -0
- package/dist/hub-character-plan.js +70 -0
- package/dist/hub-character-plan.js.map +1 -0
- package/dist/hub-contact-windows.d.ts +13 -1
- package/dist/hub-contact-windows.js +35 -2
- package/dist/hub-contact-windows.js.map +1 -1
- package/dist/hub-picture-reduce.d.ts +34 -0
- package/dist/hub-picture-reduce.js +101 -0
- package/dist/hub-picture-reduce.js.map +1 -0
- package/dist/hub-picture-worker.d.ts +1 -0
- package/dist/hub-picture-worker.js +19 -0
- package/dist/hub-picture-worker.js.map +1 -0
- package/dist/hub-report-target.d.ts +6 -0
- package/dist/hub-report-target.js +6 -0
- package/dist/hub-report-target.js.map +1 -1
- package/dist/locale.js +357 -265
- package/dist/locale.js.map +1 -1
- package/dist/ls-rows.d.ts +2 -0
- package/dist/ls-rows.js.map +1 -1
- package/dist/needs-you.d.ts +6 -0
- package/dist/needs-you.js +3 -1
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +8 -0
- package/dist/outbound-handlers.js +53 -6
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +2 -0
- package/dist/outbound-schemas.js +6 -4
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/runtime-cli-install.js +4 -4
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/task-board-tool.d.ts +17 -0
- package/dist/task-board-tool.js +58 -6
- package/dist/task-board-tool.js.map +1 -1
- package/dist/tips.js +3 -3
- package/dist/tool-permissions.js +2 -2
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/agent-export-strings.js +1 -1
- package/dist/ui/agent-page-strings.js +5 -5
- package/dist/ui/contact-auth-client.js +2 -2
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/fleet-cache.js +5 -5
- package/dist/ui/fleet-canvas.js +3 -2
- package/dist/ui/fleet-office-card.js +46 -7
- package/dist/ui/fleet-office-dialogue.d.ts +6 -3
- package/dist/ui/fleet-office-dialogue.js +13 -3
- package/dist/ui/fleet-office-layout.js +15 -15
- package/dist/ui/fleet-office-model.js +3 -2
- package/dist/ui/fleet-office-overview.js +1 -1
- package/dist/ui/fleet-office-pack.d.ts +17 -7
- package/dist/ui/fleet-office-pack.js +106 -38
- package/dist/ui/fleet-office-play.js +11 -4
- package/dist/ui/fleet-office-skin.js +41 -11
- package/dist/ui/fleet-office-store.js +10 -1
- package/dist/ui/fleet-office-talk.js +423 -0
- package/dist/ui/fleet-office-view.js +58 -17
- package/dist/ui/fleet-office-zones.js +20 -12
- package/dist/ui/fleet-office.js +250 -65
- package/dist/ui/fleet-org.js +3 -3
- package/dist/ui/fleet-task-common.js +3 -3
- package/dist/ui/fleet-task-sort.js +88 -0
- package/dist/ui/fleet-task-view.js +38 -9
- package/dist/ui/fleet-tasks.js +47 -15
- package/dist/ui/fleet-usage.js +6 -6
- package/dist/ui/hub-admin-overview.js +1 -1
- package/dist/ui/hub-chat-store.js +4 -3
- package/dist/ui/hub-chat-strings.js +3 -1
- package/dist/ui/hub-client.js +3 -0
- package/dist/ui/hub-my-agents-strings.js +2 -2
- package/dist/ui/hub-my-agents.js +3 -0
- package/dist/ui/hub-room-composer.js +24 -4
- package/dist/ui/hub-room-members.js +7 -3
- package/dist/ui/hub-room-office.js +71 -2
- package/dist/ui/hub-room-presence.js +14 -0
- package/dist/ui/hub-room-strings.js +18 -2
- package/dist/ui/hub-room-thread.js +82 -13
- package/dist/ui/hub-room-working.js +37 -0
- package/dist/ui/hub-session-limits.js +79 -0
- package/dist/ui/panel-fleet.js +5 -5
- package/dist/ui/panel-hub.js +41 -6
- package/dist/ui/panel-log.js +3 -3
- package/dist/ui/panel-needs.js +28 -2
- package/dist/ui/panel-runtimes.js +2 -2
- package/dist/ui/runtime-cli-install.js +1 -1
- package/dist/ui/runtime-update-status.js +1 -1
- package/dist/ui/settings-access-strings.js +1 -1
- package/dist/ui/settings-hub-setup-strings.js +1 -1
- package/dist/ui/settings-layout.js +2 -2
- package/dist/ui/settings-named-test.js +16 -16
- package/dist/ui/settings-public-session-strings.js +2 -2
- package/dist/ui/settings-revoke-strings.js +1 -1
- package/dist/ui/settings-shared-strings.js +2 -2
- package/dist/ui/settings-strings.js +40 -40
- package/dist/ui/shared/app-shell.js +1 -1
- package/dist/ui/shared/app.css +106 -6
- package/dist/ui/shared/chat-strings.js +9 -9
- package/dist/ui/shared/hub-owner.css +5 -0
- package/dist/ui/shared/hub-rooms-u2.css +3 -0
- package/dist/ui/shared/instance-nav.js +36 -2
- package/dist/ui/shared/office-dialogue.css +110 -0
- package/dist/ui/shared/task-board.css +103 -7
- package/dist/ui/shared/view-strings.js +27 -9
- package/dist/web-api.d.ts +5 -0
- package/dist/web-api.js +29 -0
- package/dist/web-api.js.map +1 -1
- package/dist/web-office-skins.d.ts +8 -2
- package/dist/web-office-skins.js +33 -14
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-office-store.js +5 -3
- package/dist/web-office-store.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/fleet-org.js
CHANGED
|
@@ -24,11 +24,11 @@ register("org", {
|
|
|
24
24
|
sending: "Sending:", queuedNote: "(queued)", workingNote: "(in progress)",
|
|
25
25
|
},
|
|
26
26
|
"zh-TW": {
|
|
27
|
-
starting: "啟動中", queued: "等待啟動", title: "組織圖", general: "General", unteamed: "
|
|
27
|
+
starting: "啟動中", queued: "等待啟動", title: "組織圖", general: "General", unteamed: "未加入團隊", members: "{0} 名成員", member: "1 名成員", instances: "{0} 個 Agent", instance: "1 個 Agent",
|
|
28
28
|
needs: "等你回應", working: "工作中", idle: "閒置", stuck: "似乎卡住", paused: "已暫停", stopped: "已停止", crashed: "已當掉",
|
|
29
29
|
missing: "不在 fleet 中", thread_discord: "Discord 討論串", thread_telegram: "Telegram topic", openChat: "開啟聊天",
|
|
30
|
-
classic: "ClassicBot 頻道", empty: "還沒有 Agent", emptyHint: "fleet 有 Agent
|
|
31
|
-
noTeams: "
|
|
30
|
+
classic: "ClassicBot 頻道", empty: "還沒有 Agent", emptyHint: "fleet 有 Agent 和團隊後會顯示在這裡。",
|
|
31
|
+
noTeams: "還沒有團隊——到 Fleet → 團隊 定義後,組織圖會依團隊分組。", newTab: "(在新分頁開啟)",
|
|
32
32
|
sending: "傳送中:", queuedNote: "(排隊中)", workingNote: "(進行中)",
|
|
33
33
|
},
|
|
34
34
|
});
|
|
@@ -100,7 +100,7 @@ register("tasks", {
|
|
|
100
100
|
reviewYou: "等你確認", reviewBy: "等 {0} 確認", reviewByTip: "由 {0} 確認,不是你",
|
|
101
101
|
main: "主任務", sub: "子任務", urgent: "緊急", high: "高", normal: "一般", low: "低",
|
|
102
102
|
sizeS: "小", sizeM: "中", sizeL: "大", sizeNone: "未定",
|
|
103
|
-
projects: "專案", noProject: "未分類", noProjectDesc: "
|
|
103
|
+
projects: "專案", noProject: "未分類", noProjectDesc: "Fleet 在專案以外開的任務",
|
|
104
104
|
newProject: "新增專案", newMain: "主任務", archived: "已封存", archive: "封存", restore: "恢復",
|
|
105
105
|
rename: "編輯專案", projectName: "名稱", projectDesc: "說明",
|
|
106
106
|
projectLead: "負責的 Agent", projectLeadNone: "無(General)", projectLeadHint: "這個專案裡等你處理的卡片(待確認或卡住)會在負責 Agent 的頻道顯示按鈕;若卡片是某個 Agent 派出的,則顯示在派出者的頻道。", projectLeadGone: "{0}(已不在 fleet 中)", projectLeadChip: "負責:{0}", create: "建立", save: "儲存", cancel: "取消",
|
|
@@ -131,7 +131,7 @@ register("tasks", {
|
|
|
131
131
|
boardOffNote: "{0} 的任務板是關閉的:不能指派卡片給它,留言和 @ 也叫不醒它,它也收不到 [Task board] 通知。",
|
|
132
132
|
boardOffCommentNote: "{0} 的任務板是關閉的,這則留言不會叫醒它。",
|
|
133
133
|
boardOffWhere: "要打開:{0}(所有 Agent),或這個 Agent 自己的設定 → 進階 → 網頁儀表板權限。", boardOffWhereLink: "設定 → Agent 共用設定",
|
|
134
|
-
boardOff: "{0}(看板已關閉)", boardOffHint: "關閉任務看板的 Agent
|
|
134
|
+
boardOff: "{0}(看板已關閉)", boardOffHint: "關閉任務看板的 Agent 不能被派卡:它沒有任務工具,讀不到卡片。",
|
|
135
135
|
reviewBox: "做完要停在待確認,等我確認", created: "已開 {0}", titleRequired: "標題必填",
|
|
136
136
|
search: "搜尋卡片", searchHint: "搜尋標題、各欄位、驗收條件和留言", searchEmpty: "沒有符合的卡片", inField: "在{0}",
|
|
137
137
|
fieldgoal: "目標", fieldscope: "範圍", fieldcontext: "背景", fieldstate: "目前狀態", fieldresult: "產出", fieldblockedReason: "卡住原因",
|
|
@@ -161,7 +161,7 @@ register("tasks", {
|
|
|
161
161
|
"err.dep_own_main": "子任務不能相依自己的主任務 {0}", "err.dep_own_sub": "主任務不能相依自己的子任務 {0}",
|
|
162
162
|
"err.dep_cycle": "相依會形成循環,大家會互相等待:{0}", "err.conflict": "{0} 已經被改過(最後由 {1} 修改)",
|
|
163
163
|
"err.signed_in_only": "看板只接受已登入網頁的修改", "err.unavailable": "看板目前無法使用", "err.not_over_public_link": "公開連結只能看看板,不能修改",
|
|
164
|
-
"err.assignee_board_off": "{0} 關閉了任務看板,讀不到也動不了卡片。請先替 {0}
|
|
164
|
+
"err.assignee_board_off": "{0} 關閉了任務看板,讀不到也動不了卡片。請先替 {0} 開啟(設定 → 該 Agent → 網頁儀表板權限),或改在聊天中交辦",
|
|
165
165
|
"err.watcher_unknown": "「{0}」不是 fleet 裡的 Agent", "err.watcher_board_off": "{0} 關閉了任務看板,讀不到也動不了卡片,通知送過去它也沒辦法處理",
|
|
166
166
|
"err.watchers_max": "{0} 最多只能有 {1} 個關注者", "err.watch_not_board": "{0} 不是任務板上的卡片,只有任務板上的卡片可以關注",
|
|
167
167
|
"note.review_waiting": "{0}「{1}」的子任務都完成了,等你確認",
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// "No project" made hard to miss (Fleet › Tasks). A card an agent opens without a project lands in No project; the tile for
|
|
2
|
+
// it was the last on Home and only there, and the page remembers the project last looked at, so a person who stays in one
|
|
3
|
+
// project never saw it. When the board has projects and some live main task has none:
|
|
4
|
+
// - Home opens with a "No project: N to file" list (the newest cards, each with a project picker that files it at once) above the
|
|
5
|
+
// projects, and the No project tile moves first and says how many are waiting;
|
|
6
|
+
// - a project's board says so in its header, with a link to No project;
|
|
7
|
+
// - the No project board says what the place is for.
|
|
8
|
+
// A board with no project at all is not asked to sort anything: there, No project is the whole board.
|
|
9
|
+
// Pure helpers are exported (tests import them); the rest draws from what the board read already carries.
|
|
10
|
+
import { html, useRef, useState } from "/assets/app-html.js";
|
|
11
|
+
import { t, register } from "/assets/app-i18n.js";
|
|
12
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
13
|
+
import { toast } from "/assets/ui-toast.js";
|
|
14
|
+
import { NO_PROJECT, boardApi, errorText, projectKey, relTime } from "./fleet-task-common.js";
|
|
15
|
+
|
|
16
|
+
register("tasksort", {
|
|
17
|
+
en: {
|
|
18
|
+
title: "No project: {0} to file", hint: "Agents open a card in No project when nobody said which project it is for. Pick a project to file it.",
|
|
19
|
+
pick: "File in…", pickFor: "{0}: file in a project", moved: "{0} filed in {1}", by: "by {0}",
|
|
20
|
+
openAll: "Open No project", seeAll: "See all {0}",
|
|
21
|
+
tileBadge: "{0} to file", headerLink: "{0} in No project", headerLinkTip: "Open No project and file them", go: "File them",
|
|
22
|
+
placeLead: "Cards opened without a project. Open one and choose its project, or file them from Home.",
|
|
23
|
+
},
|
|
24
|
+
"zh-TW": {
|
|
25
|
+
title: "未分類:{0} 張待歸檔", hint: "沒有人說這張卡屬於哪個專案時,Agent 會先把卡開在未分類。選一個專案就能歸檔。",
|
|
26
|
+
pick: "歸檔到…", pickFor: "{0}:歸檔到專案", moved: "{0} 已歸檔到 {1}", by: "{0} 建立",
|
|
27
|
+
openAll: "開啟未分類", seeAll: "看全部 {0} 張",
|
|
28
|
+
tileBadge: "{0} 張待歸檔", headerLink: "未分類 {0} 張", headerLinkTip: "開啟未分類並歸檔", go: "前往歸檔",
|
|
29
|
+
placeLead: "沒指定專案時開出來的卡。打開卡片選專案,或在首頁直接歸檔。",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/** The most cards Home lists to sort (the rest are one click away in No project). */
|
|
34
|
+
export const SORT_SHOWN = 5;
|
|
35
|
+
|
|
36
|
+
/** A main task nobody put in a project, still alive (open, in progress, waiting or blocked): what there is to sort. */
|
|
37
|
+
export const isLoose = (card) => card.kind === "main" && projectKey(card) === NO_PROJECT && card.status !== "done" && card.status !== "cancelled";
|
|
38
|
+
|
|
39
|
+
/** The live cards with no project, newest first. */
|
|
40
|
+
export function looseCards(cards) {
|
|
41
|
+
const number = (c) => Number(String(c.id).replace(/\D/g, "")) || 0; // M-10 comes after M-9 (the text sorts it before)
|
|
42
|
+
return cards.filter(isLoose).sort((a, b) => Date.parse(b.createdAt) - Date.parse(a.createdAt) || number(b) - number(a));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* How many cards wait to be sorted, or 0 when there is nothing to ask: a board with no active project has only No project, and
|
|
47
|
+
* sorting means putting them somewhere that is not there yet.
|
|
48
|
+
*/
|
|
49
|
+
export function sortCount(cards, projects) {
|
|
50
|
+
return projects.some((p) => !p.archived) ? cards.filter(isLoose).length : 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Home's list: the newest cards with no project, each with a picker that files it. Nothing is drawn when there is nothing to sort. */
|
|
54
|
+
export function ToSort({ cards, projects, writable, onOpen, onOpenNoProject, reload }) {
|
|
55
|
+
const active = projects.filter((p) => !p.archived);
|
|
56
|
+
const loose = looseCards(cards);
|
|
57
|
+
const pending = useRef(new Set());
|
|
58
|
+
const [busy, setBusy] = useState(() => new Set());
|
|
59
|
+
if (!active.length || !loose.length) return null;
|
|
60
|
+
const shown = loose.slice(0, SORT_SHOWN);
|
|
61
|
+
// One filing at a time per card (claimed before the first await): a double change sends one write.
|
|
62
|
+
const file = async (card, value) => {
|
|
63
|
+
const id = Number(value);
|
|
64
|
+
const project = active.find((p) => p.id === id);
|
|
65
|
+
if (!project || pending.current.has(card.id)) return;
|
|
66
|
+
pending.current.add(card.id);
|
|
67
|
+
setBusy(new Set(pending.current));
|
|
68
|
+
try {
|
|
69
|
+
await boardApi.update(card.id, { projectId: project.id, version: card.version });
|
|
70
|
+
toast(t("tasksort.moved", card.id, project.name));
|
|
71
|
+
reload();
|
|
72
|
+
} catch (err) { toast(errorText(err), false); reload(); }
|
|
73
|
+
finally { pending.current.delete(card.id); setBusy(new Set(pending.current)); }
|
|
74
|
+
};
|
|
75
|
+
return html`<section class="tb-waiting tb-sort" aria-label=${t("tasksort.title", loose.length)}>
|
|
76
|
+
<h3 class="tb-section-title"><${Icon} name="inbox" size=${16} />${t("tasksort.title", loose.length)}</h3>
|
|
77
|
+
<p class="note tb-sort-hint">${t("tasksort.hint")}</p>
|
|
78
|
+
<ul class="rows">${shown.map((c) => html`<li key=${c.id} class="row-item tb-sort-row" data-sort=${c.id}>
|
|
79
|
+
<button type="button" class="tb-wait-title" onClick=${() => onOpen(c.id)}><span class="tb-code">${c.id}</span> ${c.title}</button>
|
|
80
|
+
<span class="muted tb-sort-meta">${c.createdBy ? `${t("tasksort.by", c.createdBy)} · ` : ""}${relTime(c.createdAt)}</span>
|
|
81
|
+
${writable ? html`<select class="tb-select tb-sort-pick" value="" disabled=${busy.has(c.id)} aria-label=${t("tasksort.pickFor", c.id)} onChange=${(e) => { const v = e.target.value; e.target.value = ""; void file(c, v); }}>
|
|
82
|
+
<option value="">${t("tasksort.pick")}</option>${active.map((p) => html`<option key=${p.id} value=${String(p.id)}>${p.name}</option>`)}</select>` : null}
|
|
83
|
+
</li>`)}</ul>
|
|
84
|
+
<div class="tb-sort-foot">
|
|
85
|
+
<button type="button" class="btn btn-ghost btn-sm" onClick=${onOpenNoProject}>${loose.length > shown.length ? t("tasksort.seeAll", loose.length) : t("tasksort.openAll")}</button>
|
|
86
|
+
</div>
|
|
87
|
+
</section>`;
|
|
88
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Filters stack (each "is" or "is not" some values; a main task stays when it or one of its sub tasks matches them all)
|
|
6
6
|
// and ride in the address with the project (`?tp=`, `?tf=`), so a filtered board can be sent as a link; the last ones
|
|
7
7
|
// and the display choices are remembered on this device. No style attribute anywhere (the CSP).
|
|
8
|
-
import { html, useState } from "/assets/app-html.js";
|
|
8
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
9
9
|
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";
|
|
@@ -308,25 +308,54 @@ export function ColumnScroll({ reach, onScroll }) {
|
|
|
308
308
|
${btn(-1, "prev", reach.left, t("taskview.columnsLeft"))}${btn(1, "next", reach.right, t("taskview.columnsRight"))}</div>`;
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
/**
|
|
312
|
-
|
|
313
|
-
|
|
311
|
+
/**
|
|
312
|
+
* The project's search: filters what the board and the list show as you type; Esc clears it. On a phone the field is closed
|
|
313
|
+
* (`closed`: the toolbar's 🔍 opens it) unless it holds words; Esc on an empty field asks to close it (`onEmptyEscape`).
|
|
314
|
+
*/
|
|
315
|
+
export function SearchField({ value, onChange, closed = false, inputRef = null, onEmptyEscape = null }) {
|
|
316
|
+
return html`<div class=${`tb-search tb-find${closed ? " is-closed" : ""}`}>
|
|
314
317
|
<${Icon} name="search" size=${16} cls="tb-search-icon" />
|
|
315
|
-
<input type="search" value=${value} placeholder=${t("taskview.search")} aria-label=${t("taskview.searchLabel")} title=${t("taskview.searchLabel")}
|
|
316
|
-
onInput=${(e) => onChange(e.target.value)}
|
|
318
|
+
<input id="tb-find-input" type="search" ref=${inputRef} value=${value} placeholder=${t("taskview.search")} aria-label=${t("taskview.searchLabel")} title=${t("taskview.searchLabel")}
|
|
319
|
+
onInput=${(e) => onChange(e.target.value)}
|
|
320
|
+
onKeyDown=${(e) => {
|
|
321
|
+
if (e.key !== "Escape") return;
|
|
322
|
+
if (value) { e.preventDefault(); e.stopPropagation(); onChange(""); } else if (onEmptyEscape) onEmptyEscape();
|
|
323
|
+
}} />
|
|
317
324
|
</div>`;
|
|
318
325
|
}
|
|
319
326
|
|
|
320
327
|
/**
|
|
321
328
|
* One row of controls under a project's header: the board / list switch, the search, Filter and Display, the buttons that scroll
|
|
322
329
|
* the board's columns while some are out of sight (`scroller`: its `reach` and `by(direction)`), then the filters in force as chips. The filters, the view and the display are kept on this device.
|
|
330
|
+
* On a phone it is one row — the switch at the left; Filter, Display and the 🔍 at the right — and the search field opens from
|
|
331
|
+
* 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
|
+
* where the field is always there (the page's CSS decides: the same markup serves both).
|
|
323
333
|
*/
|
|
324
334
|
export function TaskToolbar({ cards, display, onDisplay, filters, onFilters, query, onQuery, scroller = null }) {
|
|
335
|
+
const [asked, setAsked] = useState(false);
|
|
336
|
+
const field = useRef(null);
|
|
337
|
+
const focusNext = useRef(false);
|
|
338
|
+
const hasWords = query !== "";
|
|
339
|
+
const open = asked || hasWords;
|
|
340
|
+
useEffect(() => {
|
|
341
|
+
if (open && focusNext.current) { focusNext.current = false; if (field.current) field.current.focus(); }
|
|
342
|
+
});
|
|
343
|
+
/** The 🔍: opens the field and puts the cursor in it; with words in it, only takes the cursor there; else shuts it. */
|
|
344
|
+
const toggle = () => {
|
|
345
|
+
if (hasWords) { if (field.current) field.current.focus(); return; }
|
|
346
|
+
if (asked) { setAsked(false); return; }
|
|
347
|
+
focusNext.current = true;
|
|
348
|
+
setAsked(true);
|
|
349
|
+
};
|
|
325
350
|
return html`<div class="tb-view-bar">
|
|
326
351
|
<${ViewToggle} display=${display} onChange=${onDisplay} />
|
|
327
|
-
<${SearchField} value=${query} onChange=${onQuery} />
|
|
328
|
-
|
|
329
|
-
|
|
352
|
+
<${SearchField} value=${query} onChange=${onQuery} closed=${!open} inputRef=${field} onEmptyEscape=${() => setAsked(false)} />
|
|
353
|
+
<div class="tb-view-actions">
|
|
354
|
+
<${FilterMenu} cards=${cards} filters=${filters} onChange=${onFilters} />
|
|
355
|
+
<${DisplayMenu} display=${display} onChange=${onDisplay} />
|
|
356
|
+
<button type="button" class=${`btn btn-sm tb-search-toggle${hasWords ? " active" : ""}`} aria-expanded=${open ? "true" : "false"} aria-controls="tb-find-input"
|
|
357
|
+
aria-label=${t("taskview.searchLabel")} title=${t("taskview.searchLabel")} onClick=${toggle}><${Icon} name="search" size=${16} /></button>
|
|
358
|
+
</div>
|
|
330
359
|
${scroller && scroller.reach.over ? html`<${ColumnScroll} reach=${scroller.reach} onScroll=${scroller.by} />` : null}
|
|
331
360
|
<${FilterBar} cards=${cards} filters=${filters} onChange=${onFilters} />
|
|
332
361
|
</div>`;
|
package/dist/ui/fleet-tasks.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
// when its revision moved. Over the temporary public link the board is read-only (the server refuses its writes there).
|
|
7
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
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
|
|
9
|
+
// the same row, fleet-task-view.js); on a phone the board shows one status at a time (a row of pills that scrolls sideways), the head and
|
|
10
|
+
// the toolbar are laid out for the width, and every control is a 44px box that is not drawn bigger (task-board.css). A card's ⋯ (or a right click, or the
|
|
10
11
|
// menu key) opens its menu; its page steps to the previous / next card (fleet-task-menu.js). The open card is in the
|
|
11
12
|
// address (`?card=`): opening one adds a history entry, so Back returns to the board or the list.
|
|
12
13
|
import { html, useEffect, useMemo, useRef, useState } from "/assets/app-html.js";
|
|
@@ -27,6 +28,7 @@ import { InstancesDrawer } from "./fleet-task-work.js";
|
|
|
27
28
|
import { RunMark, inProgressBy, runOf, useRunContext } from "./fleet-task-run.js";
|
|
28
29
|
import { OwnerChip, otherWorkers, quietInfo } from "./fleet-task-owner.js";
|
|
29
30
|
import { InsightsDialog } from "./fleet-task-stats.js";
|
|
31
|
+
import { ToSort, sortCount } from "./fleet-task-sort.js";
|
|
30
32
|
|
|
31
33
|
const PROJECT_KEY = "agend_tasks_project";
|
|
32
34
|
const QUERY_KEY = "agend_tasks_query";
|
|
@@ -202,6 +204,7 @@ export function TaskBoardTab({ lease }) {
|
|
|
202
204
|
? html`<${Home} cards=${cards} projects=${projects} stats=${stats} writable=${writable} onOpenProject=${setAt} onOpen=${openCard} onDialog=${setDialog} onInstances=${showInstances} reload=${reload} />`
|
|
203
205
|
: html`<${ProjectBoard} project=${project} cards=${cards} stats=${stats} flashed=${flashed} display=${display} filters=${filters} query=${query} writable=${writable}
|
|
204
206
|
onDisplay=${setDisplay} onFilters=${setFilters} onQuery=${setQuery} onBack=${() => setAt(null)} onMore=${openMenuFor} onOwner=${openOwnerMenu}
|
|
207
|
+
notSorted=${sortCount(cards, projects)} onOpenNoProject=${() => setAt(NO_PROJECT)}
|
|
205
208
|
onOpen=${openCard} onCreate=${() => setDialog({ kind: "main", project: project === NO_PROJECT ? null : project.id })} onInstances=${showInstances} reload=${reload} />`;
|
|
206
209
|
|
|
207
210
|
/** A right click on a card, or the keyboard's menu key on it (no pointer: the menu goes under the card). */
|
|
@@ -309,7 +312,8 @@ export function TaskBoardTab({ lease }) {
|
|
|
309
312
|
|
|
310
313
|
/** The board's Instance button (taskhall's): the fleet's instances and what each works on. */
|
|
311
314
|
function InstancesButton({ onClick }) {
|
|
312
|
-
|
|
315
|
+
// The label is its own span: a phone narrower than 390px keeps only the icon (the label stays for a screen reader), so the head fits.
|
|
316
|
+
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>`;
|
|
313
317
|
}
|
|
314
318
|
|
|
315
319
|
function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialog, onInstances, reload }) {
|
|
@@ -317,6 +321,9 @@ function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialo
|
|
|
317
321
|
const active = projects.filter((p) => !p.archived);
|
|
318
322
|
const archived = projects.filter((p) => p.archived);
|
|
319
323
|
const loose = stats(NO_PROJECT).mains > 0;
|
|
324
|
+
// Cards with no project, while the board has projects to put them in: the list below, and the tile first with its badge.
|
|
325
|
+
const toSort = sortCount(cards, projects);
|
|
326
|
+
const looseTile = loose ? html`<${ProjectTile} project=${null} stats=${stats(NO_PROJECT)} sorting=${toSort} onOpen=${() => onOpenProject(NO_PROJECT)} />` : null;
|
|
320
327
|
return html`<div class="tb-home">
|
|
321
328
|
<div class="list-head tb-head s-page-head"><div class="s-page-title"><h2>${t("tasks.projects")}</h2></div>
|
|
322
329
|
<div class="tb-head-actions">
|
|
@@ -325,9 +332,11 @@ function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialo
|
|
|
325
332
|
${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
333
|
</div>
|
|
327
334
|
<${Waiting} cards=${cards} writable=${writable} onOpen=${onOpen} reload=${reload} />
|
|
335
|
+
<${ToSort} cards=${cards} projects=${projects} writable=${writable} onOpen=${onOpen} onOpenNoProject=${() => onOpenProject(NO_PROJECT)} reload=${reload} />
|
|
328
336
|
${active.length || loose ? html`<div class="tb-projects">
|
|
337
|
+
${toSort ? looseTile : null}
|
|
329
338
|
${active.map((p) => html`<${ProjectTile} key=${p.id} project=${p} stats=${stats(p.id)} onOpen=${() => onOpenProject(p.id)} onDialog=${writable ? onDialog : null} reload=${reload} />`)}
|
|
330
|
-
${
|
|
339
|
+
${toSort ? null : looseTile}
|
|
331
340
|
</div>` : html`<${Empty} icon="tasks" title=${t("tasks.noProjects")} hint=${t("tasks.noProjectsHint")} />`}
|
|
332
341
|
${archived.length ? html`<div class="tb-archived">
|
|
333
342
|
<button type="button" class="btn btn-ghost btn-sm" aria-expanded=${showArchived ? "true" : "false"} onClick=${() => setShowArchived(!showArchived)}>
|
|
@@ -337,19 +346,20 @@ function Home({ cards, projects, stats, writable, onOpenProject, onOpen, onDialo
|
|
|
337
346
|
</div>`;
|
|
338
347
|
}
|
|
339
348
|
|
|
340
|
-
function ProjectTile({ project, stats, onOpen, onDialog, reload }) {
|
|
349
|
+
function ProjectTile({ project, stats, sorting = 0, onOpen, onDialog, reload }) {
|
|
341
350
|
async function setArchived(archived) {
|
|
342
351
|
try { await boardApi.updateProject(project.id, { archived }); toast(t("tasks.projectSaved")); reload(); } catch (err) { toast(errorText(err), false); }
|
|
343
352
|
}
|
|
344
353
|
const name = project ? project.name : t("tasks.noProject");
|
|
345
354
|
const desc = project ? project.description : t("tasks.noProjectDesc");
|
|
346
|
-
return html`<div class=${`tb-project${project && project.archived ? " is-archived" : ""}`}>
|
|
355
|
+
return html`<div class=${`tb-project${project && project.archived ? " is-archived" : ""}${sorting ? " needs-sort" : ""}`}>
|
|
347
356
|
<button type="button" class="tb-project-open" onClick=${onOpen}>
|
|
348
357
|
<span class="tb-project-name">${name}</span>
|
|
349
358
|
${desc ? html`<span class="tb-project-desc">${desc}</span>` : null}
|
|
350
359
|
<span class="tb-project-pct" title=${t("tasks.percentTitle")}><span class="tb-pct">${stats.percent}%</span><${ProgressBar} progress=${stats.units} wide /></span>
|
|
351
360
|
<span class="tb-project-meta">
|
|
352
361
|
<span>${stats.mains === 1 ? t("tasks.mainOne") : t("tasks.mainCount", stats.mains)}</span>
|
|
362
|
+
${sorting ? html`<span class="tb-flag st-review tb-sort-flag">${t("tasksort.tileBadge", sorting)}</span>` : null}
|
|
353
363
|
${stats.waiting ? html`<span class="tb-flag st-review">${t("tasks.waiting", stats.waiting)}</span>` : null}
|
|
354
364
|
${stats.blocked ? html`<span class="tb-flag st-blocked">${t("tasks.blockedN", stats.blocked)}</span>` : null}
|
|
355
365
|
${stats.lastActivity ? html`<span class="muted">${t("tasks.lastActivity", relTime(stats.lastActivity))}</span>` : null}
|
|
@@ -442,7 +452,7 @@ function SearchBox({ onOpen }) {
|
|
|
442
452
|
|
|
443
453
|
// ── A project's board ─────────────────────────────────────
|
|
444
454
|
|
|
445
|
-
function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filters, query, writable, onDisplay, onFilters, onQuery, onBack, onOpen, onMore, onOwner, onCreate, onInstances, reload }) {
|
|
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 }) {
|
|
446
456
|
const [expanded, setExpanded] = useState({});
|
|
447
457
|
// A phone shows one status at a time: the one picked here, else the first that has cards (the person's own first).
|
|
448
458
|
const [phoneStatus, setPhoneStatus] = useState(null);
|
|
@@ -505,6 +515,20 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
|
|
|
505
515
|
const scrollEl = useRef(null);
|
|
506
516
|
const [reach, setReach] = useState(NO_REACH);
|
|
507
517
|
const showsColumns = display.view !== "list" && mains.length > 0;
|
|
518
|
+
// On a phone the statuses are one row of pills that scrolls sideways: the picked one is brought into view (the first time at
|
|
519
|
+
// once, then smoothly) — by the person's tap, or because it is the status that opens first (Review may be the fourth).
|
|
520
|
+
const pillRow = useRef(null);
|
|
521
|
+
const pillsSeen = useRef(false);
|
|
522
|
+
useEffect(() => {
|
|
523
|
+
const row = pillRow.current;
|
|
524
|
+
const on = row && row.querySelector(".tb-seg-btn.active");
|
|
525
|
+
if (!on || !row.clientWidth || row.scrollWidth <= row.clientWidth + 1) return; // not drawn (a desk), or all of it fits
|
|
526
|
+
const a = on.getBoundingClientRect(), b = row.getBoundingClientRect();
|
|
527
|
+
const left = row.scrollLeft + (a.left - b.left) - (b.width - a.width) / 2;
|
|
528
|
+
const calm = !pillsSeen.current || !!(globalThis.matchMedia && globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
529
|
+
pillsSeen.current = true;
|
|
530
|
+
if (typeof row.scrollTo === "function") row.scrollTo({ left, behavior: calm ? "auto" : "smooth" }); else row.scrollLeft = left;
|
|
531
|
+
}, [current, showsColumns]);
|
|
508
532
|
useEffect(() => {
|
|
509
533
|
const el = scrollEl.current;
|
|
510
534
|
if (!showsColumns || !el) { setReach(NO_REACH); return undefined; }
|
|
@@ -581,15 +605,21 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
|
|
|
581
605
|
<div class="tb-head-main">
|
|
582
606
|
<div class="tb-title s-page-title">
|
|
583
607
|
<button type="button" class="btn btn-ghost btn-sm tb-head-back" onClick=${onBack}><${Icon} name="back" size=${16} />${t("tasks.back")}</button>
|
|
584
|
-
<
|
|
585
|
-
|
|
608
|
+
<div class="tb-name">
|
|
609
|
+
<h2>${project === NO_PROJECT ? t("tasks.noProject") : project.name}</h2>
|
|
610
|
+
${archived ? html`<span class="s-scope">${t("tasks.archived")}</span>` : null}
|
|
611
|
+
</div>
|
|
586
612
|
</div>
|
|
587
613
|
${project !== NO_PROJECT && project.description ? html`<p class="s-page-lead tb-head-lead">${project.description}</p>` : null}
|
|
614
|
+
${project === NO_PROJECT ? html`<p class="s-page-lead tb-head-lead">${t("tasksort.placeLead")}</p>` : null}
|
|
588
615
|
<div class="tb-stats" title=${t("tasks.percentTitle")}>
|
|
589
|
-
<
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
616
|
+
<div class="tb-progress">
|
|
617
|
+
<span class="tb-pct">${stats.percent}%</span><${ProgressBar} progress=${stats.units} />
|
|
618
|
+
<span class="muted">${stats.mains === 1 ? t("tasks.mainOne") : t("tasks.mainCount", stats.mains)}</span>
|
|
619
|
+
${stats.waiting ? html`<span class="tb-flag st-review">${t("tasks.waiting", stats.waiting)}</span>` : null}
|
|
620
|
+
${stats.blocked ? html`<span class="tb-flag st-blocked">${t("tasks.blockedN", stats.blocked)}</span>` : null}
|
|
621
|
+
</div>
|
|
622
|
+
${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}
|
|
593
623
|
<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
624
|
</div>
|
|
595
625
|
</div>
|
|
@@ -601,9 +631,11 @@ function ProjectBoard({ project, cards, stats: statsOf, flashed, display, filter
|
|
|
601
631
|
<${TaskToolbar} cards=${own} display=${display} onDisplay=${onDisplay} filters=${filters} onFilters=${onFilters} query=${query} onQuery=${onQuery}
|
|
602
632
|
scroller=${display.view === "list" ? null : { reach, by: scrollColumns }} />
|
|
603
633
|
${display.view === "list" ? listBody() : mains.length === 0 && !drag ? empty()
|
|
604
|
-
: html`${html`<div class="tb-seg tb-status-seg" role="group" aria-label=${t("taskview.statusTabs")}>${columns.map((status) =>
|
|
605
|
-
|
|
606
|
-
|
|
634
|
+
: 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;
|
|
636
|
+
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
|
+
onClick=${() => setPhoneStatus(status)}><span class=${`tb-dot st-${status}`} aria-hidden="true"></span>${t(`tasks.${status}`)} <span class="tb-count">${count}</span></button>`;
|
|
638
|
+
})}</div>`}
|
|
607
639
|
<div class="tb-scroll" ref=${scrollEl}><div class="tb-columns">
|
|
608
640
|
${columns.map((status) => {
|
|
609
641
|
const list = mains.filter((c) => c.status === status);
|
package/dist/ui/fleet-usage.js
CHANGED
|
@@ -50,23 +50,23 @@ register("fusage", {
|
|
|
50
50
|
},
|
|
51
51
|
"zh-TW": {
|
|
52
52
|
range: "期間", today: "今天", r7d: "7 天", month: "本月", all: "全部", custom: "自訂", from: "從", to: "到", apply: "套用",
|
|
53
|
-
group: "分組", g_instance: "Agent", g_backend: "Backend", g_model: "模型", g_profile: "
|
|
53
|
+
group: "分組", g_instance: "Agent", g_backend: "Backend", g_model: "模型", g_profile: "憑證設定檔", g_team: "Team(依目前設定)",
|
|
54
54
|
csv: "下載 CSV", basis: "依牌價換算的 API 等值({0})——不是實際花費。", basisMore: "訂閱方案不按 token 計費。",
|
|
55
55
|
amount: "API 等值", input: "輸入", output: "輸出", reasoning: "推理", read: "快取讀取", write: "快取寫入", total: "token 總計", requests: "請求數", messages: "訊息數",
|
|
56
|
-
notPriced: "未定價", partial: "部分", noTeam: "
|
|
56
|
+
notPriced: "未定價", partial: "部分", noTeam: "(不屬於任何團隊)", unknown: "未知",
|
|
57
57
|
t_not_priced: "未定價:{0}", t_partial: "這一列有部分模型沒有價格", t_write_unreported: "Codex/Muse 不回報快取寫入",
|
|
58
58
|
t_cost_reported: "金額為 CLI 自行回報", t_estimated: "依文字長度估算(Kiro 不記錄 token 數)", t_reasoning_none: "這個 CLI 不回報",
|
|
59
|
-
sourceNote: "部分時段在 AgEnD
|
|
59
|
+
sourceNote: "部分時段在 AgEnD 記錄後端與設定檔之前就已讀取。", profileUnrecorded: "未記錄設定檔",
|
|
60
60
|
l_partial: "◐ 部分定價", l_cost_reported: "† 金額由 CLI 回報", l_estimated: "≈ 估算值",
|
|
61
61
|
speed: "速度", speedUnit: "{0} token/秒", speedCoverage: "{1} 個請求中有 {0} 個可計時", speedSpread: "p10–p90:{0}–{1} token/秒",
|
|
62
|
-
speedNone: "
|
|
62
|
+
speedNone: "對話紀錄沒有計時資訊", speedByModel: "各模型速度",
|
|
63
63
|
speedBasis: "輸出 token ÷ 模型本身的回應時間(不含工具執行時間);方法參考 tokdash。",
|
|
64
64
|
|
|
65
65
|
f_includes_estimates: "含估算值(Kiro)", estimatedPart: "其中估算:{0}",
|
|
66
66
|
scanning: "掃描中——總數可能還會增加。", updated: "更新於 {0} · 每 10 分鐘讀取一次", since: "自 {0} 起收集", notYet: "尚未收集",
|
|
67
67
|
refresh: "重新整理",
|
|
68
|
-
notMeasured: "未量測", nm_credit_billed: "Kiro
|
|
69
|
-
shared: "與 {0}
|
|
68
|
+
notMeasured: "未量測", nm_credit_billed: "Kiro 以點數計費,不記錄 token", nm_unsupported: "AgEnD 目前還讀不到這個 CLI 的用量", nm_no_data: "尚未讀到任何資料",
|
|
69
|
+
shared: "與 {0} 共用工作目錄,無法分辨各自的對話紀錄",
|
|
70
70
|
empty: "還沒有任何紀錄", emptyHint: "用量從 Claude Code、Codex、Grok、Muse、OpenCode 與 Antigravity 讀取,Kiro 則為估算,自 fleet 啟動起計。",
|
|
71
71
|
blocked: "公開連結上不提供", blockedHint: "只有在設定 → 網頁儀表板裡開啟「透過公開連結提供用量報告」時,公開連結才會提供用量;這個設定要在執行 AgEnD 的那台電腦上、直接開啟的儀表板裡變更。",
|
|
72
72
|
openSettings: "在那台電腦上開啟設定 → 網頁儀表板",
|
|
@@ -43,7 +43,7 @@ register("hubOverview", {
|
|
|
43
43
|
qPerDay: "每天的提問數", qRange_today: "今天", qRange_7d: "7 天", qHint: "每問一個 Agent 算一次。", qToday: "今天",
|
|
44
44
|
aTime: "回答時間", aMed: "一般(中位數)", aSlow: "最慢的十分之一", aWait: "正在等回答", aWaitOld: "目前等最久",
|
|
45
45
|
notEnough: "回答數還不夠", none: "—",
|
|
46
|
-
fTitle: "沒有得到回答", fRate: "
|
|
46
|
+
fTitle: "沒有得到回答", fRate: "佔全部提問的 {0}%", fOff: "Agent 的 Fleet 沒有連接", fTime: "逾時沒有回答",
|
|
47
47
|
fPerm: "權限先到期", fBusy: "Agent 停止或拒絕", fUnknown: "其他或原因不明",
|
|
48
48
|
topTitle: "最常被問的 Agent", topAgent: "Agent", topAsk: "提問數", topMed: "一般回答時間", topFail: "沒有回答",
|
|
49
49
|
topNone: "這段期間還沒有人問過 Agent。", topShared: "總共分享了 {0} 個 Agent。",
|
|
@@ -38,7 +38,7 @@ export function hubEntryToMessages(entry, room, { me = "", reason = (code) => co
|
|
|
38
38
|
// D: a Hub file in the shared thread's shape (hub-attachments.js); one the renderer cannot take is left out.
|
|
39
39
|
const files = (list) => { const a = Array.isArray(list) ? list.map(hubFileAttachment).filter(Boolean) : []; return a.length ? { attachments: a } : {}; };
|
|
40
40
|
// A closed poll's tally is already in its widget. Its automatic agent prompt was not typed by the asker.
|
|
41
|
-
if (entry.pollResult !== true) out.push({ boot: "hub", id, role: "user", sender: me, ts: iso(entry.askedAt) ?? iso(at),
|
|
41
|
+
if (entry.pollResult !== true && entry.ownPost !== true) out.push({ boot: "hub", id, role: "user", sender: me, ts: iso(entry.askedAt) ?? iso(at),
|
|
42
42
|
text: entry.expired && entry.question === undefined ? "" : String(entry.question ?? ""), delivery: stageMark(stage),
|
|
43
43
|
...files(entry.questionFiles), ...(entry.quote ? { quote: entry.quote } : {}) });
|
|
44
44
|
if (entry.answer !== undefined) {
|
|
@@ -143,8 +143,9 @@ export function createHubChatStore(room, { client = hubClient(), me = "", reason
|
|
|
143
143
|
},
|
|
144
144
|
/** The question the agent is working on now (the oldest "consumed" one), with when it started; null when none. */
|
|
145
145
|
working() {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
// M-3596: also from the moment the Hub handed it to the agent (startedAt), long before its "consumed" evidence.
|
|
147
|
+
const w = st.entries.find((e) => e.receipt && e.answer === undefined && (typeof e.startedAt === "number" || e.receipt.stage === "consumed"));
|
|
148
|
+
return w ? { since: typeof w.startedAt === "number" ? w.startedAt : w.receipt.at } : null;
|
|
148
149
|
},
|
|
149
150
|
refresh() { schedule(0); },
|
|
150
151
|
/** #3226 D2: send passes `extras.files` to the client as given (hub-attachments checks the mark). */
|
|
@@ -24,6 +24,7 @@ register("hubChat", {
|
|
|
24
24
|
notAnswered: "Not answered: {0}", uncertain: "Outcome unknown: it may or may not have been answered.",
|
|
25
25
|
reason_expired: "the question expired before an answer", reason_revoked: "your permission ended", reason_frozen: "the owner paused questions",
|
|
26
26
|
reason_withdrawn: "the agent is no longer shared", reason_unknown: "no reason given",
|
|
27
|
+
reason_reshare: "this agent is unavailable until its owner shares it again",
|
|
27
28
|
closed: "This chat has closed: your permission ended, or the agent is no longer shared.",
|
|
28
29
|
frozen: "The owner has paused questions to {0}. What is here stays readable.",
|
|
29
30
|
tagCanAsk: "Can ask", tagFrozen: "Paused", tagClosed: "Closed",
|
|
@@ -57,6 +58,7 @@ register("hubChat", {
|
|
|
57
58
|
notAnswered: "未回答:{0}", uncertain: "結果未知:可能已回答,也可能沒有。",
|
|
58
59
|
reason_expired: "問題在回答前就過期了", reason_revoked: "你的權限已結束", reason_frozen: "擁有者暫停了提問",
|
|
59
60
|
reason_withdrawn: "這個 Agent 不再分享", reason_unknown: "沒有說明原因",
|
|
61
|
+
reason_reshare: "這個 Agent 暫時無法回答,擁有者需要重新分享",
|
|
60
62
|
closed: "這個對話已關閉:你的權限已結束,或這個 Agent 不再分享。",
|
|
61
63
|
frozen: "擁有者暫停了 {0} 的提問。這裡的內容仍然看得到。",
|
|
62
64
|
tagCanAsk: "可提問", tagFrozen: "已暫停", tagClosed: "已關閉",
|
|
@@ -67,7 +69,7 @@ register("hubChat", {
|
|
|
67
69
|
ownerSees: "你的問題會出現在 {0} 的 fleet 聊天裡,標示你的 Hub 身分。",
|
|
68
70
|
agentShares: "它和其他有權限的人共用同一段對話,可能記得別人問過的事。別放不想讓別人知道的內容。",
|
|
69
71
|
adminTitle: "Hub 管理員", adminSees: "看不到內容。",
|
|
70
|
-
notHere: "這裡沒有", notHereText: "{0}
|
|
72
|
+
notHere: "這裡沒有", notHereText: "{0} 的檔案與變更、終端機畫面(檢視)、工具進度:只有 {1} 在自己的 fleet 看得到。",
|
|
71
73
|
oneToOne: "一個聊天室只有你和這個 Agent。",
|
|
72
74
|
menu: "選單", mine: "我的 Agent", mineHint: "誰可以提問、到什麼時候", admin: "管理", adminHint: "連接 Fleet",
|
|
73
75
|
back: "對話",
|
package/dist/ui/hub-client.js
CHANGED
|
@@ -638,6 +638,9 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
|
|
|
638
638
|
// M-3162 / M-3161: Administration → Overview's counts for Today or 7 days, in the viewer's time zone (counts only).
|
|
639
639
|
adminDashboard({ range = "7d", timeZone = "UTC" } = {}) { return call("GET", `/hub/v1/admin/dashboard?range=${encodeURIComponent(range)}&timeZone=${encodeURIComponent(timeZone)}`); },
|
|
640
640
|
// M-3141 / M-3138 (versions spec §3.1): the Hub's recommended AgEnD version — read, preview (nothing saved), save.
|
|
641
|
+
// M-3592: how long a sign-in lasts (Administration → Sign-in).
|
|
642
|
+
sessionLimits() { return call("GET", "/hub/v1/admin/session-limits"); },
|
|
643
|
+
saveSessionLimits(input) { return call("PUT", "/hub/v1/admin/session-limits", input); },
|
|
641
644
|
recommendedVersion() { return call("GET", "/hub/v1/admin/recommended-version"); },
|
|
642
645
|
previewRecommendedVersion(input) { return call("POST", "/hub/v1/admin/recommended-version/preview", input); },
|
|
643
646
|
saveRecommendedVersion(input) { return call("PUT", "/hub/v1/admin/recommended-version", input); },
|
|
@@ -4,7 +4,7 @@ register("hubMyAgents", {
|
|
|
4
4
|
offlineShort:"Offline · last seen {0}", knownShared:"{0} shared", oldCountOne:"1 Fleet needs an update to share agents from here.", oldCount:"{0} Fleets need an update to share agents from here.", namesMore:"{0} and {1} more", lead:"The agents you can share on this Hub, and who may ask each one.", refresh:"Refresh", refreshing:"Checking…", fleet:"Fleet", connected:"Connected", offline:"This Fleet is offline. Shown as last seen at {0}.", count:"{0} of {1} shared", select:"Select all", general:"Your Fleet's General. It can manage this Fleet.", classic:"ClassicBot room", classicHint:"Hub questions and answers are not posted in its Discord or Telegram room, and the room's chat is not copied to the Hub. It is one agent with one memory: it may use what it learned in the room when it answers here.",
|
|
5
5
|
old:"Update this Fleet to share agents from here.", update:"Update this Fleet", updateHint:"On that computer, open Settings → Hub and check its connection and version.", off:"Sharing from the Hub page is turned off in this Fleet's Settings → Hub.", denied:"Your Hub administrator hasn't allowed you to share agents.", unknown:"The Hub could not check whether sharing is allowed. Refresh to check.", remote:"This kind of agent can't answer Hub questions yet.", unavailable:"This agent cannot answer Hub questions right now.", limit:"This Fleet already shares 64 agents, the most allowed.", suspended:"This Fleet is paused on this Hub.", revoked:"This Fleet was removed from this Hub.",
|
|
6
6
|
lapsed:"Its backend or folder changed since you shared it, so Hub questions are refused until you share it again. The people who may ask it stay.", shareAgain:"Share again", needsReshare:"Needs re-share", kept:"(kept)",
|
|
7
|
-
shared:"Shared", nobody:"nobody may ask yet", setWho:"Choose who may ask", peopleOne:"1 person may ask", people:"{0} people may ask", subjects:"{0} people, groups or teams may ask", paused:"Paused", sharing:"Sharing…", stopping:"Stopping…", uncertain:"Not confirmed yet: this Fleet hasn't answered. Refresh to check.", refused:"Not shared: {0}", changed:"This list changed. It has been refreshed; tick again.",
|
|
7
|
+
shared:"Shared", nobody:"nobody may ask yet", setWho:"Choose who may ask", pictureDiscLarge:"Its avatar is too large for the Hub (limit 64 KB). On your Fleet, pick a smaller picture, or a PNG that AgEnD can shrink, in this agent's View → Edit profile → Avatar.", picturePortraitLarge:"Its identity-card portrait is too large for the Hub (limit 512 KB, including its avatar). On your Fleet, pick a smaller picture, or a PNG that AgEnD can shrink, in this agent's View → Edit profile → Identity card → Portrait.", pictureCharacterLarge:"Its own character from your office's skin pack is too large for the Hub (limit 512 KB with its avatar and portrait), so room offices draw it as the plain figure. In that pack, give it a smaller set: fewer or smaller frames.", peopleOne:"1 person may ask", people:"{0} people may ask", subjects:"{0} people, groups or teams may ask", paused:"Paused", sharing:"Sharing…", stopping:"Stopping…", uncertain:"Not confirmed yet: this Fleet hasn't answered. Refresh to check.", refused:"Not shared: {0}", changed:"This list changed. It has been refreshed; tick again.",
|
|
8
8
|
shareOne:"Share 1 agent", stopOne:"Stop sharing 1 agent", stopTitleOne:"Stop sharing 1 agent?", accessTitleOne:"1 agent is shared. Who may ask it?", share:"Share {0} agents", stop:"Stop sharing {0} agents", mixed:"Share {0} · Stop sharing {1}", apply:"Apply changes", cancel:"Cancel", stopTitle:"Stop sharing {0} agents?", stopBody:"People will no longer be able to ask: {0}. Their lists of who may ask are cleared.", stopHint:"To keep the lists and only stop answers for now, pause sharing instead.", stopGo:"Stop sharing", pause:"Pause instead", pauseOne:"Pause sharing", later:"Decide later", accessTitle:"{0} agents are shared. Who may ask them?", accessLead:"Nobody can ask them until you choose.", same:"The same people for all {0}", each:"Choose for each agent", choose:"Choose who may ask", previousMixed:"Use the list it had before", previous:"Use the list it had before ({0} people)", used:"The previous list is saved.", saved:"Saved", saveFailed:"Could not save access for {0}. Check the current agent and try again.", personal:"On my own computer", details:"Open {0}",
|
|
9
9
|
empty:"You don't have an agent on this Hub yet.", already:"You can already ask other people's agents: open Chats, or @mention an agent in a room.", emptyLead:"To have an agent of your own that colleagues can ask:", personalOff:"Personal agents are turned off on this Hub. Ask your Hub administrator.", fleetLead:"If you run AgEnD, share the agents in it.", connectDenied:"Ask your Hub administrator to let you connect a Fleet.", apps:"Your own Claude Code or Codex can also use this Hub for you. That is for asking and posting as you. Colleagues can't ask it.", appsLink:"My AI apps", failed:"The list could not be read. Refresh to try again.",
|
|
10
10
|
},
|
|
@@ -12,7 +12,7 @@ register("hubMyAgents", {
|
|
|
12
12
|
offlineShort:"離線 · 最後上線 {0}", knownShared:"已分享 {0}", oldCountOne:"有 1 個 Fleet 需要更新,才能從這裡分享 Agent。", oldCount:"有 {0} 個 Fleet 需要更新,才能從這裡分享 Agent。", namesMore:"{0} 等 {1} 個", lead:"可以分享到這個 Hub 的 Agent,以及誰可以向它們提問。", refresh:"重新整理", refreshing:"確認中…", fleet:"Fleet", connected:"已連接", offline:"這個 Fleet 目前離線,顯示的是 {0} 的狀態。", count:"已分享 {0} / {1}", select:"全選", general:"你的 Fleet 的 General,可以管理這個 Fleet。", classic:"ClassicBot 房間", classicHint:"Hub 的提問與回答不會貼到它的 Discord 或 Telegram 房間,房間的聊天也不會複製到 Hub。但它是同一個 Agent、同一份記憶:在這裡回答時,可能用到它在房間裡得知的內容。",
|
|
13
13
|
old:"請更新這個 Fleet,才能從這裡分享 Agent。", update:"更新這個 Fleet", updateHint:"請到那台電腦的「設定 → Hub」,確認連接狀態與版本。", off:"這個 Fleet 的「設定 → Hub」關閉了從 Hub 頁面分享。", denied:"Hub 管理員還沒有允許你分享 Agent。", unknown:"Hub 目前無法確認是否允許分享,請重新整理確認。", remote:"這種 Agent 還不能回答 Hub 的提問。", unavailable:"這個 Agent 目前無法回答 Hub 的提問。", limit:"這個 Fleet 已經分享 64 個 Agent,達到上限。", suspended:"這個 Fleet 在這個 Hub 已暫停。", revoked:"這個 Fleet 已從這個 Hub 移除。",
|
|
14
14
|
lapsed:"分享之後它的後端或資料夾換了,重新分享之前 Hub 的提問都會被拒絕。可以提問的人會保留。", shareAgain:"重新分享", needsReshare:"需要重新分享", kept:"(會保留)",
|
|
15
|
-
shared:"分享中", nobody:"還沒有人可以問", setWho:"設定誰可以問", peopleOne:"1 人可以提問", people:"{0} 人可以提問", subjects:"{0} 個人員、群組或團隊可以提問", paused:"已暫停", sharing:"分享中…", stopping:"停止中…", uncertain:"還沒有確認:這個 Fleet 尚未回應,請重新整理確認。", refused:"沒有分享:{0}", changed:"清單已有變動並重新整理,請重新勾選。",
|
|
15
|
+
shared:"分享中", nobody:"還沒有人可以問", setWho:"設定誰可以問", pictureDiscLarge:"它的頭像太大,Hub 無法顯示(上限 64 KB)。請在你的 Fleet 上,於這個 Agent 的「檢視 → 編輯個人資料 → 頭像」換一張較小的圖片,或改用 AgEnD 能自動縮小的 PNG。", picturePortraitLarge:"它的身分卡肖像太大,Hub 無法顯示(上限 512 KB,含頭像)。請在你的 Fleet 上,於這個 Agent 的「檢視 → 編輯個人資料 → 身分卡 → 肖像」換一張較小的圖片,或改用 AgEnD 能自動縮小的 PNG。", pictureCharacterLarge:"它在你辦公室外觀包裡的專屬角色太大,Hub 無法顯示(上限 512 KB,含頭像與肖像),房間辦公室會改用一般人物。請在那個外觀包裡給它較小的角色:較少或較小的影格。", peopleOne:"1 人可以提問", people:"{0} 人可以提問", subjects:"{0} 個人員、群組或團隊可以提問", paused:"已暫停", sharing:"分享中…", stopping:"停止中…", uncertain:"還沒有確認:這個 Fleet 尚未回應,請重新整理確認。", refused:"沒有分享:{0}", changed:"清單已有變動並重新整理,請重新勾選。",
|
|
16
16
|
shareOne:"分享 1 個 Agent", stopOne:"停止分享 1 個 Agent", stopTitleOne:"要停止分享 1 個 Agent 嗎?", accessTitleOne:"已分享 1 個 Agent。誰可以問它?", share:"分享 {0} 個 Agent", stop:"停止分享 {0} 個 Agent", mixed:"分享 {0} 個 · 停止分享 {1} 個", apply:"套用變更", cancel:"取消", stopTitle:"要停止分享 {0} 個 Agent 嗎?", stopBody:"同仁將無法再問:{0}。這些 Agent 的「可以提問的人」名單會被清除。", stopHint:"如果只是暫時不回答、想保留名單,請改用「暫停分享」。", stopGo:"停止分享", pause:"改為暫停", pauseOne:"暫停分享", later:"稍後再決定", accessTitle:"已分享 {0} 個 Agent。誰可以問它們?", accessLead:"在你選擇之前,沒有人可以問它們。", same:"{0} 個都用同一份名單", each:"每個 Agent 分開選", choose:"選擇誰可以提問", previousMixed:"沿用之前的名單", previous:"沿用之前的名單({0} 人)", used:"已儲存之前的名單。", saved:"已儲存", saveFailed:"無法儲存 {0} 的提問權限,請確認目前的 Agent 後再試。", personal:"在我的電腦上", details:"開啟 {0}",
|
|
17
17
|
empty:"你在這個 Hub 還沒有自己的 Agent。", already:"你現在就可以問別人的 Agent:到「對話」,或在房間裡 @ 一個 Agent。", emptyLead:"想要有自己的 Agent 讓同仁提問:", personalOff:"這個 Hub 還沒有開啟個人 Agent,請洽 Hub 管理員。", fleetLead:"如果你有在使用 AgEnD,可以分享裡面的 Agent。", connectDenied:"請 Hub 管理員允許你連接 Fleet。", apps:"你自己的 Claude Code 或 Codex 也可以替你使用這個 Hub,用來提問和發言;同仁不能問它。", appsLink:"我的 AI App", failed:"無法讀取清單,請重新整理再試。",
|
|
18
18
|
}
|
package/dist/ui/hub-my-agents.js
CHANGED
|
@@ -138,6 +138,9 @@ export function HubMyAgents({ client, scope, shared = [], policy = false, person
|
|
|
138
138
|
? html`<small class="note hub-agent-who">${ms("shared")} · <button type="button" class="btn btn-sm hub-agent-set-who" data-set-who=${row.current.id} disabled=${busy}
|
|
139
139
|
onClick=${() => setAccess([{ ...row.current, direct: true }])}>${ms("setWho")}</button></small>`
|
|
140
140
|
: html`<small class="note">${ms(row.current.state !== "published" ? "paused" : "shared")} · ${summary(row.current)}</small>`) : null}
|
|
141
|
+
${row.shared && row.current && fleet.picturesTooLarge?.[row.current.id]?.length
|
|
142
|
+
// M-3533 R2b (Lumen): a picture its Fleet shows but the Hub cannot take says so here, to its owner alone.
|
|
143
|
+
? fleet.picturesTooLarge[row.current.id].map(slot => html`<small class="note hub-agent-picture-large" data-picture-large=${slot}>${ms(slot === "disc" ? "pictureDiscLarge" : slot === "character" ? "pictureCharacterLarge" : "picturePortraitLarge")}</small>`) : null}
|
|
141
144
|
${row.shared && row.exposure?.lapsed === true && row.instance ? html`<small class="note hub-agent-lapsed" role="status">${ms("lapsed")}</small>
|
|
142
145
|
<button type="button" class="btn btn-sm hub-agent-share-again" data-share-again=${row.instance} disabled=${busy || !!waiting.length} onClick=${() => shareAgain(row, fleet)}>${ms("shareAgain")}</button>` : null}
|
|
143
146
|
${status ? html`<small class=${status.state === "refused" ? "err" : "note"} role="status">${status.state === "uncertain" ? ms("uncertain") : status.state === "refused" ? status.code === "stale-list" ? ms("changed") : ms("refused", ms(({ "not-allowed": "denied", "switched-off": "off", "limit": "limit", "not-shareable": "unavailable" })[status.code] || "unavailable")) : ms(status.instance ? "sharing" : "stopping")}</small>` : null}</span>
|
|
@@ -157,11 +157,28 @@ export function allBar(detail) {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const REFUSALS = { "all-mention-off": "errAllMention", "not-member": "errNotMember", archived: "errArchived" };
|
|
160
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* A refusal in words (spec §4); the network's own failure as the Fleet chat says it. M-3604: only a send that never got an
|
|
162
|
+
* answer says "check the connection"; a Hub refusal says why (before, every refusal read as a network problem).
|
|
163
|
+
*/
|
|
161
164
|
export function refusalText(r) {
|
|
162
165
|
if (!r || r.ok) return "";
|
|
163
166
|
if (REFUSALS[r.code]) return hroom(REFUSALS[r.code]);
|
|
164
|
-
|
|
167
|
+
const status = Number(r.status) || 0, code = typeof r.code === "string" ? r.code : "";
|
|
168
|
+
const why = !status || code === "unreachable" ? "sendNoConnection"
|
|
169
|
+
: status === 401 ? "sendSignedOut"
|
|
170
|
+
: code === "csrf" || code === "cross-site" ? "sendSession"
|
|
171
|
+
: status === 429 || code === "backpressure" ? "sendBusy"
|
|
172
|
+
: code === "denied" || code === "revoked" || code === "forbidden" ? "sendDenied"
|
|
173
|
+
: code === "invalid" ? "sendInvalid"
|
|
174
|
+
: status >= 500 || code === "unavailable" ? "sendUnavailable" : "";
|
|
175
|
+
return hroom("notSentBecause", why ? hroom(why) : hroom("sendRefused", code || String(status)));
|
|
176
|
+
}
|
|
177
|
+
/** M-3604: 「重試傳送」 only where sending the same thing again can work (no answer, busy, unavailable). */
|
|
178
|
+
export function retryable(r) {
|
|
179
|
+
if (!r || r.ok || REFUSALS[r.code]) return false;
|
|
180
|
+
const status = Number(r.status) || 0;
|
|
181
|
+
return !status || r.code === "unreachable" || status === 429 || r.code === "backpressure" || status >= 500;
|
|
165
182
|
}
|
|
166
183
|
|
|
167
184
|
/**
|
|
@@ -171,7 +188,7 @@ export function refusalText(r) {
|
|
|
171
188
|
* M-3117 (for M-3125's files): `attach` is ComposerInput's own ({ title, onFiles } — the Fleet's + left of the box), `pending`
|
|
172
189
|
* the files waiting, drawn first in the box (where the 1:1 chat puts its PendingFiles). Neither given: no Attach.
|
|
173
190
|
*/
|
|
174
|
-
export function RoomComposer({ store, detail, reply = null, onReply = () => {}, closed = false, inputRef, insertRef, attach = null, pending = null, canSendEmpty = false }) {
|
|
191
|
+
export function RoomComposer({ store, detail, reply = null, onReply = () => {}, closed = false, inputRef, insertRef, editRef = null, attach = null, pending = null, canSendEmpty = false }) {
|
|
175
192
|
const [value, setValue] = useState(""), [msg, setMsg] = useState(null), [busy, setBusy] = useState(false), [pick, setPick] = useState(0);
|
|
176
193
|
// M-3533: the mentions put in the box for a member, where they were put; each edit moves or retires them by its own
|
|
177
194
|
// range (editRange: the selection when it began, the caret after), never by guessing from the text.
|
|
@@ -195,6 +212,9 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
195
212
|
});
|
|
196
213
|
setTimeout(() => input.current?.focus(), 0);
|
|
197
214
|
};
|
|
215
|
+
// M-3591: the preview panel's "Reply about this page" / Point at it — a line put after what is in the box (`edit`: the
|
|
216
|
+
// box's text → the next; a line only ever goes after the end, so no bound mention moves).
|
|
217
|
+
if (editRef) editRef.current = (edit) => setValue((v) => edit(v));
|
|
198
218
|
// Where the box's selection was when this edit began: the edit's own beforeinput (each one, so a caret moved since is
|
|
199
219
|
// never stale); an IME's, where its composition started (kept to its end: the text arrives once, at compositionend);
|
|
200
220
|
// the latest key's (each keydown, an arrow too, replaces it) only where no beforeinput came. Spent by each edit.
|
|
@@ -223,7 +243,7 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
223
243
|
setBusy(true); setMsg(null);
|
|
224
244
|
const r = await store.send(text, { mentions: boundMentions(value, detail, bindings.current), ...(reply ? { replyTo: reply.roomMessage } : {}) });
|
|
225
245
|
setBusy(false);
|
|
226
|
-
if (r.ok) { setValue(""); bindings.current = []; onReply(null); } else setMsg({ text: refusalText(r), retry:
|
|
246
|
+
if (r.ok) { setValue(""); bindings.current = []; onReply(null); } else setMsg({ text: refusalText(r), retry: retryable(r) });
|
|
227
247
|
};
|
|
228
248
|
const onKeyDown = (e) => {
|
|
229
249
|
if (palette && (e.key === "ArrowDown" || e.key === "ArrowUp")) { e.preventDefault(); setPick((i) => (i + (e.key === "ArrowDown" ? 1 : palette.length - 1)) % palette.length); return; }
|