saibo-kanban 0.5.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/CHANGELOG.md +8 -0
- package/bin/import.mjs +1 -1
- package/client.js +72 -13
- package/index.js +2 -2
- package/package.json +1 -1
- package/store.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
- 表格去掉「编号」列(原始 id 不再展示)。
|
|
6
|
+
- 表头下加筛选行:类型 / 状态 / 范围;范围选项从现有数据生成。
|
|
7
|
+
- 列表改为滚动加载(每次 100 条,滚到底自动加载,另有「加载更多」兜底),显示总数。
|
|
8
|
+
- 列表上限从 200 提到 2000,已归档不再被截断。
|
|
9
|
+
- 导入默认跳过「节点说明」(CLI 加 `--include-notes` 才导入)。
|
|
10
|
+
|
|
3
11
|
## 0.5.0
|
|
4
12
|
|
|
5
13
|
- 表格加表头(# / 编号 / 标题 / 类型 / 状态 / 范围 / 修订)和行序号。
|
package/bin/import.mjs
CHANGED
|
@@ -62,5 +62,5 @@ const write = (item, note) => {
|
|
|
62
62
|
};
|
|
63
63
|
for (const item of plan.main) write(item, '导入:任务主表');
|
|
64
64
|
for (const item of plan.rolling) write(item, '导入:长期滚动项');
|
|
65
|
-
if (plan.notes) write(plan.notes, '导入:节点说明');
|
|
65
|
+
if (plan.notes && flags['include-notes'] === true) write(plan.notes, '导入:节点说明');
|
|
66
66
|
console.log(`\n已导入 ${imported} 条,跳过重复 ${skipped} 条 → ${path.join(dataDir, 'records.jsonl')}`);
|
package/client.js
CHANGED
|
@@ -74,6 +74,7 @@ window.__ModuleLoader__.load({
|
|
|
74
74
|
.sk-rev { width:44px; flex:none; text-align:right; font-size:11.5px; color:var(--dsw-alias-label-secondary,#6b7280); }
|
|
75
75
|
.sk-num { width:34px; flex:none; text-align:right; font-size:11.5px; color:var(--dsw-alias-label-secondary,#6b7280); }
|
|
76
76
|
.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; }
|
|
77
|
+
.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; }
|
|
77
78
|
.sk-col-k { width:76px; flex:none; }
|
|
78
79
|
.sk-col-s { width:92px; flex:none; }
|
|
79
80
|
.sk-col-sc { width:120px; flex:none; }
|
|
@@ -116,6 +117,11 @@ window.__ModuleLoader__.load({
|
|
|
116
117
|
const [items, setItems] = useState([]);
|
|
117
118
|
const [view, setView] = useState('table');
|
|
118
119
|
const [showArchived, setShowArchived] = useState(false);
|
|
120
|
+
const [fStatus, setFStatus] = useState('');
|
|
121
|
+
const [fKind, setFKind] = useState('');
|
|
122
|
+
const [fScope, setFScope] = useState('');
|
|
123
|
+
const [visibleCount, setVisibleCount] = useState(100);
|
|
124
|
+
const sentinelRef = useRef(null);
|
|
119
125
|
const [query, setQuery] = useState('');
|
|
120
126
|
const [error, setError] = useState('');
|
|
121
127
|
const [detail, setDetail] = useState(null);
|
|
@@ -155,9 +161,35 @@ window.__ModuleLoader__.load({
|
|
|
155
161
|
|
|
156
162
|
const visible = useMemo(() => {
|
|
157
163
|
const q = query.trim().toLowerCase();
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
164
|
+
return items.filter(i => {
|
|
165
|
+
if (fStatus && i.status !== fStatus) return false;
|
|
166
|
+
if (fKind && i.kind !== fKind) return false;
|
|
167
|
+
if (fScope && (i.scope || '') !== fScope) return false;
|
|
168
|
+
if (!q) return true;
|
|
169
|
+
return (i.title + ' ' + (i.scope || '') + ' ' + i.id).toLowerCase().includes(q);
|
|
170
|
+
});
|
|
171
|
+
}, [items, query, fStatus, fKind, fScope]);
|
|
172
|
+
|
|
173
|
+
const scopeOptions = useMemo(() => {
|
|
174
|
+
const set = new Set();
|
|
175
|
+
for (const i of items) if (i.scope) set.add(i.scope);
|
|
176
|
+
return [...set].sort();
|
|
177
|
+
}, [items]);
|
|
178
|
+
|
|
179
|
+
useEffect(() => { setVisibleCount(100); }, [query, fStatus, fKind, fScope, view]);
|
|
180
|
+
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
if (view !== 'table') return undefined;
|
|
183
|
+
const el = sentinelRef.current;
|
|
184
|
+
if (!el || typeof IntersectionObserver === 'undefined') return undefined;
|
|
185
|
+
const io = new IntersectionObserver(entries => {
|
|
186
|
+
if (entries.some(e => e.isIntersecting)) {
|
|
187
|
+
setVisibleCount(c => Math.min(c + 100, visible.length));
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
io.observe(el);
|
|
191
|
+
return () => io.disconnect();
|
|
192
|
+
}, [view, visible.length, visibleCount]);
|
|
161
193
|
|
|
162
194
|
const openDetail = useCallback(async id => {
|
|
163
195
|
try { setDetail(await api('get', { id })); }
|
|
@@ -232,12 +264,20 @@ window.__ModuleLoader__.load({
|
|
|
232
264
|
|
|
233
265
|
let content = null;
|
|
234
266
|
if (view === 'table') {
|
|
267
|
+
const shown = visible.slice(0, visibleCount);
|
|
235
268
|
content = h('div', null,
|
|
236
|
-
quick,
|
|
269
|
+
h('div', { className: 'sk-quick' },
|
|
270
|
+
h('span', { className: 'sk-k' }, '+'),
|
|
271
|
+
h('input', {
|
|
272
|
+
placeholder: '快加一条(回车新建)',
|
|
273
|
+
onKeyDown: e => { if (e.key === 'Enter') { create(e.currentTarget.value); e.currentTarget.value = ''; } }
|
|
274
|
+
}),
|
|
275
|
+
h('span', { style: { color: 'var(--dsw-alias-label-secondary,#6b7280)', fontSize: 12, whiteSpace: 'nowrap' } },
|
|
276
|
+
'共 ' + visible.length + ' 条' + (visible.length > shown.length ? ' · 已显示 ' + shown.length : ''))
|
|
277
|
+
),
|
|
237
278
|
h('div', { className: 'sk-panel' },
|
|
238
279
|
h('div', { className: 'sk-row sk-th' },
|
|
239
280
|
h('span', { className: 'sk-num' }, '#'),
|
|
240
|
-
h('span', { className: 'sk-id' }, '编号'),
|
|
241
281
|
h('span', { className: 'sk-name', style: { cursor: 'default' } }, '标题'),
|
|
242
282
|
h('span', { className: 'sk-col-k' }, '类型'),
|
|
243
283
|
h('span', { className: 'sk-col-s' }, '状态'),
|
|
@@ -245,10 +285,27 @@ window.__ModuleLoader__.load({
|
|
|
245
285
|
h('span', { className: 'sk-rev' }, '修订'),
|
|
246
286
|
h('span', { style: { width: 44 } }, '')
|
|
247
287
|
),
|
|
248
|
-
|
|
249
|
-
|
|
288
|
+
h('div', { className: 'sk-row sk-filter' },
|
|
289
|
+
h('span', { className: 'sk-num' }, ''),
|
|
290
|
+
h('span', { className: 'sk-name' }, ''),
|
|
291
|
+
h('select', {
|
|
292
|
+
className: 'sk-sel sk-col-k', value: fKind,
|
|
293
|
+
onChange: e => setFKind(e.target.value)
|
|
294
|
+
}, h('option', { value: '' }, '全部'), KINDS.map(k => h('option', { key: k.id, value: k.id }, k.label))),
|
|
295
|
+
h('select', {
|
|
296
|
+
className: 'sk-sel sk-col-s', value: fStatus,
|
|
297
|
+
onChange: e => setFStatus(e.target.value)
|
|
298
|
+
}, h('option', { value: '' }, '全部'), STATUSES.map(s => h('option', { key: s.id, value: s.id }, s.label))),
|
|
299
|
+
h('select', {
|
|
300
|
+
className: 'sk-sel sk-col-sc', value: fScope,
|
|
301
|
+
onChange: e => setFScope(e.target.value)
|
|
302
|
+
}, h('option', { value: '' }, '全部'), scopeOptions.map(s => h('option', { key: s, value: s }, s))),
|
|
303
|
+
h('span', { className: 'sk-rev' }, ''),
|
|
304
|
+
h('span', { style: { width: 44 } }, '')
|
|
305
|
+
),
|
|
306
|
+
visible.length === 0 ? h('div', { className: 'sk-empty' }, '没有匹配的条目。跟 agent 说“记一条…”,或在上面的输入框快加。') :
|
|
307
|
+
shown.map((item, index) => h('div', { key: item.id, className: 'sk-row' + (item.archived ? ' arch' : '') },
|
|
250
308
|
h('span', { className: 'sk-num' }, String(index + 1)),
|
|
251
|
-
h('span', { className: 'sk-id' }, item.id),
|
|
252
309
|
h('div', {
|
|
253
310
|
className: 'sk-name',
|
|
254
311
|
onClick: () => { setEditing(item.id); setDraft(item.title); }
|
|
@@ -272,10 +329,14 @@ window.__ModuleLoader__.load({
|
|
|
272
329
|
h('select', {
|
|
273
330
|
className: 'sk-sel sk-col-sc', value: item.scope || '',
|
|
274
331
|
onChange: e => update(item.id, item.rev, { scope: e.target.value })
|
|
275
|
-
}, h('option', { value: '' }, '
|
|
332
|
+
}, h('option', { value: '' }, '未定'), scopeOptions.map(s => h('option', { key: s, value: s }, s))),
|
|
276
333
|
h('span', { className: 'sk-rev' }, 'r' + item.rev),
|
|
277
334
|
h('button', { className: 'sk-btn', onClick: () => openDetail(item.id) }, '详情')
|
|
278
|
-
))
|
|
335
|
+
)),
|
|
336
|
+
h('div', { ref: sentinelRef, style: { height: 1 } }),
|
|
337
|
+
visible.length > shown.length ? h('div', { style: { padding: 10 } },
|
|
338
|
+
h('button', { className: 'sk-btn', onClick: () => setVisibleCount(c => c + 100) },
|
|
339
|
+
'加载更多(' + shown.length + ' / ' + visible.length + ')')) : null
|
|
279
340
|
)
|
|
280
341
|
);
|
|
281
342
|
} else if (view === 'board') {
|
|
@@ -321,7 +382,6 @@ window.__ModuleLoader__.load({
|
|
|
321
382
|
h('div', { className: 'sk-panel' },
|
|
322
383
|
recent.length === 0 ? h('div', { className: 'sk-empty' }, '还没有条目。') :
|
|
323
384
|
recent.map(item => h('div', { key: item.id, className: 'sk-row' },
|
|
324
|
-
h('span', { className: 'sk-id' }, item.id),
|
|
325
385
|
h('span', { style: { flex: 1, fontWeight: 550 } }, item.title),
|
|
326
386
|
h('span', { style: { color: 'var(--dsw-alias-label-secondary,#6b7280)', fontSize: 12 } },
|
|
327
387
|
statusLabel(item.status) + ' · ' + kindLabel(item.kind) + (item.scope ? ' · ' + item.scope : '')),
|
|
@@ -334,7 +394,6 @@ window.__ModuleLoader__.load({
|
|
|
334
394
|
|
|
335
395
|
const drawer = detail ? h('div', { className: 'sk-drawer' },
|
|
336
396
|
h('div', { className: 'sk-drawer-head' },
|
|
337
|
-
h('span', { className: 'sk-id' }, detail.item.id),
|
|
338
397
|
h('span', { style: { fontWeight: 600, flex: 1 } }, '条目详情'),
|
|
339
398
|
h('button', { className: 'sk-btn', onClick: () => setDetail(null) }, '关闭')
|
|
340
399
|
),
|
|
@@ -368,7 +427,7 @@ window.__ModuleLoader__.load({
|
|
|
368
427
|
h('select', {
|
|
369
428
|
className: 'sk-sel', value: detail.item.scope || '',
|
|
370
429
|
onChange: e => update(detail.item.id, detail.item.rev, { scope: e.target.value })
|
|
371
|
-
}, h('option', { value: '' }, '
|
|
430
|
+
}, h('option', { value: '' }, '未定'), scopeOptions.map(s => h('option', { key: s, value: s }, s))),
|
|
372
431
|
detail.item.archived
|
|
373
432
|
? h('button', {
|
|
374
433
|
className: 'sk-btn',
|
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({ includeArchived: args.includeArchived === true, limit:
|
|
61
|
+
const result = store.list({ includeArchived: args.includeArchived === true, limit: 2000 });
|
|
62
62
|
return { items: result.items.map(publicItem), total: result.total };
|
|
63
63
|
}
|
|
64
64
|
case 'get': {
|
|
@@ -147,7 +147,7 @@ function applyPlan(store, plan) {
|
|
|
147
147
|
};
|
|
148
148
|
for (const item of plan.main) write(item, '导入:任务主表');
|
|
149
149
|
for (const item of plan.rolling) write(item, '导入:长期滚动项');
|
|
150
|
-
if (plan.notes) write(plan.notes, '导入:节点说明');
|
|
150
|
+
if (plan.notes && args.includeNotes === true) write(plan.notes, '导入:节点说明');
|
|
151
151
|
return { imported, skipped, summary: describeImport(plan) };
|
|
152
152
|
}
|
|
153
153
|
|
package/package.json
CHANGED
package/store.js
CHANGED
|
@@ -263,7 +263,7 @@ export class Store {
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
list(options = {}) {
|
|
266
|
-
const limit = Math.max(1, Math.min(options.limit ?? 50,
|
|
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
269
|
if (!options.includeArchived && item.archived) continue;
|