dsh-dispatch-board 0.3.3 → 0.5.6
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/README.md +12 -4
- package/lib/client.js +913 -289
- package/lib/index.js +1893 -95
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
- package/presets/taskboard.patch.yml +108 -56
package/lib/client.js
CHANGED
|
@@ -42,7 +42,8 @@ window.__ModuleLoader__.load({
|
|
|
42
42
|
const BUNDLE_ID = 'dsh-dispatch-board'
|
|
43
43
|
const RPC_CHANNEL = '/taskboard'
|
|
44
44
|
const CSS_TAG_ID = BUNDLE_ID + '/client.css'
|
|
45
|
-
const PLUGIN_VERSION = '0.
|
|
45
|
+
const PLUGIN_VERSION = '0.5.6' // 兜底值:正常走 snapshot.pluginVersion(宿主读 package.json)
|
|
46
|
+
const ARCHIVE_RETENTION_PRESETS = [0, 5, 15, 30, 60, 120, 360, 1440]
|
|
46
47
|
const POLL_VISIBLE_MS = 2000
|
|
47
48
|
const POLL_HIDDEN_MS = 10000
|
|
48
49
|
const ICON_POLL_MS = 6000
|
|
@@ -118,7 +119,8 @@ window.__ModuleLoader__.load({
|
|
|
118
119
|
// 不固定时 flex 行高被按钮撑大 ~10px,导致「已完成」标题和整列卡片都比别的列低一截。
|
|
119
120
|
'.tb-page[data-narrow=true] .tb-colhead{height:29px}',
|
|
120
121
|
'.tb-coldot{width:8px;height:8px;border-radius:50%;flex:0 0 auto;background:var(--tb-accent)}',
|
|
121
|
-
|
|
122
|
+
// 列名可能比状态名长(「待处理」/「Needs attention」):单行省略,不撑破列头(v0.5.3)。
|
|
123
|
+
'.tb-colname{font:var(--dsw-font-xxs-strong-12);font-weight:600;letter-spacing:.01em;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
122
124
|
'.tb-colcount{min-width:18px;height:18px;padding:0 5px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:color-mix(in srgb,var(--tb-accent) 16%,transparent);color:var(--tb-accent);font:var(--dsw-font-xxxs-strong-11);font-variant-numeric:tabular-nums}',
|
|
123
125
|
'.tb-colhead-actions{margin-left:auto;display:flex;align-items:center;gap:4px}',
|
|
124
126
|
'.tb-cards{display:flex;flex-direction:column;gap:8px;min-height:0}',
|
|
@@ -130,6 +132,10 @@ window.__ModuleLoader__.load({
|
|
|
130
132
|
// 唯一例外:全局平台看板多一行工作区标签(.tb-card-workspace,v0.2.4),
|
|
131
133
|
// 右栏看板不传 workspaceLabel,卡片结构维持「标题 + 操作按钮」不变。
|
|
132
134
|
'.tb-card{display:flex;flex-direction:column;gap:6px;padding:9px 10px;background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-left:3px solid var(--tb-accent);border-radius:var(--dsw-radius-sm);min-width:0;box-sizing:border-box}',
|
|
135
|
+
// v0.5.2:lastError 非空时卡片右上角一枚小红点(绝对定位,不参与布局、不改卡片高度):
|
|
136
|
+
// 「worker 结束但状态没动 / 合入冲突」这类异常在看板上必须一眼可见,完整原因去详情浮层看。
|
|
137
|
+
'.tb-card[data-lasterror=true]{position:relative}',
|
|
138
|
+
'.tb-card[data-lasterror=true]::after{content:"";position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--tb-danger,var(--dsw-alias-state-error-primary,#d97706));box-shadow:0 0 0 2px var(--dsw-alias-bg-base);pointer-events:none}',
|
|
133
139
|
'.tb-card-title{font:var(--dsw-font-xxs-strong-12);font-weight:600;line-height:1.45;word-break:break-word}',
|
|
134
140
|
// 平台看板卡片上的一行工作区标签(v0.2.4):单行、超长省略,标题仍是第一眼信息。
|
|
135
141
|
// 只有全局看板的 Col 传入 workspaceLabel 时才渲染(右栏看板绑定单个工作区,不重复显示)。
|
|
@@ -259,8 +265,9 @@ window.__ModuleLoader__.load({
|
|
|
259
265
|
'.tb-detail-actions{display:flex;justify-content:flex-end;gap:8px;padding:9px 16px;border-top:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);flex:0 0 auto}',
|
|
260
266
|
'.tb-page[data-narrow=true]{padding:10px 10px 12px;gap:9px}',
|
|
261
267
|
'.tb-page[data-narrow=true] .tb-title{font-size:16px}',
|
|
262
|
-
|
|
263
|
-
'.tb-page[data-narrow=true] .tb-head
|
|
268
|
+
// v0.5.6:窄栏也把标题与操作按钮放在同一行;空间不够时由 flex-wrap 自动折行。
|
|
269
|
+
'.tb-page[data-narrow=true] .tb-head{align-items:center;gap:8px}',
|
|
270
|
+
'.tb-page[data-narrow=true] .tb-head-side{gap:6px;flex-wrap:wrap;row-gap:6px}',
|
|
264
271
|
'.tb-page[data-narrow=true] .tb-optional{display:none}',
|
|
265
272
|
'.tb-page[data-narrow=true] .tb-board{grid-template-columns:minmax(0,1fr)}',
|
|
266
273
|
'.tb-page[data-layout=medium] .tb-board{grid-template-columns:repeat(2,minmax(0,1fr))}',
|
|
@@ -295,24 +302,26 @@ window.__ModuleLoader__.load({
|
|
|
295
302
|
'.tb-page[data-narrow=true] .tb-lead-label{max-width:160px}',
|
|
296
303
|
|
|
297
304
|
|
|
298
|
-
// ──
|
|
299
|
-
//
|
|
300
|
-
|
|
301
|
-
'.tb-needs-head{display:flex;align-items:center;gap:6px}',
|
|
302
|
-
'.tb-needs-dot{width:7px;height:7px;border-radius:50%;background:var(--dsw-alias-state-error-primary);flex:0 0 auto}',
|
|
303
|
-
'.tb-needs-name{font:var(--dsw-font-xxs-strong-12);font-weight:600}',
|
|
304
|
-
'.tb-needs-count{min-width:18px;height:18px;padding:0 5px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary-foreground);font:var(--dsw-font-xxxs-strong-11);font-variant-numeric:tabular-nums}',
|
|
305
|
-
'.tb-needs-list{display:flex;flex-direction:column;gap:4px}',
|
|
306
|
-
'.tb-needs-item{display:flex;flex-direction:column;gap:1px;width:100%;padding:5px 7px;text-align:left;border:0;border-radius:var(--dsw-radius-sm);background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit}',
|
|
307
|
-
'.tb-needs-item:hover{background:var(--dsw-alias-interactive-bg-hover)}',
|
|
308
|
-
'.tb-needs-item:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}',
|
|
309
|
-
'.tb-needs-title{font:var(--dsw-font-xxs-strong-12);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
310
|
-
'.tb-needs-q{font:var(--dsw-font-xxxs-11);color:var(--dsw-alias-label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
311
|
-
// 平台看板第五列(放在「待开始」之前;没有 flagged 任务时整列不渲染,仍是四列)。
|
|
305
|
+
// ── 待处理列(v0.2.2 顶部条 → v0.5.4 起两块看板统一用派生列,顶部条已删)──
|
|
306
|
+
// 平台看板「待处理」派生列(放在「待开始」之前;v0.5.3 起列里除提问卡还有阻塞卡,
|
|
307
|
+
// 两类都没有时整列不渲染)。
|
|
312
308
|
'.tb-board[data-needs=true]{grid-template-columns:repeat(5,minmax(0,1fr))}',
|
|
309
|
+
// v0.5.4:「已归档」列默认隐藏(data-archive=false 表示未渲染)→ 网格按可见列数收缩,
|
|
310
|
+
// 不留空列;待处理 + 归档同时出现时最多 5 列(4 个状态列 + 待处理)。
|
|
311
|
+
'.tb-board[data-archive=false]{grid-template-columns:repeat(3,minmax(0,1fr))}',
|
|
312
|
+
'.tb-board[data-needs=true][data-archive=false]{grid-template-columns:repeat(4,minmax(0,1fr))}',
|
|
313
|
+
// 右栏 medium(560–900px 两列)里「待处理 + 隐藏归档」仍是 2 列:这条选择器与上面组合规则同级,
|
|
314
|
+
// 必须写在后面,否则会被顶成 4 列(右栏宽度不够,会溢出 / 挤爆列头)。
|
|
315
|
+
'.tb-page[data-layout=medium] .tb-board[data-needs=true][data-archive=false]{grid-template-columns:repeat(2,minmax(0,1fr))}',
|
|
313
316
|
'.tb-col[data-status=needsUser]{border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 30%,transparent);border-radius:var(--dsw-radius-md);padding:9px 9px 11px;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 5%,var(--dsw-alias-bg-layer-1))}',
|
|
314
317
|
'.tb-needs-card-q{margin:4px 0 0;font:var(--dsw-font-xxxs-11);line-height:1.5;color:var(--dsw-alias-label-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}',
|
|
315
318
|
'.tb-needs-card .tb-card-actions{margin-top:6px}',
|
|
319
|
+
// 阻塞卡(doing + lastError,v0.5.3):左缘警示色 + 一行首行异常摘要(单行省略,全文在详情「最近异常」)。
|
|
320
|
+
'.tb-card[data-attention=blocked]{border-left-color:var(--tb-danger,var(--dsw-alias-state-error-primary,#d97706));background:color-mix(in srgb,var(--tb-danger,var(--dsw-alias-state-error-primary,#d97706)) 4%,var(--dsw-alias-bg-base))}',
|
|
321
|
+
'.tb-card[data-attention=blocked]:hover{border-left-color:var(--tb-danger,var(--dsw-alias-state-error-primary,#d97706))}',
|
|
322
|
+
'.tb-card-attn{display:flex;align-items:center;gap:5px;min-width:0;font:var(--dsw-font-xxxs-11)}',
|
|
323
|
+
'.tb-card-attn-label{flex:0 0 auto;padding:0 5px;border-radius:999px;background:color-mix(in srgb,var(--tb-danger,var(--dsw-alias-state-error-primary,#d97706)) 16%,transparent);color:var(--tb-danger,var(--dsw-alias-state-error-primary,#d97706));font-weight:600}',
|
|
324
|
+
'.tb-card-attn-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary)}',
|
|
316
325
|
// 详情浮层的「需要你处理」区(问题 / 选项 / 自由输入 / 回复并继续 / 最近回答)。
|
|
317
326
|
'.tb-detail-needs{border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent);border-radius:var(--dsw-radius-md);padding:9px 11px;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 6%,transparent);gap:7px}',
|
|
318
327
|
'.tb-needs-question{margin:0;font:var(--dsw-font-xs-12);line-height:1.6;white-space:pre-wrap;word-break:break-word}',
|
|
@@ -324,81 +333,118 @@ window.__ModuleLoader__.load({
|
|
|
324
333
|
'.tb-detail-lastanswer{margin:0;padding:6px 8px;border-radius:6px;background:var(--dsw-alias-bg-skeleton);font:var(--dsw-font-xxxs-11);color:var(--dsw-alias-label-secondary);white-space:pre-wrap;word-break:break-word}',
|
|
325
334
|
// 独立红色角标:与 todo 角标同一形状,放在按钮 / 图标的另一角,不抢 todo 数字。
|
|
326
335
|
'.tb-badge-needs{top:auto;bottom:-3px;right:-5px;background:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary-foreground)}',
|
|
327
|
-
'.tb-page[data-layout=narrow] .tb-needs{padding:7px 8px}',
|
|
328
|
-
'.tb-page[data-layout=narrow] .tb-needs-item{padding:4px 5px}',
|
|
329
336
|
|
|
330
337
|
// ── Apple 风格皮肤(最后追加,覆盖上面的基础样式)──────────
|
|
331
|
-
// 设计参照 macOS /
|
|
332
|
-
// 颜色全部走宿主主题 token
|
|
338
|
+
// 设计参照 macOS / Linear:层次分明的画布 + 泳道底槽 + 状态色左缘卡片、发丝分隔线、胶囊按钮、柔和阴影。
|
|
339
|
+
// 颜色全部走宿主主题 token,亮色 / 深色模式自动跟随。
|
|
333
340
|
// 令牌挂在 body 上:宿主主题的 --dsw-alias-* 就定义在 body 作用域(:root 上取不到)。
|
|
334
|
-
'body{--tb-surface:var(--dsw-alias-bg-base);--tb-canvas:color-mix(in srgb,var(--dsw-alias-bg-base)
|
|
335
|
-
//
|
|
336
|
-
|
|
337
|
-
'.tb-page{
|
|
338
|
-
'.tb-page[data-narrow=true]{width:calc(100% - 14px);height:calc(100% - 14px);margin:7px;padding:10px;border-radius:14px}',
|
|
341
|
+
'body{--tb-surface:var(--dsw-alias-bg-base);--tb-canvas:color-mix(in srgb,var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base)) 78%,var(--dsw-alias-bg-base));--tb-col-bg:color-mix(in srgb,var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base)) 46%,var(--dsw-alias-bg-base));--tb-tint:color-mix(in srgb,var(--dsw-alias-bg-skeleton,var(--dsw-alias-bg-base)) 65%,var(--dsw-alias-bg-base));--tb-hairline:var(--dsw-alias-border-l2);--tb-hairline-soft:var(--dsw-alias-border-l1);--tb-text:var(--dsw-alias-label-primary);--tb-text-2:var(--dsw-alias-label-secondary);--tb-text-3:var(--dsw-alias-label-tertiary);--tb-accent:var(--dsw-alias-state-business-primary,#0071e3);--tb-danger:var(--dsw-alias-state-error-primary,#ec1313);--tb-pill:980px;--tb-shadow-1:0 1px 2px rgba(15,17,21,.04),0 4px 14px rgba(15,17,21,.05);--tb-shadow-2:0 8px 24px rgba(15,17,21,.11),0 2px 6px rgba(15,17,21,.05)}',
|
|
342
|
+
// 页面:柔和画布底座 + 细滚动条
|
|
343
|
+
'.tb-page{gap:11px;background:var(--tb-canvas);border:1px solid var(--tb-hairline-soft);border-radius:16px;padding:15px 18px 16px;width:calc(100% - 20px);height:calc(100% - 20px);margin:10px;scrollbar-width:thin}',
|
|
344
|
+
'.tb-page[data-narrow=true]{width:calc(100% - 12px);height:calc(100% - 12px);margin:6px;padding:11px 11px 13px;border-radius:13px;gap:9px}',
|
|
339
345
|
// 主区看板:窗口变窄时自动降列(平台页不经过面板宽度测量)
|
|
340
|
-
'@media (max-width:1180px){.tb-platform .tb-board{grid-template-columns:repeat(2,minmax(0,1fr))}}',
|
|
346
|
+
'@media (max-width:1180px){.tb-platform .tb-board,.tb-platform .tb-board[data-needs=true],.tb-platform .tb-board[data-archive=false],.tb-platform .tb-board[data-needs=true][data-archive=false]{grid-template-columns:repeat(2,minmax(0,1fr))}}',
|
|
341
347
|
'@media (max-width:820px){.tb-platform .tb-optional{display:none}.tb-platform .tb-head{flex-direction:column;align-items:stretch}.tb-platform .tb-head-side{justify-content:flex-start}}',
|
|
342
|
-
'@media (max-width:620px){.tb-platform .tb-board{grid-template-columns:minmax(0,1fr)}}',
|
|
343
|
-
'.tb-title{font:600 17px/1.3 var(--dsh-font-family-text-default,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);color:var(--tb-text);letter-spacing:-.
|
|
344
|
-
'.tb-sub{color:var(--tb-text-2);font-size:11.5px}',
|
|
345
|
-
'.tb-
|
|
348
|
+
'@media (max-width:620px){.tb-platform .tb-board,.tb-platform .tb-board[data-needs=true],.tb-platform .tb-board[data-archive=false],.tb-platform .tb-board[data-needs=true][data-archive=false]{grid-template-columns:minmax(0,1fr)}}',
|
|
349
|
+
'.tb-title{font:600 17px/1.3 var(--dsh-font-family-text-default,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);color:var(--tb-text);letter-spacing:-.015em}',
|
|
350
|
+
'.tb-sub{color:var(--tb-text-2);font-size:11.5px;line-height:1.4}',
|
|
351
|
+
'.tb-dot{box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-state-success-primary) 18%,transparent)}',
|
|
352
|
+
'.tb-dot[data-on=false]{box-shadow:none}',
|
|
353
|
+
'.tb-head{gap:10px;padding-bottom:9px;border-bottom:1px solid var(--tb-hairline-soft);align-items:center}',
|
|
346
354
|
'.tb-head-side{gap:6px}',
|
|
347
355
|
// 输入 / 下拉
|
|
348
|
-
'.tb-input,.tb-select{height:
|
|
349
|
-
'.tb-
|
|
350
|
-
'.tb-
|
|
356
|
+
'.tb-input,.tb-select{height:29px;border-radius:8px;border:1px solid var(--tb-hairline);background:var(--tb-surface);color:var(--tb-text);font-size:12px;padding:0 10px;box-shadow:none;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}',
|
|
357
|
+
'.tb-select{height:27px;font-size:11.5px;padding:0 8px;cursor:pointer}',
|
|
358
|
+
'.tb-select:hover:not(:disabled){border-color:color-mix(in srgb,var(--tb-text-2) 45%,var(--tb-hairline))}',
|
|
359
|
+
'.tb-input:focus,.tb-select:focus,.tb-textarea:focus{outline:0;border-color:var(--tb-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--tb-accent) 18%,transparent)}',
|
|
360
|
+
'.tb-input::placeholder,.tb-textarea::placeholder{color:var(--tb-text-3)}',
|
|
361
|
+
'.tb-textarea{border-radius:8px;border:1px solid var(--tb-hairline);background:var(--tb-surface);transition:border-color .15s ease,box-shadow .15s ease}',
|
|
362
|
+
// 新建区(与组长条、卡片统一表面质感)
|
|
363
|
+
'.tb-composer{background:var(--tb-surface);border:1px solid var(--tb-hairline-soft);border-radius:12px;padding:10px 12px;gap:8px;box-shadow:var(--tb-shadow-1);transition:border-color .18s ease,box-shadow .18s ease}',
|
|
364
|
+
'.tb-composer:focus-within{border-color:color-mix(in srgb,var(--tb-accent) 42%,var(--tb-hairline))}',
|
|
365
|
+
'.tb-linkbtn{font-weight:500;color:var(--tb-accent);text-decoration:none}',
|
|
366
|
+
'.tb-linkbtn:hover{text-decoration:underline}',
|
|
351
367
|
// 胶囊按钮
|
|
352
|
-
'.tb-btn{height:27px;padding:0 12px;border:1px solid
|
|
353
|
-
'.tb-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--tb-text)}',
|
|
354
|
-
'.tb-btn:active{transform:scale(.98)}',
|
|
355
|
-
'.tb-btn:disabled{opacity:.
|
|
356
|
-
'.tb-btn-sm{height:24px;padding:0
|
|
357
|
-
'.tb-btn-primary{background:var(--tb-accent);color:var(--dsw-alias-label-primary-foreground,#fff);border-color:transparent}',
|
|
358
|
-
'.tb-btn-primary:hover{background:var(--tb-accent);filter:brightness(.
|
|
359
|
-
'.tb-btn-
|
|
360
|
-
|
|
361
|
-
'.tb-
|
|
362
|
-
'.tb-
|
|
368
|
+
'.tb-btn{height:27px;padding:0 12px;border:1px solid var(--tb-hairline-soft);border-radius:var(--tb-pill);background:var(--tb-surface);color:var(--tb-text);font:500 11.5px/1 var(--dsh-font-family-text-default,-apple-system,sans-serif);letter-spacing:0;box-shadow:0 1px 1px rgba(15,17,21,.03);transition:background .15s ease,border-color .15s ease,color .15s ease,opacity .15s ease,transform .1s ease,box-shadow .15s ease}',
|
|
369
|
+
'.tb-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);border-color:var(--tb-hairline);color:var(--tb-text)}',
|
|
370
|
+
'.tb-btn:active:not(:disabled){transform:scale(.98)}',
|
|
371
|
+
'.tb-btn:disabled{opacity:.42;cursor:not-allowed;box-shadow:none}',
|
|
372
|
+
'.tb-btn-sm{height:24px;padding:0 9px;font-size:11px;box-shadow:none}',
|
|
373
|
+
'.tb-btn-primary{background:var(--tb-accent);color:var(--dsw-alias-label-primary-foreground,#fff);border-color:transparent;box-shadow:0 1px 2px color-mix(in srgb,var(--tb-accent) 30%,transparent)}',
|
|
374
|
+
'.tb-btn-primary:hover:not(:disabled){background:var(--tb-accent);border-color:transparent;filter:brightness(1.05);color:var(--dsw-alias-label-primary-foreground,#fff)}',
|
|
375
|
+
'.tb-btn-active{border-color:color-mix(in srgb,var(--tb-accent) 45%,var(--tb-hairline));background:color-mix(in srgb,var(--tb-accent) 12%,var(--tb-surface));color:var(--tb-accent)}',
|
|
376
|
+
// 设置面板(v0.3.6)
|
|
377
|
+
'.tb-settings{display:flex;flex-direction:column;gap:9px;padding:11px 13px;background:var(--tb-surface);border:1px solid var(--tb-hairline-soft);border-radius:12px;box-shadow:var(--tb-shadow-1)}',
|
|
378
|
+
'.tb-settings-head{display:flex;align-items:center;gap:8px;justify-content:space-between}',
|
|
379
|
+
'.tb-settings-title{margin:0;font:600 12.5px/1.35 var(--dsh-font-family-text-default,-apple-system,sans-serif);color:var(--tb-text)}',
|
|
380
|
+
'.tb-settings-badge{padding:2px 8px;border-radius:var(--tb-pill);background:color-mix(in srgb,var(--tb-accent) 12%,var(--tb-surface));color:var(--tb-accent);font-size:10.5px;font-weight:500}',
|
|
381
|
+
'.tb-settings-body{display:flex;flex-direction:column;gap:10px}',
|
|
382
|
+
'.tb-settings-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding-bottom:8px;border-bottom:1px solid var(--tb-hairline-soft)}',
|
|
383
|
+
'.tb-settings-field{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--tb-text-2)}',
|
|
384
|
+
'.tb-settings-label{font-weight:600;font-size:11.5px;color:var(--tb-text)}',
|
|
385
|
+
'.tb-settings-hint{margin:0;font-size:11px;color:var(--tb-text-3);line-height:1.45}',
|
|
386
|
+
'.tb-settings-presets{display:flex;flex-wrap:wrap;gap:5px;align-items:center}',
|
|
387
|
+
'.tb-settings-custom{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding-top:2px}',
|
|
388
|
+
'.tb-settings-input{width:88px;height:26px;font-variant-numeric:tabular-nums}',
|
|
389
|
+
'.tb-settings-unit{font-size:11px;color:var(--tb-text-2)}',
|
|
390
|
+
'.tb-btn-ghost{background:transparent;border-color:transparent;color:var(--tb-text-2);box-shadow:none}',
|
|
391
|
+
'.tb-btn-ghost:hover:not(:disabled){background:var(--dsw-alias-bg-skeleton);border-color:transparent;color:var(--tb-text)}',
|
|
392
|
+
'.tb-btn-danger{background:transparent;border-color:transparent;color:var(--tb-danger);box-shadow:none}',
|
|
393
|
+
'.tb-btn-danger:hover:not(:disabled){background:color-mix(in srgb,var(--tb-danger) 12%,transparent);border-color:color-mix(in srgb,var(--tb-danger) 28%,transparent);color:var(--tb-danger)}',
|
|
363
394
|
// 提示条
|
|
364
|
-
'.tb-banner{border:1px solid var(--tb-hairline-soft);border-radius:11px;background:var(--tb-surface);box-shadow:var(--tb-shadow-1);font-size:11.5px;color:var(--tb-text-2);padding:8px
|
|
395
|
+
'.tb-banner{border:1px solid var(--tb-hairline-soft);border-radius:11px;background:var(--tb-surface);box-shadow:var(--tb-shadow-1);font-size:11.5px;color:var(--tb-text-2);padding:8px 11px;align-items:center}',
|
|
396
|
+
'.tb-banner[data-tone=error]{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 32%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,var(--tb-surface));color:var(--dsw-alias-state-error-primary)}',
|
|
397
|
+
'.tb-banner[data-tone=warn]{border-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 34%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 9%,var(--tb-surface));color:var(--dsw-alias-state-warn-primary)}',
|
|
398
|
+
'.tb-banner[data-tone=ok]{border-color:color-mix(in srgb,var(--dsw-alias-state-success-primary) 32%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,var(--tb-surface));color:var(--dsw-alias-state-success-primary)}',
|
|
365
399
|
'.tb-notice{border:1px dashed var(--tb-hairline);border-radius:11px;background:var(--tb-surface);color:var(--tb-text-2)}',
|
|
366
|
-
//
|
|
367
|
-
'.tb-board{gap:
|
|
368
|
-
'.tb-col{background:
|
|
369
|
-
'.tb-
|
|
370
|
-
'.tb-
|
|
371
|
-
'.tb-
|
|
372
|
-
'.tb-
|
|
400
|
+
// 看板:泳道底槽 + 白色卡片(五列与四列保持完全一致的内边距与圆角)
|
|
401
|
+
'.tb-board{gap:11px;min-height:0}',
|
|
402
|
+
'.tb-col{background:var(--tb-col-bg);border:1px solid var(--tb-hairline-soft);border-radius:13px;padding:9px 9px 11px;gap:8px;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}',
|
|
403
|
+
'.tb-col[data-status=needsUser]{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 28%,var(--tb-hairline-soft));border-radius:13px;padding:9px 9px 11px;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 5%,var(--tb-col-bg))}',
|
|
404
|
+
'.tb-page[data-narrow=true] .tb-col{padding:8px 8px 10px;border-radius:11px}',
|
|
405
|
+
'.tb-colhead{gap:6px;padding:1px 2px 6px;border-bottom:1px solid var(--tb-hairline-soft)}',
|
|
406
|
+
'.tb-coldot{width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 2px color-mix(in srgb,var(--tb-accent) 20%,transparent)}',
|
|
407
|
+
'.tb-colname{font:600 12px/1.3 var(--dsh-font-family-text-default,-apple-system,sans-serif);color:var(--tb-text);letter-spacing:0}',
|
|
408
|
+
'.tb-colcount{background:color-mix(in srgb,var(--tb-accent) 14%,var(--dsw-alias-bg-skeleton));color:var(--tb-accent);border-radius:999px;padding:0 6px;font:600 10px/16px var(--dsh-font-family-text-default,-apple-system,sans-serif);height:16px;min-width:16px;text-align:center}',
|
|
373
409
|
'.tb-cards{gap:8px}',
|
|
374
|
-
|
|
375
|
-
'.tb-card:
|
|
410
|
+
// 卡片:保留左侧状态色条(3px),悬停轻微上浮并加亮左缘;子卡(data-subtask=true)用虚线左缘与略浅表面区分
|
|
411
|
+
'.tb-card{background:var(--tb-surface);border:1px solid var(--tb-hairline-soft);border-left:3px solid color-mix(in srgb,var(--tb-accent) 76%,var(--tb-hairline));border-radius:var(--dsw-radius-md,11px);padding:10px 11px;box-shadow:var(--tb-shadow-1);transition:box-shadow .18s ease,transform .18s ease,border-color .18s ease}',
|
|
412
|
+
'.tb-card[data-subtask=true]{border-left-style:dashed;background:color-mix(in srgb,var(--tb-surface) 92%,var(--tb-canvas))}',
|
|
413
|
+
'.tb-card:hover{box-shadow:var(--tb-shadow-2);border-color:var(--tb-hairline);border-left-color:var(--tb-accent);transform:translateY(-1px)}',
|
|
414
|
+
// v0.5.3 阻塞卡在 Apple 皮肤下同样保持警示色左缘(悬停也不被状态色覆盖)。
|
|
415
|
+
'.tb-card[data-attention=blocked]{border-left-color:var(--tb-danger);background:color-mix(in srgb,var(--tb-danger) 5%,var(--tb-surface))}',
|
|
416
|
+
'.tb-card[data-attention=blocked]:hover{border-left-color:var(--tb-danger)}',
|
|
376
417
|
'.tb-card-title{font:600 12.5px/1.45 var(--dsh-font-family-text-default,-apple-system,sans-serif);color:var(--tb-text);letter-spacing:0}',
|
|
377
|
-
'.tb-card-
|
|
378
|
-
'.tb-
|
|
379
|
-
'.tb-
|
|
380
|
-
'.tb-foot
|
|
381
|
-
'.tb-
|
|
382
|
-
'.tb-
|
|
418
|
+
'.tb-card-titlebtn:hover{color:var(--dsw-alias-state-business-primary,#0071e3);text-decoration:none}',
|
|
419
|
+
'.tb-card-workspace{color:var(--tb-text-2);font-size:10px;line-height:1.4;background:var(--tb-tint);padding:1px 6px;border-radius:5px;align-self:flex-start}',
|
|
420
|
+
'.tb-empty{color:var(--tb-text-3);font-size:11px;padding:16px 8px;text-align:center;border:1px dashed var(--tb-hairline-soft);border-radius:9px;background:color-mix(in srgb,var(--tb-surface) 45%,transparent)}',
|
|
421
|
+
'.tb-foot{color:var(--tb-text-3);font-size:10.5px;padding-top:4px;border-top:1px solid var(--tb-hairline-soft)}',
|
|
422
|
+
'.tb-foot code{background:var(--dsw-alias-bg-skeleton);border-radius:5px;padding:1px 6px;font-size:10px}',
|
|
423
|
+
'.tb-wsname{color:var(--tb-text-2);font-size:11px;font-weight:500}',
|
|
424
|
+
'.tb-toolbar{padding:2px 2px 0}',
|
|
425
|
+
'.tb-toolbar-filter{color:var(--tb-text-2);font-size:11px;font-weight:500}',
|
|
426
|
+
'.tb-toolbar-count{color:var(--tb-text-3);font-size:11px;background:var(--tb-surface);border:1px solid var(--tb-hairline-soft);border-radius:var(--tb-pill);padding:2px 9px}',
|
|
427
|
+
// v0.5.4:顶部「待你处理」粘性横幅已删(提问卡统一进「待处理」列),相关皮肤规则一并去掉。
|
|
383
428
|
// 组长条:与卡片同一套表面(颜色全部走官方 --dsw-* 主题变量)
|
|
384
|
-
'.tb-leads{background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:7px
|
|
429
|
+
'.tb-leads{background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:7px 11px;box-shadow:var(--tb-shadow-1);gap:4px 10px}',
|
|
385
430
|
'.tb-lead + .tb-lead{border-left-color:var(--dsw-alias-border-l1)}',
|
|
386
|
-
'.tb-lead-label{color:var(--dsw-alias-label-secondary)}',
|
|
431
|
+
'.tb-lead-label{color:var(--dsw-alias-label-secondary);font-weight:500}',
|
|
387
432
|
'.tb-lead-state,.tb-lead-hint{color:var(--dsw-alias-label-tertiary)}',
|
|
388
433
|
// 组长条按钮与同行文字统一字体/字号/行高/字重:按钮默认 500 字重 + 另一套
|
|
389
434
|
// 字体族 + line-height:1,会让「打开」「把当前对话设为主会话」比「组长 · xxx」
|
|
390
435
|
// 低约 1px(上下不齐)。这里改成完全继承组长条正文排版。
|
|
391
436
|
'.tb-leads .tb-lead-btn{font-family:inherit;font-size:inherit;font-weight:400;line-height:inherit}',
|
|
392
437
|
// 详情浮层:灰色画布 + 白色分组卡片
|
|
393
|
-
'.tb-detail-mask{background:rgba(15,17,21,.
|
|
438
|
+
'.tb-detail-mask{background:rgba(15,17,21,.34);backdrop-filter:blur(12px) saturate(140%);padding:20px}',
|
|
394
439
|
'.tb-detail{background:var(--tb-surface);border:1px solid var(--tb-hairline);border-radius:18px;box-shadow:0 30px 90px rgba(15,17,21,.28)}',
|
|
395
440
|
'.tb-detail-head{padding:16px 18px 12px;border-bottom:1px solid var(--tb-hairline-soft);background:var(--tb-surface)}',
|
|
396
441
|
'.tb-detail-title{font:600 15px/1.35 var(--dsh-font-family-text-default,-apple-system,sans-serif);color:var(--tb-text)}',
|
|
397
442
|
'.tb-detail-close{border-radius:50%;color:var(--tb-text-2);background:var(--dsw-alias-bg-skeleton)}',
|
|
398
443
|
'.tb-detail-close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--tb-text)}',
|
|
399
|
-
'.tb-detail-body{background:var(--tb-canvas);padding:12px;gap:10px}',
|
|
400
|
-
'.tb-detail-section{background:var(--tb-surface);border:1px solid var(--tb-hairline-soft);border-radius:var(--dsw-radius-md,12px);padding:10px 12px;gap:6px}',
|
|
444
|
+
'.tb-detail-body{background:var(--tb-canvas);padding:12px 14px;gap:10px}',
|
|
445
|
+
'.tb-detail-section{background:var(--tb-surface);border:1px solid var(--tb-hairline-soft);border-radius:var(--dsw-radius-md,12px);padding:10px 12px;gap:6px;box-shadow:0 1px 2px rgba(15,17,21,.02)}',
|
|
401
446
|
'.tb-detail-sub{font:600 10.5px/1.4 var(--dsh-font-family-text-default,-apple-system,sans-serif);color:var(--tb-text-3);letter-spacing:.03em;text-transform:none}',
|
|
447
|
+
'.tb-detail-row:not(:last-child){border-bottom:1px dashed var(--tb-hairline-soft)}',
|
|
402
448
|
'.tb-detail-grid dt{color:var(--tb-text-3)}',
|
|
403
449
|
'.tb-detail-grid dd{color:var(--tb-text)}',
|
|
404
450
|
'.tb-detail-text{background:transparent;padding:0;border-radius:0;color:var(--tb-text);font-size:12px;line-height:1.65;max-height:none;overflow:visible}',
|
|
@@ -408,7 +454,13 @@ window.__ModuleLoader__.load({
|
|
|
408
454
|
'.tb-detail-muted{color:var(--tb-text-3)}',
|
|
409
455
|
'.tb-detail-error{color:var(--tb-danger);background:transparent;padding:0}',
|
|
410
456
|
'.tb-detail-sessions .tb-btn{border-radius:var(--tb-pill)}',
|
|
411
|
-
'.tb-detail-chip{background:var(--dsw-alias-bg-skeleton);border-radius:6px;color:var(--tb-text-2);font-size:10px;padding:2px 7px}',
|
|
457
|
+
'.tb-detail-chip{background:var(--dsw-alias-bg-skeleton);border-radius:6px;color:var(--tb-text-2);font-size:10px;padding:2px 7px;font-variant-numeric:tabular-nums}',
|
|
458
|
+
'.tb-detail-parent{border:1px solid color-mix(in srgb,var(--tb-accent) 28%,transparent);background:color-mix(in srgb,var(--tb-accent) 10%,var(--tb-surface));color:var(--tb-accent);cursor:pointer;font-family:inherit;line-height:inherit}',
|
|
459
|
+
'.tb-detail-parent:hover{background:color-mix(in srgb,var(--tb-accent) 18%,var(--tb-surface))}',
|
|
460
|
+
'.tb-subtasks{display:flex;flex-direction:column;gap:5px}',
|
|
461
|
+
'.tb-subtask-item{display:flex;align-items:center;gap:7px;width:100%;padding:5px 8px;border:1px solid var(--tb-hairline-soft);border-radius:8px;background:var(--tb-canvas);color:var(--tb-text);cursor:pointer;text-align:left;font:var(--dsw-font-xxs-12);transition:background .14s ease,border-color .14s ease}',
|
|
462
|
+
'.tb-subtask-item:hover{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--tb-hairline)}',
|
|
463
|
+
'.tb-subtask-title{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
412
464
|
'.tb-statusbadge{border-radius:var(--tb-pill);font-size:10px;font-weight:600;padding:2px 9px 2px 7px;background:var(--dsw-alias-bg-skeleton);color:var(--tb-text-2)}',
|
|
413
465
|
'.tb-statusbadge[data-status=todo]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 14%,transparent);color:var(--dsw-alias-state-business-primary)}',
|
|
414
466
|
'.tb-statusbadge[data-status=doing]{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 16%,transparent);color:var(--dsw-alias-state-warn-primary)}',
|
|
@@ -416,9 +468,9 @@ window.__ModuleLoader__.load({
|
|
|
416
468
|
'.tb-statusbadge[data-status=archived]{background:var(--dsw-alias-bg-skeleton);color:var(--tb-text-3)}',
|
|
417
469
|
'.tb-timeline{background:transparent;padding:2px 0 0;border-radius:0}',
|
|
418
470
|
'.tb-timeline-label{color:var(--tb-text-3);font-size:10px}',
|
|
419
|
-
'.tb-timeline-value{color:var(--tb-text);font-size:12px}',
|
|
420
|
-
'.tb-timeline-item{border-left:1px solid var(--tb-hairline-soft)}',
|
|
421
|
-
'.tb-timeline-item:first-child{border-left:0}',
|
|
471
|
+
'.tb-timeline-value{color:var(--tb-text);font-size:12px;font-variant-numeric:tabular-nums}',
|
|
472
|
+
'.tb-timeline-item{border-left:1px solid var(--tb-hairline-soft);padding:0 8px}',
|
|
473
|
+
'.tb-timeline-item:first-child{border-left:0;padding-left:0}',
|
|
422
474
|
'.tb-detail-actions{background:var(--tb-surface);border-top:1px solid var(--tb-hairline-soft);padding:10px 16px}',
|
|
423
475
|
// 富文本:Apple 风格的表格 / 代码
|
|
424
476
|
'.tb-rich .tb-rich-tablewrap{border:1px solid var(--tb-hairline-soft);border-radius:10px;background:var(--tb-surface);max-height:none}',
|
|
@@ -442,8 +494,13 @@ window.__ModuleLoader__.load({
|
|
|
442
494
|
// 全文放 title 属性;行内编辑态不带 .tb-card-fixed,高度自适应。
|
|
443
495
|
'.tb-card-fixed{gap:5px;padding:9px 10px 8px}',
|
|
444
496
|
'.tb-card-fixed .tb-card-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.8em;line-height:1.4;word-break:break-word}',
|
|
445
|
-
'.tb-card-fixed .tb-card-actions{gap:
|
|
446
|
-
'.tb-card-fixed .tb-card-actions .tb-btn{height:22px;padding:0 7px;font-size:10.5px}',
|
|
497
|
+
'.tb-card-fixed .tb-card-actions{gap:4px;padding-top:2px;border-top:1px solid color-mix(in srgb,var(--tb-hairline-soft) 65%,transparent)}',
|
|
498
|
+
'.tb-card-fixed .tb-card-actions .tb-btn{height:22px;padding:0 7px;font-size:10.5px;background:var(--tb-tint);border-color:transparent}',
|
|
499
|
+
'.tb-card-fixed .tb-card-actions .tb-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);border-color:var(--tb-hairline-soft)}',
|
|
500
|
+
'.tb-card-fixed .tb-card-actions .tb-btn-primary{background:color-mix(in srgb,var(--tb-accent) 15%,var(--tb-surface));color:var(--tb-accent);border-color:color-mix(in srgb,var(--tb-accent) 32%,transparent);font-weight:600}',
|
|
501
|
+
'.tb-card-fixed .tb-card-actions .tb-btn-primary:hover:not(:disabled){background:var(--tb-accent);color:var(--dsw-alias-label-primary-foreground,#fff);border-color:transparent;filter:none}',
|
|
502
|
+
'.tb-card-fixed .tb-card-actions .tb-btn-danger{background:transparent;color:var(--tb-danger)}',
|
|
503
|
+
'.tb-card-fixed .tb-card-actions .tb-btn-danger:hover:not(:disabled){background:color-mix(in srgb,var(--tb-danger) 12%,transparent);border-color:transparent}',
|
|
447
504
|
].join('\n')
|
|
448
505
|
|
|
449
506
|
function injectCss() {
|
|
@@ -468,6 +525,23 @@ window.__ModuleLoader__.load({
|
|
|
468
525
|
'page.title': '任务看板',
|
|
469
526
|
'page.refresh': '刷新',
|
|
470
527
|
'page.refreshing': '刷新中…',
|
|
528
|
+
'settings.button': '设置',
|
|
529
|
+
'settings.title': '看板设置',
|
|
530
|
+
'settings.archiveRetention': '归档任务自动删除时间',
|
|
531
|
+
'settings.archiveRetentionHint': '已归档的任务在保留满指定分钟数后自动从看板彻底删除(设为 0 则永不自动删除)。',
|
|
532
|
+
'settings.archiveCurrent': '当前:{m} 分钟后自动删除',
|
|
533
|
+
'settings.archiveCurrentNever': '当前:不自动删除',
|
|
534
|
+
'settings.archiveNever': '不自动删除',
|
|
535
|
+
'settings.minutes': '{m} 分钟',
|
|
536
|
+
'settings.minutesUnit': '分钟(0 = 不自动删除,最多 10080)',
|
|
537
|
+
'settings.save': '保存设置',
|
|
538
|
+
'settings.saved': '已更新归档保留时间设置',
|
|
539
|
+
'settings.archiveInvalid': '请输入 0 到 10080 之间的整数分钟数',
|
|
540
|
+
'settings.worktreeIsolation': 'Git Worktree 并发隔离',
|
|
541
|
+
'settings.worktreeHint': '开启后,Git 仓库内的并行切片与无依赖任务自动在独立 Worktree 中真并发执行并软链主仓依赖。',
|
|
542
|
+
'settings.worktreeOn': '已启用(真并发隔离)',
|
|
543
|
+
'settings.worktreeOff': '已关闭(同目录串行)',
|
|
544
|
+
'detail.worktree': '隔离工作树',
|
|
471
545
|
'poll.on': '每 {interval} 轮询',
|
|
472
546
|
'poll.off': '轮询已暂停',
|
|
473
547
|
'poll.lastRun': '上次检查 {time}',
|
|
@@ -553,9 +627,15 @@ window.__ModuleLoader__.load({
|
|
|
553
627
|
'detail.sourceUser': '用户(看板 / 对话)',
|
|
554
628
|
'detail.sourceAgent': '主 Agent(模型工具)',
|
|
555
629
|
'detail.id': '任务 id',
|
|
630
|
+
'detail.parentTask': '↳ 父任务 {id}',
|
|
631
|
+
'detail.subtasks': '拆分子任务({done}/{total} 已完成)',
|
|
632
|
+
'detail.dependsOn': '前置依赖({done}/{total} 已满足)',
|
|
633
|
+
'detail.dependsPruned': '已归档清理',
|
|
634
|
+
'composer.dependsOn': '前置依赖(可选,逗号分隔,如 t-1, t-2)',
|
|
556
635
|
'detail.note': '备注 / 验收标准',
|
|
557
636
|
'detail.result': '完成结论',
|
|
558
637
|
'detail.error': '最近错误',
|
|
638
|
+
'detail.lastError': '最近异常',
|
|
559
639
|
'detail.emptyNote': '(没有备注)',
|
|
560
640
|
'detail.emptyResult': '任务已完成,但主 Agent 还没有写结论。',
|
|
561
641
|
'detail.emptyResultPending': '任务还没完成,完成后主 Agent 会把结论写在这里。',
|
|
@@ -607,6 +687,7 @@ window.__ModuleLoader__.load({
|
|
|
607
687
|
'poll.skip.creator-cold': '创建这条任务的对话还没激活(历史会话):在那边发一条消息,任务就会回到该对话执行;急的话点「立即派发」',
|
|
608
688
|
// v0.2.0 workspace-lead 路由的跳过原因(poll.lastSkipReason)
|
|
609
689
|
'poll.skip.lead-busy': '工作区组长正在运行,等它空下来再派',
|
|
690
|
+
'poll.skip.lead-worker-busy': '本工作区已有任务正在执行或待组长验收,完成后再自动派发下一条',
|
|
610
691
|
'poll.skip.lead-unavailable': '工作区组长不可用:稍后重试,或在看板点「创建组长」',
|
|
611
692
|
'poll.skip.lead-no-workspace': '无法解析任务的工作区:请从目标工作区的会话里重新加这条任务',
|
|
612
693
|
|
|
@@ -635,7 +716,6 @@ window.__ModuleLoader__.load({
|
|
|
635
716
|
'detail.noLead': '(还没有组长)',
|
|
636
717
|
|
|
637
718
|
// v0.2.2「待你处理」(§1.9):组长提问 → 看板提示 → 用户回答 → 任务继续
|
|
638
|
-
'column.needsUser': '待你处理',
|
|
639
719
|
'needsUser.title': '需要你处理',
|
|
640
720
|
'needsUser.question': '需要你回答的问题',
|
|
641
721
|
'needsUser.answerPlaceholder': '输入你的回答(≤{max} 字)…',
|
|
@@ -648,6 +728,14 @@ window.__ModuleLoader__.load({
|
|
|
648
728
|
'needsUser.answerEmpty': '先写回答再提交',
|
|
649
729
|
'needsUser.answerTooLong': '回答不能超过 {max} 字',
|
|
650
730
|
'needsUser.pickOption': '点上面的选项可以填入输入框,也可以自己写。',
|
|
731
|
+
|
|
732
|
+
// v0.5.3「待处理」派生列(§5.1.1):提问卡(needsUser)+ 阻塞卡(doing + lastError)共用一列
|
|
733
|
+
'column.attention': '待处理',
|
|
734
|
+
'attention.blocked': '阻塞',
|
|
735
|
+
|
|
736
|
+
// v0.5.4:「已归档」列默认隐藏,顶部按钮切换(带当前归档条数,aria-expanded 表达状态)
|
|
737
|
+
'archive.show': '显示归档({n})',
|
|
738
|
+
'archive.hide': '隐藏归档({n})',
|
|
651
739
|
}
|
|
652
740
|
|
|
653
741
|
const DICT_EN = {
|
|
@@ -657,6 +745,23 @@ window.__ModuleLoader__.load({
|
|
|
657
745
|
'page.title': 'Task board',
|
|
658
746
|
'page.refresh': 'Refresh',
|
|
659
747
|
'page.refreshing': 'Refreshing…',
|
|
748
|
+
'settings.button': 'Settings',
|
|
749
|
+
'settings.title': 'Board settings',
|
|
750
|
+
'settings.archiveRetention': 'Auto-delete archived tasks after',
|
|
751
|
+
'settings.archiveRetentionHint': 'Archived tasks are permanently removed after the configured minutes (set 0 to never auto-delete).',
|
|
752
|
+
'settings.archiveCurrent': 'Current: delete after {m} min',
|
|
753
|
+
'settings.archiveCurrentNever': 'Current: never auto-delete',
|
|
754
|
+
'settings.archiveNever': 'Never',
|
|
755
|
+
'settings.minutes': '{m} min',
|
|
756
|
+
'settings.minutesUnit': 'minutes (0 = never, max 10080)',
|
|
757
|
+
'settings.save': 'Save',
|
|
758
|
+
'settings.saved': 'Updated archive retention setting',
|
|
759
|
+
'settings.archiveInvalid': 'Enter an integer between 0 and 10080 minutes',
|
|
760
|
+
'settings.worktreeIsolation': 'Git Worktree isolation',
|
|
761
|
+
'settings.worktreeHint': 'Run parallel slices and independent tasks in isolated Git worktrees with shared dependency junctions.',
|
|
762
|
+
'settings.worktreeOn': 'Enabled (isolated)',
|
|
763
|
+
'settings.worktreeOff': 'Disabled (serial)',
|
|
764
|
+
'detail.worktree': 'Worktree',
|
|
660
765
|
'poll.on': 'Polling every {interval}',
|
|
661
766
|
'poll.off': 'Polling paused',
|
|
662
767
|
'poll.lastRun': 'Last check {time}',
|
|
@@ -742,9 +847,15 @@ window.__ModuleLoader__.load({
|
|
|
742
847
|
'detail.sourceUser': 'User (board or chat)',
|
|
743
848
|
'detail.sourceAgent': 'Main agent (model tool)',
|
|
744
849
|
'detail.id': 'Task id',
|
|
850
|
+
'detail.parentTask': '↳ Parent {id}',
|
|
851
|
+
'detail.subtasks': 'Subtasks ({done}/{total} done)',
|
|
852
|
+
'detail.dependsOn': 'Dependencies ({done}/{total} satisfied)',
|
|
853
|
+
'detail.dependsPruned': 'Archived & pruned',
|
|
854
|
+
'composer.dependsOn': 'Depends on (optional, e.g. t-1, t-2)',
|
|
745
855
|
'detail.note': 'Note / acceptance',
|
|
746
856
|
'detail.result': 'Result',
|
|
747
857
|
'detail.error': 'Last error',
|
|
858
|
+
'detail.lastError': 'Recent issue',
|
|
748
859
|
'detail.emptyNote': '(no note)',
|
|
749
860
|
'detail.emptyResult': 'Task is done but the main agent has not written a result yet.',
|
|
750
861
|
'detail.emptyResultPending': 'Not finished yet; the main agent writes the result here when done.',
|
|
@@ -796,6 +907,7 @@ window.__ModuleLoader__.load({
|
|
|
796
907
|
'poll.skip.creator-cold': 'The creating conversation is not active yet (legacy session): send a message there to receive the task, or click Dispatch now',
|
|
797
908
|
// v0.2.0 workspace-lead routing skip reasons (poll.lastSkipReason)
|
|
798
909
|
'poll.skip.lead-busy': 'The workspace lead is running; it will retry once it is idle',
|
|
910
|
+
'poll.skip.lead-worker-busy': 'Another task in this workspace is still running or awaiting lead review; retrying once it finishes',
|
|
799
911
|
'poll.skip.lead-unavailable': 'The workspace lead is unavailable: retry later, or click Create lead on the board',
|
|
800
912
|
'poll.skip.lead-no-workspace': 'Cannot resolve the task workspace: re-add this task from a conversation inside the target workspace',
|
|
801
913
|
|
|
@@ -824,7 +936,6 @@ window.__ModuleLoader__.load({
|
|
|
824
936
|
'detail.noLead': '(no lead yet)',
|
|
825
937
|
|
|
826
938
|
// v0.2.2 needs-user loop (§1.9)
|
|
827
|
-
'column.needsUser': 'Needs you',
|
|
828
939
|
'needsUser.title': 'Needs your answer',
|
|
829
940
|
'needsUser.question': 'Question for you',
|
|
830
941
|
'needsUser.answerPlaceholder': 'Type your answer (≤{max} chars)…',
|
|
@@ -837,6 +948,14 @@ window.__ModuleLoader__.load({
|
|
|
837
948
|
'needsUser.answerEmpty': 'Write an answer first',
|
|
838
949
|
'needsUser.answerTooLong': 'The answer must be at most {max} chars',
|
|
839
950
|
'needsUser.pickOption': 'Click an option to fill the box, or write your own answer.',
|
|
951
|
+
|
|
952
|
+
// v0.5.3 attention column (§5.1.1): question cards + blocked cards (doing + lastError)
|
|
953
|
+
'column.attention': 'Needs attention',
|
|
954
|
+
'attention.blocked': 'Blocked',
|
|
955
|
+
|
|
956
|
+
// v0.5.4: the archived column is hidden by default; header button toggles it.
|
|
957
|
+
'archive.show': 'Show archived ({n})',
|
|
958
|
+
'archive.hide': 'Hide archived ({n})',
|
|
840
959
|
}
|
|
841
960
|
|
|
842
961
|
function detectLang(locale) {
|
|
@@ -1698,8 +1817,9 @@ window.__ModuleLoader__.load({
|
|
|
1698
1817
|
}
|
|
1699
1818
|
|
|
1700
1819
|
/**
|
|
1701
|
-
* v0.2.2(§1.9
|
|
1820
|
+
* v0.2.2(§1.9)派生「待你处理」列表——`needsUser === true`、排除已归档,
|
|
1702
1821
|
* 按 `askedAt` 升序(等得最久的排最前;缺 / 坏 `askedAt` 的排最后,再按 id)。
|
|
1822
|
+
* v0.5.4 起看板改用「待处理」列(`attentionTasks`),这个纯函数只保留给 `__test` 与兼容调用。
|
|
1703
1823
|
*/
|
|
1704
1824
|
function needsUserTasks(tasks) {
|
|
1705
1825
|
return (Array.isArray(tasks) ? tasks : [])
|
|
@@ -1727,6 +1847,68 @@ window.__ModuleLoader__.load({
|
|
|
1727
1847
|
)
|
|
1728
1848
|
}
|
|
1729
1849
|
|
|
1850
|
+
/**
|
|
1851
|
+
* v0.5.3(§1.9 / §5.1.1):「待处理」派生列的卡片分类——仍然不新增 status、不迁移任务数据。
|
|
1852
|
+
* 提问卡(红点 / 可回答)优先:`needsUser === true` 且未归档;
|
|
1853
|
+
* 阻塞卡:`status === 'doing'` 且 `lastError` 非空(合入冲突 / worker 结束异常 / 执行会话失联)。
|
|
1854
|
+
* 已归档任务一律不进「待处理」(归档是终态,§1.9)。
|
|
1855
|
+
*/
|
|
1856
|
+
function attentionTaskKind(task) {
|
|
1857
|
+
if (!task || typeof task !== 'object') return ''
|
|
1858
|
+
if (task.needsUser === true && task.status !== 'archived') return 'question'
|
|
1859
|
+
if (task.status === 'doing' && typeof task.lastError === 'string' && task.lastError.trim() !== '') return 'blocked'
|
|
1860
|
+
return ''
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* v0.5.3:派生「待处理」列——提问卡在前、阻塞卡在后,各自 `updatedAt` 倒序
|
|
1865
|
+
* (缺 / 坏时间排最后,再按 id)。返回 `{ task, kind: 'question' | 'blocked' }` 列表。
|
|
1866
|
+
*/
|
|
1867
|
+
function attentionTasks(tasks) {
|
|
1868
|
+
const questions = []
|
|
1869
|
+
const blocked = []
|
|
1870
|
+
for (const task of Array.isArray(tasks) ? tasks : []) {
|
|
1871
|
+
const kind = attentionTaskKind(task)
|
|
1872
|
+
if (kind === 'question') questions.push(task)
|
|
1873
|
+
else if (kind === 'blocked') blocked.push(task)
|
|
1874
|
+
}
|
|
1875
|
+
const byUpdatedDesc = (a, b) => {
|
|
1876
|
+
const at = Date.parse(typeof a.updatedAt === 'string' ? a.updatedAt : '')
|
|
1877
|
+
const bt = Date.parse(typeof b.updatedAt === 'string' ? b.updatedAt : '')
|
|
1878
|
+
const aOk = Number.isFinite(at)
|
|
1879
|
+
const bOk = Number.isFinite(bt)
|
|
1880
|
+
if (aOk && bOk && at !== bt) return bt - at
|
|
1881
|
+
if (aOk !== bOk) return aOk ? -1 : 1
|
|
1882
|
+
return String(a.id).localeCompare(String(b.id))
|
|
1883
|
+
}
|
|
1884
|
+
return questions
|
|
1885
|
+
.slice()
|
|
1886
|
+
.sort(byUpdatedDesc)
|
|
1887
|
+
.map((task) => ({ task, kind: 'question' }))
|
|
1888
|
+
.concat(blocked.slice().sort(byUpdatedDesc).map((task) => ({ task, kind: 'blocked' })))
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* v0.5.3:普通四列用的任务——「待处理」列里的卡(提问卡 + 阻塞卡)不重复出现。
|
|
1893
|
+
* 已归档的 flagged 任务仍留在「已归档」列(attentionTaskKind 对 archived 返回空)。
|
|
1894
|
+
*/
|
|
1895
|
+
function withoutAttention(tasks) {
|
|
1896
|
+
return (Array.isArray(tasks) ? tasks : []).filter((task) => attentionTaskKind(task) === '')
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* v0.5.3:阻塞卡上的异常摘要——取 `lastError` 首行(空白折叠)、超长截断;
|
|
1901
|
+
* 完整文本仍只在详情浮层「最近异常」行。
|
|
1902
|
+
*/
|
|
1903
|
+
function lastErrorSummary(error, max = 88) {
|
|
1904
|
+
const text = typeof error === 'string' ? error : ''
|
|
1905
|
+
const firstLine = text.split(/\r?\n/).map((line) => line.trim()).find((line) => line !== '') || ''
|
|
1906
|
+
const flat = firstLine.replace(/\s+/g, ' ')
|
|
1907
|
+
const limit = Number.isFinite(max) && max > 1 ? Math.floor(max) : 88
|
|
1908
|
+
if (flat.length <= limit) return flat
|
|
1909
|
+
return flat.slice(0, limit - 1) + '…'
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1730
1912
|
function errorText(t, error) {
|
|
1731
1913
|
if (!error || typeof error !== 'object') return t('error.internal')
|
|
1732
1914
|
const code = error.code || 'internal'
|
|
@@ -2426,8 +2608,13 @@ window.__ModuleLoader__.load({
|
|
|
2426
2608
|
className: 'tb-btn tb-btn-sm tb-btn-ghost',
|
|
2427
2609
|
disabled: busy !== '',
|
|
2428
2610
|
onClick: () => {
|
|
2429
|
-
const
|
|
2430
|
-
if (
|
|
2611
|
+
const todos = list.filter((task) => task && task.status === 'todo')
|
|
2612
|
+
if (todos.length === 0) return
|
|
2613
|
+
if (typeof actions.dispatchAll === 'function') {
|
|
2614
|
+
actions.dispatchAll(todos)
|
|
2615
|
+
} else {
|
|
2616
|
+
actions.dispatchNow(todos[0])
|
|
2617
|
+
}
|
|
2431
2618
|
},
|
|
2432
2619
|
},
|
|
2433
2620
|
t('column.dispatchAll'),
|
|
@@ -2459,115 +2646,89 @@ window.__ModuleLoader__.load({
|
|
|
2459
2646
|
}
|
|
2460
2647
|
|
|
2461
2648
|
/**
|
|
2462
|
-
*
|
|
2463
|
-
*
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
if (list.length === 0) return null
|
|
2469
|
-
const actions = bind.actions
|
|
2470
|
-
return h(
|
|
2471
|
-
'section',
|
|
2472
|
-
{ className: 'tb-needs', role: 'region', 'aria-label': t('column.needsUser') },
|
|
2473
|
-
h(
|
|
2474
|
-
'header',
|
|
2475
|
-
{ className: 'tb-needs-head' },
|
|
2476
|
-
h('span', { className: 'tb-needs-dot', 'aria-hidden': 'true' }),
|
|
2477
|
-
h('span', { className: 'tb-needs-name' }, t('column.needsUser')),
|
|
2478
|
-
h('span', { className: 'tb-needs-count' }, String(list.length)),
|
|
2479
|
-
),
|
|
2480
|
-
h(
|
|
2481
|
-
'div',
|
|
2482
|
-
{ className: 'tb-needs-list' },
|
|
2483
|
-
list.map((task) =>
|
|
2484
|
-
h(
|
|
2485
|
-
'button',
|
|
2486
|
-
{
|
|
2487
|
-
key: task.id,
|
|
2488
|
-
type: 'button',
|
|
2489
|
-
className: 'tb-needs-item',
|
|
2490
|
-
title: (task.title || '') + '\n' + (task.question || ''),
|
|
2491
|
-
onClick: () => actions.openDetail(task),
|
|
2492
|
-
},
|
|
2493
|
-
h('span', { className: 'tb-needs-title' }, task.title || ''),
|
|
2494
|
-
h('span', { className: 'tb-needs-q' }, task.question || ''),
|
|
2495
|
-
),
|
|
2496
|
-
),
|
|
2497
|
-
),
|
|
2498
|
-
)
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
/**
|
|
2502
|
-
* 平台看板的第五列「待你处理」(v0.2.2,§1.9):放在「待开始」之前,仅非空时由调用方渲染。
|
|
2503
|
-
* 卡片显示标题 + 问题一行 + 「处理」按钮(需要用户阅读,是纯标题卡的例外);
|
|
2504
|
-
* 点标题 / 「处理」都打开详情浮层的回答区。
|
|
2649
|
+
* 平台看板的「待处理」派生列(v0.2.2 第五列「待你处理」,v0.5.3 扩成两类卡):
|
|
2650
|
+
* 放在「待开始」之前,仅非空时由调用方渲染(空时整列消失,看板回四列)。
|
|
2651
|
+
* - 提问卡(needsUser):标题 + 问题两行 + 「处理」按钮,点标题 / 按钮都打开详情回答区;
|
|
2652
|
+
* - 阻塞卡(doing + lastError):完整 Card(原有操作按钮不丢)+ 警示色左缘 + 首行异常摘要,
|
|
2653
|
+
* 点标题 / 「详情」打开详情浮层(完整文本在「最近异常」行)。
|
|
2654
|
+
* 提问在前、阻塞在后(由 attentionTasks 排好)。第五列也是全局视角,卡片照常带工作区标签。
|
|
2505
2655
|
*/
|
|
2506
2656
|
function NeedsColumn(props) {
|
|
2507
2657
|
const t = bind.t
|
|
2508
|
-
const
|
|
2658
|
+
const items = Array.isArray(props && props.items)
|
|
2659
|
+
? props.items
|
|
2660
|
+
: (props && Array.isArray(props.tasks) ? props.tasks : []).map((task) => ({ task, kind: 'question' }))
|
|
2509
2661
|
const actions = bind.actions
|
|
2510
|
-
// 第五列也是全局视角(只有平台看板渲染它):同样显示工作区标签;
|
|
2511
|
-
// 右栏的「待你处理」是顶部条(.tb-needs-item,不是卡片),不受影响。
|
|
2512
2662
|
const workspaceLabelOf = props && typeof props.workspaceLabel === 'function' ? props.workspaceLabel : null
|
|
2663
|
+
const labelOf = (task) => (workspaceLabelOf ? workspaceLabelOf(task) : '')
|
|
2513
2664
|
return h(
|
|
2514
2665
|
'section',
|
|
2515
2666
|
{
|
|
2516
2667
|
className: 'tb-col tb-needs-col',
|
|
2517
2668
|
'data-status': 'needsUser',
|
|
2518
|
-
'
|
|
2669
|
+
'data-compact': props && props.compact === true ? 'true' : 'false',
|
|
2670
|
+
'data-attention': items.length > 0 ? 'true' : 'false',
|
|
2671
|
+
'aria-label': t('column.attention'),
|
|
2519
2672
|
},
|
|
2520
2673
|
h(
|
|
2521
2674
|
'header',
|
|
2522
2675
|
{ className: 'tb-colhead', style: { '--tb-accent': STATUS_ACCENT.needsUser } },
|
|
2523
2676
|
h('span', { className: 'tb-coldot', 'aria-hidden': 'true' }),
|
|
2524
|
-
h('span', { className: 'tb-colname' }, t('column.
|
|
2525
|
-
h('span', { className: 'tb-colcount' }, String(
|
|
2677
|
+
h('span', { className: 'tb-colname' }, t('column.attention')),
|
|
2678
|
+
h('span', { className: 'tb-colcount' }, String(items.length)),
|
|
2526
2679
|
),
|
|
2527
2680
|
h(
|
|
2528
2681
|
'div',
|
|
2529
2682
|
{ className: 'tb-cards' },
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
h(
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
onClick: () => actions.openDetail(task),
|
|
2546
|
-
onKeyDown: (event) => {
|
|
2547
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
2548
|
-
event.preventDefault()
|
|
2549
|
-
actions.openDetail(task)
|
|
2550
|
-
}
|
|
2683
|
+
items.map((item) =>
|
|
2684
|
+
item.kind === 'blocked'
|
|
2685
|
+
? h(Card, {
|
|
2686
|
+
key: 'blocked:' + item.task.id,
|
|
2687
|
+
task: item.task,
|
|
2688
|
+
workspaceLabel: labelOf(item.task),
|
|
2689
|
+
attention: 'blocked',
|
|
2690
|
+
})
|
|
2691
|
+
: h(
|
|
2692
|
+
'article',
|
|
2693
|
+
{
|
|
2694
|
+
key: 'question:' + item.task.id,
|
|
2695
|
+
className: 'tb-card tb-card-fixed tb-needs-card',
|
|
2696
|
+
'data-attention': 'question',
|
|
2697
|
+
style: { '--tb-accent': STATUS_ACCENT.needsUser },
|
|
2551
2698
|
},
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2699
|
+
h(
|
|
2700
|
+
'div',
|
|
2701
|
+
{
|
|
2702
|
+
className: 'tb-card-title tb-card-titlebtn',
|
|
2703
|
+
role: 'button',
|
|
2704
|
+
tabIndex: 0,
|
|
2705
|
+
title: item.task.title,
|
|
2706
|
+
onClick: () => actions.openDetail(item.task),
|
|
2707
|
+
onKeyDown: (event) => {
|
|
2708
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
2709
|
+
event.preventDefault()
|
|
2710
|
+
actions.openDetail(item.task)
|
|
2711
|
+
}
|
|
2712
|
+
},
|
|
2713
|
+
},
|
|
2714
|
+
item.task.title,
|
|
2715
|
+
),
|
|
2716
|
+
h('div', { className: 'tb-needs-card-q', title: item.task.question || '' }, item.task.question || ''),
|
|
2717
|
+
h(WorkspaceTag, {
|
|
2718
|
+
label: labelOf(item.task),
|
|
2719
|
+
empty: !(typeof item.task.cwd === 'string' && item.task.cwd !== ''),
|
|
2720
|
+
path: typeof item.task.cwd === 'string' ? item.task.cwd : '',
|
|
2721
|
+
}),
|
|
2722
|
+
h(
|
|
2723
|
+
'div',
|
|
2724
|
+
{ className: 'tb-card-actions' },
|
|
2725
|
+
h(
|
|
2726
|
+
'button',
|
|
2727
|
+
{ type: 'button', className: 'tb-btn tb-btn-sm tb-btn-primary', onClick: () => actions.openDetail(item.task) },
|
|
2728
|
+
t('needsUser.open'),
|
|
2729
|
+
),
|
|
2730
|
+
),
|
|
2568
2731
|
),
|
|
2569
|
-
),
|
|
2570
|
-
),
|
|
2571
2732
|
),
|
|
2572
2733
|
),
|
|
2573
2734
|
)
|
|
@@ -2582,6 +2743,9 @@ window.__ModuleLoader__.load({
|
|
|
2582
2743
|
const status = task.status
|
|
2583
2744
|
// 工作区标签(v0.2.4):只有平台看板的 Col 传值;右栏看板传空串 → 不渲染。
|
|
2584
2745
|
const workspaceLabel = typeof props.workspaceLabel === 'string' ? props.workspaceLabel : ''
|
|
2746
|
+
// v0.5.3:阻塞卡(doing + lastError)在「待处理」列里多一行警示条 + 首行异常摘要;
|
|
2747
|
+
// 普通四列里的卡片完全不变(异常全文只在详情浮层「最近异常」行)。
|
|
2748
|
+
const attention = props && props.attention === 'blocked'
|
|
2585
2749
|
const hasCwd = typeof task.cwd === 'string' && task.cwd !== ''
|
|
2586
2750
|
const isEditing = editing !== null && editing.id === task.id
|
|
2587
2751
|
const busyKey = 'update:' + task.id
|
|
@@ -2616,6 +2780,13 @@ window.__ModuleLoader__.load({
|
|
|
2616
2780
|
placeholder: t('composer.note'),
|
|
2617
2781
|
onChange: (event) => actions.setEditing(Object.assign({}, editing, { note: event.target.value })),
|
|
2618
2782
|
}),
|
|
2783
|
+
h('input', {
|
|
2784
|
+
className: 'tb-input',
|
|
2785
|
+
value: typeof editing.dependsOn === 'string' ? editing.dependsOn : '',
|
|
2786
|
+
placeholder: t('composer.dependsOn'),
|
|
2787
|
+
'aria-label': t('composer.dependsOn'),
|
|
2788
|
+
onChange: (event) => actions.setEditing(Object.assign({}, editing, { dependsOn: event.target.value })),
|
|
2789
|
+
}),
|
|
2619
2790
|
h(
|
|
2620
2791
|
'div',
|
|
2621
2792
|
{ className: 'tb-edit-actions' },
|
|
@@ -2667,7 +2838,15 @@ window.__ModuleLoader__.load({
|
|
|
2667
2838
|
|
|
2668
2839
|
return h(
|
|
2669
2840
|
'article',
|
|
2670
|
-
{
|
|
2841
|
+
{
|
|
2842
|
+
className: 'tb-card tb-card-fixed',
|
|
2843
|
+
'data-subtask': typeof task.parentTaskId === 'string' && task.parentTaskId !== '' ? 'true' : undefined,
|
|
2844
|
+
// v0.5.2:异常可见化——lastError 非空时挂小红点(纯 CSS ::after,不改卡片布局)。
|
|
2845
|
+
'data-lasterror': typeof task.lastError === 'string' && task.lastError !== '' ? 'true' : undefined,
|
|
2846
|
+
// v0.5.3:阻塞卡在「待处理」列里带警示色左缘 + 异常摘要(data-attention=blocked)。
|
|
2847
|
+
'data-attention': attention ? 'blocked' : undefined,
|
|
2848
|
+
style: { '--tb-accent': STATUS_ACCENT[status] },
|
|
2849
|
+
},
|
|
2671
2850
|
h(
|
|
2672
2851
|
'div',
|
|
2673
2852
|
{
|
|
@@ -2686,6 +2865,15 @@ window.__ModuleLoader__.load({
|
|
|
2686
2865
|
},
|
|
2687
2866
|
task.title,
|
|
2688
2867
|
),
|
|
2868
|
+
// v0.5.3 阻塞卡:警示标签 + lastError 首行摘要(单行省略,title 兜全文,完整文本看详情「最近异常」)。
|
|
2869
|
+
attention
|
|
2870
|
+
? h(
|
|
2871
|
+
'div',
|
|
2872
|
+
{ className: 'tb-card-attn' },
|
|
2873
|
+
h('span', { className: 'tb-card-attn-label' }, t('attention.blocked')),
|
|
2874
|
+
h('span', { className: 'tb-card-attn-text', title: task.lastError || '' }, lastErrorSummary(task.lastError)),
|
|
2875
|
+
)
|
|
2876
|
+
: null,
|
|
2689
2877
|
// 工作区标签放在标题与操作行之间(副标题位):不挤标题的 2 行高度,
|
|
2690
2878
|
// 单行省略;cwd 为空时显示「—」占位。
|
|
2691
2879
|
h(WorkspaceTag, { label: workspaceLabel, empty: !hasCwd, path: hasCwd ? task.cwd : '' }),
|
|
@@ -2730,8 +2918,33 @@ window.__ModuleLoader__.load({
|
|
|
2730
2918
|
const answerDraft = typeof bind.answerDraft === 'string' ? bind.answerDraft : ''
|
|
2731
2919
|
const answerError = typeof bind.answerError === 'string' ? bind.answerError : ''
|
|
2732
2920
|
const answerBusyKey = 'answer:' + task.id
|
|
2921
|
+
const boardAllTasks = Array.isArray(bind.allTasks) ? bind.allTasks : []
|
|
2922
|
+
const parentTaskId = typeof task.parentTaskId === 'string' ? task.parentTaskId : ''
|
|
2923
|
+
const parentTask =
|
|
2924
|
+
parentTaskId !== '' ? boardAllTasks.find((item) => item && item.id === parentTaskId) || null : null
|
|
2925
|
+
const subtasks = boardAllTasks.filter((item) => item && item.parentTaskId === task.id)
|
|
2926
|
+
const subtasksDone = subtasks.filter(
|
|
2927
|
+
(item) => item.status === 'done' || item.status === 'archived',
|
|
2928
|
+
).length
|
|
2929
|
+
const dependsList = Array.isArray(task.dependsOn) ? task.dependsOn : []
|
|
2930
|
+
const dependsItems = dependsList.map((depId) => {
|
|
2931
|
+
const found = boardAllTasks.find((item) => item && item.id === depId) || null
|
|
2932
|
+
return {
|
|
2933
|
+
id: depId,
|
|
2934
|
+
task: found,
|
|
2935
|
+
satisfied: !found || found.status === 'done' || found.status === 'archived',
|
|
2936
|
+
}
|
|
2937
|
+
})
|
|
2938
|
+
const dependsDone = dependsItems.filter((entry) => entry.satisfied).length
|
|
2733
2939
|
const metaRows = [
|
|
2734
2940
|
[t('detail.workspace'), task.cwd || '—'],
|
|
2941
|
+
...(typeof task.worktreePath === 'string' && task.worktreePath !== ''
|
|
2942
|
+
? [[t('detail.worktree'), (task.worktreeBranch ? task.worktreeBranch + ' · ' : '') + task.worktreePath]]
|
|
2943
|
+
: []),
|
|
2944
|
+
// v0.5.2:基本信息里也给出「最近异常」(完整文本仍在下方「最近错误」区)。
|
|
2945
|
+
...(typeof task.lastError === 'string' && task.lastError !== ''
|
|
2946
|
+
? [[t('detail.lastError'), task.lastError]]
|
|
2947
|
+
: []),
|
|
2735
2948
|
[t('detail.lead'), taskLeadLabel(task) || t('detail.noLead')],
|
|
2736
2949
|
[t('detail.assignee'), task.assignee || t('detail.assigneeAuto')],
|
|
2737
2950
|
[t('detail.source'), task.source === 'agent' ? t('detail.sourceAgent') : t('detail.sourceUser')],
|
|
@@ -2793,6 +3006,20 @@ window.__ModuleLoader__.load({
|
|
|
2793
3006
|
{ className: 'tb-detail-badges' },
|
|
2794
3007
|
h('span', { className: 'tb-statusbadge', 'data-status': task.status }, t('column.' + task.status)),
|
|
2795
3008
|
h('span', { className: 'tb-detail-chip' }, task.id),
|
|
3009
|
+
parentTaskId !== ''
|
|
3010
|
+
? parentTask
|
|
3011
|
+
? h(
|
|
3012
|
+
'button',
|
|
3013
|
+
{
|
|
3014
|
+
type: 'button',
|
|
3015
|
+
className: 'tb-detail-chip tb-detail-parent',
|
|
3016
|
+
title: parentTask.title || parentTaskId,
|
|
3017
|
+
onClick: () => bind.actions.openDetail(parentTask),
|
|
3018
|
+
},
|
|
3019
|
+
t('detail.parentTask', { id: parentTaskId }),
|
|
3020
|
+
)
|
|
3021
|
+
: h('span', { className: 'tb-detail-chip' }, t('detail.parentTask', { id: parentTaskId }))
|
|
3022
|
+
: null,
|
|
2796
3023
|
h(
|
|
2797
3024
|
'span',
|
|
2798
3025
|
{ className: 'tb-detail-chip' },
|
|
@@ -2907,6 +3134,77 @@ window.__ModuleLoader__.load({
|
|
|
2907
3134
|
task.note ? renderRichText(task.note, richOptions) : t('detail.emptyNote'),
|
|
2908
3135
|
),
|
|
2909
3136
|
),
|
|
3137
|
+
dependsItems.length > 0
|
|
3138
|
+
? h(
|
|
3139
|
+
'section',
|
|
3140
|
+
{ className: 'tb-detail-section tb-detail-depends' },
|
|
3141
|
+
h(
|
|
3142
|
+
'h3',
|
|
3143
|
+
{ className: 'tb-detail-sub' },
|
|
3144
|
+
t('detail.dependsOn', { done: dependsDone, total: dependsItems.length }),
|
|
3145
|
+
),
|
|
3146
|
+
h(
|
|
3147
|
+
'div',
|
|
3148
|
+
{ className: 'tb-subtasks' },
|
|
3149
|
+
dependsItems.map((entry) =>
|
|
3150
|
+
entry.task
|
|
3151
|
+
? h(
|
|
3152
|
+
'button',
|
|
3153
|
+
{
|
|
3154
|
+
key: entry.id,
|
|
3155
|
+
type: 'button',
|
|
3156
|
+
className: 'tb-subtask-item',
|
|
3157
|
+
title: entry.task.title || entry.id,
|
|
3158
|
+
onClick: () => bind.actions.openDetail(entry.task),
|
|
3159
|
+
},
|
|
3160
|
+
h(
|
|
3161
|
+
'span',
|
|
3162
|
+
{ className: 'tb-statusbadge', 'data-status': entry.task.status },
|
|
3163
|
+
t('column.' + entry.task.status),
|
|
3164
|
+
),
|
|
3165
|
+
h('span', { className: 'tb-detail-chip' }, entry.id),
|
|
3166
|
+
h('span', { className: 'tb-subtask-title' }, entry.task.title || ''),
|
|
3167
|
+
)
|
|
3168
|
+
: h(
|
|
3169
|
+
'div',
|
|
3170
|
+
{ key: entry.id, className: 'tb-subtask-item' },
|
|
3171
|
+
h('span', { className: 'tb-statusbadge', 'data-status': 'archived' }, t('detail.dependsPruned')),
|
|
3172
|
+
h('span', { className: 'tb-detail-chip' }, entry.id),
|
|
3173
|
+
),
|
|
3174
|
+
),
|
|
3175
|
+
),
|
|
3176
|
+
)
|
|
3177
|
+
: null,
|
|
3178
|
+
subtasks.length > 0
|
|
3179
|
+
? h(
|
|
3180
|
+
'section',
|
|
3181
|
+
{ className: 'tb-detail-section tb-detail-subtasks' },
|
|
3182
|
+
h(
|
|
3183
|
+
'h3',
|
|
3184
|
+
{ className: 'tb-detail-sub' },
|
|
3185
|
+
t('detail.subtasks', { done: subtasksDone, total: subtasks.length }),
|
|
3186
|
+
),
|
|
3187
|
+
h(
|
|
3188
|
+
'div',
|
|
3189
|
+
{ className: 'tb-subtasks' },
|
|
3190
|
+
subtasks.map((sub) =>
|
|
3191
|
+
h(
|
|
3192
|
+
'button',
|
|
3193
|
+
{
|
|
3194
|
+
key: sub.id,
|
|
3195
|
+
type: 'button',
|
|
3196
|
+
className: 'tb-subtask-item',
|
|
3197
|
+
title: sub.title || sub.id,
|
|
3198
|
+
onClick: () => bind.actions.openDetail(sub),
|
|
3199
|
+
},
|
|
3200
|
+
h('span', { className: 'tb-statusbadge', 'data-status': sub.status }, t('column.' + sub.status)),
|
|
3201
|
+
h('span', { className: 'tb-detail-chip' }, sub.id),
|
|
3202
|
+
h('span', { className: 'tb-subtask-title' }, sub.title || ''),
|
|
3203
|
+
),
|
|
3204
|
+
),
|
|
3205
|
+
),
|
|
3206
|
+
)
|
|
3207
|
+
: null,
|
|
2910
3208
|
h(
|
|
2911
3209
|
'section',
|
|
2912
3210
|
{ className: 'tb-detail-section' },
|
|
@@ -3141,7 +3439,156 @@ window.__ModuleLoader__.load({
|
|
|
3141
3439
|
return h('div', { className: 'tb-leads', role: 'group', 'aria-label': t('lead.barLabel') }, cells)
|
|
3142
3440
|
}
|
|
3143
3441
|
|
|
3144
|
-
|
|
3442
|
+
/** 看板顶部可折叠「设置」面板(v0.3.6,两块看板共用):配置归档任务自动删除分钟数。 */
|
|
3443
|
+
function SettingsPanel() {
|
|
3444
|
+
if (!bind.showSettings) return null
|
|
3445
|
+
const t = bind.t
|
|
3446
|
+
const busyNow = bind.busy !== ''
|
|
3447
|
+
const actions = bind.actions
|
|
3448
|
+
const cfg = bind.config || {}
|
|
3449
|
+
const currentMinutes =
|
|
3450
|
+
typeof cfg.archiveRetentionMinutes === 'number' && Number.isFinite(cfg.archiveRetentionMinutes)
|
|
3451
|
+
? cfg.archiveRetentionMinutes
|
|
3452
|
+
: 30
|
|
3453
|
+
const draft = typeof bind.retentionDraft === 'string' ? bind.retentionDraft : String(currentMinutes)
|
|
3454
|
+
return h(
|
|
3455
|
+
'section',
|
|
3456
|
+
{ className: 'tb-settings', role: 'region', 'aria-label': t('settings.title') },
|
|
3457
|
+
h(
|
|
3458
|
+
'div',
|
|
3459
|
+
{ className: 'tb-settings-head' },
|
|
3460
|
+
h(
|
|
3461
|
+
'div',
|
|
3462
|
+
{ style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap' } },
|
|
3463
|
+
h('h2', { className: 'tb-settings-title' }, t('settings.title')),
|
|
3464
|
+
h(
|
|
3465
|
+
'span',
|
|
3466
|
+
{ className: 'tb-settings-badge' },
|
|
3467
|
+
currentMinutes === 0 ? t('settings.archiveCurrentNever') : t('settings.archiveCurrent', { m: currentMinutes }),
|
|
3468
|
+
),
|
|
3469
|
+
),
|
|
3470
|
+
h(
|
|
3471
|
+
'button',
|
|
3472
|
+
{
|
|
3473
|
+
type: 'button',
|
|
3474
|
+
className: 'tb-detail-close',
|
|
3475
|
+
onClick: () => actions.setShowSettings(false),
|
|
3476
|
+
'aria-label': t('detail.close'),
|
|
3477
|
+
},
|
|
3478
|
+
'\u00d7',
|
|
3479
|
+
),
|
|
3480
|
+
),
|
|
3481
|
+
h(
|
|
3482
|
+
'div',
|
|
3483
|
+
{ className: 'tb-settings-body' },
|
|
3484
|
+
h(
|
|
3485
|
+
'div',
|
|
3486
|
+
{ className: 'tb-settings-row' },
|
|
3487
|
+
h(
|
|
3488
|
+
'label',
|
|
3489
|
+
{ className: 'tb-settings-field' },
|
|
3490
|
+
h('span', { className: 'tb-settings-label' }, t('poll.interval')),
|
|
3491
|
+
h(
|
|
3492
|
+
'select',
|
|
3493
|
+
{
|
|
3494
|
+
className: 'tb-select',
|
|
3495
|
+
value: String(cfg.pollIntervalMs || 15000),
|
|
3496
|
+
disabled: busyNow,
|
|
3497
|
+
'aria-label': t('poll.interval'),
|
|
3498
|
+
onChange: (event) => actions.setConfig({ pollIntervalMs: Number(event.target.value) }),
|
|
3499
|
+
},
|
|
3500
|
+
[5000, 15000, 30000, 60000].map((ms) => h('option', { key: ms, value: String(ms) }, fmtInterval(ms))),
|
|
3501
|
+
),
|
|
3502
|
+
),
|
|
3503
|
+
h(
|
|
3504
|
+
'label',
|
|
3505
|
+
{ className: 'tb-settings-field' },
|
|
3506
|
+
h('span', { className: 'tb-settings-label' }, t('dispatch.mode')),
|
|
3507
|
+
h(
|
|
3508
|
+
'select',
|
|
3509
|
+
{
|
|
3510
|
+
className: 'tb-select',
|
|
3511
|
+
value: dispatchModeOf(cfg),
|
|
3512
|
+
disabled: busyNow,
|
|
3513
|
+
title: t('dispatch.modeHint'),
|
|
3514
|
+
'aria-label': t('dispatch.mode'),
|
|
3515
|
+
onChange: (event) => actions.setConfig({ dispatchMode: event.target.value }),
|
|
3516
|
+
},
|
|
3517
|
+
DISPATCH_MODES.map((mode) => h('option', { key: mode, value: mode }, t('dispatch.mode.' + mode))),
|
|
3518
|
+
),
|
|
3519
|
+
),
|
|
3520
|
+
h(
|
|
3521
|
+
'div',
|
|
3522
|
+
{ className: 'tb-settings-field' },
|
|
3523
|
+
h('span', { className: 'tb-settings-label' }, t('settings.worktreeIsolation')),
|
|
3524
|
+
h(
|
|
3525
|
+
'button',
|
|
3526
|
+
{
|
|
3527
|
+
type: 'button',
|
|
3528
|
+
className: 'tb-btn tb-btn-sm' + (cfg.worktreeIsolation !== false ? ' tb-btn-primary' : ''),
|
|
3529
|
+
disabled: busyNow,
|
|
3530
|
+
title: t('settings.worktreeHint'),
|
|
3531
|
+
'aria-label': t('settings.worktreeIsolation'),
|
|
3532
|
+
onClick: () => actions.setConfig({ worktreeIsolation: cfg.worktreeIsolation === false }),
|
|
3533
|
+
},
|
|
3534
|
+
cfg.worktreeIsolation !== false ? t('settings.worktreeOn') : t('settings.worktreeOff'),
|
|
3535
|
+
),
|
|
3536
|
+
),
|
|
3537
|
+
),
|
|
3538
|
+
h('div', { className: 'tb-settings-label' }, t('settings.archiveRetention')),
|
|
3539
|
+
h('p', { className: 'tb-settings-hint' }, t('settings.archiveRetentionHint')),
|
|
3540
|
+
h(
|
|
3541
|
+
'div',
|
|
3542
|
+
{ className: 'tb-settings-presets' },
|
|
3543
|
+
ARCHIVE_RETENTION_PRESETS.map((m) =>
|
|
3544
|
+
h(
|
|
3545
|
+
'button',
|
|
3546
|
+
{
|
|
3547
|
+
key: String(m),
|
|
3548
|
+
type: 'button',
|
|
3549
|
+
className: 'tb-btn tb-btn-sm' + (currentMinutes === m ? ' tb-btn-primary' : ''),
|
|
3550
|
+
disabled: busyNow,
|
|
3551
|
+
onClick: () => actions.saveArchiveRetention(m),
|
|
3552
|
+
},
|
|
3553
|
+
m === 0 ? t('settings.archiveNever') : t('settings.minutes', { m }),
|
|
3554
|
+
),
|
|
3555
|
+
),
|
|
3556
|
+
),
|
|
3557
|
+
h(
|
|
3558
|
+
'div',
|
|
3559
|
+
{ className: 'tb-settings-custom' },
|
|
3560
|
+
h('input', {
|
|
3561
|
+
type: 'number',
|
|
3562
|
+
min: 0,
|
|
3563
|
+
max: 10080,
|
|
3564
|
+
className: 'tb-input tb-settings-input',
|
|
3565
|
+
value: draft,
|
|
3566
|
+
'aria-label': t('settings.archiveRetention'),
|
|
3567
|
+
onChange: (event) => actions.setRetentionDraft(event.target.value),
|
|
3568
|
+
onKeyDown: (event) => {
|
|
3569
|
+
if (event.key === 'Enter') {
|
|
3570
|
+
event.preventDefault()
|
|
3571
|
+
actions.saveArchiveRetention()
|
|
3572
|
+
}
|
|
3573
|
+
},
|
|
3574
|
+
}),
|
|
3575
|
+
h('span', { className: 'tb-settings-unit' }, t('settings.minutesUnit')),
|
|
3576
|
+
h(
|
|
3577
|
+
'button',
|
|
3578
|
+
{
|
|
3579
|
+
type: 'button',
|
|
3580
|
+
className: 'tb-btn tb-btn-sm tb-btn-primary',
|
|
3581
|
+
disabled: busyNow || String(draft).trim() === '',
|
|
3582
|
+
onClick: () => actions.saveArchiveRetention(),
|
|
3583
|
+
},
|
|
3584
|
+
t('settings.save'),
|
|
3585
|
+
),
|
|
3586
|
+
),
|
|
3587
|
+
),
|
|
3588
|
+
)
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3591
|
+
return { Banner, Col, Detail, LeadBar, NeedsColumn, SettingsPanel, sessionCandidatesOf }
|
|
3145
3592
|
}
|
|
3146
3593
|
|
|
3147
3594
|
/* ── 看板页 ─────────────────────────────────────────────── */
|
|
@@ -3183,7 +3630,12 @@ window.__ModuleLoader__.load({
|
|
|
3183
3630
|
const [notice, setNotice] = useState(null)
|
|
3184
3631
|
const [title, setTitle] = useState('')
|
|
3185
3632
|
const [note, setNote] = useState('')
|
|
3633
|
+
const [dependsDraft, setDependsDraft] = useState('')
|
|
3186
3634
|
const [showNote, setShowNote] = useState(false)
|
|
3635
|
+
const [showSettings, setShowSettings] = useState(false)
|
|
3636
|
+
const [retentionDraft, setRetentionDraft] = useState('30')
|
|
3637
|
+
// v0.5.4:「已归档」列默认隐藏,顶部按钮切换(组件本地 state,不写 config)。
|
|
3638
|
+
const [showArchive, setShowArchive] = useState(false)
|
|
3187
3639
|
// v0.2.0:待提交的粘贴图片({id, preview, ...})与详情浮层的附件 data URL 缓存。
|
|
3188
3640
|
const [attachments, setAttachments] = useState([])
|
|
3189
3641
|
// 上传中的请求计数(不是布尔):连续多次粘贴时,只有全部结束才解除提交禁用。
|
|
@@ -3279,11 +3731,18 @@ window.__ModuleLoader__.load({
|
|
|
3279
3731
|
// 右栏 = 本工作区看板:只显示 cwd 与当前工作区相同(归一化比较)的任务;
|
|
3280
3732
|
// 工作区未知(历史会话 / 缺 cwd)时给说明条并显示空看板。
|
|
3281
3733
|
const workspaceTitle = cwdForHint ? workspaceTitleOf(workspaces, cwdForHint) : ''
|
|
3282
|
-
// v0.2.2(§1.9
|
|
3283
|
-
//
|
|
3734
|
+
// v0.2.2(§1.9)/ v0.5.4:提问卡 + 阻塞卡统一进「待处理」列(与平台看板同一口径),
|
|
3735
|
+
// 不再有顶部固定条,也不在普通状态列 / lane 里重复。
|
|
3284
3736
|
const workspaceTasks = tasksForWorkspace(allTasks, cwdForHint, sessionId)
|
|
3285
|
-
const
|
|
3286
|
-
const
|
|
3737
|
+
const attention = attentionTasks(workspaceTasks)
|
|
3738
|
+
const attentionPlain = withoutAttention(workspaceTasks)
|
|
3739
|
+
// v0.5.4:「已归档」列默认隐藏,顶部按钮切换(状态只在本组件,不写 config)。
|
|
3740
|
+
const archivedCount = attentionPlain.filter((task) => task && task.status === 'archived').length
|
|
3741
|
+
const tasks = showArchive
|
|
3742
|
+
? attentionPlain
|
|
3743
|
+
: attentionPlain.filter((task) => !task || task.status !== 'archived')
|
|
3744
|
+
// 这里的 plainTasks 只服务「组长对话」兜底与「无归属任务」提示,不是渲染用的列数据
|
|
3745
|
+
// (列数据是上面的 attention / tasks,已按「待处理」列口径扣掉提问卡 + 阻塞卡)。
|
|
3287
3746
|
const plainTasks = withoutNeedsUser(allTasks)
|
|
3288
3747
|
// 有些旧任务/别的会话建的任务没有 cwd,本面板按设计不显示;给个去处,避免「任务凭空消失」。
|
|
3289
3748
|
const detailTask = detailId ? allTasks.find((task) => task && task.id === detailId) || null : null
|
|
@@ -3294,11 +3753,13 @@ window.__ModuleLoader__.load({
|
|
|
3294
3753
|
(task) => task && !task.cwd && task.status !== 'archived' && task.sessionId !== sessionId,
|
|
3295
3754
|
).length
|
|
3296
3755
|
const groups = groupTasks(tasks)
|
|
3756
|
+
// v0.5.4:隐藏归档时连「已归档」列一起不渲染(不留空列)。
|
|
3757
|
+
const visibleStatuses = showArchive ? STATUS_ORDER : STATUS_ORDER.filter((status) => status !== 'archived')
|
|
3297
3758
|
const preset = (snap && snap.preset) || null
|
|
3298
3759
|
// v0.2.0 组长条:leads 是运行时视图(组长启停 / 忙闲不 bump revision),每次渲染都读最新值;
|
|
3299
|
-
//
|
|
3760
|
+
// 右栏只列当前看板可见任务(含待你处理)涉及的工作区,没组长的补「创建组长」入口。
|
|
3300
3761
|
const leads = (snap && snap.leads) || null
|
|
3301
|
-
const leadRows = workspaceLeadRows(leads, taskWorkspaceCwds(
|
|
3762
|
+
const leadRows = workspaceLeadRows(leads, taskWorkspaceCwds(workspaceTasks, cwdForHint), { all: false })
|
|
3302
3763
|
|
|
3303
3764
|
/** 统一执行一次写操作:忙态 + 错误提示 + 成功后刷新。 */
|
|
3304
3765
|
const run = useCallback(
|
|
@@ -3336,11 +3797,13 @@ window.__ModuleLoader__.load({
|
|
|
3336
3797
|
}
|
|
3337
3798
|
const payload = { title: trimmedTitle }
|
|
3338
3799
|
if (note.trim() !== '') payload.note = note.trim()
|
|
3800
|
+
if (dependsDraft.trim() !== '') payload.dependsOn = dependsDraft.trim()
|
|
3339
3801
|
if (sessionId !== '') payload.sessionId = sessionId
|
|
3340
3802
|
run('add', () => callRpc('add-task', payload)).then((value) => {
|
|
3341
3803
|
if (!value) return
|
|
3342
3804
|
setTitle('')
|
|
3343
3805
|
setNote('')
|
|
3806
|
+
setDependsDraft('')
|
|
3344
3807
|
setShowNote(false)
|
|
3345
3808
|
setAttachments([])
|
|
3346
3809
|
})
|
|
@@ -3377,6 +3840,41 @@ window.__ModuleLoader__.load({
|
|
|
3377
3840
|
})
|
|
3378
3841
|
}
|
|
3379
3842
|
|
|
3843
|
+
function dispatchAll(todos) {
|
|
3844
|
+
const items = Array.isArray(todos) ? todos.filter((task) => task && task.status === 'todo') : []
|
|
3845
|
+
if (items.length === 0) return
|
|
3846
|
+
if (items.length === 1) {
|
|
3847
|
+
dispatchNow(items[0])
|
|
3848
|
+
return
|
|
3849
|
+
}
|
|
3850
|
+
run('dispatchAll', async () => {
|
|
3851
|
+
let lastRes = { ok: true, value: null }
|
|
3852
|
+
let lastDispatched = null
|
|
3853
|
+
for (const task of items) {
|
|
3854
|
+
const res = await callRpc('dispatch-now', { id: task.id })
|
|
3855
|
+
lastRes = res
|
|
3856
|
+
if (!res.ok) return res
|
|
3857
|
+
if (res.value && res.value.dispatched) lastDispatched = res.value
|
|
3858
|
+
}
|
|
3859
|
+
return lastDispatched ? { ok: true, value: lastDispatched } : lastRes
|
|
3860
|
+
}).then((value) => {
|
|
3861
|
+
if (!value) return
|
|
3862
|
+
if (value.dispatched) {
|
|
3863
|
+
setNotice({ tone: 'ok', text: t('action.dispatched', { session: shortSession(value.sessionId) }) })
|
|
3864
|
+
} else {
|
|
3865
|
+
const reason = (poll && poll.lastSkipReason) || value.reason || ''
|
|
3866
|
+
setNotice({ tone: 'warn', text: t('poll.skip.' + reason) === 'poll.skip.' + reason ? reason : t('poll.skip.' + reason) })
|
|
3867
|
+
}
|
|
3868
|
+
})
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
function refreshNow() {
|
|
3872
|
+
setBusy('refresh')
|
|
3873
|
+
refresh().finally(() => {
|
|
3874
|
+
if (aliveRef.current) setBusy('')
|
|
3875
|
+
})
|
|
3876
|
+
}
|
|
3877
|
+
|
|
3380
3878
|
/**
|
|
3381
3879
|
* v0.2.2(§1.9):提交回答。不用 run():错误要显示在详情浮层的回答区(而不是顶部条),
|
|
3382
3880
|
* 失败时不关闭浮层、不丢输入;成功后关闭浮层、清草稿并刷新看板。
|
|
@@ -3412,6 +3910,25 @@ window.__ModuleLoader__.load({
|
|
|
3412
3910
|
run('config', () => callRpc('set-config', patch))
|
|
3413
3911
|
}
|
|
3414
3912
|
|
|
3913
|
+
function toggleSettings() {
|
|
3914
|
+
const currentMinutes =
|
|
3915
|
+
config && typeof config.archiveRetentionMinutes === 'number' ? config.archiveRetentionMinutes : 30
|
|
3916
|
+
if (!showSettings) setRetentionDraft(String(currentMinutes))
|
|
3917
|
+
setShowSettings(!showSettings)
|
|
3918
|
+
}
|
|
3919
|
+
|
|
3920
|
+
function saveArchiveRetention(rawMinutes) {
|
|
3921
|
+
const raw = rawMinutes !== undefined ? String(rawMinutes) : String(retentionDraft || '').trim()
|
|
3922
|
+
const parsed = Number(raw)
|
|
3923
|
+
if (raw === '' || !Number.isFinite(parsed) || parsed < 0 || parsed > 10080) {
|
|
3924
|
+
setNotice({ tone: 'warn', text: t('settings.archiveInvalid') })
|
|
3925
|
+
return
|
|
3926
|
+
}
|
|
3927
|
+
const minutes = Math.round(parsed)
|
|
3928
|
+
setRetentionDraft(String(minutes))
|
|
3929
|
+
run('config', () => callRpc('set-config', { archiveRetentionMinutes: minutes }), t('settings.saved'))
|
|
3930
|
+
}
|
|
3931
|
+
|
|
3415
3932
|
function archiveDone() {
|
|
3416
3933
|
run('archiveDone', () => callRpc('archive-done', {})).then((value) => {
|
|
3417
3934
|
if (value && value.archived > 0) setNotice({ tone: 'ok', text: t('action.archived', { n: value.archived }) })
|
|
@@ -3419,7 +3936,14 @@ window.__ModuleLoader__.load({
|
|
|
3419
3936
|
}
|
|
3420
3937
|
|
|
3421
3938
|
function startEdit(task) {
|
|
3422
|
-
|
|
3939
|
+
const initialDependsOn = Array.isArray(task.dependsOn) ? task.dependsOn.join(', ') : ''
|
|
3940
|
+
setEditing({
|
|
3941
|
+
id: task.id,
|
|
3942
|
+
title: task.title,
|
|
3943
|
+
note: task.note || '',
|
|
3944
|
+
dependsOn: initialDependsOn,
|
|
3945
|
+
initialDependsOn,
|
|
3946
|
+
})
|
|
3423
3947
|
}
|
|
3424
3948
|
|
|
3425
3949
|
function saveEdit() {
|
|
@@ -3435,7 +3959,13 @@ window.__ModuleLoader__.load({
|
|
|
3435
3959
|
setNotice({ tone: 'error', text: limitText })
|
|
3436
3960
|
return
|
|
3437
3961
|
}
|
|
3438
|
-
|
|
3962
|
+
const patch = { title: trimmedTitle, note: String(editing.note || '').trim() }
|
|
3963
|
+
const rawDeps = String(editing.dependsOn || '').trim()
|
|
3964
|
+
const initDeps = String(editing.initialDependsOn || '').trim()
|
|
3965
|
+
if (rawDeps !== initDeps) {
|
|
3966
|
+
patch.dependsOn = rawDeps === '' ? [] : rawDeps
|
|
3967
|
+
}
|
|
3968
|
+
updateTask(editing.id, patch)
|
|
3439
3969
|
setEditing(null)
|
|
3440
3970
|
}
|
|
3441
3971
|
|
|
@@ -3522,6 +4052,7 @@ window.__ModuleLoader__.load({
|
|
|
3522
4052
|
const boardActions = {
|
|
3523
4053
|
updateTask,
|
|
3524
4054
|
dispatchNow,
|
|
4055
|
+
dispatchAll,
|
|
3525
4056
|
removeTask,
|
|
3526
4057
|
requestDelete,
|
|
3527
4058
|
isConfirmingDelete: (id) => confirmDeleteId === id,
|
|
@@ -3550,6 +4081,11 @@ window.__ModuleLoader__.load({
|
|
|
3550
4081
|
// v0.2.2「待你处理」:回答草稿由看板持有,浮层通过 bind.actions 读写。
|
|
3551
4082
|
setAnswerDraft,
|
|
3552
4083
|
submitAnswer,
|
|
4084
|
+
setConfig,
|
|
4085
|
+
toggleSettings,
|
|
4086
|
+
setShowSettings,
|
|
4087
|
+
setRetentionDraft,
|
|
4088
|
+
saveArchiveRetention,
|
|
3553
4089
|
}
|
|
3554
4090
|
if (boardBindRef.current === null) {
|
|
3555
4091
|
boardBindRef.current = {
|
|
@@ -3577,8 +4113,11 @@ window.__ModuleLoader__.load({
|
|
|
3577
4113
|
boardBindRef.current.leadRows = leadRows
|
|
3578
4114
|
boardBindRef.current.currentSessionId = sessionId
|
|
3579
4115
|
boardBindRef.current.leadActions = leadActions
|
|
3580
|
-
// v0.2.2
|
|
3581
|
-
boardBindRef.current.
|
|
4116
|
+
// v0.2.2「待处理」:回答草稿(每次渲染都刷新;v0.5.4 起无顶部条,任务列表直接从 bind.allTasks 派生)。
|
|
4117
|
+
boardBindRef.current.allTasks = allTasks
|
|
4118
|
+
boardBindRef.current.config = config
|
|
4119
|
+
boardBindRef.current.showSettings = showSettings
|
|
4120
|
+
boardBindRef.current.retentionDraft = retentionDraft
|
|
3582
4121
|
boardBindRef.current.answerDraft = answerDraft
|
|
3583
4122
|
boardBindRef.current.answerError = answerError
|
|
3584
4123
|
if (boardPiecesRef.current === null) boardPiecesRef.current = createBoardPieces(boardBindRef.current)
|
|
@@ -3586,8 +4125,8 @@ window.__ModuleLoader__.load({
|
|
|
3586
4125
|
const Col = boardPiecesRef.current.Col
|
|
3587
4126
|
const Detail = boardPiecesRef.current.Detail
|
|
3588
4127
|
const LeadBar = boardPiecesRef.current.LeadBar
|
|
3589
|
-
const NeedsBanner = boardPiecesRef.current.NeedsBanner
|
|
3590
4128
|
const NeedsColumn = boardPiecesRef.current.NeedsColumn
|
|
4129
|
+
const SettingsPanel = boardPiecesRef.current.SettingsPanel
|
|
3591
4130
|
|
|
3592
4131
|
/* ── 顶部状态文案 ─────────────────────────────────────── */
|
|
3593
4132
|
|
|
@@ -3626,22 +4165,6 @@ window.__ModuleLoader__.load({
|
|
|
3626
4165
|
'div',
|
|
3627
4166
|
{ className: 'tb-head-main' },
|
|
3628
4167
|
h('h1', { className: 'tb-title' }, t('page.title')),
|
|
3629
|
-
h('p', { className: 'tb-sub' },
|
|
3630
|
-
h('span', { className: 'tb-dot', 'data-on': config.pollEnabled ? 'true' : 'false', 'aria-hidden': 'true' }),
|
|
3631
|
-
workspaceTitle
|
|
3632
|
-
? h('span', { className: 'tb-wsname' }, t('board.workspaceSuffix', { name: workspaceTitle }))
|
|
3633
|
-
: null,
|
|
3634
|
-
h('span', null, config.pollEnabled ? t('poll.on', { interval: intervalText }) : t('poll.off')),
|
|
3635
|
-
h('span', null, '·'),
|
|
3636
|
-
h('span', null, poll.lastRunAt ? t('poll.lastRun', { time: fmtClock(poll.lastRunAt, lang()) }) : t('poll.never')),
|
|
3637
|
-
poll.lastDispatchAt
|
|
3638
|
-
? h('span', { className: 'tb-optional' }, '· ' + t('poll.lastDispatch', {
|
|
3639
|
-
time: fmtClock(poll.lastDispatchAt, lang()),
|
|
3640
|
-
session: poll.lastDispatchSessionTitle || shortSession(poll.lastDispatchSessionId),
|
|
3641
|
-
}))
|
|
3642
|
-
: null,
|
|
3643
|
-
skipText ? h('span', { style: { color: 'var(--dsw-alias-state-warn-primary)' } }, '· ' + skipText) : null,
|
|
3644
|
-
),
|
|
3645
4168
|
unboundElsewhere > 0
|
|
3646
4169
|
? h('p', { className: 'tb-sub tb-unbound' }, t('board.unboundHint', { n: unboundElsewhere }))
|
|
3647
4170
|
: null,
|
|
@@ -3649,38 +4172,6 @@ window.__ModuleLoader__.load({
|
|
|
3649
4172
|
h(
|
|
3650
4173
|
'div',
|
|
3651
4174
|
{ className: 'tb-head-side' },
|
|
3652
|
-
h(
|
|
3653
|
-
'label',
|
|
3654
|
-
{ className: 'tb-composer-meta', style: { gap: '5px' } },
|
|
3655
|
-
h('span', { className: 'tb-optional' }, t('poll.interval')),
|
|
3656
|
-
h(
|
|
3657
|
-
'select',
|
|
3658
|
-
{
|
|
3659
|
-
className: 'tb-select',
|
|
3660
|
-
value: String(config.pollIntervalMs),
|
|
3661
|
-
disabled: busyNow,
|
|
3662
|
-
onChange: (event) => setConfig({ pollIntervalMs: Number(event.target.value) }),
|
|
3663
|
-
},
|
|
3664
|
-
[5000, 15000, 30000, 60000].map((ms) => h('option', { key: ms, value: String(ms) }, fmtInterval(ms))),
|
|
3665
|
-
),
|
|
3666
|
-
),
|
|
3667
|
-
h(
|
|
3668
|
-
'label',
|
|
3669
|
-
{ className: 'tb-composer-meta', style: { gap: '5px' } },
|
|
3670
|
-
h('span', { className: 'tb-optional' }, t('dispatch.mode')),
|
|
3671
|
-
h(
|
|
3672
|
-
'select',
|
|
3673
|
-
{
|
|
3674
|
-
className: 'tb-select',
|
|
3675
|
-
value: dispatchModeOf(config),
|
|
3676
|
-
disabled: busyNow,
|
|
3677
|
-
title: t('dispatch.modeHint'),
|
|
3678
|
-
'aria-label': t('dispatch.mode'),
|
|
3679
|
-
onChange: (event) => setConfig({ dispatchMode: event.target.value }),
|
|
3680
|
-
},
|
|
3681
|
-
DISPATCH_MODES.map((mode) => h('option', { key: mode, value: mode }, t('dispatch.mode.' + mode))),
|
|
3682
|
-
),
|
|
3683
|
-
),
|
|
3684
4175
|
h(
|
|
3685
4176
|
'button',
|
|
3686
4177
|
{
|
|
@@ -3693,12 +4184,34 @@ window.__ModuleLoader__.load({
|
|
|
3693
4184
|
),
|
|
3694
4185
|
h(
|
|
3695
4186
|
'button',
|
|
3696
|
-
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick:
|
|
4187
|
+
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick: refreshNow },
|
|
3697
4188
|
busy === 'refresh' ? t('page.refreshing') : t('page.refresh'),
|
|
3698
4189
|
),
|
|
4190
|
+
// v0.5.4:归档列默认隐藏,按钮切换(带归档条数;aria-expanded 表达当前是否展开)。
|
|
4191
|
+
h(
|
|
4192
|
+
'button',
|
|
4193
|
+
{
|
|
4194
|
+
type: 'button',
|
|
4195
|
+
className: 'tb-btn' + (showArchive ? ' tb-btn-active' : ''),
|
|
4196
|
+
'aria-expanded': showArchive ? 'true' : 'false',
|
|
4197
|
+
onClick: () => setShowArchive(!showArchive),
|
|
4198
|
+
},
|
|
4199
|
+
t(showArchive ? 'archive.hide' : 'archive.show', { n: archivedCount }),
|
|
4200
|
+
),
|
|
4201
|
+
h(
|
|
4202
|
+
'button',
|
|
4203
|
+
{
|
|
4204
|
+
type: 'button',
|
|
4205
|
+
className: 'tb-btn' + (showSettings ? ' tb-btn-active' : ''),
|
|
4206
|
+
'aria-expanded': showSettings ? 'true' : 'false',
|
|
4207
|
+
onClick: toggleSettings,
|
|
4208
|
+
},
|
|
4209
|
+
t('settings.button'),
|
|
4210
|
+
),
|
|
3699
4211
|
),
|
|
3700
4212
|
),
|
|
3701
4213
|
|
|
4214
|
+
h(SettingsPanel, { key: 'settings' }),
|
|
3702
4215
|
h(LeadBar, { key: 'leads' }),
|
|
3703
4216
|
presetBanner ? h(Banner, { item: presetBanner }) : null,
|
|
3704
4217
|
notice ? h(Banner, { item: notice, onClose: () => setNotice(null) }) : null,
|
|
@@ -3755,6 +4268,15 @@ window.__ModuleLoader__.load({
|
|
|
3755
4268
|
onPaste: onNotePaste,
|
|
3756
4269
|
})
|
|
3757
4270
|
: null,
|
|
4271
|
+
showNote
|
|
4272
|
+
? h('input', {
|
|
4273
|
+
className: 'tb-input',
|
|
4274
|
+
placeholder: t('composer.dependsOn'),
|
|
4275
|
+
'aria-label': t('composer.dependsOn'),
|
|
4276
|
+
value: dependsDraft,
|
|
4277
|
+
onChange: (event) => setDependsDraft(event.target.value),
|
|
4278
|
+
})
|
|
4279
|
+
: null,
|
|
3758
4280
|
attachments.length > 0
|
|
3759
4281
|
? h(
|
|
3760
4282
|
'div',
|
|
@@ -3803,19 +4325,29 @@ window.__ModuleLoader__.load({
|
|
|
3803
4325
|
),
|
|
3804
4326
|
),
|
|
3805
4327
|
|
|
3806
|
-
// v0.
|
|
3807
|
-
|
|
3808
|
-
|
|
4328
|
+
// v0.5.4:提问卡 + 阻塞卡统一进「待处理」列(排在最前、仅非空时渲染),
|
|
4329
|
+
// 不再有顶部固定条;「已归档」列默认隐藏,由顶部按钮切出来(两种布局一致)。
|
|
3809
4330
|
wide
|
|
3810
4331
|
? h(
|
|
3811
4332
|
'div',
|
|
3812
|
-
{
|
|
3813
|
-
|
|
4333
|
+
{
|
|
4334
|
+
className: 'tb-board',
|
|
4335
|
+
'data-layout': layout,
|
|
4336
|
+
'data-needs': attention.length > 0 ? 'true' : 'false',
|
|
4337
|
+
'data-archive': showArchive ? 'true' : 'false',
|
|
4338
|
+
},
|
|
4339
|
+
attention.length > 0 ? h(NeedsColumn, { key: 'attention', items: attention, compact: !wide }) : null,
|
|
4340
|
+
visibleStatuses.map((status) => h(Col, { key: status, status, tasks: groups[status], compact: false })),
|
|
3814
4341
|
)
|
|
3815
4342
|
: h(
|
|
3816
4343
|
'div',
|
|
3817
|
-
{
|
|
3818
|
-
|
|
4344
|
+
{
|
|
4345
|
+
className: 'tb-lanes',
|
|
4346
|
+
'data-needs': attention.length > 0 ? 'true' : 'false',
|
|
4347
|
+
'data-archive': showArchive ? 'true' : 'false',
|
|
4348
|
+
},
|
|
4349
|
+
attention.length > 0 ? h(NeedsColumn, { key: 'attention', items: attention, compact: true }) : null,
|
|
4350
|
+
visibleStatuses.map((status) => h(Col, { key: status, status, tasks: groups[status], compact: true })),
|
|
3819
4351
|
),
|
|
3820
4352
|
|
|
3821
4353
|
h(
|
|
@@ -3997,7 +4529,12 @@ window.__ModuleLoader__.load({
|
|
|
3997
4529
|
const [notice, setNotice] = useState(null)
|
|
3998
4530
|
const [title, setTitle] = useState('')
|
|
3999
4531
|
const [note, setNote] = useState('')
|
|
4532
|
+
const [dependsDraft, setDependsDraft] = useState('')
|
|
4000
4533
|
const [showNote, setShowNote] = useState(false)
|
|
4534
|
+
const [showSettings, setShowSettings] = useState(false)
|
|
4535
|
+
const [retentionDraft, setRetentionDraft] = useState('30')
|
|
4536
|
+
// v0.5.4:「已归档」列默认隐藏,顶部按钮切换(组件本地 state,不写 config)。
|
|
4537
|
+
const [showArchive, setShowArchive] = useState(false)
|
|
4001
4538
|
// v0.2.0:与右栏看板同一套粘贴图片 / 详情附件缓存。
|
|
4002
4539
|
const [attachments, setAttachments] = useState([])
|
|
4003
4540
|
// 上传中的请求计数(不是布尔):连续多次粘贴时,只有全部结束才解除提交禁用。
|
|
@@ -4103,9 +4640,18 @@ window.__ModuleLoader__.load({
|
|
|
4103
4640
|
const workspaceLabelOf = (task) => taskWorkspaceLabel(workspaces, task)
|
|
4104
4641
|
const visibleAll = tasksForFilter(allTasks, activeFilter)
|
|
4105
4642
|
// v0.2.2(§1.9):flagged 任务只进最左第五列,不重复出现在普通四列。
|
|
4106
|
-
|
|
4107
|
-
|
|
4643
|
+
// v0.5.3(§5.1.1):第五列升级为「待处理」派生列——提问卡(needsUser)+ 阻塞卡
|
|
4644
|
+
// (doing + lastError);两类都没有时整列不渲染(看板回四列)。
|
|
4645
|
+
// v0.5.4:「已归档」列默认隐藏,顶部按钮切出来(组件本地 state,不写 config)。
|
|
4646
|
+
const attention = attentionTasks(visibleAll)
|
|
4647
|
+
const attentionPlain = withoutAttention(visibleAll)
|
|
4648
|
+
const archivedCount = attentionPlain.filter((task) => task && task.status === 'archived').length
|
|
4649
|
+
const visibleTasks = showArchive
|
|
4650
|
+
? attentionPlain
|
|
4651
|
+
: attentionPlain.filter((task) => !task || task.status !== 'archived')
|
|
4108
4652
|
const groups = groupTasks(visibleTasks)
|
|
4653
|
+
// v0.5.4:隐藏归档时连「已归档」列一起不渲染(不留空列)。
|
|
4654
|
+
const visibleStatuses = showArchive ? STATUS_ORDER : STATUS_ORDER.filter((status) => status !== 'archived')
|
|
4109
4655
|
const doingAll = withoutNeedsUser(allTasks).filter((task) => task && task.status === 'doing')
|
|
4110
4656
|
const fallbackDispatchSessionId =
|
|
4111
4657
|
poll && poll.lastDispatchSessionId && (poll.lastDispatchTaskId || doingAll.length === 1) ? poll.lastDispatchSessionId : ''
|
|
@@ -4158,10 +4704,12 @@ window.__ModuleLoader__.load({
|
|
|
4158
4704
|
// 用校验后的 activeWorkspaceCwd:选中的工作区被删 / 改名时不会把失效路径写进任务。
|
|
4159
4705
|
const payload = { title: trimmedTitle, cwd: activeWorkspaceCwd }
|
|
4160
4706
|
if (note.trim() !== '') payload.note = note.trim()
|
|
4707
|
+
if (dependsDraft.trim() !== '') payload.dependsOn = dependsDraft.trim()
|
|
4161
4708
|
run('add', () => callRpc('add-task', payload)).then((value) => {
|
|
4162
4709
|
if (!value) return
|
|
4163
4710
|
setTitle('')
|
|
4164
4711
|
setNote('')
|
|
4712
|
+
setDependsDraft('')
|
|
4165
4713
|
setShowNote(false)
|
|
4166
4714
|
setAttachments([])
|
|
4167
4715
|
})
|
|
@@ -4235,6 +4783,41 @@ window.__ModuleLoader__.load({
|
|
|
4235
4783
|
})
|
|
4236
4784
|
}
|
|
4237
4785
|
|
|
4786
|
+
function dispatchAll(todos) {
|
|
4787
|
+
const items = Array.isArray(todos) ? todos.filter((task) => task && task.status === 'todo') : []
|
|
4788
|
+
if (items.length === 0) return
|
|
4789
|
+
if (items.length === 1) {
|
|
4790
|
+
dispatchNow(items[0])
|
|
4791
|
+
return
|
|
4792
|
+
}
|
|
4793
|
+
run('dispatchAll', async () => {
|
|
4794
|
+
let lastRes = { ok: true, value: null }
|
|
4795
|
+
let lastDispatched = null
|
|
4796
|
+
for (const task of items) {
|
|
4797
|
+
const res = await callRpc('dispatch-now', { id: task.id })
|
|
4798
|
+
lastRes = res
|
|
4799
|
+
if (!res.ok) return res
|
|
4800
|
+
if (res.value && res.value.dispatched) lastDispatched = res.value
|
|
4801
|
+
}
|
|
4802
|
+
return lastDispatched ? { ok: true, value: lastDispatched } : lastRes
|
|
4803
|
+
}).then((value) => {
|
|
4804
|
+
if (!value) return
|
|
4805
|
+
if (value.dispatched) {
|
|
4806
|
+
setNotice({ tone: 'ok', text: t('action.dispatched', { session: shortSession(value.sessionId) }) })
|
|
4807
|
+
} else {
|
|
4808
|
+
const reason = (poll && poll.lastSkipReason) || value.reason || ''
|
|
4809
|
+
setNotice({ tone: 'warn', text: t('poll.skip.' + reason) === 'poll.skip.' + reason ? reason : t('poll.skip.' + reason) })
|
|
4810
|
+
}
|
|
4811
|
+
})
|
|
4812
|
+
}
|
|
4813
|
+
|
|
4814
|
+
function refreshNow() {
|
|
4815
|
+
setBusy('refresh')
|
|
4816
|
+
refresh().finally(() => {
|
|
4817
|
+
if (aliveRef.current) setBusy('')
|
|
4818
|
+
})
|
|
4819
|
+
}
|
|
4820
|
+
|
|
4238
4821
|
/**
|
|
4239
4822
|
* v0.2.2(§1.9):提交回答。不用 run():错误要显示在详情浮层的回答区(而不是顶部条),
|
|
4240
4823
|
* 失败时不关闭浮层、不丢输入;成功后关闭浮层、清草稿并刷新看板。
|
|
@@ -4270,6 +4853,25 @@ window.__ModuleLoader__.load({
|
|
|
4270
4853
|
run('config', () => callRpc('set-config', patch))
|
|
4271
4854
|
}
|
|
4272
4855
|
|
|
4856
|
+
function toggleSettings() {
|
|
4857
|
+
const currentMinutes =
|
|
4858
|
+
config && typeof config.archiveRetentionMinutes === 'number' ? config.archiveRetentionMinutes : 30
|
|
4859
|
+
if (!showSettings) setRetentionDraft(String(currentMinutes))
|
|
4860
|
+
setShowSettings(!showSettings)
|
|
4861
|
+
}
|
|
4862
|
+
|
|
4863
|
+
function saveArchiveRetention(rawMinutes) {
|
|
4864
|
+
const raw = rawMinutes !== undefined ? String(rawMinutes) : String(retentionDraft || '').trim()
|
|
4865
|
+
const parsed = Number(raw)
|
|
4866
|
+
if (raw === '' || !Number.isFinite(parsed) || parsed < 0 || parsed > 10080) {
|
|
4867
|
+
setNotice({ tone: 'warn', text: t('settings.archiveInvalid') })
|
|
4868
|
+
return
|
|
4869
|
+
}
|
|
4870
|
+
const minutes = Math.round(parsed)
|
|
4871
|
+
setRetentionDraft(String(minutes))
|
|
4872
|
+
run('config', () => callRpc('set-config', { archiveRetentionMinutes: minutes }), t('settings.saved'))
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4273
4875
|
function archiveDone() {
|
|
4274
4876
|
run('archiveDone', () => callRpc('archive-done', {})).then((value) => {
|
|
4275
4877
|
if (value && value.archived > 0) setNotice({ tone: 'ok', text: t('action.archived', { n: value.archived }) })
|
|
@@ -4277,7 +4879,14 @@ window.__ModuleLoader__.load({
|
|
|
4277
4879
|
}
|
|
4278
4880
|
|
|
4279
4881
|
function startEdit(task) {
|
|
4280
|
-
|
|
4882
|
+
const initialDependsOn = Array.isArray(task.dependsOn) ? task.dependsOn.join(', ') : ''
|
|
4883
|
+
setEditing({
|
|
4884
|
+
id: task.id,
|
|
4885
|
+
title: task.title,
|
|
4886
|
+
note: task.note || '',
|
|
4887
|
+
dependsOn: initialDependsOn,
|
|
4888
|
+
initialDependsOn,
|
|
4889
|
+
})
|
|
4281
4890
|
}
|
|
4282
4891
|
|
|
4283
4892
|
function saveEdit() {
|
|
@@ -4293,7 +4902,13 @@ window.__ModuleLoader__.load({
|
|
|
4293
4902
|
setNotice({ tone: 'error', text: limitText })
|
|
4294
4903
|
return
|
|
4295
4904
|
}
|
|
4296
|
-
|
|
4905
|
+
const patch = { title: trimmedTitle, note: String(editing.note || '').trim() }
|
|
4906
|
+
const rawDeps = String(editing.dependsOn || '').trim()
|
|
4907
|
+
const initDeps = String(editing.initialDependsOn || '').trim()
|
|
4908
|
+
if (rawDeps !== initDeps) {
|
|
4909
|
+
patch.dependsOn = rawDeps === '' ? [] : rawDeps
|
|
4910
|
+
}
|
|
4911
|
+
updateTask(editing.id, patch)
|
|
4297
4912
|
setEditing(null)
|
|
4298
4913
|
}
|
|
4299
4914
|
|
|
@@ -4373,6 +4988,7 @@ window.__ModuleLoader__.load({
|
|
|
4373
4988
|
const boardActions = {
|
|
4374
4989
|
updateTask,
|
|
4375
4990
|
dispatchNow,
|
|
4991
|
+
dispatchAll,
|
|
4376
4992
|
removeTask,
|
|
4377
4993
|
requestDelete,
|
|
4378
4994
|
isConfirmingDelete: (id) => confirmDeleteId === id,
|
|
@@ -4401,6 +5017,11 @@ window.__ModuleLoader__.load({
|
|
|
4401
5017
|
// v0.2.2「待你处理」:回答草稿由看板持有,浮层通过 bind.actions 读写。
|
|
4402
5018
|
setAnswerDraft,
|
|
4403
5019
|
submitAnswer,
|
|
5020
|
+
setConfig,
|
|
5021
|
+
toggleSettings,
|
|
5022
|
+
setShowSettings,
|
|
5023
|
+
setRetentionDraft,
|
|
5024
|
+
saveArchiveRetention,
|
|
4404
5025
|
}
|
|
4405
5026
|
if (boardBindRef.current === null) {
|
|
4406
5027
|
boardBindRef.current = {
|
|
@@ -4428,10 +5049,13 @@ window.__ModuleLoader__.load({
|
|
|
4428
5049
|
boardBindRef.current.leadRows = leadRows
|
|
4429
5050
|
boardBindRef.current.currentSessionId = currentSessionId
|
|
4430
5051
|
boardBindRef.current.leadActions = leadActions
|
|
4431
|
-
// v0.2.2
|
|
5052
|
+
// v0.2.2「待处理」:回答草稿(每次渲染都刷新)。
|
|
4432
5053
|
// 缺了会让平台侧边栏详情浮层的回答框永远读到 '':打字被复位、选项不填、
|
|
4433
5054
|
// 「回复并继续」恒禁用(t-92,v0.2.5 拆分双看板时漏抄的回归)。
|
|
4434
|
-
boardBindRef.current.
|
|
5055
|
+
boardBindRef.current.allTasks = allTasks
|
|
5056
|
+
boardBindRef.current.config = config
|
|
5057
|
+
boardBindRef.current.showSettings = showSettings
|
|
5058
|
+
boardBindRef.current.retentionDraft = retentionDraft
|
|
4435
5059
|
boardBindRef.current.answerDraft = answerDraft
|
|
4436
5060
|
boardBindRef.current.answerError = answerError
|
|
4437
5061
|
if (boardPiecesRef.current === null) boardPiecesRef.current = createBoardPieces(boardBindRef.current)
|
|
@@ -4439,8 +5063,8 @@ window.__ModuleLoader__.load({
|
|
|
4439
5063
|
const Col = boardPiecesRef.current.Col
|
|
4440
5064
|
const Detail = boardPiecesRef.current.Detail
|
|
4441
5065
|
const LeadBar = boardPiecesRef.current.LeadBar
|
|
4442
|
-
const NeedsBanner = boardPiecesRef.current.NeedsBanner
|
|
4443
5066
|
const NeedsColumn = boardPiecesRef.current.NeedsColumn
|
|
5067
|
+
const SettingsPanel = boardPiecesRef.current.SettingsPanel
|
|
4444
5068
|
|
|
4445
5069
|
const intervalText = fmtInterval(config.pollIntervalMs)
|
|
4446
5070
|
const busyNow = busy !== ''
|
|
@@ -4468,51 +5092,10 @@ window.__ModuleLoader__.load({
|
|
|
4468
5092
|
'div',
|
|
4469
5093
|
{ className: 'tb-head-main' },
|
|
4470
5094
|
h('h1', { className: 'tb-title' }, t('platform.title')),
|
|
4471
|
-
h('p', { className: 'tb-sub' },
|
|
4472
|
-
h('span', { className: 'tb-dot', 'data-on': config.pollEnabled ? 'true' : 'false', 'aria-hidden': 'true' }),
|
|
4473
|
-
h('span', null, t('platform.total', { n: allTasks.length })),
|
|
4474
|
-
h('span', null, '·'),
|
|
4475
|
-
h('span', null, config.pollEnabled ? t('poll.on', { interval: intervalText }) : t('poll.off')),
|
|
4476
|
-
h('span', null, '·'),
|
|
4477
|
-
h('span', null, poll.lastRunAt ? t('poll.lastRun', { time: fmtClock(poll.lastRunAt, lang()) }) : t('poll.never')),
|
|
4478
|
-
skipText ? h('span', { style: { color: 'var(--dsw-alias-state-warn-primary)' } }, '· ' + skipText) : null,
|
|
4479
|
-
),
|
|
4480
5095
|
),
|
|
4481
5096
|
h(
|
|
4482
5097
|
'div',
|
|
4483
5098
|
{ className: 'tb-head-side' },
|
|
4484
|
-
h(
|
|
4485
|
-
'label',
|
|
4486
|
-
{ className: 'tb-composer-meta', style: { gap: '5px' } },
|
|
4487
|
-
h('span', null, t('poll.interval')),
|
|
4488
|
-
h(
|
|
4489
|
-
'select',
|
|
4490
|
-
{
|
|
4491
|
-
className: 'tb-select',
|
|
4492
|
-
value: String(config.pollIntervalMs),
|
|
4493
|
-
disabled: busyNow,
|
|
4494
|
-
onChange: (event) => setConfig({ pollIntervalMs: Number(event.target.value) }),
|
|
4495
|
-
},
|
|
4496
|
-
[5000, 15000, 30000, 60000].map((ms) => h('option', { key: ms, value: String(ms) }, fmtInterval(ms))),
|
|
4497
|
-
),
|
|
4498
|
-
),
|
|
4499
|
-
h(
|
|
4500
|
-
'label',
|
|
4501
|
-
{ className: 'tb-composer-meta', style: { gap: '5px' } },
|
|
4502
|
-
h('span', { className: 'tb-optional' }, t('dispatch.mode')),
|
|
4503
|
-
h(
|
|
4504
|
-
'select',
|
|
4505
|
-
{
|
|
4506
|
-
className: 'tb-select',
|
|
4507
|
-
value: dispatchModeOf(config),
|
|
4508
|
-
disabled: busyNow,
|
|
4509
|
-
title: t('dispatch.modeHint'),
|
|
4510
|
-
'aria-label': t('dispatch.mode'),
|
|
4511
|
-
onChange: (event) => setConfig({ dispatchMode: event.target.value }),
|
|
4512
|
-
},
|
|
4513
|
-
DISPATCH_MODES.map((mode) => h('option', { key: mode, value: mode }, t('dispatch.mode.' + mode))),
|
|
4514
|
-
),
|
|
4515
|
-
),
|
|
4516
5099
|
h(
|
|
4517
5100
|
'button',
|
|
4518
5101
|
{
|
|
@@ -4525,7 +5108,7 @@ window.__ModuleLoader__.load({
|
|
|
4525
5108
|
),
|
|
4526
5109
|
h(
|
|
4527
5110
|
'button',
|
|
4528
|
-
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick:
|
|
5111
|
+
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick: refreshNow },
|
|
4529
5112
|
busy === 'refresh' ? t('page.refreshing') : t('platform.refresh'),
|
|
4530
5113
|
),
|
|
4531
5114
|
h(
|
|
@@ -4533,9 +5116,31 @@ window.__ModuleLoader__.load({
|
|
|
4533
5116
|
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'archiveDone', onClick: archiveDone },
|
|
4534
5117
|
t('platform.archiveDone'),
|
|
4535
5118
|
),
|
|
5119
|
+
// v0.5.4:归档列默认隐藏,按钮切换(带归档条数;aria-expanded 表达当前是否展开)。
|
|
5120
|
+
h(
|
|
5121
|
+
'button',
|
|
5122
|
+
{
|
|
5123
|
+
type: 'button',
|
|
5124
|
+
className: 'tb-btn' + (showArchive ? ' tb-btn-active' : ''),
|
|
5125
|
+
'aria-expanded': showArchive ? 'true' : 'false',
|
|
5126
|
+
onClick: () => setShowArchive(!showArchive),
|
|
5127
|
+
},
|
|
5128
|
+
t(showArchive ? 'archive.hide' : 'archive.show', { n: archivedCount }),
|
|
5129
|
+
),
|
|
5130
|
+
h(
|
|
5131
|
+
'button',
|
|
5132
|
+
{
|
|
5133
|
+
type: 'button',
|
|
5134
|
+
className: 'tb-btn' + (showSettings ? ' tb-btn-active' : ''),
|
|
5135
|
+
'aria-expanded': showSettings ? 'true' : 'false',
|
|
5136
|
+
onClick: toggleSettings,
|
|
5137
|
+
},
|
|
5138
|
+
t('settings.button'),
|
|
5139
|
+
),
|
|
4536
5140
|
),
|
|
4537
5141
|
),
|
|
4538
5142
|
|
|
5143
|
+
h(SettingsPanel, { key: 'settings' }),
|
|
4539
5144
|
h(LeadBar, { key: 'leads' }),
|
|
4540
5145
|
presetBanner ? h(Banner, { item: presetBanner }) : null,
|
|
4541
5146
|
notice ? h(Banner, { item: notice, onClose: () => setNotice(null) }) : null,
|
|
@@ -4603,6 +5208,15 @@ window.__ModuleLoader__.load({
|
|
|
4603
5208
|
onPaste: onNotePaste,
|
|
4604
5209
|
})
|
|
4605
5210
|
: null,
|
|
5211
|
+
showNote
|
|
5212
|
+
? h('input', {
|
|
5213
|
+
className: 'tb-input',
|
|
5214
|
+
placeholder: t('composer.dependsOn'),
|
|
5215
|
+
'aria-label': t('composer.dependsOn'),
|
|
5216
|
+
value: dependsDraft,
|
|
5217
|
+
onChange: (event) => setDependsDraft(event.target.value),
|
|
5218
|
+
})
|
|
5219
|
+
: null,
|
|
4606
5220
|
attachments.length > 0
|
|
4607
5221
|
? h(
|
|
4608
5222
|
'div',
|
|
@@ -4673,12 +5287,17 @@ window.__ModuleLoader__.load({
|
|
|
4673
5287
|
|
|
4674
5288
|
h(
|
|
4675
5289
|
'div',
|
|
4676
|
-
{
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
5290
|
+
{
|
|
5291
|
+
className: 'tb-board',
|
|
5292
|
+
'data-layout': 'wide',
|
|
5293
|
+
'data-needs': attention.length > 0 ? 'true' : 'false',
|
|
5294
|
+
'data-archive': showArchive ? 'true' : 'false',
|
|
5295
|
+
},
|
|
5296
|
+
// 「待处理」列放最左(在「待开始」之前),仅非空时渲染(提问卡在前、阻塞卡在后)。
|
|
5297
|
+
attention.length > 0
|
|
5298
|
+
? h(NeedsColumn, { key: 'attention', items: attention, workspaceLabel: workspaceLabelOf })
|
|
4680
5299
|
: null,
|
|
4681
|
-
|
|
5300
|
+
visibleStatuses.map((status) =>
|
|
4682
5301
|
h(Col, { key: status, status, tasks: groups[status], compact: false, workspaceLabel: workspaceLabelOf }),
|
|
4683
5302
|
),
|
|
4684
5303
|
),
|
|
@@ -4875,6 +5494,11 @@ window.__ModuleLoader__.load({
|
|
|
4875
5494
|
// v0.2.2「待你处理」(§1.9)派生列表
|
|
4876
5495
|
needsUserTasks,
|
|
4877
5496
|
withoutNeedsUser,
|
|
5497
|
+
// v0.5.3「待处理」派生列(§5.1.1):提问卡 + 阻塞卡
|
|
5498
|
+
attentionTaskKind,
|
|
5499
|
+
attentionTasks,
|
|
5500
|
+
withoutAttention,
|
|
5501
|
+
lastErrorSummary,
|
|
4878
5502
|
// t-89:侧栏角标贴「任务看板」文字右上角(标签 rect → 相对图标坐标 / 找宿主标签节点)
|
|
4879
5503
|
labelBadgeAnchor,
|
|
4880
5504
|
hostLabelNode,
|