dsh-dispatch-board 0.5.1 → 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 +281 -142
- package/lib/index.js +288 -53
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
- package/presets/taskboard.patch.yml +4 -0
package/lib/client.js
CHANGED
|
@@ -42,7 +42,7 @@ 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.5.
|
|
45
|
+
const PLUGIN_VERSION = '0.5.6' // 兜底值:正常走 snapshot.pluginVersion(宿主读 package.json)
|
|
46
46
|
const ARCHIVE_RETENTION_PRESETS = [0, 5, 15, 30, 60, 120, 360, 1440]
|
|
47
47
|
const POLL_VISIBLE_MS = 2000
|
|
48
48
|
const POLL_HIDDEN_MS = 10000
|
|
@@ -119,7 +119,8 @@ window.__ModuleLoader__.load({
|
|
|
119
119
|
// 不固定时 flex 行高被按钮撑大 ~10px,导致「已完成」标题和整列卡片都比别的列低一截。
|
|
120
120
|
'.tb-page[data-narrow=true] .tb-colhead{height:29px}',
|
|
121
121
|
'.tb-coldot{width:8px;height:8px;border-radius:50%;flex:0 0 auto;background:var(--tb-accent)}',
|
|
122
|
-
|
|
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}',
|
|
123
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}',
|
|
124
125
|
'.tb-colhead-actions{margin-left:auto;display:flex;align-items:center;gap:4px}',
|
|
125
126
|
'.tb-cards{display:flex;flex-direction:column;gap:8px;min-height:0}',
|
|
@@ -131,6 +132,10 @@ window.__ModuleLoader__.load({
|
|
|
131
132
|
// 唯一例外:全局平台看板多一行工作区标签(.tb-card-workspace,v0.2.4),
|
|
132
133
|
// 右栏看板不传 workspaceLabel,卡片结构维持「标题 + 操作按钮」不变。
|
|
133
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}',
|
|
134
139
|
'.tb-card-title{font:var(--dsw-font-xxs-strong-12);font-weight:600;line-height:1.45;word-break:break-word}',
|
|
135
140
|
// 平台看板卡片上的一行工作区标签(v0.2.4):单行、超长省略,标题仍是第一眼信息。
|
|
136
141
|
// 只有全局看板的 Col 传入 workspaceLabel 时才渲染(右栏看板绑定单个工作区,不重复显示)。
|
|
@@ -260,8 +265,9 @@ window.__ModuleLoader__.load({
|
|
|
260
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}',
|
|
261
266
|
'.tb-page[data-narrow=true]{padding:10px 10px 12px;gap:9px}',
|
|
262
267
|
'.tb-page[data-narrow=true] .tb-title{font-size:16px}',
|
|
263
|
-
|
|
264
|
-
'.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}',
|
|
265
271
|
'.tb-page[data-narrow=true] .tb-optional{display:none}',
|
|
266
272
|
'.tb-page[data-narrow=true] .tb-board{grid-template-columns:minmax(0,1fr)}',
|
|
267
273
|
'.tb-page[data-layout=medium] .tb-board{grid-template-columns:repeat(2,minmax(0,1fr))}',
|
|
@@ -296,24 +302,26 @@ window.__ModuleLoader__.load({
|
|
|
296
302
|
'.tb-page[data-narrow=true] .tb-lead-label{max-width:160px}',
|
|
297
303
|
|
|
298
304
|
|
|
299
|
-
// ──
|
|
300
|
-
//
|
|
301
|
-
|
|
302
|
-
'.tb-needs-head{display:flex;align-items:center;gap:6px}',
|
|
303
|
-
'.tb-needs-dot{width:7px;height:7px;border-radius:50%;background:var(--dsw-alias-state-error-primary);flex:0 0 auto}',
|
|
304
|
-
'.tb-needs-name{font:var(--dsw-font-xxs-strong-12);font-weight:600}',
|
|
305
|
-
'.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}',
|
|
306
|
-
'.tb-needs-list{display:flex;flex-direction:column;gap:4px}',
|
|
307
|
-
'.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}',
|
|
308
|
-
'.tb-needs-item:hover{background:var(--dsw-alias-interactive-bg-hover)}',
|
|
309
|
-
'.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}',
|
|
310
|
-
'.tb-needs-title{font:var(--dsw-font-xxs-strong-12);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
311
|
-
'.tb-needs-q{font:var(--dsw-font-xxxs-11);color:var(--dsw-alias-label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
312
|
-
// 平台看板第五列(放在「待开始」之前;没有 flagged 任务时整列不渲染,仍是四列)。
|
|
305
|
+
// ── 待处理列(v0.2.2 顶部条 → v0.5.4 起两块看板统一用派生列,顶部条已删)──
|
|
306
|
+
// 平台看板「待处理」派生列(放在「待开始」之前;v0.5.3 起列里除提问卡还有阻塞卡,
|
|
307
|
+
// 两类都没有时整列不渲染)。
|
|
313
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))}',
|
|
314
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))}',
|
|
315
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}',
|
|
316
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)}',
|
|
317
325
|
// 详情浮层的「需要你处理」区(问题 / 选项 / 自由输入 / 回复并继续 / 最近回答)。
|
|
318
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}',
|
|
319
327
|
'.tb-needs-question{margin:0;font:var(--dsw-font-xs-12);line-height:1.6;white-space:pre-wrap;word-break:break-word}',
|
|
@@ -325,8 +333,6 @@ window.__ModuleLoader__.load({
|
|
|
325
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}',
|
|
326
334
|
// 独立红色角标:与 todo 角标同一形状,放在按钮 / 图标的另一角,不抢 todo 数字。
|
|
327
335
|
'.tb-badge-needs{top:auto;bottom:-3px;right:-5px;background:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary-foreground)}',
|
|
328
|
-
'.tb-page[data-layout=narrow] .tb-needs{padding:7px 8px}',
|
|
329
|
-
'.tb-page[data-layout=narrow] .tb-needs-item{padding:4px 5px}',
|
|
330
336
|
|
|
331
337
|
// ── Apple 风格皮肤(最后追加,覆盖上面的基础样式)──────────
|
|
332
338
|
// 设计参照 macOS / Linear:层次分明的画布 + 泳道底槽 + 状态色左缘卡片、发丝分隔线、胶囊按钮、柔和阴影。
|
|
@@ -337,9 +343,9 @@ window.__ModuleLoader__.load({
|
|
|
337
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}',
|
|
338
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,.tb-platform .tb-board[data-needs=true]{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,.tb-platform .tb-board[data-needs=true]{grid-template-columns:minmax(0,1fr)}}',
|
|
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)}}',
|
|
343
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}',
|
|
344
350
|
'.tb-sub{color:var(--tb-text-2);font-size:11.5px;line-height:1.4}',
|
|
345
351
|
'.tb-dot{box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-state-success-primary) 18%,transparent)}',
|
|
@@ -405,6 +411,9 @@ window.__ModuleLoader__.load({
|
|
|
405
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}',
|
|
406
412
|
'.tb-card[data-subtask=true]{border-left-style:dashed;background:color-mix(in srgb,var(--tb-surface) 92%,var(--tb-canvas))}',
|
|
407
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)}',
|
|
408
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}',
|
|
409
418
|
'.tb-card-titlebtn:hover{color:var(--dsw-alias-state-business-primary,#0071e3);text-decoration:none}',
|
|
410
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}',
|
|
@@ -415,10 +424,7 @@ window.__ModuleLoader__.load({
|
|
|
415
424
|
'.tb-toolbar{padding:2px 2px 0}',
|
|
416
425
|
'.tb-toolbar-filter{color:var(--tb-text-2);font-size:11px;font-weight:500}',
|
|
417
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}',
|
|
418
|
-
//
|
|
419
|
-
'.tb-needs{backdrop-filter:blur(10px);box-shadow:var(--tb-shadow-1);border-radius:12px}',
|
|
420
|
-
'.tb-needs-item{background:color-mix(in srgb,var(--tb-surface) 82%,transparent);border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 16%,transparent);border-radius:8px;padding:6px 8px;transition:background .15s ease,border-color .15s ease}',
|
|
421
|
-
'.tb-needs-item:hover{background:var(--tb-surface);border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent)}',
|
|
427
|
+
// v0.5.4:顶部「待你处理」粘性横幅已删(提问卡统一进「待处理」列),相关皮肤规则一并去掉。
|
|
422
428
|
// 组长条:与卡片同一套表面(颜色全部走官方 --dsw-* 主题变量)
|
|
423
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}',
|
|
424
430
|
'.tb-lead + .tb-lead{border-left-color:var(--dsw-alias-border-l1)}',
|
|
@@ -629,6 +635,7 @@ window.__ModuleLoader__.load({
|
|
|
629
635
|
'detail.note': '备注 / 验收标准',
|
|
630
636
|
'detail.result': '完成结论',
|
|
631
637
|
'detail.error': '最近错误',
|
|
638
|
+
'detail.lastError': '最近异常',
|
|
632
639
|
'detail.emptyNote': '(没有备注)',
|
|
633
640
|
'detail.emptyResult': '任务已完成,但主 Agent 还没有写结论。',
|
|
634
641
|
'detail.emptyResultPending': '任务还没完成,完成后主 Agent 会把结论写在这里。',
|
|
@@ -709,7 +716,6 @@ window.__ModuleLoader__.load({
|
|
|
709
716
|
'detail.noLead': '(还没有组长)',
|
|
710
717
|
|
|
711
718
|
// v0.2.2「待你处理」(§1.9):组长提问 → 看板提示 → 用户回答 → 任务继续
|
|
712
|
-
'column.needsUser': '待你处理',
|
|
713
719
|
'needsUser.title': '需要你处理',
|
|
714
720
|
'needsUser.question': '需要你回答的问题',
|
|
715
721
|
'needsUser.answerPlaceholder': '输入你的回答(≤{max} 字)…',
|
|
@@ -722,6 +728,14 @@ window.__ModuleLoader__.load({
|
|
|
722
728
|
'needsUser.answerEmpty': '先写回答再提交',
|
|
723
729
|
'needsUser.answerTooLong': '回答不能超过 {max} 字',
|
|
724
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})',
|
|
725
739
|
}
|
|
726
740
|
|
|
727
741
|
const DICT_EN = {
|
|
@@ -841,6 +855,7 @@ window.__ModuleLoader__.load({
|
|
|
841
855
|
'detail.note': 'Note / acceptance',
|
|
842
856
|
'detail.result': 'Result',
|
|
843
857
|
'detail.error': 'Last error',
|
|
858
|
+
'detail.lastError': 'Recent issue',
|
|
844
859
|
'detail.emptyNote': '(no note)',
|
|
845
860
|
'detail.emptyResult': 'Task is done but the main agent has not written a result yet.',
|
|
846
861
|
'detail.emptyResultPending': 'Not finished yet; the main agent writes the result here when done.',
|
|
@@ -921,7 +936,6 @@ window.__ModuleLoader__.load({
|
|
|
921
936
|
'detail.noLead': '(no lead yet)',
|
|
922
937
|
|
|
923
938
|
// v0.2.2 needs-user loop (§1.9)
|
|
924
|
-
'column.needsUser': 'Needs you',
|
|
925
939
|
'needsUser.title': 'Needs your answer',
|
|
926
940
|
'needsUser.question': 'Question for you',
|
|
927
941
|
'needsUser.answerPlaceholder': 'Type your answer (≤{max} chars)…',
|
|
@@ -934,6 +948,14 @@ window.__ModuleLoader__.load({
|
|
|
934
948
|
'needsUser.answerEmpty': 'Write an answer first',
|
|
935
949
|
'needsUser.answerTooLong': 'The answer must be at most {max} chars',
|
|
936
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})',
|
|
937
959
|
}
|
|
938
960
|
|
|
939
961
|
function detectLang(locale) {
|
|
@@ -1795,8 +1817,9 @@ window.__ModuleLoader__.load({
|
|
|
1795
1817
|
}
|
|
1796
1818
|
|
|
1797
1819
|
/**
|
|
1798
|
-
* v0.2.2(§1.9
|
|
1820
|
+
* v0.2.2(§1.9)派生「待你处理」列表——`needsUser === true`、排除已归档,
|
|
1799
1821
|
* 按 `askedAt` 升序(等得最久的排最前;缺 / 坏 `askedAt` 的排最后,再按 id)。
|
|
1822
|
+
* v0.5.4 起看板改用「待处理」列(`attentionTasks`),这个纯函数只保留给 `__test` 与兼容调用。
|
|
1800
1823
|
*/
|
|
1801
1824
|
function needsUserTasks(tasks) {
|
|
1802
1825
|
return (Array.isArray(tasks) ? tasks : [])
|
|
@@ -1824,6 +1847,68 @@ window.__ModuleLoader__.load({
|
|
|
1824
1847
|
)
|
|
1825
1848
|
}
|
|
1826
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
|
+
|
|
1827
1912
|
function errorText(t, error) {
|
|
1828
1913
|
if (!error || typeof error !== 'object') return t('error.internal')
|
|
1829
1914
|
const code = error.code || 'internal'
|
|
@@ -2561,115 +2646,89 @@ window.__ModuleLoader__.load({
|
|
|
2561
2646
|
}
|
|
2562
2647
|
|
|
2563
2648
|
/**
|
|
2564
|
-
*
|
|
2565
|
-
*
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
if (list.length === 0) return null
|
|
2571
|
-
const actions = bind.actions
|
|
2572
|
-
return h(
|
|
2573
|
-
'section',
|
|
2574
|
-
{ className: 'tb-needs', role: 'region', 'aria-label': t('column.needsUser') },
|
|
2575
|
-
h(
|
|
2576
|
-
'header',
|
|
2577
|
-
{ className: 'tb-needs-head' },
|
|
2578
|
-
h('span', { className: 'tb-needs-dot', 'aria-hidden': 'true' }),
|
|
2579
|
-
h('span', { className: 'tb-needs-name' }, t('column.needsUser')),
|
|
2580
|
-
h('span', { className: 'tb-needs-count' }, String(list.length)),
|
|
2581
|
-
),
|
|
2582
|
-
h(
|
|
2583
|
-
'div',
|
|
2584
|
-
{ className: 'tb-needs-list' },
|
|
2585
|
-
list.map((task) =>
|
|
2586
|
-
h(
|
|
2587
|
-
'button',
|
|
2588
|
-
{
|
|
2589
|
-
key: task.id,
|
|
2590
|
-
type: 'button',
|
|
2591
|
-
className: 'tb-needs-item',
|
|
2592
|
-
title: (task.title || '') + '\n' + (task.question || ''),
|
|
2593
|
-
onClick: () => actions.openDetail(task),
|
|
2594
|
-
},
|
|
2595
|
-
h('span', { className: 'tb-needs-title' }, task.title || ''),
|
|
2596
|
-
h('span', { className: 'tb-needs-q' }, task.question || ''),
|
|
2597
|
-
),
|
|
2598
|
-
),
|
|
2599
|
-
),
|
|
2600
|
-
)
|
|
2601
|
-
}
|
|
2602
|
-
|
|
2603
|
-
/**
|
|
2604
|
-
* 平台看板的第五列「待你处理」(v0.2.2,§1.9):放在「待开始」之前,仅非空时由调用方渲染。
|
|
2605
|
-
* 卡片显示标题 + 问题一行 + 「处理」按钮(需要用户阅读,是纯标题卡的例外);
|
|
2606
|
-
* 点标题 / 「处理」都打开详情浮层的回答区。
|
|
2649
|
+
* 平台看板的「待处理」派生列(v0.2.2 第五列「待你处理」,v0.5.3 扩成两类卡):
|
|
2650
|
+
* 放在「待开始」之前,仅非空时由调用方渲染(空时整列消失,看板回四列)。
|
|
2651
|
+
* - 提问卡(needsUser):标题 + 问题两行 + 「处理」按钮,点标题 / 按钮都打开详情回答区;
|
|
2652
|
+
* - 阻塞卡(doing + lastError):完整 Card(原有操作按钮不丢)+ 警示色左缘 + 首行异常摘要,
|
|
2653
|
+
* 点标题 / 「详情」打开详情浮层(完整文本在「最近异常」行)。
|
|
2654
|
+
* 提问在前、阻塞在后(由 attentionTasks 排好)。第五列也是全局视角,卡片照常带工作区标签。
|
|
2607
2655
|
*/
|
|
2608
2656
|
function NeedsColumn(props) {
|
|
2609
2657
|
const t = bind.t
|
|
2610
|
-
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' }))
|
|
2611
2661
|
const actions = bind.actions
|
|
2612
|
-
// 第五列也是全局视角(只有平台看板渲染它):同样显示工作区标签;
|
|
2613
|
-
// 右栏的「待你处理」是顶部条(.tb-needs-item,不是卡片),不受影响。
|
|
2614
2662
|
const workspaceLabelOf = props && typeof props.workspaceLabel === 'function' ? props.workspaceLabel : null
|
|
2663
|
+
const labelOf = (task) => (workspaceLabelOf ? workspaceLabelOf(task) : '')
|
|
2615
2664
|
return h(
|
|
2616
2665
|
'section',
|
|
2617
2666
|
{
|
|
2618
2667
|
className: 'tb-col tb-needs-col',
|
|
2619
2668
|
'data-status': 'needsUser',
|
|
2620
|
-
'
|
|
2669
|
+
'data-compact': props && props.compact === true ? 'true' : 'false',
|
|
2670
|
+
'data-attention': items.length > 0 ? 'true' : 'false',
|
|
2671
|
+
'aria-label': t('column.attention'),
|
|
2621
2672
|
},
|
|
2622
2673
|
h(
|
|
2623
2674
|
'header',
|
|
2624
2675
|
{ className: 'tb-colhead', style: { '--tb-accent': STATUS_ACCENT.needsUser } },
|
|
2625
2676
|
h('span', { className: 'tb-coldot', 'aria-hidden': 'true' }),
|
|
2626
|
-
h('span', { className: 'tb-colname' }, t('column.
|
|
2627
|
-
h('span', { className: 'tb-colcount' }, String(
|
|
2677
|
+
h('span', { className: 'tb-colname' }, t('column.attention')),
|
|
2678
|
+
h('span', { className: 'tb-colcount' }, String(items.length)),
|
|
2628
2679
|
),
|
|
2629
2680
|
h(
|
|
2630
2681
|
'div',
|
|
2631
2682
|
{ className: 'tb-cards' },
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
h(
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
onClick: () => actions.openDetail(task),
|
|
2648
|
-
onKeyDown: (event) => {
|
|
2649
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
2650
|
-
event.preventDefault()
|
|
2651
|
-
actions.openDetail(task)
|
|
2652
|
-
}
|
|
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 },
|
|
2653
2698
|
},
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
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
|
+
),
|
|
2670
2731
|
),
|
|
2671
|
-
),
|
|
2672
|
-
),
|
|
2673
2732
|
),
|
|
2674
2733
|
),
|
|
2675
2734
|
)
|
|
@@ -2684,6 +2743,9 @@ window.__ModuleLoader__.load({
|
|
|
2684
2743
|
const status = task.status
|
|
2685
2744
|
// 工作区标签(v0.2.4):只有平台看板的 Col 传值;右栏看板传空串 → 不渲染。
|
|
2686
2745
|
const workspaceLabel = typeof props.workspaceLabel === 'string' ? props.workspaceLabel : ''
|
|
2746
|
+
// v0.5.3:阻塞卡(doing + lastError)在「待处理」列里多一行警示条 + 首行异常摘要;
|
|
2747
|
+
// 普通四列里的卡片完全不变(异常全文只在详情浮层「最近异常」行)。
|
|
2748
|
+
const attention = props && props.attention === 'blocked'
|
|
2687
2749
|
const hasCwd = typeof task.cwd === 'string' && task.cwd !== ''
|
|
2688
2750
|
const isEditing = editing !== null && editing.id === task.id
|
|
2689
2751
|
const busyKey = 'update:' + task.id
|
|
@@ -2779,6 +2841,10 @@ window.__ModuleLoader__.load({
|
|
|
2779
2841
|
{
|
|
2780
2842
|
className: 'tb-card tb-card-fixed',
|
|
2781
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,
|
|
2782
2848
|
style: { '--tb-accent': STATUS_ACCENT[status] },
|
|
2783
2849
|
},
|
|
2784
2850
|
h(
|
|
@@ -2799,6 +2865,15 @@ window.__ModuleLoader__.load({
|
|
|
2799
2865
|
},
|
|
2800
2866
|
task.title,
|
|
2801
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,
|
|
2802
2877
|
// 工作区标签放在标题与操作行之间(副标题位):不挤标题的 2 行高度,
|
|
2803
2878
|
// 单行省略;cwd 为空时显示「—」占位。
|
|
2804
2879
|
h(WorkspaceTag, { label: workspaceLabel, empty: !hasCwd, path: hasCwd ? task.cwd : '' }),
|
|
@@ -2866,6 +2941,10 @@ window.__ModuleLoader__.load({
|
|
|
2866
2941
|
...(typeof task.worktreePath === 'string' && task.worktreePath !== ''
|
|
2867
2942
|
? [[t('detail.worktree'), (task.worktreeBranch ? task.worktreeBranch + ' · ' : '') + task.worktreePath]]
|
|
2868
2943
|
: []),
|
|
2944
|
+
// v0.5.2:基本信息里也给出「最近异常」(完整文本仍在下方「最近错误」区)。
|
|
2945
|
+
...(typeof task.lastError === 'string' && task.lastError !== ''
|
|
2946
|
+
? [[t('detail.lastError'), task.lastError]]
|
|
2947
|
+
: []),
|
|
2869
2948
|
[t('detail.lead'), taskLeadLabel(task) || t('detail.noLead')],
|
|
2870
2949
|
[t('detail.assignee'), task.assignee || t('detail.assigneeAuto')],
|
|
2871
2950
|
[t('detail.source'), task.source === 'agent' ? t('detail.sourceAgent') : t('detail.sourceUser')],
|
|
@@ -3509,7 +3588,7 @@ window.__ModuleLoader__.load({
|
|
|
3509
3588
|
)
|
|
3510
3589
|
}
|
|
3511
3590
|
|
|
3512
|
-
return { Banner, Col, Detail, LeadBar,
|
|
3591
|
+
return { Banner, Col, Detail, LeadBar, NeedsColumn, SettingsPanel, sessionCandidatesOf }
|
|
3513
3592
|
}
|
|
3514
3593
|
|
|
3515
3594
|
/* ── 看板页 ─────────────────────────────────────────────── */
|
|
@@ -3555,6 +3634,8 @@ window.__ModuleLoader__.load({
|
|
|
3555
3634
|
const [showNote, setShowNote] = useState(false)
|
|
3556
3635
|
const [showSettings, setShowSettings] = useState(false)
|
|
3557
3636
|
const [retentionDraft, setRetentionDraft] = useState('30')
|
|
3637
|
+
// v0.5.4:「已归档」列默认隐藏,顶部按钮切换(组件本地 state,不写 config)。
|
|
3638
|
+
const [showArchive, setShowArchive] = useState(false)
|
|
3558
3639
|
// v0.2.0:待提交的粘贴图片({id, preview, ...})与详情浮层的附件 data URL 缓存。
|
|
3559
3640
|
const [attachments, setAttachments] = useState([])
|
|
3560
3641
|
// 上传中的请求计数(不是布尔):连续多次粘贴时,只有全部结束才解除提交禁用。
|
|
@@ -3650,11 +3731,18 @@ window.__ModuleLoader__.load({
|
|
|
3650
3731
|
// 右栏 = 本工作区看板:只显示 cwd 与当前工作区相同(归一化比较)的任务;
|
|
3651
3732
|
// 工作区未知(历史会话 / 缺 cwd)时给说明条并显示空看板。
|
|
3652
3733
|
const workspaceTitle = cwdForHint ? workspaceTitleOf(workspaces, cwdForHint) : ''
|
|
3653
|
-
// v0.2.2(§1.9
|
|
3654
|
-
//
|
|
3734
|
+
// v0.2.2(§1.9)/ v0.5.4:提问卡 + 阻塞卡统一进「待处理」列(与平台看板同一口径),
|
|
3735
|
+
// 不再有顶部固定条,也不在普通状态列 / lane 里重复。
|
|
3655
3736
|
const workspaceTasks = tasksForWorkspace(allTasks, cwdForHint, sessionId)
|
|
3656
|
-
const
|
|
3657
|
-
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,已按「待处理」列口径扣掉提问卡 + 阻塞卡)。
|
|
3658
3746
|
const plainTasks = withoutNeedsUser(allTasks)
|
|
3659
3747
|
// 有些旧任务/别的会话建的任务没有 cwd,本面板按设计不显示;给个去处,避免「任务凭空消失」。
|
|
3660
3748
|
const detailTask = detailId ? allTasks.find((task) => task && task.id === detailId) || null : null
|
|
@@ -3665,6 +3753,8 @@ window.__ModuleLoader__.load({
|
|
|
3665
3753
|
(task) => task && !task.cwd && task.status !== 'archived' && task.sessionId !== sessionId,
|
|
3666
3754
|
).length
|
|
3667
3755
|
const groups = groupTasks(tasks)
|
|
3756
|
+
// v0.5.4:隐藏归档时连「已归档」列一起不渲染(不留空列)。
|
|
3757
|
+
const visibleStatuses = showArchive ? STATUS_ORDER : STATUS_ORDER.filter((status) => status !== 'archived')
|
|
3668
3758
|
const preset = (snap && snap.preset) || null
|
|
3669
3759
|
// v0.2.0 组长条:leads 是运行时视图(组长启停 / 忙闲不 bump revision),每次渲染都读最新值;
|
|
3670
3760
|
// 右栏只列当前看板可见任务(含待你处理)涉及的工作区,没组长的补「创建组长」入口。
|
|
@@ -4023,12 +4113,11 @@ window.__ModuleLoader__.load({
|
|
|
4023
4113
|
boardBindRef.current.leadRows = leadRows
|
|
4024
4114
|
boardBindRef.current.currentSessionId = sessionId
|
|
4025
4115
|
boardBindRef.current.leadActions = leadActions
|
|
4026
|
-
// v0.2.2
|
|
4116
|
+
// v0.2.2「待处理」:回答草稿(每次渲染都刷新;v0.5.4 起无顶部条,任务列表直接从 bind.allTasks 派生)。
|
|
4027
4117
|
boardBindRef.current.allTasks = allTasks
|
|
4028
4118
|
boardBindRef.current.config = config
|
|
4029
4119
|
boardBindRef.current.showSettings = showSettings
|
|
4030
4120
|
boardBindRef.current.retentionDraft = retentionDraft
|
|
4031
|
-
boardBindRef.current.needsUserTasks = needsUser
|
|
4032
4121
|
boardBindRef.current.answerDraft = answerDraft
|
|
4033
4122
|
boardBindRef.current.answerError = answerError
|
|
4034
4123
|
if (boardPiecesRef.current === null) boardPiecesRef.current = createBoardPieces(boardBindRef.current)
|
|
@@ -4036,7 +4125,6 @@ window.__ModuleLoader__.load({
|
|
|
4036
4125
|
const Col = boardPiecesRef.current.Col
|
|
4037
4126
|
const Detail = boardPiecesRef.current.Detail
|
|
4038
4127
|
const LeadBar = boardPiecesRef.current.LeadBar
|
|
4039
|
-
const NeedsBanner = boardPiecesRef.current.NeedsBanner
|
|
4040
4128
|
const NeedsColumn = boardPiecesRef.current.NeedsColumn
|
|
4041
4129
|
const SettingsPanel = boardPiecesRef.current.SettingsPanel
|
|
4042
4130
|
|
|
@@ -4099,6 +4187,17 @@ window.__ModuleLoader__.load({
|
|
|
4099
4187
|
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick: refreshNow },
|
|
4100
4188
|
busy === 'refresh' ? t('page.refreshing') : t('page.refresh'),
|
|
4101
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
|
+
),
|
|
4102
4201
|
h(
|
|
4103
4202
|
'button',
|
|
4104
4203
|
{
|
|
@@ -4226,19 +4325,29 @@ window.__ModuleLoader__.load({
|
|
|
4226
4325
|
),
|
|
4227
4326
|
),
|
|
4228
4327
|
|
|
4229
|
-
// v0.
|
|
4230
|
-
|
|
4231
|
-
|
|
4328
|
+
// v0.5.4:提问卡 + 阻塞卡统一进「待处理」列(排在最前、仅非空时渲染),
|
|
4329
|
+
// 不再有顶部固定条;「已归档」列默认隐藏,由顶部按钮切出来(两种布局一致)。
|
|
4232
4330
|
wide
|
|
4233
4331
|
? h(
|
|
4234
4332
|
'div',
|
|
4235
|
-
{
|
|
4236
|
-
|
|
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 })),
|
|
4237
4341
|
)
|
|
4238
4342
|
: h(
|
|
4239
4343
|
'div',
|
|
4240
|
-
{
|
|
4241
|
-
|
|
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 })),
|
|
4242
4351
|
),
|
|
4243
4352
|
|
|
4244
4353
|
h(
|
|
@@ -4424,6 +4533,8 @@ window.__ModuleLoader__.load({
|
|
|
4424
4533
|
const [showNote, setShowNote] = useState(false)
|
|
4425
4534
|
const [showSettings, setShowSettings] = useState(false)
|
|
4426
4535
|
const [retentionDraft, setRetentionDraft] = useState('30')
|
|
4536
|
+
// v0.5.4:「已归档」列默认隐藏,顶部按钮切换(组件本地 state,不写 config)。
|
|
4537
|
+
const [showArchive, setShowArchive] = useState(false)
|
|
4427
4538
|
// v0.2.0:与右栏看板同一套粘贴图片 / 详情附件缓存。
|
|
4428
4539
|
const [attachments, setAttachments] = useState([])
|
|
4429
4540
|
// 上传中的请求计数(不是布尔):连续多次粘贴时,只有全部结束才解除提交禁用。
|
|
@@ -4529,9 +4640,18 @@ window.__ModuleLoader__.load({
|
|
|
4529
4640
|
const workspaceLabelOf = (task) => taskWorkspaceLabel(workspaces, task)
|
|
4530
4641
|
const visibleAll = tasksForFilter(allTasks, activeFilter)
|
|
4531
4642
|
// v0.2.2(§1.9):flagged 任务只进最左第五列,不重复出现在普通四列。
|
|
4532
|
-
|
|
4533
|
-
|
|
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')
|
|
4534
4652
|
const groups = groupTasks(visibleTasks)
|
|
4653
|
+
// v0.5.4:隐藏归档时连「已归档」列一起不渲染(不留空列)。
|
|
4654
|
+
const visibleStatuses = showArchive ? STATUS_ORDER : STATUS_ORDER.filter((status) => status !== 'archived')
|
|
4535
4655
|
const doingAll = withoutNeedsUser(allTasks).filter((task) => task && task.status === 'doing')
|
|
4536
4656
|
const fallbackDispatchSessionId =
|
|
4537
4657
|
poll && poll.lastDispatchSessionId && (poll.lastDispatchTaskId || doingAll.length === 1) ? poll.lastDispatchSessionId : ''
|
|
@@ -4929,14 +5049,13 @@ window.__ModuleLoader__.load({
|
|
|
4929
5049
|
boardBindRef.current.leadRows = leadRows
|
|
4930
5050
|
boardBindRef.current.currentSessionId = currentSessionId
|
|
4931
5051
|
boardBindRef.current.leadActions = leadActions
|
|
4932
|
-
// v0.2.2
|
|
5052
|
+
// v0.2.2「待处理」:回答草稿(每次渲染都刷新)。
|
|
4933
5053
|
// 缺了会让平台侧边栏详情浮层的回答框永远读到 '':打字被复位、选项不填、
|
|
4934
5054
|
// 「回复并继续」恒禁用(t-92,v0.2.5 拆分双看板时漏抄的回归)。
|
|
4935
5055
|
boardBindRef.current.allTasks = allTasks
|
|
4936
5056
|
boardBindRef.current.config = config
|
|
4937
5057
|
boardBindRef.current.showSettings = showSettings
|
|
4938
5058
|
boardBindRef.current.retentionDraft = retentionDraft
|
|
4939
|
-
boardBindRef.current.needsUserTasks = needsUser
|
|
4940
5059
|
boardBindRef.current.answerDraft = answerDraft
|
|
4941
5060
|
boardBindRef.current.answerError = answerError
|
|
4942
5061
|
if (boardPiecesRef.current === null) boardPiecesRef.current = createBoardPieces(boardBindRef.current)
|
|
@@ -4944,7 +5063,6 @@ window.__ModuleLoader__.load({
|
|
|
4944
5063
|
const Col = boardPiecesRef.current.Col
|
|
4945
5064
|
const Detail = boardPiecesRef.current.Detail
|
|
4946
5065
|
const LeadBar = boardPiecesRef.current.LeadBar
|
|
4947
|
-
const NeedsBanner = boardPiecesRef.current.NeedsBanner
|
|
4948
5066
|
const NeedsColumn = boardPiecesRef.current.NeedsColumn
|
|
4949
5067
|
const SettingsPanel = boardPiecesRef.current.SettingsPanel
|
|
4950
5068
|
|
|
@@ -4998,6 +5116,17 @@ window.__ModuleLoader__.load({
|
|
|
4998
5116
|
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'archiveDone', onClick: archiveDone },
|
|
4999
5117
|
t('platform.archiveDone'),
|
|
5000
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
|
+
),
|
|
5001
5130
|
h(
|
|
5002
5131
|
'button',
|
|
5003
5132
|
{
|
|
@@ -5158,12 +5287,17 @@ window.__ModuleLoader__.load({
|
|
|
5158
5287
|
|
|
5159
5288
|
h(
|
|
5160
5289
|
'div',
|
|
5161
|
-
{
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
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 })
|
|
5165
5299
|
: null,
|
|
5166
|
-
|
|
5300
|
+
visibleStatuses.map((status) =>
|
|
5167
5301
|
h(Col, { key: status, status, tasks: groups[status], compact: false, workspaceLabel: workspaceLabelOf }),
|
|
5168
5302
|
),
|
|
5169
5303
|
),
|
|
@@ -5360,6 +5494,11 @@ window.__ModuleLoader__.load({
|
|
|
5360
5494
|
// v0.2.2「待你处理」(§1.9)派生列表
|
|
5361
5495
|
needsUserTasks,
|
|
5362
5496
|
withoutNeedsUser,
|
|
5497
|
+
// v0.5.3「待处理」派生列(§5.1.1):提问卡 + 阻塞卡
|
|
5498
|
+
attentionTaskKind,
|
|
5499
|
+
attentionTasks,
|
|
5500
|
+
withoutAttention,
|
|
5501
|
+
lastErrorSummary,
|
|
5363
5502
|
// t-89:侧栏角标贴「任务看板」文字右上角(标签 rect → 相对图标坐标 / 找宿主标签节点)
|
|
5364
5503
|
labelBadgeAnchor,
|
|
5365
5504
|
hostLabelNode,
|