saibo-kanban 0.5.3 → 0.5.5
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/CHANGELOG.md +11 -0
- package/client.js +20 -11
- package/core.js +3 -5
- package/lib/import-map.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.5
|
|
4
|
+
|
|
5
|
+
- 取消状态流转限制:任意状态可以互转(例如 todo 直接改 done),只校验状态值本身;改错可回滚。
|
|
6
|
+
|
|
7
|
+
## 0.5.4
|
|
8
|
+
|
|
9
|
+
- 表格列宽重排:标题固定宽度、内容占剩余空间,行高收紧。
|
|
10
|
+
- 「详情」按钮不再折行。
|
|
11
|
+
- 内容列显示真正的说明文字(自动跳过「编号 / 优先级 / 来源」等元数据行)。
|
|
12
|
+
- 导入时把说明放在正文第一行,元数据放后面。
|
|
13
|
+
|
|
3
14
|
## 0.5.3
|
|
4
15
|
|
|
5
16
|
- 表格新增「内容」列(标题与类型之间):正文首行直接可见,点击打开详情。
|
package/client.js
CHANGED
|
@@ -23,6 +23,14 @@ window.__ModuleLoader__.load({
|
|
|
23
23
|
const kindLabel = id => (KINDS.find(k => k.id === id) || { label: id }).label;
|
|
24
24
|
const statusLabel = id => (STATUSES.find(s => s.id === id) || { label: id }).label;
|
|
25
25
|
|
|
26
|
+
function displayContent(body) {
|
|
27
|
+
if (!body) return '—';
|
|
28
|
+
const meta = /^(编号|类型|优先级|滚动次数|首次来源|最近来源):/;
|
|
29
|
+
const lines = String(body).split('\n').map(s => s.trim()).filter(Boolean);
|
|
30
|
+
const real = lines.filter(l => !meta.test(l));
|
|
31
|
+
return real[0] || '—';
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
function toBase64(buf) {
|
|
27
35
|
const bytes = new Uint8Array(buf);
|
|
28
36
|
let s = '';
|
|
@@ -62,23 +70,24 @@ window.__ModuleLoader__.load({
|
|
|
62
70
|
.sk-quick input { flex:1; border:0; outline:none; background:transparent; color:inherit; font:inherit; padding:4px; }
|
|
63
71
|
.sk-quick .sk-k { color:var(--dsw-alias-label-secondary,#6b7280); font-size:12px; }
|
|
64
72
|
.sk-panel { background:var(--dsw-alias-bg-layer-1,#fff); border:1px solid var(--dsw-alias-border-l1,#e6e7eb); border-radius:10px; overflow:hidden; }
|
|
65
|
-
.sk-row { display:flex; align-items:center; gap:
|
|
73
|
+
.sk-row { display:flex; align-items:center; gap:8px; padding:6px 10px; border-top:1px solid var(--dsw-alias-border-l1,#f0f1f4); }
|
|
66
74
|
.sk-row:first-child { border-top:0; }
|
|
67
75
|
.sk-row:hover { background:var(--dsw-alias-bg-layer-2,#fbfbfc); }
|
|
68
76
|
.sk-id { font-family:ui-monospace,Consolas,monospace; font-size:11.5px; color:var(--dsw-alias-label-secondary,#6b7280); width:86px; flex:none; }
|
|
69
|
-
.sk-name { flex:
|
|
70
|
-
.sk-content { flex:1 1
|
|
77
|
+
.sk-name { flex:0 0 260px; max-width:260px; cursor:text; border-radius:5px; padding:2px 4px; margin:-2px -4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
|
78
|
+
.sk-content { flex:1 1 auto; min-width:0; font-size:12.5px; color:var(--dsw-alias-label-secondary,#6b7280); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; padding:2px 4px; }
|
|
71
79
|
.sk-name:hover { background:var(--dsw-alias-bg-layer-2,#f3f4f6); }
|
|
72
80
|
.sk-name input { width:100%; border:1px solid var(--dsw-alias-brand-primary,#2563eb); border-radius:5px; padding:2px 4px; background:var(--dsw-alias-bg-layer-1,#fff); color:inherit; font:inherit; outline:none; }
|
|
73
81
|
.sk-sel { border:1px solid transparent; background:transparent; color:inherit; font:inherit; font-size:12px; border-radius:6px; padding:3px 4px; cursor:pointer; max-width:110px; }
|
|
74
82
|
.sk-sel:hover { border-color:var(--dsw-alias-border-l1,#e6e7eb); background:var(--dsw-alias-bg-layer-1,#fff); }
|
|
75
|
-
.sk-rev { width:
|
|
76
|
-
.sk-num { width:
|
|
83
|
+
.sk-rev { width:48px; flex:none; text-align:right; font-size:11.5px; color:var(--dsw-alias-label-secondary,#6b7280); }
|
|
84
|
+
.sk-num { width:36px; flex:none; text-align:right; font-size:11.5px; color:var(--dsw-alias-label-secondary,#6b7280); }
|
|
77
85
|
.sk-th { background:var(--dsw-alias-bg-layer-2,#f7f8fa); font-size:11.5px; font-weight:600; color:var(--dsw-alias-label-secondary,#6b7280); position:sticky; top:0; z-index:1; }
|
|
78
86
|
.sk-filter { background:var(--dsw-alias-bg-layer-2,#fbfbfc); border-bottom:1px solid var(--dsw-alias-border-l1,#e6e7eb); padding:4px 12px; gap:8px; }
|
|
79
|
-
.sk-col-k { width:
|
|
80
|
-
.sk-col-s { width:
|
|
81
|
-
.sk-col-sc { width:
|
|
87
|
+
.sk-col-k { width:84px; flex:none; }
|
|
88
|
+
.sk-col-s { width:100px; flex:none; }
|
|
89
|
+
.sk-col-sc { width:140px; flex:none; }
|
|
90
|
+
.sk-detail-btn { white-space:nowrap; min-width:52px; padding:4px 8px; font-size:12px; }
|
|
82
91
|
.sk-row.arch { opacity:.6; }
|
|
83
92
|
.sk-badge { margin-left:6px; font-size:10.5px; color:var(--dsw-alias-label-secondary,#6b7280); border:1px solid var(--dsw-alias-border-l1,#e6e7eb); border-radius:999px; padding:0 6px; vertical-align:1px; }
|
|
84
93
|
.sk-board { display:grid; grid-template-columns:repeat(6,minmax(160px,1fr)); gap:10px; align-items:start; }
|
|
@@ -294,7 +303,7 @@ window.__ModuleLoader__.load({
|
|
|
294
303
|
onChange: e => setFScope(e.target.value)
|
|
295
304
|
}, h('option', { value: '' }, '范围'), scopeOptions.map(s => h('option', { key: s, value: s }, s))),
|
|
296
305
|
h('span', { className: 'sk-rev' }, '修订'),
|
|
297
|
-
h('span', { style: { width:
|
|
306
|
+
h('span', { style: { width: 60 } }, '')
|
|
298
307
|
),
|
|
299
308
|
visible.length === 0 ? h('div', { className: 'sk-empty' }, '没有匹配的条目。跟 agent 说“记一条…”,或在上面的输入框快加。') :
|
|
300
309
|
shown.map((item, index) => h('div', { key: item.id, className: 'sk-row' },
|
|
@@ -315,7 +324,7 @@ window.__ModuleLoader__.load({
|
|
|
315
324
|
className: 'sk-content',
|
|
316
325
|
title: item.body || '',
|
|
317
326
|
onClick: () => openDetail(item.id)
|
|
318
|
-
}, item.body ? item.body
|
|
327
|
+
}, item.body ? displayContent(item.body) : '—'),
|
|
319
328
|
h('select', {
|
|
320
329
|
className: 'sk-sel sk-col-k', value: item.kind,
|
|
321
330
|
onChange: e => update(item.id, item.rev, { kind: e.target.value })
|
|
@@ -329,7 +338,7 @@ window.__ModuleLoader__.load({
|
|
|
329
338
|
onChange: e => update(item.id, item.rev, { scope: e.target.value })
|
|
330
339
|
}, h('option', { value: '' }, '未定'), scopeOptions.map(s => h('option', { key: s, value: s }, s))),
|
|
331
340
|
h('span', { className: 'sk-rev' }, 'r' + item.rev),
|
|
332
|
-
h('button', { className: 'sk-btn', onClick: () => openDetail(item.id) }, '详情')
|
|
341
|
+
h('button', { className: 'sk-btn sk-detail-btn', onClick: () => openDetail(item.id) }, '详情')
|
|
333
342
|
)),
|
|
334
343
|
h('div', { ref: sentinelRef, style: { height: 1 } }),
|
|
335
344
|
visible.length > shown.length ? h('div', { style: { padding: 10 } },
|
package/core.js
CHANGED
|
@@ -81,14 +81,12 @@ export function assertTitle(title) {
|
|
|
81
81
|
return title.trim();
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* 校验状态值。任意状态之间可以互转(回滚兜底),只拒绝未知状态。
|
|
86
|
+
*/
|
|
85
87
|
export function assertTransition(from, to) {
|
|
86
88
|
if (from === to) return;
|
|
87
89
|
assertStatus(to);
|
|
88
|
-
const allowed = TRANSITIONS[from] || [];
|
|
89
|
-
if (!allowed.includes(to)) {
|
|
90
|
-
throw new BoardError('INVALID_TRANSITION', `状态不能从 ${from} 直接变成 ${to}`);
|
|
91
|
-
}
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
export function nextId() {
|
package/lib/import-map.js
CHANGED
|
@@ -52,9 +52,9 @@ export function mapMain(rows) {
|
|
|
52
52
|
out.push({
|
|
53
53
|
title,
|
|
54
54
|
body: [
|
|
55
|
+
cell(rows[i], cBody),
|
|
55
56
|
cell(rows[i], cId) ? `编号:${cell(rows[i], cId)}` : '',
|
|
56
|
-
cell(rows[i], cType) ? `类型:${cell(rows[i], cType)}` : ''
|
|
57
|
-
cell(rows[i], cBody)
|
|
57
|
+
cell(rows[i], cType) ? `类型:${cell(rows[i], cType)}` : ''
|
|
58
58
|
].filter(Boolean).join('\n'),
|
|
59
59
|
kind: 'task',
|
|
60
60
|
scope: cell(rows[i], cGroup),
|
|
@@ -84,8 +84,8 @@ export function mapRolling(rows) {
|
|
|
84
84
|
out.push({
|
|
85
85
|
title,
|
|
86
86
|
body: [
|
|
87
|
-
cell(rows[i], cId) ? `编号:${cell(rows[i], cId)}` : '',
|
|
88
87
|
cell(rows[i], cBody),
|
|
88
|
+
cell(rows[i], cId) ? `编号:${cell(rows[i], cId)}` : '',
|
|
89
89
|
cell(rows[i], cPri) ? `优先级:${cell(rows[i], cPri)}` : '',
|
|
90
90
|
cell(rows[i], cRoll) ? `滚动次数:${cell(rows[i], cRoll)}` : '',
|
|
91
91
|
cell(rows[i], cFirst) ? `首次来源:${cell(rows[i], cFirst)}` : '',
|