saibo-kanban 0.5.1 → 0.5.3
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 +12 -0
- package/bin/board.mjs +3 -16
- package/bin/import.mjs +1 -2
- package/client.js +30 -35
- package/index.js +2 -11
- package/lib/import-map.js +1 -1
- package/package.json +1 -1
- package/store.js +1 -1
- package/tools.js +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.3
|
|
4
|
+
|
|
5
|
+
- 表格新增「内容」列(标题与类型之间):正文首行直接可见,点击打开详情。
|
|
6
|
+
- 看板卡片悬停显示详情浮层:标题 / 正文 / 状态 / 类型 / 范围。
|
|
7
|
+
|
|
8
|
+
## 0.5.2
|
|
9
|
+
|
|
10
|
+
- 移除归档功能:页面、接口、CLI 都不再有归档/恢复;done 条目直接可见。
|
|
11
|
+
- 导入不再把主表归档,done 原样进入列表。
|
|
12
|
+
- 表头与筛选合并为一行(类型 / 状态 / 范围 直接放在表头格子里)。
|
|
13
|
+
- 删除导入时生成的「节点说明」条目;导入默认不再包含它。
|
|
14
|
+
|
|
3
15
|
## 0.5.1
|
|
4
16
|
|
|
5
17
|
- 表格去掉「编号」列(原始 id 不再展示)。
|
package/bin/board.mjs
CHANGED
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
* 这是「人」的入口:0 token、本地直写台账。页面做好之前先用它,
|
|
6
6
|
* 页面做好之后两者共用同一份 store 与规则。
|
|
7
7
|
*
|
|
8
|
-
* saibo-board list [--status todo] [--scope 看板插件]
|
|
8
|
+
* saibo-board list [--status todo] [--scope 看板插件]
|
|
9
9
|
* saibo-board inbox
|
|
10
10
|
* saibo-board add "标题" [--kind decision] [--scope 存储] [--body "正文"]
|
|
11
11
|
* saibo-board show <id>
|
|
12
12
|
* saibo-board accept <id> | unaccept <id>
|
|
13
|
-
* saibo-board archive <id> | restore <id>
|
|
14
13
|
* saibo-board update <id> [--title ...] [--status ...] [--kind ...] [--scope ...] [--body ...]
|
|
15
14
|
* saibo-board search <关键词>
|
|
16
15
|
* saibo-board brief [--scope ...]
|
|
@@ -70,14 +69,12 @@ function printItem(item) {
|
|
|
70
69
|
function usage() {
|
|
71
70
|
console.log(`赛博看板 CLI
|
|
72
71
|
|
|
73
|
-
list [--status <状态>] [--kind <类型>] [--scope <范围>] [--query <词>]
|
|
72
|
+
list [--status <状态>] [--kind <类型>] [--scope <范围>] [--query <词>]
|
|
74
73
|
inbox
|
|
75
74
|
add <标题> [--kind <类型>] [--scope <范围>] [--body <正文>]
|
|
76
75
|
show <id>
|
|
77
76
|
accept <id> 把条目标为已确认
|
|
78
77
|
unaccept <id> 取消确认
|
|
79
|
-
archive <id> 归档(不删除)
|
|
80
|
-
restore <id> 撤销归档
|
|
81
78
|
update <id> [--title ...] [--status ...] [--kind ...] [--scope ...] [--body ...]
|
|
82
79
|
search <关键词>
|
|
83
80
|
brief [--scope <范围>]
|
|
@@ -95,8 +92,7 @@ switch (command) {
|
|
|
95
92
|
kind: flags.kind,
|
|
96
93
|
scope: flags.scope,
|
|
97
94
|
query: flags.query,
|
|
98
|
-
includeArchived: flags.all === true,
|
|
99
|
-
draft: flags.drafts === true ? true : undefined,
|
|
95
|
+
includeArchived: flags.all === true, draft: flags.drafts === true ? true : undefined,
|
|
100
96
|
limit: 200
|
|
101
97
|
});
|
|
102
98
|
if (result.items.length === 0) {
|
|
@@ -154,15 +150,6 @@ switch (command) {
|
|
|
154
150
|
console.log(`${id} → ${command === 'accept' ? '已确认' : '待确认'}`);
|
|
155
151
|
break;
|
|
156
152
|
}
|
|
157
|
-
case 'archive':
|
|
158
|
-
case 'restore': {
|
|
159
|
-
const id = positionals[0];
|
|
160
|
-
if (!id) { usage(); process.exitCode = 1; break; }
|
|
161
|
-
if (command === 'archive') store.archive(id, { by: 'human' });
|
|
162
|
-
else store.restore(id, { by: 'human' });
|
|
163
|
-
console.log(`${id} → ${command === 'archive' ? '已归档' : '已恢复'}`);
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
153
|
case 'update': {
|
|
167
154
|
const id = positionals[0];
|
|
168
155
|
if (!id) { usage(); process.exitCode = 1; break; }
|
package/bin/import.mjs
CHANGED
|
@@ -53,10 +53,9 @@ let imported = 0;
|
|
|
53
53
|
let skipped = 0;
|
|
54
54
|
const write = (item, note) => {
|
|
55
55
|
if (existing.has(`${item.scope}|${item.title}`)) { skipped += 1; return; }
|
|
56
|
-
|
|
56
|
+
store.record({
|
|
57
57
|
title: item.title, kind: item.kind, scope: item.scope, body: item.body, status: item.status
|
|
58
58
|
}, { by: 'human', note });
|
|
59
|
-
if (item.archived) store.archive(created.id, { by: 'human', note: '导入历史台账' });
|
|
60
59
|
existing.add(`${item.scope}|${item.title}`);
|
|
61
60
|
imported += 1;
|
|
62
61
|
};
|
package/client.js
CHANGED
|
@@ -66,7 +66,8 @@ window.__ModuleLoader__.load({
|
|
|
66
66
|
.sk-row:first-child { border-top:0; }
|
|
67
67
|
.sk-row:hover { background:var(--dsw-alias-bg-layer-2,#fbfbfc); }
|
|
68
68
|
.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:1
|
|
69
|
+
.sk-name { flex:1 1 34%; min-width:140px; cursor:text; border-radius:5px; padding:2px 4px; margin:-2px -4px; }
|
|
70
|
+
.sk-content { flex:1 1 40%; min-width:150px; font-size:12.5px; color:var(--dsw-alias-label-secondary,#6b7280); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; padding:2px 4px; }
|
|
70
71
|
.sk-name:hover { background:var(--dsw-alias-bg-layer-2,#f3f4f6); }
|
|
71
72
|
.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; }
|
|
72
73
|
.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; }
|
|
@@ -85,7 +86,12 @@ window.__ModuleLoader__.load({
|
|
|
85
86
|
.sk-col-head { display:flex; align-items:center; gap:6px; padding:9px 11px; font-weight:600; font-size:12.5px; color:var(--dsw-alias-label-secondary,#6b7280); border-bottom:1px solid var(--dsw-alias-border-l1,#e6e7eb); }
|
|
86
87
|
.sk-col-body { padding:7px; display:flex; flex-direction:column; gap:7px; min-height:70px; }
|
|
87
88
|
.sk-col.over { outline:2px dashed var(--dsw-alias-brand-primary,#2563eb); outline-offset:-3px; }
|
|
88
|
-
.sk-card { background:var(--dsw-alias-bg-layer-1,#fff); border:1px solid var(--dsw-alias-border-l1,#e6e7eb); border-radius:9px; padding:8px 10px; cursor:grab; }
|
|
89
|
+
.sk-card { background:var(--dsw-alias-bg-layer-1,#fff); border:1px solid var(--dsw-alias-border-l1,#e6e7eb); border-radius:9px; padding:8px 10px; cursor:grab; position:relative; }
|
|
90
|
+
.sk-tip { display:none; position:absolute; left:0; top:calc(100% + 4px); width:300px; max-width:70vw; background:var(--dsw-alias-bg-overlay,#fff); border:1px solid var(--dsw-alias-border-l1,#e6e7eb); border-radius:8px; box-shadow:0 8px 24px rgba(16,24,40,.18); padding:8px 10px; z-index:20; cursor:default; }
|
|
91
|
+
.sk-card:hover .sk-tip { display:block; }
|
|
92
|
+
.sk-tip-title { font-weight:600; font-size:12.5px; }
|
|
93
|
+
.sk-tip-body { margin-top:4px; font-size:12px; color:var(--dsw-alias-label-secondary,#6b7280); white-space:pre-wrap; max-height:160px; overflow:hidden; }
|
|
94
|
+
.sk-tip-meta { margin-top:6px; font-size:11px; color:var(--dsw-alias-label-secondary,#6b7280); }
|
|
89
95
|
.sk-card .t { font-weight:550; line-height:1.4; font-size:13px; }
|
|
90
96
|
.sk-card .m { margin-top:5px; display:flex; gap:6px; color:var(--dsw-alias-label-secondary,#6b7280); font-size:11.5px; }
|
|
91
97
|
.sk-drawer { position:absolute; top:0; right:0; bottom:0; width:min(460px,92%); background:var(--dsw-alias-bg-layer-1,#fff); border-left:1px solid var(--dsw-alias-border-l1,#e6e7eb); box-shadow:-8px 0 24px rgba(16,24,40,.08); display:flex; flex-direction:column; z-index:5; }
|
|
@@ -116,7 +122,6 @@ window.__ModuleLoader__.load({
|
|
|
116
122
|
function Panel() {
|
|
117
123
|
const [items, setItems] = useState([]);
|
|
118
124
|
const [view, setView] = useState('table');
|
|
119
|
-
const [showArchived, setShowArchived] = useState(false);
|
|
120
125
|
const [fStatus, setFStatus] = useState('');
|
|
121
126
|
const [fKind, setFKind] = useState('');
|
|
122
127
|
const [fScope, setFScope] = useState('');
|
|
@@ -144,11 +149,11 @@ window.__ModuleLoader__.load({
|
|
|
144
149
|
|
|
145
150
|
const load = useCallback(async () => {
|
|
146
151
|
try {
|
|
147
|
-
const r = await api('list'
|
|
152
|
+
const r = await api('list');
|
|
148
153
|
setItems(r.items);
|
|
149
154
|
setError('');
|
|
150
155
|
} catch (e) { setError(e.message); }
|
|
151
|
-
}, [
|
|
156
|
+
}, []);
|
|
152
157
|
|
|
153
158
|
useEffect(() => { load(); }, [load]);
|
|
154
159
|
|
|
@@ -230,10 +235,6 @@ window.__ModuleLoader__.load({
|
|
|
230
235
|
className: 'sk-search', placeholder: '搜索标题 / 编号 / 范围',
|
|
231
236
|
value: query, onChange: e => setQuery(e.target.value)
|
|
232
237
|
}),
|
|
233
|
-
h('button', {
|
|
234
|
-
className: 'sk-btn' + (showArchived ? ' primary' : ''),
|
|
235
|
-
onClick: () => setShowArchived(v => !v)
|
|
236
|
-
}, showArchived ? '隐藏归档' : '显示归档'),
|
|
237
238
|
h('button', { className: 'sk-btn', onClick: () => fileRef.current && fileRef.current.click() }, '导入 xlsx'),
|
|
238
239
|
h('input', {
|
|
239
240
|
ref: fileRef, type: 'file', accept: '.xlsx', style: { display: 'none' },
|
|
@@ -279,32 +280,24 @@ window.__ModuleLoader__.load({
|
|
|
279
280
|
h('div', { className: 'sk-row sk-th' },
|
|
280
281
|
h('span', { className: 'sk-num' }, '#'),
|
|
281
282
|
h('span', { className: 'sk-name', style: { cursor: 'default' } }, '标题'),
|
|
282
|
-
h('span', { className: 'sk-
|
|
283
|
-
h('span', { className: 'sk-col-s' }, '状态'),
|
|
284
|
-
h('span', { className: 'sk-col-sc' }, '范围'),
|
|
285
|
-
h('span', { className: 'sk-rev' }, '修订'),
|
|
286
|
-
h('span', { style: { width: 44 } }, '')
|
|
287
|
-
),
|
|
288
|
-
h('div', { className: 'sk-row sk-filter' },
|
|
289
|
-
h('span', { className: 'sk-num' }, ''),
|
|
290
|
-
h('span', { className: 'sk-name' }, ''),
|
|
283
|
+
h('span', { className: 'sk-content', style: { cursor: 'default' } }, '内容'),
|
|
291
284
|
h('select', {
|
|
292
285
|
className: 'sk-sel sk-col-k', value: fKind,
|
|
293
286
|
onChange: e => setFKind(e.target.value)
|
|
294
|
-
}, h('option', { value: '' }, '
|
|
287
|
+
}, h('option', { value: '' }, '类型'), KINDS.map(k => h('option', { key: k.id, value: k.id }, k.label))),
|
|
295
288
|
h('select', {
|
|
296
289
|
className: 'sk-sel sk-col-s', value: fStatus,
|
|
297
290
|
onChange: e => setFStatus(e.target.value)
|
|
298
|
-
}, h('option', { value: '' }, '
|
|
291
|
+
}, h('option', { value: '' }, '状态'), STATUSES.map(s => h('option', { key: s.id, value: s.id }, s.label))),
|
|
299
292
|
h('select', {
|
|
300
293
|
className: 'sk-sel sk-col-sc', value: fScope,
|
|
301
294
|
onChange: e => setFScope(e.target.value)
|
|
302
|
-
}, h('option', { value: '' }, '
|
|
303
|
-
h('span', { className: 'sk-rev' }, ''),
|
|
295
|
+
}, h('option', { value: '' }, '范围'), scopeOptions.map(s => h('option', { key: s, value: s }, s))),
|
|
296
|
+
h('span', { className: 'sk-rev' }, '修订'),
|
|
304
297
|
h('span', { style: { width: 44 } }, '')
|
|
305
298
|
),
|
|
306
299
|
visible.length === 0 ? h('div', { className: 'sk-empty' }, '没有匹配的条目。跟 agent 说“记一条…”,或在上面的输入框快加。') :
|
|
307
|
-
shown.map((item, index) => h('div', { key: item.id, className: 'sk-row'
|
|
300
|
+
shown.map((item, index) => h('div', { key: item.id, className: 'sk-row' },
|
|
308
301
|
h('span', { className: 'sk-num' }, String(index + 1)),
|
|
309
302
|
h('div', {
|
|
310
303
|
className: 'sk-name',
|
|
@@ -317,7 +310,12 @@ window.__ModuleLoader__.load({
|
|
|
317
310
|
if (e.key === 'Enter') e.currentTarget.blur();
|
|
318
311
|
if (e.key === 'Escape') setEditing(null);
|
|
319
312
|
}
|
|
320
|
-
}) : item.title
|
|
313
|
+
}) : item.title),
|
|
314
|
+
h('div', {
|
|
315
|
+
className: 'sk-content',
|
|
316
|
+
title: item.body || '',
|
|
317
|
+
onClick: () => openDetail(item.id)
|
|
318
|
+
}, item.body ? item.body.split('\n')[0] : '—'),
|
|
321
319
|
h('select', {
|
|
322
320
|
className: 'sk-sel sk-col-k', value: item.kind,
|
|
323
321
|
onChange: e => update(item.id, item.rev, { kind: e.target.value })
|
|
@@ -370,6 +368,12 @@ window.__ModuleLoader__.load({
|
|
|
370
368
|
h('span', null, kindLabel(item.kind)),
|
|
371
369
|
h('span', null, item.scope || '未定范围'),
|
|
372
370
|
h('span', { style: { marginLeft: 'auto' } }, 'r' + item.rev)
|
|
371
|
+
),
|
|
372
|
+
h('div', { className: 'sk-tip' },
|
|
373
|
+
h('div', { className: 'sk-tip-title' }, item.title),
|
|
374
|
+
h('div', { className: 'sk-tip-body' }, item.body || '(无内容)'),
|
|
375
|
+
h('div', { className: 'sk-tip-meta' },
|
|
376
|
+
statusLabel(item.status) + ' · ' + kindLabel(item.kind) + (item.scope ? ' · ' + item.scope : ''))
|
|
373
377
|
)))
|
|
374
378
|
));
|
|
375
379
|
})
|
|
@@ -427,16 +431,7 @@ window.__ModuleLoader__.load({
|
|
|
427
431
|
h('select', {
|
|
428
432
|
className: 'sk-sel', value: detail.item.scope || '',
|
|
429
433
|
onChange: e => update(detail.item.id, detail.item.rev, { scope: e.target.value })
|
|
430
|
-
}, h('option', { value: '' }, '未定'), scopeOptions.map(s => h('option', { key: s, value: s }, s)))
|
|
431
|
-
detail.item.archived
|
|
432
|
-
? h('button', {
|
|
433
|
-
className: 'sk-btn',
|
|
434
|
-
onClick: () => run(() => api('restore', { id: detail.item.id }), '已恢复').then(() => setDetail(null))
|
|
435
|
-
}, '恢复')
|
|
436
|
-
: h('button', {
|
|
437
|
-
className: 'sk-btn danger',
|
|
438
|
-
onClick: () => run(() => api('archive', { id: detail.item.id }), '已归档').then(() => setDetail(null))
|
|
439
|
-
}, '归档')
|
|
434
|
+
}, h('option', { value: '' }, '未定'), scopeOptions.map(s => h('option', { key: s, value: s }, s)))
|
|
440
435
|
),
|
|
441
436
|
h('div', { className: 'sk-hist' },
|
|
442
437
|
h('h4', null, '修订历史(点“回滚”回到那一版)'),
|
|
@@ -462,7 +457,7 @@ window.__ModuleLoader__.load({
|
|
|
462
457
|
h('h3', null, '导入 ' + (imp.name || 'xlsx')),
|
|
463
458
|
imp.error ? h('div', { className: 'hint', style: { color: 'var(--dsw-alias-state-error-primary,#dc2626)' } }, imp.error) : null,
|
|
464
459
|
imp.summary ? h('div', { className: 'sk-kv' },
|
|
465
|
-
h('span', null, '主表 ', h('b', null, String(imp.summary.main)), '
|
|
460
|
+
h('span', null, '主表 ', h('b', null, String(imp.summary.main)), ' 条'),
|
|
466
461
|
h('span', null, '滚动项 ', h('b', null, String(imp.summary.rolling)), ' 条(活跃)'),
|
|
467
462
|
h('span', null, '节点说明 ', h('b', null, String(imp.summary.notes)), ' 条')
|
|
468
463
|
) : h('div', { className: 'hint' }, impBusy ? '解析中…' : ''),
|
package/index.js
CHANGED
|
@@ -58,7 +58,7 @@ export function apply(ctx, config) {
|
|
|
58
58
|
function dispatch(store, method, args) {
|
|
59
59
|
switch (method) {
|
|
60
60
|
case 'list': {
|
|
61
|
-
const result = store.list({
|
|
61
|
+
const result = store.list({ limit: 2000 });
|
|
62
62
|
return { items: result.items.map(publicItem), total: result.total };
|
|
63
63
|
}
|
|
64
64
|
case 'get': {
|
|
@@ -83,14 +83,6 @@ function dispatch(store, method, args) {
|
|
|
83
83
|
});
|
|
84
84
|
return { item: publicItem(result.item), changed: result.changed, changes: result.changes };
|
|
85
85
|
}
|
|
86
|
-
case 'archive': {
|
|
87
|
-
const result = store.archive(args.id, { by: 'human', note: '页面归档' });
|
|
88
|
-
return { item: publicItem(result.item) };
|
|
89
|
-
}
|
|
90
|
-
case 'restore': {
|
|
91
|
-
const result = store.restore(args.id, { by: 'human', note: '页面恢复' });
|
|
92
|
-
return { item: publicItem(result.item) };
|
|
93
|
-
}
|
|
94
86
|
case 'rollback': {
|
|
95
87
|
const result = store.rollback(args.id, args.rev, { by: 'human', note: args.note || `回滚到 r${args.rev}` });
|
|
96
88
|
return { item: publicItem(result.item) };
|
|
@@ -138,10 +130,9 @@ function applyPlan(store, plan) {
|
|
|
138
130
|
let skipped = 0;
|
|
139
131
|
const write = (item, note) => {
|
|
140
132
|
if (existing.has(`${item.scope}|${item.title}`)) { skipped += 1; return; }
|
|
141
|
-
|
|
133
|
+
store.record({
|
|
142
134
|
title: item.title, kind: item.kind, scope: item.scope, body: item.body, status: item.status
|
|
143
135
|
}, { by: 'human', note });
|
|
144
|
-
if (item.archived) store.archive(created.id, { by: 'human', note: '导入历史台账' });
|
|
145
136
|
existing.add(`${item.scope}|${item.title}`);
|
|
146
137
|
imported += 1;
|
|
147
138
|
};
|
package/lib/import-map.js
CHANGED
package/package.json
CHANGED
package/store.js
CHANGED
|
@@ -266,7 +266,7 @@ export class Store {
|
|
|
266
266
|
const limit = Math.max(1, Math.min(options.limit ?? 50, 2000));
|
|
267
267
|
const out = [];
|
|
268
268
|
for (const item of this.items.values()) {
|
|
269
|
-
if (
|
|
269
|
+
if (item.mergedInto) continue;
|
|
270
270
|
if (options.status && item.status !== options.status) continue;
|
|
271
271
|
if (options.kind && item.kind !== options.kind) continue;
|
|
272
272
|
if (options.scope && item.scope !== options.scope) continue;
|
package/tools.js
CHANGED
|
@@ -255,7 +255,7 @@ export function createTools(store, options = {}) {
|
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
257
|
name: 'board_search',
|
|
258
|
-
description: '
|
|
258
|
+
description: '检索看板条目:按关键词、状态、类型、范围过滤,返回紧凑列表。',
|
|
259
259
|
parameters: {
|
|
260
260
|
type: 'object',
|
|
261
261
|
properties: {
|
|
@@ -263,7 +263,6 @@ export function createTools(store, options = {}) {
|
|
|
263
263
|
status: { type: 'string', enum: statusIds },
|
|
264
264
|
kind: { type: 'string', enum: kindIds },
|
|
265
265
|
scope: { type: 'string' },
|
|
266
|
-
includeArchived: { type: 'boolean', description: '是否包含已归档条目,默认 false' },
|
|
267
266
|
limit: { type: 'number', description: '最多返回条数,默认 20,上限 200' }
|
|
268
267
|
},
|
|
269
268
|
additionalProperties: false
|
|
@@ -287,7 +286,6 @@ export function createTools(store, options = {}) {
|
|
|
287
286
|
status: args.status,
|
|
288
287
|
kind: args.kind,
|
|
289
288
|
scope: args.scope,
|
|
290
|
-
includeArchived: args.includeArchived === true,
|
|
291
289
|
limit: Math.min(Math.max(args.limit || 20, 1), 200)
|
|
292
290
|
});
|
|
293
291
|
return {
|