dsh-dispatch-board 0.3.0 → 0.5.1
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 +13 -9
- package/lib/client.js +640 -155
- package/lib/index.js +1861 -100
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
- package/presets/taskboard.patch.yml +106 -36
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.1' // 兜底值:正常走 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
|
|
@@ -328,77 +329,116 @@ window.__ModuleLoader__.load({
|
|
|
328
329
|
'.tb-page[data-layout=narrow] .tb-needs-item{padding:4px 5px}',
|
|
329
330
|
|
|
330
331
|
// ── Apple 风格皮肤(最后追加,覆盖上面的基础样式)──────────
|
|
331
|
-
// 设计参照 macOS /
|
|
332
|
-
// 颜色全部走宿主主题 token
|
|
332
|
+
// 设计参照 macOS / Linear:层次分明的画布 + 泳道底槽 + 状态色左缘卡片、发丝分隔线、胶囊按钮、柔和阴影。
|
|
333
|
+
// 颜色全部走宿主主题 token,亮色 / 深色模式自动跟随。
|
|
333
334
|
// 令牌挂在 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}',
|
|
335
|
+
'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)}',
|
|
336
|
+
// 页面:柔和画布底座 + 细滚动条
|
|
337
|
+
'.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
|
+
'.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
339
|
// 主区看板:窗口变窄时自动降列(平台页不经过面板宽度测量)
|
|
340
|
-
'@media (max-width:1180px){.tb-platform .tb-board{grid-template-columns:repeat(2,minmax(0,1fr))}}',
|
|
340
|
+
'@media (max-width:1180px){.tb-platform .tb-board,.tb-platform .tb-board[data-needs=true]{grid-template-columns:repeat(2,minmax(0,1fr))}}',
|
|
341
341
|
'@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-
|
|
342
|
+
'@media (max-width:620px){.tb-platform .tb-board,.tb-platform .tb-board[data-needs=true]{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:-.015em}',
|
|
344
|
+
'.tb-sub{color:var(--tb-text-2);font-size:11.5px;line-height:1.4}',
|
|
345
|
+
'.tb-dot{box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-state-success-primary) 18%,transparent)}',
|
|
346
|
+
'.tb-dot[data-on=false]{box-shadow:none}',
|
|
347
|
+
'.tb-head{gap:10px;padding-bottom:9px;border-bottom:1px solid var(--tb-hairline-soft);align-items:center}',
|
|
346
348
|
'.tb-head-side{gap:6px}',
|
|
347
349
|
// 输入 / 下拉
|
|
348
|
-
'.tb-input,.tb-select{height:
|
|
349
|
-
'.tb-
|
|
350
|
-
'.tb-
|
|
350
|
+
'.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}',
|
|
351
|
+
'.tb-select{height:27px;font-size:11.5px;padding:0 8px;cursor:pointer}',
|
|
352
|
+
'.tb-select:hover:not(:disabled){border-color:color-mix(in srgb,var(--tb-text-2) 45%,var(--tb-hairline))}',
|
|
353
|
+
'.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)}',
|
|
354
|
+
'.tb-input::placeholder,.tb-textarea::placeholder{color:var(--tb-text-3)}',
|
|
355
|
+
'.tb-textarea{border-radius:8px;border:1px solid var(--tb-hairline);background:var(--tb-surface);transition:border-color .15s ease,box-shadow .15s ease}',
|
|
356
|
+
// 新建区(与组长条、卡片统一表面质感)
|
|
357
|
+
'.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}',
|
|
358
|
+
'.tb-composer:focus-within{border-color:color-mix(in srgb,var(--tb-accent) 42%,var(--tb-hairline))}',
|
|
359
|
+
'.tb-linkbtn{font-weight:500;color:var(--tb-accent);text-decoration:none}',
|
|
360
|
+
'.tb-linkbtn:hover{text-decoration:underline}',
|
|
351
361
|
// 胶囊按钮
|
|
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-
|
|
362
|
+
'.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}',
|
|
363
|
+
'.tb-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);border-color:var(--tb-hairline);color:var(--tb-text)}',
|
|
364
|
+
'.tb-btn:active:not(:disabled){transform:scale(.98)}',
|
|
365
|
+
'.tb-btn:disabled{opacity:.42;cursor:not-allowed;box-shadow:none}',
|
|
366
|
+
'.tb-btn-sm{height:24px;padding:0 9px;font-size:11px;box-shadow:none}',
|
|
367
|
+
'.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)}',
|
|
368
|
+
'.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)}',
|
|
369
|
+
'.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)}',
|
|
370
|
+
// 设置面板(v0.3.6)
|
|
371
|
+
'.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)}',
|
|
372
|
+
'.tb-settings-head{display:flex;align-items:center;gap:8px;justify-content:space-between}',
|
|
373
|
+
'.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)}',
|
|
374
|
+
'.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}',
|
|
375
|
+
'.tb-settings-body{display:flex;flex-direction:column;gap:10px}',
|
|
376
|
+
'.tb-settings-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding-bottom:8px;border-bottom:1px solid var(--tb-hairline-soft)}',
|
|
377
|
+
'.tb-settings-field{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--tb-text-2)}',
|
|
378
|
+
'.tb-settings-label{font-weight:600;font-size:11.5px;color:var(--tb-text)}',
|
|
379
|
+
'.tb-settings-hint{margin:0;font-size:11px;color:var(--tb-text-3);line-height:1.45}',
|
|
380
|
+
'.tb-settings-presets{display:flex;flex-wrap:wrap;gap:5px;align-items:center}',
|
|
381
|
+
'.tb-settings-custom{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding-top:2px}',
|
|
382
|
+
'.tb-settings-input{width:88px;height:26px;font-variant-numeric:tabular-nums}',
|
|
383
|
+
'.tb-settings-unit{font-size:11px;color:var(--tb-text-2)}',
|
|
384
|
+
'.tb-btn-ghost{background:transparent;border-color:transparent;color:var(--tb-text-2);box-shadow:none}',
|
|
385
|
+
'.tb-btn-ghost:hover:not(:disabled){background:var(--dsw-alias-bg-skeleton);border-color:transparent;color:var(--tb-text)}',
|
|
386
|
+
'.tb-btn-danger{background:transparent;border-color:transparent;color:var(--tb-danger);box-shadow:none}',
|
|
387
|
+
'.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
388
|
// 提示条
|
|
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
|
|
389
|
+
'.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}',
|
|
390
|
+
'.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)}',
|
|
391
|
+
'.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)}',
|
|
392
|
+
'.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
393
|
'.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-
|
|
394
|
+
// 看板:泳道底槽 + 白色卡片(五列与四列保持完全一致的内边距与圆角)
|
|
395
|
+
'.tb-board{gap:11px;min-height:0}',
|
|
396
|
+
'.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)}',
|
|
397
|
+
'.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))}',
|
|
398
|
+
'.tb-page[data-narrow=true] .tb-col{padding:8px 8px 10px;border-radius:11px}',
|
|
399
|
+
'.tb-colhead{gap:6px;padding:1px 2px 6px;border-bottom:1px solid var(--tb-hairline-soft)}',
|
|
400
|
+
'.tb-coldot{width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 2px color-mix(in srgb,var(--tb-accent) 20%,transparent)}',
|
|
401
|
+
'.tb-colname{font:600 12px/1.3 var(--dsh-font-family-text-default,-apple-system,sans-serif);color:var(--tb-text);letter-spacing:0}',
|
|
402
|
+
'.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
403
|
'.tb-cards{gap:8px}',
|
|
374
|
-
|
|
375
|
-
'.tb-card:
|
|
404
|
+
// 卡片:保留左侧状态色条(3px),悬停轻微上浮并加亮左缘;子卡(data-subtask=true)用虚线左缘与略浅表面区分
|
|
405
|
+
'.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
|
+
'.tb-card[data-subtask=true]{border-left-style:dashed;background:color-mix(in srgb,var(--tb-surface) 92%,var(--tb-canvas))}',
|
|
407
|
+
'.tb-card:hover{box-shadow:var(--tb-shadow-2);border-color:var(--tb-hairline);border-left-color:var(--tb-accent);transform:translateY(-1px)}',
|
|
376
408
|
'.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-
|
|
409
|
+
'.tb-card-titlebtn:hover{color:var(--dsw-alias-state-business-primary,#0071e3);text-decoration:none}',
|
|
410
|
+
'.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}',
|
|
411
|
+
'.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)}',
|
|
412
|
+
'.tb-foot{color:var(--tb-text-3);font-size:10.5px;padding-top:4px;border-top:1px solid var(--tb-hairline-soft)}',
|
|
413
|
+
'.tb-foot code{background:var(--dsw-alias-bg-skeleton);border-radius:5px;padding:1px 6px;font-size:10px}',
|
|
414
|
+
'.tb-wsname{color:var(--tb-text-2);font-size:11px;font-weight:500}',
|
|
415
|
+
'.tb-toolbar{padding:2px 2px 0}',
|
|
416
|
+
'.tb-toolbar-filter{color:var(--tb-text-2);font-size:11px;font-weight:500}',
|
|
417
|
+
'.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)}',
|
|
383
422
|
// 组长条:与卡片同一套表面(颜色全部走官方 --dsw-* 主题变量)
|
|
384
|
-
'.tb-leads{background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:7px
|
|
423
|
+
'.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
424
|
'.tb-lead + .tb-lead{border-left-color:var(--dsw-alias-border-l1)}',
|
|
386
|
-
'.tb-lead-label{color:var(--dsw-alias-label-secondary)}',
|
|
425
|
+
'.tb-lead-label{color:var(--dsw-alias-label-secondary);font-weight:500}',
|
|
387
426
|
'.tb-lead-state,.tb-lead-hint{color:var(--dsw-alias-label-tertiary)}',
|
|
388
427
|
// 组长条按钮与同行文字统一字体/字号/行高/字重:按钮默认 500 字重 + 另一套
|
|
389
428
|
// 字体族 + line-height:1,会让「打开」「把当前对话设为主会话」比「组长 · xxx」
|
|
390
429
|
// 低约 1px(上下不齐)。这里改成完全继承组长条正文排版。
|
|
391
430
|
'.tb-leads .tb-lead-btn{font-family:inherit;font-size:inherit;font-weight:400;line-height:inherit}',
|
|
392
431
|
// 详情浮层:灰色画布 + 白色分组卡片
|
|
393
|
-
'.tb-detail-mask{background:rgba(15,17,21,.
|
|
432
|
+
'.tb-detail-mask{background:rgba(15,17,21,.34);backdrop-filter:blur(12px) saturate(140%);padding:20px}',
|
|
394
433
|
'.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
434
|
'.tb-detail-head{padding:16px 18px 12px;border-bottom:1px solid var(--tb-hairline-soft);background:var(--tb-surface)}',
|
|
396
435
|
'.tb-detail-title{font:600 15px/1.35 var(--dsh-font-family-text-default,-apple-system,sans-serif);color:var(--tb-text)}',
|
|
397
436
|
'.tb-detail-close{border-radius:50%;color:var(--tb-text-2);background:var(--dsw-alias-bg-skeleton)}',
|
|
398
437
|
'.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}',
|
|
438
|
+
'.tb-detail-body{background:var(--tb-canvas);padding:12px 14px;gap:10px}',
|
|
439
|
+
'.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
440
|
'.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}',
|
|
441
|
+
'.tb-detail-row:not(:last-child){border-bottom:1px dashed var(--tb-hairline-soft)}',
|
|
402
442
|
'.tb-detail-grid dt{color:var(--tb-text-3)}',
|
|
403
443
|
'.tb-detail-grid dd{color:var(--tb-text)}',
|
|
404
444
|
'.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 +448,13 @@ window.__ModuleLoader__.load({
|
|
|
408
448
|
'.tb-detail-muted{color:var(--tb-text-3)}',
|
|
409
449
|
'.tb-detail-error{color:var(--tb-danger);background:transparent;padding:0}',
|
|
410
450
|
'.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}',
|
|
451
|
+
'.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}',
|
|
452
|
+
'.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}',
|
|
453
|
+
'.tb-detail-parent:hover{background:color-mix(in srgb,var(--tb-accent) 18%,var(--tb-surface))}',
|
|
454
|
+
'.tb-subtasks{display:flex;flex-direction:column;gap:5px}',
|
|
455
|
+
'.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}',
|
|
456
|
+
'.tb-subtask-item:hover{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--tb-hairline)}',
|
|
457
|
+
'.tb-subtask-title{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
412
458
|
'.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
459
|
'.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
460
|
'.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 +462,9 @@ window.__ModuleLoader__.load({
|
|
|
416
462
|
'.tb-statusbadge[data-status=archived]{background:var(--dsw-alias-bg-skeleton);color:var(--tb-text-3)}',
|
|
417
463
|
'.tb-timeline{background:transparent;padding:2px 0 0;border-radius:0}',
|
|
418
464
|
'.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}',
|
|
465
|
+
'.tb-timeline-value{color:var(--tb-text);font-size:12px;font-variant-numeric:tabular-nums}',
|
|
466
|
+
'.tb-timeline-item{border-left:1px solid var(--tb-hairline-soft);padding:0 8px}',
|
|
467
|
+
'.tb-timeline-item:first-child{border-left:0;padding-left:0}',
|
|
422
468
|
'.tb-detail-actions{background:var(--tb-surface);border-top:1px solid var(--tb-hairline-soft);padding:10px 16px}',
|
|
423
469
|
// 富文本:Apple 风格的表格 / 代码
|
|
424
470
|
'.tb-rich .tb-rich-tablewrap{border:1px solid var(--tb-hairline-soft);border-radius:10px;background:var(--tb-surface);max-height:none}',
|
|
@@ -442,8 +488,13 @@ window.__ModuleLoader__.load({
|
|
|
442
488
|
// 全文放 title 属性;行内编辑态不带 .tb-card-fixed,高度自适应。
|
|
443
489
|
'.tb-card-fixed{gap:5px;padding:9px 10px 8px}',
|
|
444
490
|
'.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}',
|
|
491
|
+
'.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)}',
|
|
492
|
+
'.tb-card-fixed .tb-card-actions .tb-btn{height:22px;padding:0 7px;font-size:10.5px;background:var(--tb-tint);border-color:transparent}',
|
|
493
|
+
'.tb-card-fixed .tb-card-actions .tb-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);border-color:var(--tb-hairline-soft)}',
|
|
494
|
+
'.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}',
|
|
495
|
+
'.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}',
|
|
496
|
+
'.tb-card-fixed .tb-card-actions .tb-btn-danger{background:transparent;color:var(--tb-danger)}',
|
|
497
|
+
'.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
498
|
].join('\n')
|
|
448
499
|
|
|
449
500
|
function injectCss() {
|
|
@@ -468,6 +519,23 @@ window.__ModuleLoader__.load({
|
|
|
468
519
|
'page.title': '任务看板',
|
|
469
520
|
'page.refresh': '刷新',
|
|
470
521
|
'page.refreshing': '刷新中…',
|
|
522
|
+
'settings.button': '设置',
|
|
523
|
+
'settings.title': '看板设置',
|
|
524
|
+
'settings.archiveRetention': '归档任务自动删除时间',
|
|
525
|
+
'settings.archiveRetentionHint': '已归档的任务在保留满指定分钟数后自动从看板彻底删除(设为 0 则永不自动删除)。',
|
|
526
|
+
'settings.archiveCurrent': '当前:{m} 分钟后自动删除',
|
|
527
|
+
'settings.archiveCurrentNever': '当前:不自动删除',
|
|
528
|
+
'settings.archiveNever': '不自动删除',
|
|
529
|
+
'settings.minutes': '{m} 分钟',
|
|
530
|
+
'settings.minutesUnit': '分钟(0 = 不自动删除,最多 10080)',
|
|
531
|
+
'settings.save': '保存设置',
|
|
532
|
+
'settings.saved': '已更新归档保留时间设置',
|
|
533
|
+
'settings.archiveInvalid': '请输入 0 到 10080 之间的整数分钟数',
|
|
534
|
+
'settings.worktreeIsolation': 'Git Worktree 并发隔离',
|
|
535
|
+
'settings.worktreeHint': '开启后,Git 仓库内的并行切片与无依赖任务自动在独立 Worktree 中真并发执行并软链主仓依赖。',
|
|
536
|
+
'settings.worktreeOn': '已启用(真并发隔离)',
|
|
537
|
+
'settings.worktreeOff': '已关闭(同目录串行)',
|
|
538
|
+
'detail.worktree': '隔离工作树',
|
|
471
539
|
'poll.on': '每 {interval} 轮询',
|
|
472
540
|
'poll.off': '轮询已暂停',
|
|
473
541
|
'poll.lastRun': '上次检查 {time}',
|
|
@@ -553,6 +621,11 @@ window.__ModuleLoader__.load({
|
|
|
553
621
|
'detail.sourceUser': '用户(看板 / 对话)',
|
|
554
622
|
'detail.sourceAgent': '主 Agent(模型工具)',
|
|
555
623
|
'detail.id': '任务 id',
|
|
624
|
+
'detail.parentTask': '↳ 父任务 {id}',
|
|
625
|
+
'detail.subtasks': '拆分子任务({done}/{total} 已完成)',
|
|
626
|
+
'detail.dependsOn': '前置依赖({done}/{total} 已满足)',
|
|
627
|
+
'detail.dependsPruned': '已归档清理',
|
|
628
|
+
'composer.dependsOn': '前置依赖(可选,逗号分隔,如 t-1, t-2)',
|
|
556
629
|
'detail.note': '备注 / 验收标准',
|
|
557
630
|
'detail.result': '完成结论',
|
|
558
631
|
'detail.error': '最近错误',
|
|
@@ -607,6 +680,7 @@ window.__ModuleLoader__.load({
|
|
|
607
680
|
'poll.skip.creator-cold': '创建这条任务的对话还没激活(历史会话):在那边发一条消息,任务就会回到该对话执行;急的话点「立即派发」',
|
|
608
681
|
// v0.2.0 workspace-lead 路由的跳过原因(poll.lastSkipReason)
|
|
609
682
|
'poll.skip.lead-busy': '工作区组长正在运行,等它空下来再派',
|
|
683
|
+
'poll.skip.lead-worker-busy': '本工作区已有任务正在执行或待组长验收,完成后再自动派发下一条',
|
|
610
684
|
'poll.skip.lead-unavailable': '工作区组长不可用:稍后重试,或在看板点「创建组长」',
|
|
611
685
|
'poll.skip.lead-no-workspace': '无法解析任务的工作区:请从目标工作区的会话里重新加这条任务',
|
|
612
686
|
|
|
@@ -657,6 +731,23 @@ window.__ModuleLoader__.load({
|
|
|
657
731
|
'page.title': 'Task board',
|
|
658
732
|
'page.refresh': 'Refresh',
|
|
659
733
|
'page.refreshing': 'Refreshing…',
|
|
734
|
+
'settings.button': 'Settings',
|
|
735
|
+
'settings.title': 'Board settings',
|
|
736
|
+
'settings.archiveRetention': 'Auto-delete archived tasks after',
|
|
737
|
+
'settings.archiveRetentionHint': 'Archived tasks are permanently removed after the configured minutes (set 0 to never auto-delete).',
|
|
738
|
+
'settings.archiveCurrent': 'Current: delete after {m} min',
|
|
739
|
+
'settings.archiveCurrentNever': 'Current: never auto-delete',
|
|
740
|
+
'settings.archiveNever': 'Never',
|
|
741
|
+
'settings.minutes': '{m} min',
|
|
742
|
+
'settings.minutesUnit': 'minutes (0 = never, max 10080)',
|
|
743
|
+
'settings.save': 'Save',
|
|
744
|
+
'settings.saved': 'Updated archive retention setting',
|
|
745
|
+
'settings.archiveInvalid': 'Enter an integer between 0 and 10080 minutes',
|
|
746
|
+
'settings.worktreeIsolation': 'Git Worktree isolation',
|
|
747
|
+
'settings.worktreeHint': 'Run parallel slices and independent tasks in isolated Git worktrees with shared dependency junctions.',
|
|
748
|
+
'settings.worktreeOn': 'Enabled (isolated)',
|
|
749
|
+
'settings.worktreeOff': 'Disabled (serial)',
|
|
750
|
+
'detail.worktree': 'Worktree',
|
|
660
751
|
'poll.on': 'Polling every {interval}',
|
|
661
752
|
'poll.off': 'Polling paused',
|
|
662
753
|
'poll.lastRun': 'Last check {time}',
|
|
@@ -742,6 +833,11 @@ window.__ModuleLoader__.load({
|
|
|
742
833
|
'detail.sourceUser': 'User (board or chat)',
|
|
743
834
|
'detail.sourceAgent': 'Main agent (model tool)',
|
|
744
835
|
'detail.id': 'Task id',
|
|
836
|
+
'detail.parentTask': '↳ Parent {id}',
|
|
837
|
+
'detail.subtasks': 'Subtasks ({done}/{total} done)',
|
|
838
|
+
'detail.dependsOn': 'Dependencies ({done}/{total} satisfied)',
|
|
839
|
+
'detail.dependsPruned': 'Archived & pruned',
|
|
840
|
+
'composer.dependsOn': 'Depends on (optional, e.g. t-1, t-2)',
|
|
745
841
|
'detail.note': 'Note / acceptance',
|
|
746
842
|
'detail.result': 'Result',
|
|
747
843
|
'detail.error': 'Last error',
|
|
@@ -796,6 +892,7 @@ window.__ModuleLoader__.load({
|
|
|
796
892
|
'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
893
|
// v0.2.0 workspace-lead routing skip reasons (poll.lastSkipReason)
|
|
798
894
|
'poll.skip.lead-busy': 'The workspace lead is running; it will retry once it is idle',
|
|
895
|
+
'poll.skip.lead-worker-busy': 'Another task in this workspace is still running or awaiting lead review; retrying once it finishes',
|
|
799
896
|
'poll.skip.lead-unavailable': 'The workspace lead is unavailable: retry later, or click Create lead on the board',
|
|
800
897
|
'poll.skip.lead-no-workspace': 'Cannot resolve the task workspace: re-add this task from a conversation inside the target workspace',
|
|
801
898
|
|
|
@@ -2426,8 +2523,13 @@ window.__ModuleLoader__.load({
|
|
|
2426
2523
|
className: 'tb-btn tb-btn-sm tb-btn-ghost',
|
|
2427
2524
|
disabled: busy !== '',
|
|
2428
2525
|
onClick: () => {
|
|
2429
|
-
const
|
|
2430
|
-
if (
|
|
2526
|
+
const todos = list.filter((task) => task && task.status === 'todo')
|
|
2527
|
+
if (todos.length === 0) return
|
|
2528
|
+
if (typeof actions.dispatchAll === 'function') {
|
|
2529
|
+
actions.dispatchAll(todos)
|
|
2530
|
+
} else {
|
|
2531
|
+
actions.dispatchNow(todos[0])
|
|
2532
|
+
}
|
|
2431
2533
|
},
|
|
2432
2534
|
},
|
|
2433
2535
|
t('column.dispatchAll'),
|
|
@@ -2616,6 +2718,13 @@ window.__ModuleLoader__.load({
|
|
|
2616
2718
|
placeholder: t('composer.note'),
|
|
2617
2719
|
onChange: (event) => actions.setEditing(Object.assign({}, editing, { note: event.target.value })),
|
|
2618
2720
|
}),
|
|
2721
|
+
h('input', {
|
|
2722
|
+
className: 'tb-input',
|
|
2723
|
+
value: typeof editing.dependsOn === 'string' ? editing.dependsOn : '',
|
|
2724
|
+
placeholder: t('composer.dependsOn'),
|
|
2725
|
+
'aria-label': t('composer.dependsOn'),
|
|
2726
|
+
onChange: (event) => actions.setEditing(Object.assign({}, editing, { dependsOn: event.target.value })),
|
|
2727
|
+
}),
|
|
2619
2728
|
h(
|
|
2620
2729
|
'div',
|
|
2621
2730
|
{ className: 'tb-edit-actions' },
|
|
@@ -2667,7 +2776,11 @@ window.__ModuleLoader__.load({
|
|
|
2667
2776
|
|
|
2668
2777
|
return h(
|
|
2669
2778
|
'article',
|
|
2670
|
-
{
|
|
2779
|
+
{
|
|
2780
|
+
className: 'tb-card tb-card-fixed',
|
|
2781
|
+
'data-subtask': typeof task.parentTaskId === 'string' && task.parentTaskId !== '' ? 'true' : undefined,
|
|
2782
|
+
style: { '--tb-accent': STATUS_ACCENT[status] },
|
|
2783
|
+
},
|
|
2671
2784
|
h(
|
|
2672
2785
|
'div',
|
|
2673
2786
|
{
|
|
@@ -2730,8 +2843,29 @@ window.__ModuleLoader__.load({
|
|
|
2730
2843
|
const answerDraft = typeof bind.answerDraft === 'string' ? bind.answerDraft : ''
|
|
2731
2844
|
const answerError = typeof bind.answerError === 'string' ? bind.answerError : ''
|
|
2732
2845
|
const answerBusyKey = 'answer:' + task.id
|
|
2846
|
+
const boardAllTasks = Array.isArray(bind.allTasks) ? bind.allTasks : []
|
|
2847
|
+
const parentTaskId = typeof task.parentTaskId === 'string' ? task.parentTaskId : ''
|
|
2848
|
+
const parentTask =
|
|
2849
|
+
parentTaskId !== '' ? boardAllTasks.find((item) => item && item.id === parentTaskId) || null : null
|
|
2850
|
+
const subtasks = boardAllTasks.filter((item) => item && item.parentTaskId === task.id)
|
|
2851
|
+
const subtasksDone = subtasks.filter(
|
|
2852
|
+
(item) => item.status === 'done' || item.status === 'archived',
|
|
2853
|
+
).length
|
|
2854
|
+
const dependsList = Array.isArray(task.dependsOn) ? task.dependsOn : []
|
|
2855
|
+
const dependsItems = dependsList.map((depId) => {
|
|
2856
|
+
const found = boardAllTasks.find((item) => item && item.id === depId) || null
|
|
2857
|
+
return {
|
|
2858
|
+
id: depId,
|
|
2859
|
+
task: found,
|
|
2860
|
+
satisfied: !found || found.status === 'done' || found.status === 'archived',
|
|
2861
|
+
}
|
|
2862
|
+
})
|
|
2863
|
+
const dependsDone = dependsItems.filter((entry) => entry.satisfied).length
|
|
2733
2864
|
const metaRows = [
|
|
2734
2865
|
[t('detail.workspace'), task.cwd || '—'],
|
|
2866
|
+
...(typeof task.worktreePath === 'string' && task.worktreePath !== ''
|
|
2867
|
+
? [[t('detail.worktree'), (task.worktreeBranch ? task.worktreeBranch + ' · ' : '') + task.worktreePath]]
|
|
2868
|
+
: []),
|
|
2735
2869
|
[t('detail.lead'), taskLeadLabel(task) || t('detail.noLead')],
|
|
2736
2870
|
[t('detail.assignee'), task.assignee || t('detail.assigneeAuto')],
|
|
2737
2871
|
[t('detail.source'), task.source === 'agent' ? t('detail.sourceAgent') : t('detail.sourceUser')],
|
|
@@ -2793,6 +2927,20 @@ window.__ModuleLoader__.load({
|
|
|
2793
2927
|
{ className: 'tb-detail-badges' },
|
|
2794
2928
|
h('span', { className: 'tb-statusbadge', 'data-status': task.status }, t('column.' + task.status)),
|
|
2795
2929
|
h('span', { className: 'tb-detail-chip' }, task.id),
|
|
2930
|
+
parentTaskId !== ''
|
|
2931
|
+
? parentTask
|
|
2932
|
+
? h(
|
|
2933
|
+
'button',
|
|
2934
|
+
{
|
|
2935
|
+
type: 'button',
|
|
2936
|
+
className: 'tb-detail-chip tb-detail-parent',
|
|
2937
|
+
title: parentTask.title || parentTaskId,
|
|
2938
|
+
onClick: () => bind.actions.openDetail(parentTask),
|
|
2939
|
+
},
|
|
2940
|
+
t('detail.parentTask', { id: parentTaskId }),
|
|
2941
|
+
)
|
|
2942
|
+
: h('span', { className: 'tb-detail-chip' }, t('detail.parentTask', { id: parentTaskId }))
|
|
2943
|
+
: null,
|
|
2796
2944
|
h(
|
|
2797
2945
|
'span',
|
|
2798
2946
|
{ className: 'tb-detail-chip' },
|
|
@@ -2907,6 +3055,77 @@ window.__ModuleLoader__.load({
|
|
|
2907
3055
|
task.note ? renderRichText(task.note, richOptions) : t('detail.emptyNote'),
|
|
2908
3056
|
),
|
|
2909
3057
|
),
|
|
3058
|
+
dependsItems.length > 0
|
|
3059
|
+
? h(
|
|
3060
|
+
'section',
|
|
3061
|
+
{ className: 'tb-detail-section tb-detail-depends' },
|
|
3062
|
+
h(
|
|
3063
|
+
'h3',
|
|
3064
|
+
{ className: 'tb-detail-sub' },
|
|
3065
|
+
t('detail.dependsOn', { done: dependsDone, total: dependsItems.length }),
|
|
3066
|
+
),
|
|
3067
|
+
h(
|
|
3068
|
+
'div',
|
|
3069
|
+
{ className: 'tb-subtasks' },
|
|
3070
|
+
dependsItems.map((entry) =>
|
|
3071
|
+
entry.task
|
|
3072
|
+
? h(
|
|
3073
|
+
'button',
|
|
3074
|
+
{
|
|
3075
|
+
key: entry.id,
|
|
3076
|
+
type: 'button',
|
|
3077
|
+
className: 'tb-subtask-item',
|
|
3078
|
+
title: entry.task.title || entry.id,
|
|
3079
|
+
onClick: () => bind.actions.openDetail(entry.task),
|
|
3080
|
+
},
|
|
3081
|
+
h(
|
|
3082
|
+
'span',
|
|
3083
|
+
{ className: 'tb-statusbadge', 'data-status': entry.task.status },
|
|
3084
|
+
t('column.' + entry.task.status),
|
|
3085
|
+
),
|
|
3086
|
+
h('span', { className: 'tb-detail-chip' }, entry.id),
|
|
3087
|
+
h('span', { className: 'tb-subtask-title' }, entry.task.title || ''),
|
|
3088
|
+
)
|
|
3089
|
+
: h(
|
|
3090
|
+
'div',
|
|
3091
|
+
{ key: entry.id, className: 'tb-subtask-item' },
|
|
3092
|
+
h('span', { className: 'tb-statusbadge', 'data-status': 'archived' }, t('detail.dependsPruned')),
|
|
3093
|
+
h('span', { className: 'tb-detail-chip' }, entry.id),
|
|
3094
|
+
),
|
|
3095
|
+
),
|
|
3096
|
+
),
|
|
3097
|
+
)
|
|
3098
|
+
: null,
|
|
3099
|
+
subtasks.length > 0
|
|
3100
|
+
? h(
|
|
3101
|
+
'section',
|
|
3102
|
+
{ className: 'tb-detail-section tb-detail-subtasks' },
|
|
3103
|
+
h(
|
|
3104
|
+
'h3',
|
|
3105
|
+
{ className: 'tb-detail-sub' },
|
|
3106
|
+
t('detail.subtasks', { done: subtasksDone, total: subtasks.length }),
|
|
3107
|
+
),
|
|
3108
|
+
h(
|
|
3109
|
+
'div',
|
|
3110
|
+
{ className: 'tb-subtasks' },
|
|
3111
|
+
subtasks.map((sub) =>
|
|
3112
|
+
h(
|
|
3113
|
+
'button',
|
|
3114
|
+
{
|
|
3115
|
+
key: sub.id,
|
|
3116
|
+
type: 'button',
|
|
3117
|
+
className: 'tb-subtask-item',
|
|
3118
|
+
title: sub.title || sub.id,
|
|
3119
|
+
onClick: () => bind.actions.openDetail(sub),
|
|
3120
|
+
},
|
|
3121
|
+
h('span', { className: 'tb-statusbadge', 'data-status': sub.status }, t('column.' + sub.status)),
|
|
3122
|
+
h('span', { className: 'tb-detail-chip' }, sub.id),
|
|
3123
|
+
h('span', { className: 'tb-subtask-title' }, sub.title || ''),
|
|
3124
|
+
),
|
|
3125
|
+
),
|
|
3126
|
+
),
|
|
3127
|
+
)
|
|
3128
|
+
: null,
|
|
2910
3129
|
h(
|
|
2911
3130
|
'section',
|
|
2912
3131
|
{ className: 'tb-detail-section' },
|
|
@@ -3141,7 +3360,156 @@ window.__ModuleLoader__.load({
|
|
|
3141
3360
|
return h('div', { className: 'tb-leads', role: 'group', 'aria-label': t('lead.barLabel') }, cells)
|
|
3142
3361
|
}
|
|
3143
3362
|
|
|
3144
|
-
|
|
3363
|
+
/** 看板顶部可折叠「设置」面板(v0.3.6,两块看板共用):配置归档任务自动删除分钟数。 */
|
|
3364
|
+
function SettingsPanel() {
|
|
3365
|
+
if (!bind.showSettings) return null
|
|
3366
|
+
const t = bind.t
|
|
3367
|
+
const busyNow = bind.busy !== ''
|
|
3368
|
+
const actions = bind.actions
|
|
3369
|
+
const cfg = bind.config || {}
|
|
3370
|
+
const currentMinutes =
|
|
3371
|
+
typeof cfg.archiveRetentionMinutes === 'number' && Number.isFinite(cfg.archiveRetentionMinutes)
|
|
3372
|
+
? cfg.archiveRetentionMinutes
|
|
3373
|
+
: 30
|
|
3374
|
+
const draft = typeof bind.retentionDraft === 'string' ? bind.retentionDraft : String(currentMinutes)
|
|
3375
|
+
return h(
|
|
3376
|
+
'section',
|
|
3377
|
+
{ className: 'tb-settings', role: 'region', 'aria-label': t('settings.title') },
|
|
3378
|
+
h(
|
|
3379
|
+
'div',
|
|
3380
|
+
{ className: 'tb-settings-head' },
|
|
3381
|
+
h(
|
|
3382
|
+
'div',
|
|
3383
|
+
{ style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap' } },
|
|
3384
|
+
h('h2', { className: 'tb-settings-title' }, t('settings.title')),
|
|
3385
|
+
h(
|
|
3386
|
+
'span',
|
|
3387
|
+
{ className: 'tb-settings-badge' },
|
|
3388
|
+
currentMinutes === 0 ? t('settings.archiveCurrentNever') : t('settings.archiveCurrent', { m: currentMinutes }),
|
|
3389
|
+
),
|
|
3390
|
+
),
|
|
3391
|
+
h(
|
|
3392
|
+
'button',
|
|
3393
|
+
{
|
|
3394
|
+
type: 'button',
|
|
3395
|
+
className: 'tb-detail-close',
|
|
3396
|
+
onClick: () => actions.setShowSettings(false),
|
|
3397
|
+
'aria-label': t('detail.close'),
|
|
3398
|
+
},
|
|
3399
|
+
'\u00d7',
|
|
3400
|
+
),
|
|
3401
|
+
),
|
|
3402
|
+
h(
|
|
3403
|
+
'div',
|
|
3404
|
+
{ className: 'tb-settings-body' },
|
|
3405
|
+
h(
|
|
3406
|
+
'div',
|
|
3407
|
+
{ className: 'tb-settings-row' },
|
|
3408
|
+
h(
|
|
3409
|
+
'label',
|
|
3410
|
+
{ className: 'tb-settings-field' },
|
|
3411
|
+
h('span', { className: 'tb-settings-label' }, t('poll.interval')),
|
|
3412
|
+
h(
|
|
3413
|
+
'select',
|
|
3414
|
+
{
|
|
3415
|
+
className: 'tb-select',
|
|
3416
|
+
value: String(cfg.pollIntervalMs || 15000),
|
|
3417
|
+
disabled: busyNow,
|
|
3418
|
+
'aria-label': t('poll.interval'),
|
|
3419
|
+
onChange: (event) => actions.setConfig({ pollIntervalMs: Number(event.target.value) }),
|
|
3420
|
+
},
|
|
3421
|
+
[5000, 15000, 30000, 60000].map((ms) => h('option', { key: ms, value: String(ms) }, fmtInterval(ms))),
|
|
3422
|
+
),
|
|
3423
|
+
),
|
|
3424
|
+
h(
|
|
3425
|
+
'label',
|
|
3426
|
+
{ className: 'tb-settings-field' },
|
|
3427
|
+
h('span', { className: 'tb-settings-label' }, t('dispatch.mode')),
|
|
3428
|
+
h(
|
|
3429
|
+
'select',
|
|
3430
|
+
{
|
|
3431
|
+
className: 'tb-select',
|
|
3432
|
+
value: dispatchModeOf(cfg),
|
|
3433
|
+
disabled: busyNow,
|
|
3434
|
+
title: t('dispatch.modeHint'),
|
|
3435
|
+
'aria-label': t('dispatch.mode'),
|
|
3436
|
+
onChange: (event) => actions.setConfig({ dispatchMode: event.target.value }),
|
|
3437
|
+
},
|
|
3438
|
+
DISPATCH_MODES.map((mode) => h('option', { key: mode, value: mode }, t('dispatch.mode.' + mode))),
|
|
3439
|
+
),
|
|
3440
|
+
),
|
|
3441
|
+
h(
|
|
3442
|
+
'div',
|
|
3443
|
+
{ className: 'tb-settings-field' },
|
|
3444
|
+
h('span', { className: 'tb-settings-label' }, t('settings.worktreeIsolation')),
|
|
3445
|
+
h(
|
|
3446
|
+
'button',
|
|
3447
|
+
{
|
|
3448
|
+
type: 'button',
|
|
3449
|
+
className: 'tb-btn tb-btn-sm' + (cfg.worktreeIsolation !== false ? ' tb-btn-primary' : ''),
|
|
3450
|
+
disabled: busyNow,
|
|
3451
|
+
title: t('settings.worktreeHint'),
|
|
3452
|
+
'aria-label': t('settings.worktreeIsolation'),
|
|
3453
|
+
onClick: () => actions.setConfig({ worktreeIsolation: cfg.worktreeIsolation === false }),
|
|
3454
|
+
},
|
|
3455
|
+
cfg.worktreeIsolation !== false ? t('settings.worktreeOn') : t('settings.worktreeOff'),
|
|
3456
|
+
),
|
|
3457
|
+
),
|
|
3458
|
+
),
|
|
3459
|
+
h('div', { className: 'tb-settings-label' }, t('settings.archiveRetention')),
|
|
3460
|
+
h('p', { className: 'tb-settings-hint' }, t('settings.archiveRetentionHint')),
|
|
3461
|
+
h(
|
|
3462
|
+
'div',
|
|
3463
|
+
{ className: 'tb-settings-presets' },
|
|
3464
|
+
ARCHIVE_RETENTION_PRESETS.map((m) =>
|
|
3465
|
+
h(
|
|
3466
|
+
'button',
|
|
3467
|
+
{
|
|
3468
|
+
key: String(m),
|
|
3469
|
+
type: 'button',
|
|
3470
|
+
className: 'tb-btn tb-btn-sm' + (currentMinutes === m ? ' tb-btn-primary' : ''),
|
|
3471
|
+
disabled: busyNow,
|
|
3472
|
+
onClick: () => actions.saveArchiveRetention(m),
|
|
3473
|
+
},
|
|
3474
|
+
m === 0 ? t('settings.archiveNever') : t('settings.minutes', { m }),
|
|
3475
|
+
),
|
|
3476
|
+
),
|
|
3477
|
+
),
|
|
3478
|
+
h(
|
|
3479
|
+
'div',
|
|
3480
|
+
{ className: 'tb-settings-custom' },
|
|
3481
|
+
h('input', {
|
|
3482
|
+
type: 'number',
|
|
3483
|
+
min: 0,
|
|
3484
|
+
max: 10080,
|
|
3485
|
+
className: 'tb-input tb-settings-input',
|
|
3486
|
+
value: draft,
|
|
3487
|
+
'aria-label': t('settings.archiveRetention'),
|
|
3488
|
+
onChange: (event) => actions.setRetentionDraft(event.target.value),
|
|
3489
|
+
onKeyDown: (event) => {
|
|
3490
|
+
if (event.key === 'Enter') {
|
|
3491
|
+
event.preventDefault()
|
|
3492
|
+
actions.saveArchiveRetention()
|
|
3493
|
+
}
|
|
3494
|
+
},
|
|
3495
|
+
}),
|
|
3496
|
+
h('span', { className: 'tb-settings-unit' }, t('settings.minutesUnit')),
|
|
3497
|
+
h(
|
|
3498
|
+
'button',
|
|
3499
|
+
{
|
|
3500
|
+
type: 'button',
|
|
3501
|
+
className: 'tb-btn tb-btn-sm tb-btn-primary',
|
|
3502
|
+
disabled: busyNow || String(draft).trim() === '',
|
|
3503
|
+
onClick: () => actions.saveArchiveRetention(),
|
|
3504
|
+
},
|
|
3505
|
+
t('settings.save'),
|
|
3506
|
+
),
|
|
3507
|
+
),
|
|
3508
|
+
),
|
|
3509
|
+
)
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
return { Banner, Col, Detail, LeadBar, NeedsBanner, NeedsColumn, SettingsPanel, sessionCandidatesOf }
|
|
3145
3513
|
}
|
|
3146
3514
|
|
|
3147
3515
|
/* ── 看板页 ─────────────────────────────────────────────── */
|
|
@@ -3183,7 +3551,10 @@ window.__ModuleLoader__.load({
|
|
|
3183
3551
|
const [notice, setNotice] = useState(null)
|
|
3184
3552
|
const [title, setTitle] = useState('')
|
|
3185
3553
|
const [note, setNote] = useState('')
|
|
3554
|
+
const [dependsDraft, setDependsDraft] = useState('')
|
|
3186
3555
|
const [showNote, setShowNote] = useState(false)
|
|
3556
|
+
const [showSettings, setShowSettings] = useState(false)
|
|
3557
|
+
const [retentionDraft, setRetentionDraft] = useState('30')
|
|
3187
3558
|
// v0.2.0:待提交的粘贴图片({id, preview, ...})与详情浮层的附件 data URL 缓存。
|
|
3188
3559
|
const [attachments, setAttachments] = useState([])
|
|
3189
3560
|
// 上传中的请求计数(不是布尔):连续多次粘贴时,只有全部结束才解除提交禁用。
|
|
@@ -3296,9 +3667,9 @@ window.__ModuleLoader__.load({
|
|
|
3296
3667
|
const groups = groupTasks(tasks)
|
|
3297
3668
|
const preset = (snap && snap.preset) || null
|
|
3298
3669
|
// v0.2.0 组长条:leads 是运行时视图(组长启停 / 忙闲不 bump revision),每次渲染都读最新值;
|
|
3299
|
-
//
|
|
3670
|
+
// 右栏只列当前看板可见任务(含待你处理)涉及的工作区,没组长的补「创建组长」入口。
|
|
3300
3671
|
const leads = (snap && snap.leads) || null
|
|
3301
|
-
const leadRows = workspaceLeadRows(leads, taskWorkspaceCwds(
|
|
3672
|
+
const leadRows = workspaceLeadRows(leads, taskWorkspaceCwds(workspaceTasks, cwdForHint), { all: false })
|
|
3302
3673
|
|
|
3303
3674
|
/** 统一执行一次写操作:忙态 + 错误提示 + 成功后刷新。 */
|
|
3304
3675
|
const run = useCallback(
|
|
@@ -3336,11 +3707,13 @@ window.__ModuleLoader__.load({
|
|
|
3336
3707
|
}
|
|
3337
3708
|
const payload = { title: trimmedTitle }
|
|
3338
3709
|
if (note.trim() !== '') payload.note = note.trim()
|
|
3710
|
+
if (dependsDraft.trim() !== '') payload.dependsOn = dependsDraft.trim()
|
|
3339
3711
|
if (sessionId !== '') payload.sessionId = sessionId
|
|
3340
3712
|
run('add', () => callRpc('add-task', payload)).then((value) => {
|
|
3341
3713
|
if (!value) return
|
|
3342
3714
|
setTitle('')
|
|
3343
3715
|
setNote('')
|
|
3716
|
+
setDependsDraft('')
|
|
3344
3717
|
setShowNote(false)
|
|
3345
3718
|
setAttachments([])
|
|
3346
3719
|
})
|
|
@@ -3377,6 +3750,41 @@ window.__ModuleLoader__.load({
|
|
|
3377
3750
|
})
|
|
3378
3751
|
}
|
|
3379
3752
|
|
|
3753
|
+
function dispatchAll(todos) {
|
|
3754
|
+
const items = Array.isArray(todos) ? todos.filter((task) => task && task.status === 'todo') : []
|
|
3755
|
+
if (items.length === 0) return
|
|
3756
|
+
if (items.length === 1) {
|
|
3757
|
+
dispatchNow(items[0])
|
|
3758
|
+
return
|
|
3759
|
+
}
|
|
3760
|
+
run('dispatchAll', async () => {
|
|
3761
|
+
let lastRes = { ok: true, value: null }
|
|
3762
|
+
let lastDispatched = null
|
|
3763
|
+
for (const task of items) {
|
|
3764
|
+
const res = await callRpc('dispatch-now', { id: task.id })
|
|
3765
|
+
lastRes = res
|
|
3766
|
+
if (!res.ok) return res
|
|
3767
|
+
if (res.value && res.value.dispatched) lastDispatched = res.value
|
|
3768
|
+
}
|
|
3769
|
+
return lastDispatched ? { ok: true, value: lastDispatched } : lastRes
|
|
3770
|
+
}).then((value) => {
|
|
3771
|
+
if (!value) return
|
|
3772
|
+
if (value.dispatched) {
|
|
3773
|
+
setNotice({ tone: 'ok', text: t('action.dispatched', { session: shortSession(value.sessionId) }) })
|
|
3774
|
+
} else {
|
|
3775
|
+
const reason = (poll && poll.lastSkipReason) || value.reason || ''
|
|
3776
|
+
setNotice({ tone: 'warn', text: t('poll.skip.' + reason) === 'poll.skip.' + reason ? reason : t('poll.skip.' + reason) })
|
|
3777
|
+
}
|
|
3778
|
+
})
|
|
3779
|
+
}
|
|
3780
|
+
|
|
3781
|
+
function refreshNow() {
|
|
3782
|
+
setBusy('refresh')
|
|
3783
|
+
refresh().finally(() => {
|
|
3784
|
+
if (aliveRef.current) setBusy('')
|
|
3785
|
+
})
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3380
3788
|
/**
|
|
3381
3789
|
* v0.2.2(§1.9):提交回答。不用 run():错误要显示在详情浮层的回答区(而不是顶部条),
|
|
3382
3790
|
* 失败时不关闭浮层、不丢输入;成功后关闭浮层、清草稿并刷新看板。
|
|
@@ -3412,6 +3820,25 @@ window.__ModuleLoader__.load({
|
|
|
3412
3820
|
run('config', () => callRpc('set-config', patch))
|
|
3413
3821
|
}
|
|
3414
3822
|
|
|
3823
|
+
function toggleSettings() {
|
|
3824
|
+
const currentMinutes =
|
|
3825
|
+
config && typeof config.archiveRetentionMinutes === 'number' ? config.archiveRetentionMinutes : 30
|
|
3826
|
+
if (!showSettings) setRetentionDraft(String(currentMinutes))
|
|
3827
|
+
setShowSettings(!showSettings)
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
function saveArchiveRetention(rawMinutes) {
|
|
3831
|
+
const raw = rawMinutes !== undefined ? String(rawMinutes) : String(retentionDraft || '').trim()
|
|
3832
|
+
const parsed = Number(raw)
|
|
3833
|
+
if (raw === '' || !Number.isFinite(parsed) || parsed < 0 || parsed > 10080) {
|
|
3834
|
+
setNotice({ tone: 'warn', text: t('settings.archiveInvalid') })
|
|
3835
|
+
return
|
|
3836
|
+
}
|
|
3837
|
+
const minutes = Math.round(parsed)
|
|
3838
|
+
setRetentionDraft(String(minutes))
|
|
3839
|
+
run('config', () => callRpc('set-config', { archiveRetentionMinutes: minutes }), t('settings.saved'))
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3415
3842
|
function archiveDone() {
|
|
3416
3843
|
run('archiveDone', () => callRpc('archive-done', {})).then((value) => {
|
|
3417
3844
|
if (value && value.archived > 0) setNotice({ tone: 'ok', text: t('action.archived', { n: value.archived }) })
|
|
@@ -3419,7 +3846,14 @@ window.__ModuleLoader__.load({
|
|
|
3419
3846
|
}
|
|
3420
3847
|
|
|
3421
3848
|
function startEdit(task) {
|
|
3422
|
-
|
|
3849
|
+
const initialDependsOn = Array.isArray(task.dependsOn) ? task.dependsOn.join(', ') : ''
|
|
3850
|
+
setEditing({
|
|
3851
|
+
id: task.id,
|
|
3852
|
+
title: task.title,
|
|
3853
|
+
note: task.note || '',
|
|
3854
|
+
dependsOn: initialDependsOn,
|
|
3855
|
+
initialDependsOn,
|
|
3856
|
+
})
|
|
3423
3857
|
}
|
|
3424
3858
|
|
|
3425
3859
|
function saveEdit() {
|
|
@@ -3435,7 +3869,13 @@ window.__ModuleLoader__.load({
|
|
|
3435
3869
|
setNotice({ tone: 'error', text: limitText })
|
|
3436
3870
|
return
|
|
3437
3871
|
}
|
|
3438
|
-
|
|
3872
|
+
const patch = { title: trimmedTitle, note: String(editing.note || '').trim() }
|
|
3873
|
+
const rawDeps = String(editing.dependsOn || '').trim()
|
|
3874
|
+
const initDeps = String(editing.initialDependsOn || '').trim()
|
|
3875
|
+
if (rawDeps !== initDeps) {
|
|
3876
|
+
patch.dependsOn = rawDeps === '' ? [] : rawDeps
|
|
3877
|
+
}
|
|
3878
|
+
updateTask(editing.id, patch)
|
|
3439
3879
|
setEditing(null)
|
|
3440
3880
|
}
|
|
3441
3881
|
|
|
@@ -3522,6 +3962,7 @@ window.__ModuleLoader__.load({
|
|
|
3522
3962
|
const boardActions = {
|
|
3523
3963
|
updateTask,
|
|
3524
3964
|
dispatchNow,
|
|
3965
|
+
dispatchAll,
|
|
3525
3966
|
removeTask,
|
|
3526
3967
|
requestDelete,
|
|
3527
3968
|
isConfirmingDelete: (id) => confirmDeleteId === id,
|
|
@@ -3550,6 +3991,11 @@ window.__ModuleLoader__.load({
|
|
|
3550
3991
|
// v0.2.2「待你处理」:回答草稿由看板持有,浮层通过 bind.actions 读写。
|
|
3551
3992
|
setAnswerDraft,
|
|
3552
3993
|
submitAnswer,
|
|
3994
|
+
setConfig,
|
|
3995
|
+
toggleSettings,
|
|
3996
|
+
setShowSettings,
|
|
3997
|
+
setRetentionDraft,
|
|
3998
|
+
saveArchiveRetention,
|
|
3553
3999
|
}
|
|
3554
4000
|
if (boardBindRef.current === null) {
|
|
3555
4001
|
boardBindRef.current = {
|
|
@@ -3578,6 +4024,10 @@ window.__ModuleLoader__.load({
|
|
|
3578
4024
|
boardBindRef.current.currentSessionId = sessionId
|
|
3579
4025
|
boardBindRef.current.leadActions = leadActions
|
|
3580
4026
|
// v0.2.2「待你处理」:条 / 第五列的任务列表与回答草稿(每次渲染都刷新)。
|
|
4027
|
+
boardBindRef.current.allTasks = allTasks
|
|
4028
|
+
boardBindRef.current.config = config
|
|
4029
|
+
boardBindRef.current.showSettings = showSettings
|
|
4030
|
+
boardBindRef.current.retentionDraft = retentionDraft
|
|
3581
4031
|
boardBindRef.current.needsUserTasks = needsUser
|
|
3582
4032
|
boardBindRef.current.answerDraft = answerDraft
|
|
3583
4033
|
boardBindRef.current.answerError = answerError
|
|
@@ -3588,6 +4038,7 @@ window.__ModuleLoader__.load({
|
|
|
3588
4038
|
const LeadBar = boardPiecesRef.current.LeadBar
|
|
3589
4039
|
const NeedsBanner = boardPiecesRef.current.NeedsBanner
|
|
3590
4040
|
const NeedsColumn = boardPiecesRef.current.NeedsColumn
|
|
4041
|
+
const SettingsPanel = boardPiecesRef.current.SettingsPanel
|
|
3591
4042
|
|
|
3592
4043
|
/* ── 顶部状态文案 ─────────────────────────────────────── */
|
|
3593
4044
|
|
|
@@ -3626,22 +4077,6 @@ window.__ModuleLoader__.load({
|
|
|
3626
4077
|
'div',
|
|
3627
4078
|
{ className: 'tb-head-main' },
|
|
3628
4079
|
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
4080
|
unboundElsewhere > 0
|
|
3646
4081
|
? h('p', { className: 'tb-sub tb-unbound' }, t('board.unboundHint', { n: unboundElsewhere }))
|
|
3647
4082
|
: null,
|
|
@@ -3649,38 +4084,6 @@ window.__ModuleLoader__.load({
|
|
|
3649
4084
|
h(
|
|
3650
4085
|
'div',
|
|
3651
4086
|
{ 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
4087
|
h(
|
|
3685
4088
|
'button',
|
|
3686
4089
|
{
|
|
@@ -3693,12 +4096,23 @@ window.__ModuleLoader__.load({
|
|
|
3693
4096
|
),
|
|
3694
4097
|
h(
|
|
3695
4098
|
'button',
|
|
3696
|
-
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick:
|
|
4099
|
+
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick: refreshNow },
|
|
3697
4100
|
busy === 'refresh' ? t('page.refreshing') : t('page.refresh'),
|
|
3698
4101
|
),
|
|
4102
|
+
h(
|
|
4103
|
+
'button',
|
|
4104
|
+
{
|
|
4105
|
+
type: 'button',
|
|
4106
|
+
className: 'tb-btn' + (showSettings ? ' tb-btn-active' : ''),
|
|
4107
|
+
'aria-expanded': showSettings ? 'true' : 'false',
|
|
4108
|
+
onClick: toggleSettings,
|
|
4109
|
+
},
|
|
4110
|
+
t('settings.button'),
|
|
4111
|
+
),
|
|
3699
4112
|
),
|
|
3700
4113
|
),
|
|
3701
4114
|
|
|
4115
|
+
h(SettingsPanel, { key: 'settings' }),
|
|
3702
4116
|
h(LeadBar, { key: 'leads' }),
|
|
3703
4117
|
presetBanner ? h(Banner, { item: presetBanner }) : null,
|
|
3704
4118
|
notice ? h(Banner, { item: notice, onClose: () => setNotice(null) }) : null,
|
|
@@ -3755,6 +4169,15 @@ window.__ModuleLoader__.load({
|
|
|
3755
4169
|
onPaste: onNotePaste,
|
|
3756
4170
|
})
|
|
3757
4171
|
: null,
|
|
4172
|
+
showNote
|
|
4173
|
+
? h('input', {
|
|
4174
|
+
className: 'tb-input',
|
|
4175
|
+
placeholder: t('composer.dependsOn'),
|
|
4176
|
+
'aria-label': t('composer.dependsOn'),
|
|
4177
|
+
value: dependsDraft,
|
|
4178
|
+
onChange: (event) => setDependsDraft(event.target.value),
|
|
4179
|
+
})
|
|
4180
|
+
: null,
|
|
3758
4181
|
attachments.length > 0
|
|
3759
4182
|
? h(
|
|
3760
4183
|
'div',
|
|
@@ -3997,7 +4420,10 @@ window.__ModuleLoader__.load({
|
|
|
3997
4420
|
const [notice, setNotice] = useState(null)
|
|
3998
4421
|
const [title, setTitle] = useState('')
|
|
3999
4422
|
const [note, setNote] = useState('')
|
|
4423
|
+
const [dependsDraft, setDependsDraft] = useState('')
|
|
4000
4424
|
const [showNote, setShowNote] = useState(false)
|
|
4425
|
+
const [showSettings, setShowSettings] = useState(false)
|
|
4426
|
+
const [retentionDraft, setRetentionDraft] = useState('30')
|
|
4001
4427
|
// v0.2.0:与右栏看板同一套粘贴图片 / 详情附件缓存。
|
|
4002
4428
|
const [attachments, setAttachments] = useState([])
|
|
4003
4429
|
// 上传中的请求计数(不是布尔):连续多次粘贴时,只有全部结束才解除提交禁用。
|
|
@@ -4158,10 +4584,12 @@ window.__ModuleLoader__.load({
|
|
|
4158
4584
|
// 用校验后的 activeWorkspaceCwd:选中的工作区被删 / 改名时不会把失效路径写进任务。
|
|
4159
4585
|
const payload = { title: trimmedTitle, cwd: activeWorkspaceCwd }
|
|
4160
4586
|
if (note.trim() !== '') payload.note = note.trim()
|
|
4587
|
+
if (dependsDraft.trim() !== '') payload.dependsOn = dependsDraft.trim()
|
|
4161
4588
|
run('add', () => callRpc('add-task', payload)).then((value) => {
|
|
4162
4589
|
if (!value) return
|
|
4163
4590
|
setTitle('')
|
|
4164
4591
|
setNote('')
|
|
4592
|
+
setDependsDraft('')
|
|
4165
4593
|
setShowNote(false)
|
|
4166
4594
|
setAttachments([])
|
|
4167
4595
|
})
|
|
@@ -4235,6 +4663,41 @@ window.__ModuleLoader__.load({
|
|
|
4235
4663
|
})
|
|
4236
4664
|
}
|
|
4237
4665
|
|
|
4666
|
+
function dispatchAll(todos) {
|
|
4667
|
+
const items = Array.isArray(todos) ? todos.filter((task) => task && task.status === 'todo') : []
|
|
4668
|
+
if (items.length === 0) return
|
|
4669
|
+
if (items.length === 1) {
|
|
4670
|
+
dispatchNow(items[0])
|
|
4671
|
+
return
|
|
4672
|
+
}
|
|
4673
|
+
run('dispatchAll', async () => {
|
|
4674
|
+
let lastRes = { ok: true, value: null }
|
|
4675
|
+
let lastDispatched = null
|
|
4676
|
+
for (const task of items) {
|
|
4677
|
+
const res = await callRpc('dispatch-now', { id: task.id })
|
|
4678
|
+
lastRes = res
|
|
4679
|
+
if (!res.ok) return res
|
|
4680
|
+
if (res.value && res.value.dispatched) lastDispatched = res.value
|
|
4681
|
+
}
|
|
4682
|
+
return lastDispatched ? { ok: true, value: lastDispatched } : lastRes
|
|
4683
|
+
}).then((value) => {
|
|
4684
|
+
if (!value) return
|
|
4685
|
+
if (value.dispatched) {
|
|
4686
|
+
setNotice({ tone: 'ok', text: t('action.dispatched', { session: shortSession(value.sessionId) }) })
|
|
4687
|
+
} else {
|
|
4688
|
+
const reason = (poll && poll.lastSkipReason) || value.reason || ''
|
|
4689
|
+
setNotice({ tone: 'warn', text: t('poll.skip.' + reason) === 'poll.skip.' + reason ? reason : t('poll.skip.' + reason) })
|
|
4690
|
+
}
|
|
4691
|
+
})
|
|
4692
|
+
}
|
|
4693
|
+
|
|
4694
|
+
function refreshNow() {
|
|
4695
|
+
setBusy('refresh')
|
|
4696
|
+
refresh().finally(() => {
|
|
4697
|
+
if (aliveRef.current) setBusy('')
|
|
4698
|
+
})
|
|
4699
|
+
}
|
|
4700
|
+
|
|
4238
4701
|
/**
|
|
4239
4702
|
* v0.2.2(§1.9):提交回答。不用 run():错误要显示在详情浮层的回答区(而不是顶部条),
|
|
4240
4703
|
* 失败时不关闭浮层、不丢输入;成功后关闭浮层、清草稿并刷新看板。
|
|
@@ -4270,6 +4733,25 @@ window.__ModuleLoader__.load({
|
|
|
4270
4733
|
run('config', () => callRpc('set-config', patch))
|
|
4271
4734
|
}
|
|
4272
4735
|
|
|
4736
|
+
function toggleSettings() {
|
|
4737
|
+
const currentMinutes =
|
|
4738
|
+
config && typeof config.archiveRetentionMinutes === 'number' ? config.archiveRetentionMinutes : 30
|
|
4739
|
+
if (!showSettings) setRetentionDraft(String(currentMinutes))
|
|
4740
|
+
setShowSettings(!showSettings)
|
|
4741
|
+
}
|
|
4742
|
+
|
|
4743
|
+
function saveArchiveRetention(rawMinutes) {
|
|
4744
|
+
const raw = rawMinutes !== undefined ? String(rawMinutes) : String(retentionDraft || '').trim()
|
|
4745
|
+
const parsed = Number(raw)
|
|
4746
|
+
if (raw === '' || !Number.isFinite(parsed) || parsed < 0 || parsed > 10080) {
|
|
4747
|
+
setNotice({ tone: 'warn', text: t('settings.archiveInvalid') })
|
|
4748
|
+
return
|
|
4749
|
+
}
|
|
4750
|
+
const minutes = Math.round(parsed)
|
|
4751
|
+
setRetentionDraft(String(minutes))
|
|
4752
|
+
run('config', () => callRpc('set-config', { archiveRetentionMinutes: minutes }), t('settings.saved'))
|
|
4753
|
+
}
|
|
4754
|
+
|
|
4273
4755
|
function archiveDone() {
|
|
4274
4756
|
run('archiveDone', () => callRpc('archive-done', {})).then((value) => {
|
|
4275
4757
|
if (value && value.archived > 0) setNotice({ tone: 'ok', text: t('action.archived', { n: value.archived }) })
|
|
@@ -4277,7 +4759,14 @@ window.__ModuleLoader__.load({
|
|
|
4277
4759
|
}
|
|
4278
4760
|
|
|
4279
4761
|
function startEdit(task) {
|
|
4280
|
-
|
|
4762
|
+
const initialDependsOn = Array.isArray(task.dependsOn) ? task.dependsOn.join(', ') : ''
|
|
4763
|
+
setEditing({
|
|
4764
|
+
id: task.id,
|
|
4765
|
+
title: task.title,
|
|
4766
|
+
note: task.note || '',
|
|
4767
|
+
dependsOn: initialDependsOn,
|
|
4768
|
+
initialDependsOn,
|
|
4769
|
+
})
|
|
4281
4770
|
}
|
|
4282
4771
|
|
|
4283
4772
|
function saveEdit() {
|
|
@@ -4293,7 +4782,13 @@ window.__ModuleLoader__.load({
|
|
|
4293
4782
|
setNotice({ tone: 'error', text: limitText })
|
|
4294
4783
|
return
|
|
4295
4784
|
}
|
|
4296
|
-
|
|
4785
|
+
const patch = { title: trimmedTitle, note: String(editing.note || '').trim() }
|
|
4786
|
+
const rawDeps = String(editing.dependsOn || '').trim()
|
|
4787
|
+
const initDeps = String(editing.initialDependsOn || '').trim()
|
|
4788
|
+
if (rawDeps !== initDeps) {
|
|
4789
|
+
patch.dependsOn = rawDeps === '' ? [] : rawDeps
|
|
4790
|
+
}
|
|
4791
|
+
updateTask(editing.id, patch)
|
|
4297
4792
|
setEditing(null)
|
|
4298
4793
|
}
|
|
4299
4794
|
|
|
@@ -4373,6 +4868,7 @@ window.__ModuleLoader__.load({
|
|
|
4373
4868
|
const boardActions = {
|
|
4374
4869
|
updateTask,
|
|
4375
4870
|
dispatchNow,
|
|
4871
|
+
dispatchAll,
|
|
4376
4872
|
removeTask,
|
|
4377
4873
|
requestDelete,
|
|
4378
4874
|
isConfirmingDelete: (id) => confirmDeleteId === id,
|
|
@@ -4401,6 +4897,11 @@ window.__ModuleLoader__.load({
|
|
|
4401
4897
|
// v0.2.2「待你处理」:回答草稿由看板持有,浮层通过 bind.actions 读写。
|
|
4402
4898
|
setAnswerDraft,
|
|
4403
4899
|
submitAnswer,
|
|
4900
|
+
setConfig,
|
|
4901
|
+
toggleSettings,
|
|
4902
|
+
setShowSettings,
|
|
4903
|
+
setRetentionDraft,
|
|
4904
|
+
saveArchiveRetention,
|
|
4404
4905
|
}
|
|
4405
4906
|
if (boardBindRef.current === null) {
|
|
4406
4907
|
boardBindRef.current = {
|
|
@@ -4431,6 +4932,10 @@ window.__ModuleLoader__.load({
|
|
|
4431
4932
|
// v0.2.2「待你处理」:第五列任务列表与回答草稿(每次渲染都刷新)。
|
|
4432
4933
|
// 缺了会让平台侧边栏详情浮层的回答框永远读到 '':打字被复位、选项不填、
|
|
4433
4934
|
// 「回复并继续」恒禁用(t-92,v0.2.5 拆分双看板时漏抄的回归)。
|
|
4935
|
+
boardBindRef.current.allTasks = allTasks
|
|
4936
|
+
boardBindRef.current.config = config
|
|
4937
|
+
boardBindRef.current.showSettings = showSettings
|
|
4938
|
+
boardBindRef.current.retentionDraft = retentionDraft
|
|
4434
4939
|
boardBindRef.current.needsUserTasks = needsUser
|
|
4435
4940
|
boardBindRef.current.answerDraft = answerDraft
|
|
4436
4941
|
boardBindRef.current.answerError = answerError
|
|
@@ -4441,6 +4946,7 @@ window.__ModuleLoader__.load({
|
|
|
4441
4946
|
const LeadBar = boardPiecesRef.current.LeadBar
|
|
4442
4947
|
const NeedsBanner = boardPiecesRef.current.NeedsBanner
|
|
4443
4948
|
const NeedsColumn = boardPiecesRef.current.NeedsColumn
|
|
4949
|
+
const SettingsPanel = boardPiecesRef.current.SettingsPanel
|
|
4444
4950
|
|
|
4445
4951
|
const intervalText = fmtInterval(config.pollIntervalMs)
|
|
4446
4952
|
const busyNow = busy !== ''
|
|
@@ -4468,51 +4974,10 @@ window.__ModuleLoader__.load({
|
|
|
4468
4974
|
'div',
|
|
4469
4975
|
{ className: 'tb-head-main' },
|
|
4470
4976
|
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
4977
|
),
|
|
4481
4978
|
h(
|
|
4482
4979
|
'div',
|
|
4483
4980
|
{ 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
4981
|
h(
|
|
4517
4982
|
'button',
|
|
4518
4983
|
{
|
|
@@ -4525,7 +4990,7 @@ window.__ModuleLoader__.load({
|
|
|
4525
4990
|
),
|
|
4526
4991
|
h(
|
|
4527
4992
|
'button',
|
|
4528
|
-
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick:
|
|
4993
|
+
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'refresh', onClick: refreshNow },
|
|
4529
4994
|
busy === 'refresh' ? t('page.refreshing') : t('platform.refresh'),
|
|
4530
4995
|
),
|
|
4531
4996
|
h(
|
|
@@ -4533,9 +4998,20 @@ window.__ModuleLoader__.load({
|
|
|
4533
4998
|
{ type: 'button', className: 'tb-btn', disabled: busyNow || busy === 'archiveDone', onClick: archiveDone },
|
|
4534
4999
|
t('platform.archiveDone'),
|
|
4535
5000
|
),
|
|
5001
|
+
h(
|
|
5002
|
+
'button',
|
|
5003
|
+
{
|
|
5004
|
+
type: 'button',
|
|
5005
|
+
className: 'tb-btn' + (showSettings ? ' tb-btn-active' : ''),
|
|
5006
|
+
'aria-expanded': showSettings ? 'true' : 'false',
|
|
5007
|
+
onClick: toggleSettings,
|
|
5008
|
+
},
|
|
5009
|
+
t('settings.button'),
|
|
5010
|
+
),
|
|
4536
5011
|
),
|
|
4537
5012
|
),
|
|
4538
5013
|
|
|
5014
|
+
h(SettingsPanel, { key: 'settings' }),
|
|
4539
5015
|
h(LeadBar, { key: 'leads' }),
|
|
4540
5016
|
presetBanner ? h(Banner, { item: presetBanner }) : null,
|
|
4541
5017
|
notice ? h(Banner, { item: notice, onClose: () => setNotice(null) }) : null,
|
|
@@ -4603,6 +5079,15 @@ window.__ModuleLoader__.load({
|
|
|
4603
5079
|
onPaste: onNotePaste,
|
|
4604
5080
|
})
|
|
4605
5081
|
: null,
|
|
5082
|
+
showNote
|
|
5083
|
+
? h('input', {
|
|
5084
|
+
className: 'tb-input',
|
|
5085
|
+
placeholder: t('composer.dependsOn'),
|
|
5086
|
+
'aria-label': t('composer.dependsOn'),
|
|
5087
|
+
value: dependsDraft,
|
|
5088
|
+
onChange: (event) => setDependsDraft(event.target.value),
|
|
5089
|
+
})
|
|
5090
|
+
: null,
|
|
4606
5091
|
attachments.length > 0
|
|
4607
5092
|
? h(
|
|
4608
5093
|
'div',
|