nx-kv 0.66.2 → 0.67.0
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 +69 -0
- package/assets/nx-kv/references/A02-/346/217/220/344/272/244/344/273/273/345/212/241.md +6 -7
- package/assets/nx-kv/references/A03-/346/226/207/346/241/243/344/270/216/345/275/222/345/261/236.md +1 -1
- package/assets/nx-kv/references/B02-CLI/351/200/237/346/237/245.md +2 -2
- package/package.json +1 -1
- package/src/core/attachmentdb/ids.ts +14 -1
- package/src/core/attachmentdb/query.ts +0 -38
- package/src/core/attachmentdb/repo.ts +98 -0
- package/src/core/attachmentdb.ts +5 -1
- package/src/core/db/import-json/tasks.ts +10 -9
- package/src/core/db/import-json.ts +16 -6
- package/src/core/db/index.ts +1 -1
- package/src/core/db/migrations/index.ts +2 -0
- package/src/core/db/migrations/v15.sql +88 -0
- package/src/core/db/verify.ts +7 -3
- package/src/core/db/version.ts +4 -1
- package/src/core/topic-key.ts +5 -8
- package/src/core/workflow/readiness.ts +1 -1
- package/src/core/workflow/types.ts +1 -1
- package/src/modules/claim/assemble.ts +0 -5
- package/src/modules/claim/host.ts +2 -4
- package/src/modules/claim/preview.ts +0 -1
- package/src/modules/claim/wait.ts +9 -49
- package/src/modules/docs/actions/docs-detach.ts +1 -2
- package/src/modules/docs/attach.ts +3 -17
- package/src/modules/docs/render.ts +4 -13
- package/src/modules/localtask/actions/localtask-add.ts +1 -3
- package/src/modules/localtask/actions/localtask-attach.ts +4 -2
- package/src/modules/localtask/actions/localtask-boardtasks.ts +0 -1
- package/src/modules/localtask/actions/localtask-clone.ts +1 -1
- package/src/modules/localtask/actions/localtask-config.ts +2 -11
- package/src/modules/localtask/actions/localtask-detach.ts +1 -3
- package/src/modules/localtask/infra/events.ts +5 -5
- package/src/modules/localtask/infra/repo/rows.ts +0 -1
- package/src/modules/localtask/infra/repo/settings.ts +1 -9
- package/src/modules/localtask/infra/repo/topics.ts +0 -4
- package/src/modules/localtask/lifecycle/add.ts +2 -9
- package/src/modules/localtask/lifecycle/deletion.ts +7 -15
- package/src/modules/localtask/lifecycle/task-lifecycle.ts +2 -2
- package/src/modules/localtask/lifecycle/task-ops.ts +14 -56
- package/src/modules/localtask/lifecycle/task-templates.ts +0 -13
- package/src/modules/localtask/lifecycle/task-view.ts +2 -3
- package/src/modules/localtask/lifecycle/topics.ts +3 -8
- package/src/modules/localtask/ops/attach-resource.ts +46 -4
- package/src/modules/localtask/ops/attach-template.ts +73 -3
- package/src/modules/localtask/ops/attach.ts +45 -18
- package/src/modules/localtask/paths.ts +7 -17
- package/src/modules/localtask/service.ts +3 -7
- package/src/modules/localtask/ui/action-flags.ts +2 -2
- package/src/modules/localtask/ui/action-render.ts +7 -19
- package/src/modules/localtask/waiting.ts +1 -8
- package/src/modules/promptplug/compose.ts +1 -3
- package/src/modules/promptplug/plugins/attachment.ts +56 -6
- package/src/modules/promptplug/plugins/context.ts +11 -2
- package/src/modules/promptplug/template-store.ts +25 -3
- package/src/modules/templates/scope.ts +1 -1
- package/src/shared/prompt-blocks.ts +2 -23
- package/src/web/frontend/App.tsx +4 -9
- package/src/web/frontend/api/cli-tree.json +6 -6
- package/src/web/frontend/api/client.generated.ts +11 -11
- package/src/web/frontend/api/tasks.ts +117 -0
- package/src/web/frontend/components/Introduction/index.tsx +50 -3
- package/src/web/frontend/components/Introduction/style.css +6 -0
- package/src/web/frontend/components/Introduction/use-intro.ts +25 -0
- package/src/web/frontend/components/md/attachments/attach-area.tsx +9 -11
- package/src/web/frontend/components/md/attachments/attach-common.ts +12 -5
- package/src/web/frontend/components/md/attachments/attach-modal.tsx +54 -9
- package/src/web/frontend/components/md/attachments/attach-repo-pick.tsx +48 -0
- package/src/web/frontend/components/sidebar/index.tsx +52 -48
- package/src/web/frontend/components/sidebar/model.ts +16 -32
- package/src/web/frontend/components/sidebar/queue-nav.ts +3 -4
- package/src/web/frontend/components/sidebar/row-menu.tsx +1 -1
- package/src/web/frontend/components/sidebar/task-children.tsx +53 -32
- package/src/web/frontend/{page/dir → components/task-panel}/dag-editor.tsx +1 -1
- package/src/web/frontend/components/task-panel/task-ops.ts +299 -0
- package/src/web/frontend/components/task-panel/task-page.tsx +495 -0
- package/src/web/frontend/components/tool-acts/modules.ts +3 -0
- package/src/web/frontend/modules/board/board-view.ts +2 -56
- package/src/web/frontend/modules/md/doc-store.ts +2 -3
- package/src/web/frontend/page/dag/head-bar.tsx +0 -1
- package/src/web/frontend/page/dag/index.tsx +1 -4
- package/src/web/frontend/page/dag/model.ts +0 -1
- package/src/web/frontend/page/dir/api.ts +4 -108
- package/src/web/frontend/page/dir/index.tsx +161 -348
- package/src/web/frontend/page/dir/task-actions.ts +20 -32
- package/src/web/frontend/page/dir/task-board-section.tsx +3 -0
- package/src/web/frontend/page/dir/task-chain.ts +6 -10
- package/src/web/frontend/page/dir/task-dock-panel.tsx +3 -6
- package/src/web/frontend/page/dir/task-feedback.ts +9 -17
- package/src/web/frontend/page/dir/task-not-found.tsx +2 -3
- package/src/web/frontend/page/dir/task-utils.ts +0 -1
- package/src/web/frontend/page/dir/task.tsx +14 -18
- package/src/web/frontend/page/doc/doc-dock.tsx +1 -1
- package/src/web/frontend/page/group/api.ts +3 -21
- package/src/web/frontend/page/group/group-project-memo.ts +41 -0
- package/src/web/frontend/page/group/index.tsx +289 -429
- package/src/web/frontend/page/progress/index.tsx +7 -12
- package/src/web/frontend/page/settings/api.ts +1 -2
- package/src/web/frontend/page/settings/prompt-templates-section.tsx +12 -44
- package/src/web/frontend/panels.tsx +1 -1
- package/src/web/frontend/registry.ts +1 -2
- package/src/web/frontend/route-map.ts +0 -1
- package/src/web/frontend/routes/dir.ts +1 -4
- package/src/web/frontend/routes/keys.ts +5 -3
- package/src/web/frontend/svghub/catalog-nav.ts +8 -11
- package/src/web/public/assets/app-context-CngKv8Tc.js +1 -0
- package/src/web/public/assets/{bar-Dy_QDX2h.js → bar-C0Q_Qe4z.js} +1 -1
- package/src/web/public/assets/board-view-C8OQhkyi.js +1 -0
- package/src/web/public/assets/{button-3JlUeln_.js → button-Cs6w2CDi.js} +1 -1
- package/src/web/public/assets/{composer-launch-B7DH53Yf.js → composer-launch-BF3_hyn5.js} +1 -1
- package/src/web/public/assets/{composer-panel-Cj1J16r-.js → composer-panel-D6vBrzCs.js} +1 -1
- package/src/web/public/assets/{dag-DXRPHVl8.js → dag-CZF6sV2_.js} +1 -1
- package/src/web/public/assets/dir-6RhnWw1E.js +1 -0
- package/src/web/public/assets/doc-CVIVBV6n.js +6 -0
- package/src/web/public/assets/doc-DgYKv2wo.css +1 -0
- package/src/web/public/assets/group-AF62Z-_G.js +1 -0
- package/src/web/public/assets/group-project-memo-G-O6sPRw.js +1 -0
- package/src/web/public/assets/index-Bposj22Z.js +3 -0
- package/src/web/public/assets/{list-filter-CWxiOSg_.js → list-search-DFvFY408.js} +1 -1
- package/src/web/public/assets/md-history-COQu16vy.js +47 -0
- package/src/web/public/assets/{member-picker-BZgE3HGb.js → member-picker-CHX0nS0O.js} +1 -1
- package/src/web/public/assets/popup-dBtYqEM1.js +1 -0
- package/src/web/public/assets/progress-CDh6DY7g.js +3 -0
- package/src/web/public/assets/refs-t79ynSY8.js +2 -0
- package/src/web/public/assets/reopen-text-B2d9SZi0.js +13 -0
- package/src/web/public/assets/{repo-form-modal-CNLYR12c.js → repo-form-modal-dZqpHyUj.js} +1 -1
- package/src/web/public/assets/{repos-BGx-yAXd.js → repos-DdhOQJqF.js} +9 -9
- package/src/web/public/assets/{route-crumb-DX9C4jmQ.js → route-crumb-BKq2jry0.js} +1 -1
- package/src/web/public/assets/settings-Bk3clN2f.js +1 -0
- package/src/web/public/assets/task-C8nax2rT.js +13 -0
- package/src/web/public/assets/task-ops-D6E_TgEC.js +2 -0
- package/src/web/public/assets/task-utils-Dh33OFKe.js +1 -0
- package/src/web/public/assets/{templates-Co1Qb1aA.js → templates-Dusbff7Z.js} +3 -3
- package/src/web/public/assets/{tool-bar-D5wLBLRl.js → tool-bar-DPXnjdQF.js} +2 -2
- package/src/web/public/assets/use-rail-drag-B6J0iqFK.js +1 -0
- package/src/web/public/index.html +13 -13
- package/src/web/frontend/page/dir/landing.tsx +0 -553
- package/src/web/public/assets/app-context-BqCBcDsx.js +0 -1
- package/src/web/public/assets/board-view-Cm8189wG.js +0 -1
- package/src/web/public/assets/dir-_M1ciSxM.js +0 -3
- package/src/web/public/assets/doc-Iuxssa-b.css +0 -1
- package/src/web/public/assets/doc-_iteSM2X.js +0 -6
- package/src/web/public/assets/get-loop-modal-DlAfqJMz.js +0 -2
- package/src/web/public/assets/group-CH8qe-eg.js +0 -1
- package/src/web/public/assets/index-Cui4IuGj.js +0 -3
- package/src/web/public/assets/md-history-Bj790fdn.js +0 -46
- package/src/web/public/assets/popup-DZ2Khv2c.js +0 -1
- package/src/web/public/assets/progress-MPse2JLQ.js +0 -3
- package/src/web/public/assets/refs-DiIPoqnJ.js +0 -2
- package/src/web/public/assets/settings-Pt4YgGdY.js +0 -1
- package/src/web/public/assets/task-DOIIpQ4X.js +0 -13
- package/src/web/public/assets/task-utils-CJfMODCP.js +0 -13
- package/src/web/public/assets/use-rail-drag-CNOHXWng.js +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// 「关联参考仓库」区块(#184):搜索已登记仓库 → 选中后挂指针(不走 folder)。
|
|
2
|
+
// 抽成组件是为了让 attach-modal 不因新增区块超行数门禁。
|
|
3
|
+
export interface RepoPickItem {
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
desc?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
path?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface AttachRepoPickProps {
|
|
12
|
+
repos: RepoPickItem[];
|
|
13
|
+
list: RepoPickItem[];
|
|
14
|
+
search: string;
|
|
15
|
+
onSearch: (v: string) => void;
|
|
16
|
+
onPick: (r: RepoPickItem) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function AttachRepoPick({ repos, list, search, onSearch, onPick }: AttachRepoPickProps) {
|
|
20
|
+
return (
|
|
21
|
+
<div className='att-pick'>
|
|
22
|
+
<div className='att-pick-head'>关联参考仓库(repo)</div>
|
|
23
|
+
<input
|
|
24
|
+
className='pp-input'
|
|
25
|
+
placeholder='搜索仓库名 / key / 描述'
|
|
26
|
+
value={search}
|
|
27
|
+
onChange={(e) => onSearch(e.target.value)}
|
|
28
|
+
onKeyDown={(e) => {
|
|
29
|
+
const first = list[0];
|
|
30
|
+
if (e.key === 'Enter' && first) { e.preventDefault(); onPick(first); }
|
|
31
|
+
}}
|
|
32
|
+
spellCheck='false'
|
|
33
|
+
/>
|
|
34
|
+
{list.length ? (
|
|
35
|
+
<div className='att-pick-list'>
|
|
36
|
+
{list.map((r) => (
|
|
37
|
+
<button key={r.key} type='button' className='att-pick-item' onClick={() => onPick(r)}>
|
|
38
|
+
<span className='att-pick-main'>{r.name || r.key}</span>
|
|
39
|
+
<span className='att-pick-path'>{r.type === 'ref' ? '参考仓库' : '开发仓库'} · {r.key}</span>
|
|
40
|
+
</button>
|
|
41
|
+
))}
|
|
42
|
+
</div>
|
|
43
|
+
) : (
|
|
44
|
+
<div className='att-empty-inline'>{repos.length ? '没有匹配的仓库' : '还没有登记仓库'}</div>
|
|
45
|
+
)}
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -36,7 +36,6 @@ import type { AppRoute, BoardRow, LocalTopic, Prefs, RepoRow, ShellApi } from '.
|
|
|
36
36
|
*/
|
|
37
37
|
function rowIcon(row: SideRow): string {
|
|
38
38
|
if (row.type === 'board') return 'board';
|
|
39
|
-
if (row.type === 'global') return 'globe';
|
|
40
39
|
return row.repoType === 'ref' ? 'repo-ref' : 'repo';
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -127,7 +126,6 @@ export default function Sidebar({
|
|
|
127
126
|
curCollapsed = !!r.collapsed;
|
|
128
127
|
continue;
|
|
129
128
|
}
|
|
130
|
-
if (r.type === 'global') continue;
|
|
131
129
|
if (cur && curCollapsed) hiddenKeys.add(r.type === 'board' ? 'board:' + String(r.id) : r.key);
|
|
132
130
|
}
|
|
133
131
|
return hiddenKeys;
|
|
@@ -163,20 +161,21 @@ export default function Sidebar({
|
|
|
163
161
|
};
|
|
164
162
|
|
|
165
163
|
const isActive = (row: SideRow) => {
|
|
166
|
-
if (row.type === 'global') return route.view === 'global';
|
|
167
164
|
if (row.type === 'repo') return route.view === 'dir' && route.key === row.topicKey;
|
|
168
165
|
if (row.type === 'board') return route.view === 'group' && route.key === row.id;
|
|
169
166
|
return false;
|
|
170
167
|
};
|
|
171
168
|
|
|
172
|
-
//
|
|
169
|
+
// 当前路由所在仓库 / 组自动展开子行(深链 / 总览跳转进来也能看到层级)
|
|
173
170
|
useEffect(() => {
|
|
174
171
|
const key = route.key;
|
|
175
|
-
if (
|
|
172
|
+
if (!key) return;
|
|
173
|
+
const id = route.view === 'dir' ? key : route.view === 'group' ? 'board:' + key : '';
|
|
174
|
+
if (!id) return;
|
|
176
175
|
setExpanded((prev) => {
|
|
177
|
-
if (prev.has(
|
|
176
|
+
if (prev.has(id)) return prev;
|
|
178
177
|
const next = new Set(prev);
|
|
179
|
-
next.add(
|
|
178
|
+
next.add(id);
|
|
180
179
|
return next;
|
|
181
180
|
});
|
|
182
181
|
}, [route.view, route.key]);
|
|
@@ -194,15 +193,14 @@ export default function Sidebar({
|
|
|
194
193
|
const nsOps = useSidebarNs({ patchPrefs, toast, dialog, setMenu, repos, boards, namespaces: prefs.namespaces });
|
|
195
194
|
const { nsForm, setNsForm, addFor, setAddFor, candidatesFor, manageOpen, setManageOpen, observeOpen, setObserveOpen, labelOf, setFocusNs, moveNs, removeNs, renameNs, newNsAndMove, addToNs, dropToCurrent, openNsMenu, toggleNsCollapse, moveToNs, removeFromNs } = nsOps;
|
|
196
195
|
|
|
197
|
-
// 点击:看板 =
|
|
196
|
+
// 点击:看板 = 进组视图(成员仍在组面板里下拉选择,树里不铺成员仓库;
|
|
197
|
+
// 但 chevron 可展开**本组任务**子行,与仓库行的任务子行同构);
|
|
198
198
|
// 仓库 = 进目录(子任务表);全局 = 进全局池。
|
|
199
199
|
// 仓库行没有任务队列时(topicKey 为空)点行 = 先建队列再进(与「新建页」同一套)。
|
|
200
200
|
const openRow = useCallback(
|
|
201
201
|
(row: SideRow) => {
|
|
202
202
|
if (row.type === 'board') {
|
|
203
203
|
onNavigate?.('#/group/' + encodeURIComponent(String(row.id)));
|
|
204
|
-
} else if (row.type === 'global') {
|
|
205
|
-
onNavigate?.('#/global');
|
|
206
204
|
} else if (row.topicKey) {
|
|
207
205
|
onNavigate?.('#/dir/' + encodeURIComponent(row.topicKey));
|
|
208
206
|
} else {
|
|
@@ -212,14 +210,13 @@ export default function Sidebar({
|
|
|
212
210
|
[onNavigate, refreshLocal, toast]
|
|
213
211
|
);
|
|
214
212
|
|
|
215
|
-
// chevron:展开/收起(仓库 =
|
|
213
|
+
// chevron:展开/收起(仓库 = 项目任务;组 = 本组任务,均按 topicKey / board id 记)
|
|
216
214
|
const toggleRow = useCallback(
|
|
217
215
|
(row: SideRow) => {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
216
|
+
// #251:仓库行 / 组行都可展开(按 topicKey / board id 记);#190 全局池行已删除
|
|
217
|
+
toggleExpanded(
|
|
218
|
+
row.type === 'board' ? 'board:' + String(row.id || row.key) : (row.topicKey || row.key)
|
|
219
|
+
);
|
|
223
220
|
},
|
|
224
221
|
[onNavigate, toggleExpanded]
|
|
225
222
|
);
|
|
@@ -389,6 +386,8 @@ export default function Sidebar({
|
|
|
389
386
|
// #167:折叠分区内的条目行直接不出(计数在 ns 头上仍可见)
|
|
390
387
|
const rowKey = row.type === 'board' ? 'board:' + String(row.id) : row.key;
|
|
391
388
|
if ((row.type === 'repo' || row.type === 'board') && hiddenByNs.has(rowKey)) return null;
|
|
389
|
+
// 组行也可展开(与仓库行同构):expanded 里用 `board:<id>` 前缀,不与 topicKey 混
|
|
390
|
+
const boardOpen = row.type === 'board' && expanded.has('board:' + String(row.id || row.key));
|
|
392
391
|
return (
|
|
393
392
|
row.type === 'ns' ? (
|
|
394
393
|
<NsHeadRow
|
|
@@ -406,37 +405,42 @@ export default function Sidebar({
|
|
|
406
405
|
onDrop={(e) => onDrop(e, row)}
|
|
407
406
|
/>
|
|
408
407
|
) : row.type === 'board' ? (
|
|
409
|
-
<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
>
|
|
423
|
-
{/* 组是叶子:占位只为了与其它行对齐,不给可展开的假提示 */}
|
|
424
|
-
<span className="tw" aria-hidden />
|
|
425
|
-
<span className="gico"><Icon name="board" /></span>
|
|
426
|
-
<span className="nm">
|
|
427
|
-
{row.name}
|
|
428
|
-
</span>
|
|
429
|
-
{waitTag(row, '组内有 agent 等待回填')}
|
|
430
|
-
<span className="cnt" title={`待领取 ${row.pending} · 成员 ${row.count} 个`}>
|
|
431
|
-
{row.pending > 0 ? row.pending : row.count}
|
|
432
|
-
</span>
|
|
433
|
-
<span
|
|
434
|
-
className="more" role="button" tabIndex={-1} aria-label="看板菜单"
|
|
435
|
-
onClick={(e) => openRowMenu(e, row)}
|
|
408
|
+
<div className="tblock" key={(row as any).nsId ? `${(row as any).nsId}:b:${row.id}` : 'b:' + row.id}>
|
|
409
|
+
<button
|
|
410
|
+
className={'trow group' + (isActive(row) ? ' active' : '') + (boardOpen ? ' open' : '') + (kbIndex === i ? ' kb-focus' : '')}
|
|
411
|
+
onClick={() => openRow(row)}
|
|
412
|
+
onContextMenu={(e) => openRowMenu(e, row)}
|
|
413
|
+
draggable
|
|
414
|
+
onDragStart={(e) => onDragStart(e, row)}
|
|
415
|
+
onDragEnd={onDragEnd}
|
|
416
|
+
onDragOver={(e) => onDragOver(e, row)}
|
|
417
|
+
onDragLeave={onDragLeave}
|
|
418
|
+
onDrop={(e) => onDrop(e, row)}
|
|
419
|
+
data-drop={dropHint?.id === row.id ? dropHint?.zone : undefined}
|
|
420
|
+
title={`${row.name} · ${row.count} 个目录\n${row.desc || '项目组:点进去操作组下的项目'}`}
|
|
436
421
|
>
|
|
437
|
-
<
|
|
438
|
-
|
|
439
|
-
|
|
422
|
+
<span
|
|
423
|
+
className="tw" role="button" tabIndex={-1} aria-label="展开本组任务"
|
|
424
|
+
title="展开 / 收起本组任务(只列 frontmatter.board 指向本组的任务)"
|
|
425
|
+
onClick={(e) => { e.stopPropagation(); toggleRow(row); }}
|
|
426
|
+
>
|
|
427
|
+
<Icon name="chevron" size={10} />
|
|
428
|
+
</span>
|
|
429
|
+
<span className="gico"><Icon name="board" /></span>
|
|
430
|
+
<span className="nm">{row.name}</span>
|
|
431
|
+
{waitTag(row, '组内有 agent 等待回填')}
|
|
432
|
+
<span className="cnt" title={`待领取 ${row.pending} · 成员 ${row.count} 个`}>
|
|
433
|
+
{row.pending > 0 ? row.pending : row.count}
|
|
434
|
+
</span>
|
|
435
|
+
<span className="more" role="button" tabIndex={-1} aria-label="看板菜单"
|
|
436
|
+
onClick={(e) => openRowMenu(e, row)}>
|
|
437
|
+
<Icon name="dots" size={13} />
|
|
438
|
+
</span>
|
|
439
|
+
</button>
|
|
440
|
+
{boardOpen && (
|
|
441
|
+
<TaskChildren row={row} onNavigate={onNavigate} refreshLocal={refreshLocal} />
|
|
442
|
+
)}
|
|
443
|
+
</div>
|
|
440
444
|
) : (
|
|
441
445
|
<div key={(row as any).nsId ? `${(row as any).nsId}:${row.type}:${row.key}` : row.type + ':' + row.key} className="tblock">
|
|
442
446
|
<button
|
|
@@ -471,7 +475,7 @@ export default function Sidebar({
|
|
|
471
475
|
{row.name}
|
|
472
476
|
</span>
|
|
473
477
|
{row.pending > 0 && <span className="cnt">{row.pending}</span>}
|
|
474
|
-
{waitTag(row,
|
|
478
|
+
{waitTag(row, 'agent 等待回填中')}
|
|
475
479
|
<span
|
|
476
480
|
className="more" role="button" tabIndex={-1} aria-label="行菜单"
|
|
477
481
|
onClick={(e) => openRowMenu(e, row)}
|
|
@@ -480,7 +484,7 @@ export default function Sidebar({
|
|
|
480
484
|
</span>
|
|
481
485
|
</button>
|
|
482
486
|
{/* 展开键与 openRow 同源(topicKey,空则退仓库 key)——否则无队列仓库永远展不开 */}
|
|
483
|
-
{
|
|
487
|
+
{expanded.has(row.topicKey || row.key) && (
|
|
484
488
|
<TaskChildren row={row} onNavigate={onNavigate} refreshLocal={refreshLocal} />
|
|
485
489
|
)}
|
|
486
490
|
</div>
|
|
@@ -13,7 +13,6 @@ import { stripFrontmatter } from '../../modules/md/md-parse.js';
|
|
|
13
13
|
import { projectPending, isPendingRow, taskInBoard } from '../../modules/board/board-view.js';
|
|
14
14
|
import type { BoardRow, LocalTask, LocalTopic, Prefs, RepoRow } from '../../types.js';
|
|
15
15
|
|
|
16
|
-
export const GLOBAL_KEY = '__GLOBAL__';
|
|
17
16
|
/** 「未分组」区的头行 key(不在 namespaces.items 里的条目落这里;不可重命名/删除) */
|
|
18
17
|
export const UNGROUPED_KEY = '__UNGROUPED__';
|
|
19
18
|
/** #174:内置 dynamic 视图「运行中」——只显示有任务(待领取 / 等待中)的仓库与看板。
|
|
@@ -30,8 +29,8 @@ export const ALL_TOPICS_KEY = '__ALL_TOPICS__';
|
|
|
30
29
|
* 值全部来自 /api 的登记与队列数据,故按「可选 + 宽松」收。
|
|
31
30
|
*/
|
|
32
31
|
export interface SideRow {
|
|
33
|
-
type: 'repo' | 'board' | '
|
|
34
|
-
/** 行身份(仓库 key / 看板 id /
|
|
32
|
+
type: 'repo' | 'board' | 'ns';
|
|
33
|
+
/** 行身份(仓库 key / 看板 id / 命名空间 key) */
|
|
35
34
|
key: string;
|
|
36
35
|
id?: string;
|
|
37
36
|
repoId?: string;
|
|
@@ -177,7 +176,6 @@ export function buildTree(
|
|
|
177
176
|
// 没匹配上的(目录没登记)不单独成行——它不属于任何仓库,也不该有自己的入口。
|
|
178
177
|
const topicsOf = new Map<string, LocalTopic[]>();
|
|
179
178
|
for (const t of topicList) {
|
|
180
|
-
if (t.isGlobal) continue;
|
|
181
179
|
const rid = t.repo && t.repo.id;
|
|
182
180
|
if (!rid) continue;
|
|
183
181
|
const bucket = topicsOf.get(rid);
|
|
@@ -233,12 +231,12 @@ export function buildTree(
|
|
|
233
231
|
|
|
234
232
|
const rows: SideRow[] = [];
|
|
235
233
|
|
|
236
|
-
//
|
|
237
|
-
//
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
//
|
|
241
|
-
//
|
|
234
|
+
// 看板行(分组):**不铺成员仓库子行**(2026-11-03 语义化改版)——侧栏操作的对象
|
|
235
|
+
// 是「工作组」,成员清单与项目切换收进组详情面板(#/group/<id>,面板内下拉选项目)。
|
|
236
|
+
// 但组行**可以展开本组任务**(与仓库行的任务子行同构,#251 补):任务由成员队列里
|
|
237
|
+
// frontmatter.board 指向本组的行汇总而来,与组页「本组任务」同口径。
|
|
238
|
+
// 组行徽标 = 这些任务的待领取数(#85 两种走向;以前按成员队列整队求和,会把
|
|
239
|
+
// 成员项目的纯项目任务也算成「组内待领取」,同一仓库属于两组时还会被重复计数)。
|
|
242
240
|
for (const b of boardList) {
|
|
243
241
|
// 外部数据边界:/api/boards 的成员表({key,id}),形状由后端 schema 决定
|
|
244
242
|
const memberRepos = (b.repos || []) as Array<{ key?: string; id?: string }>;
|
|
@@ -249,6 +247,11 @@ export function buildTree(
|
|
|
249
247
|
// 搜索时:命中成员也算命中这个组(组行代表它的全部成员)
|
|
250
248
|
const memberHit = members.some(hit);
|
|
251
249
|
if (q && !hit(b) && !memberHit) continue;
|
|
250
|
+
// 本组任务 = 成员队列里**正文 frontmatter.board 指向本组**的任务(与组页
|
|
251
|
+
// 「本组任务」同口径)。侧栏展开子行与行徽标读同一份,避免计数和列表对不上。
|
|
252
|
+
const boardTasks = members
|
|
253
|
+
.flatMap((m) => (m.topics || []).flatMap((t) => t.tasks || []))
|
|
254
|
+
.filter((x) => !x.deletedAt && taskInBoard(x, b));
|
|
252
255
|
rows.push({
|
|
253
256
|
type: 'board',
|
|
254
257
|
id: b.id,
|
|
@@ -256,22 +259,19 @@ export function buildTree(
|
|
|
256
259
|
name: b.name,
|
|
257
260
|
desc: b.desc || '',
|
|
258
261
|
count: memberRepos.length,
|
|
259
|
-
pending:
|
|
260
|
-
(n, m) =>
|
|
261
|
-
n + (m.topics || []).reduce((k, t) => k + (t.tasks || []).filter((x) => taskInBoard(x, b)).filter(isPendingRow).length, 0),
|
|
262
|
-
0
|
|
263
|
-
),
|
|
262
|
+
pending: boardTasks.filter(isPendingRow).length,
|
|
264
263
|
waiting: members.some((m) => m.waiting),
|
|
265
264
|
// 组行的等待标记看成员的窗口(取最早结束的那个)
|
|
266
265
|
waitingDeadlineMs: earliestDeadline(members.map((m) => m.waitingDeadlineMs)),
|
|
267
266
|
members: memberRepos.map((m) => m.key ?? ''),
|
|
267
|
+
tasks: boardTasks,
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
// **仓库是独立的模块,项目组只是指向它的指针**(任务 #61 反馈):
|
|
272
272
|
// - 组行 = 指针(聚合入口),**不铺成员**:组下面不列它指向的仓库;
|
|
273
273
|
// - 仓库行 = 模块:**每个仓库一行**,且**永远不因为被组链接就消失**。
|
|
274
|
-
//
|
|
274
|
+
// 所以仓库行平铺(不进任何组的桶、不缩进),组行只挂自己的任务子行(展开态)。
|
|
275
275
|
//
|
|
276
276
|
// 「显示哪些」由设置面板「侧栏显示」一栏编排(隐藏清单走 prefs.hidden)。
|
|
277
277
|
for (const r of matched) {
|
|
@@ -311,23 +311,7 @@ export function buildTree(
|
|
|
311
311
|
})
|
|
312
312
|
.map((x) => x.r);
|
|
313
313
|
|
|
314
|
-
// 全局池恒顶(不受排序影响)
|
|
315
|
-
const globalRow = topicList.find((t) => t.isGlobal);
|
|
316
314
|
const out: SideRow[] = [];
|
|
317
|
-
if (globalRow) {
|
|
318
|
-
out.push({
|
|
319
|
-
type: 'global',
|
|
320
|
-
key: GLOBAL_KEY,
|
|
321
|
-
name: globalRow.name || '全局任务',
|
|
322
|
-
topic: globalRow,
|
|
323
|
-
pending: globalRow.pending || 0,
|
|
324
|
-
waiting: !!globalRow.waiting,
|
|
325
|
-
waitingDeadlineMs: topicDeadlineMs(globalRow),
|
|
326
|
-
// 历史形态:全局池行把任务数组放在 topics 上(TaskChildren 读的是 tasks)——
|
|
327
|
-
// 此处只做形状收口,不改数据落点,免得顺手改了侧栏的可见行为。
|
|
328
|
-
topics: (globalRow.tasks || []).filter((t) => !t.deletedAt) as unknown as LocalTopic[],
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
315
|
|
|
332
316
|
// ── #167 namespace 分区(纯 UI 组织)──
|
|
333
317
|
// prefs.namespaces 非空且非搜索 → 按「置顶分区 → 普通分区(数组序)→ 未分组」渲染;
|
|
@@ -33,10 +33,9 @@ export interface QueueNavOptions {
|
|
|
33
33
|
*/
|
|
34
34
|
export async function ensureQueueAndGo({ row, onNavigate, refreshLocal, toast, draft = false }: QueueNavOptions): Promise<void> {
|
|
35
35
|
const withTask = (base: string) => (draft ? `${base}?task=draft` : base);
|
|
36
|
-
//
|
|
37
|
-
if (row.
|
|
38
|
-
|
|
39
|
-
onNavigate?.(withTask(base));
|
|
36
|
+
// 已有队列的仓库:直接跳(#190 全局池行已删除)
|
|
37
|
+
if (row.topicKey) {
|
|
38
|
+
onNavigate?.(withTask(`#/dir/${encodeURIComponent(String(row.topicKey))}`));
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
42
41
|
// 没队列的仓库:先登记目录再进。登记仓库没有路径(不该发生)给提示后停。
|
|
@@ -115,7 +115,7 @@ export function rowMenuItems({ row, prefs, patchPrefs, onNavigate, boards, onDat
|
|
|
115
115
|
];
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
return [
|
|
118
|
+
return []; // #190 全局任务池已删除
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/** addMenuItems 的入参:三个入口都交给调用方弹自己的表单(#193 对齐 repos 页)。 */
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
// 显示序:**未完成(待领取)优先**(sortTasksForDisplay——追加序会把新任务
|
|
10
10
|
// 埋在历史底下);长度:**不分页**——#181 去掉翻页控件后是全量铺开,但队列一长
|
|
11
11
|
// (实测 68 条)侧栏就被任务子行灌满,树形导航彻底失效。
|
|
12
|
-
// #188
|
|
13
|
-
//
|
|
12
|
+
// #188 用户口径:默认铺 8 条,尾部「…还有 N 条」**点一次只多加载 10 条**(继续点继续加载),
|
|
13
|
+
// 不再一次铺开全部——队列很长时一次全展开照样把侧栏灌满。
|
|
14
|
+
// 另有「收起」把窗口还原到 8 条。
|
|
14
15
|
import { useMemo, useState } from 'react';
|
|
15
16
|
import { Icon } from '../icons.jsx';
|
|
16
17
|
import { useToast } from '../toast/index.jsx';
|
|
@@ -29,8 +30,10 @@ import type { LocalTask } from '../../types.js';
|
|
|
29
30
|
// 这里按实际契约声明一次——它毕业成强类型后此桥退化为恒等。
|
|
30
31
|
const sortTasksForDisplayBridge = sortTasksForDisplay as unknown as (tasks: LocalTask[]) => LocalTask[];
|
|
31
32
|
|
|
32
|
-
/**
|
|
33
|
+
/** 侧栏默认铺开的任务子行条数。 */
|
|
33
34
|
const SIDE_TASK_LIMIT = 8;
|
|
35
|
+
/** #188:点「…还有 N 条」时每次多加载几条。 */
|
|
36
|
+
const SIDE_TASK_STEP = 10;
|
|
34
37
|
|
|
35
38
|
/** TaskChildren 入参。 */
|
|
36
39
|
export interface TaskChildrenProps {
|
|
@@ -41,22 +44,23 @@ export interface TaskChildrenProps {
|
|
|
41
44
|
|
|
42
45
|
export default function TaskChildren({ row, onNavigate, refreshLocal }: TaskChildrenProps) {
|
|
43
46
|
const toast = useToast();
|
|
44
|
-
//
|
|
47
|
+
// 仓库行:多个 topic 的 tasks 汇总;组行:model 已按「本组任务」口径(frontmatter.board)算好,直接铺
|
|
48
|
+
// (#85:组任务归组页管;#190 全局池行已删除)
|
|
45
49
|
const tasks = useMemo(() => {
|
|
46
|
-
const list: LocalTask[] =
|
|
47
|
-
row.
|
|
48
|
-
|
|
49
|
-
// #85 两种走向:仓库行下的子任务是**项目走向**的入口——组任务归组页管
|
|
50
|
-
: (row.topics || []).flatMap((t) => (t.tasks || []).filter((x) => !x.deletedAt && !isGroupTask(x)));
|
|
50
|
+
const list: LocalTask[] = row.type === 'board'
|
|
51
|
+
? (row.tasks || [])
|
|
52
|
+
: (row.topics || []).flatMap((t) => (t.tasks || []).filter((x) => !x.deletedAt && !isGroupTask(x)));
|
|
51
53
|
return sortTasksForDisplayBridge(list);
|
|
52
54
|
}, [row]);
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
// 导航基址:组 = 组页(#/group/<id>,任务详情带 ?task=);仓库 = 工作台,
|
|
56
|
+
// 用 **topicKey**(工作台按它找队列),不是仓库 key
|
|
57
|
+
const isBoard = row.type === 'board';
|
|
58
|
+
const base = isBoard
|
|
59
|
+
? `#/group/${encodeURIComponent(String(row.id || row.key))}`
|
|
56
60
|
: `#/dir/${encodeURIComponent(row.topicKey || row.key)}`;
|
|
57
|
-
// #188
|
|
58
|
-
const [
|
|
59
|
-
const shown =
|
|
61
|
+
// #188:默认铺 8 条;「…还有 N 条」点一次多加载 10 条(分页式增量,不一次全铺)。
|
|
62
|
+
const [limit, setLimit] = useState(SIDE_TASK_LIMIT);
|
|
63
|
+
const shown = tasks.slice(0, limit);
|
|
60
64
|
const rest = tasks.length - shown.length;
|
|
61
65
|
return (
|
|
62
66
|
<>
|
|
@@ -80,47 +84,64 @@ export default function TaskChildren({ row, onNavigate, refreshLocal }: TaskChil
|
|
|
80
84
|
</span>
|
|
81
85
|
</button>
|
|
82
86
|
))}
|
|
83
|
-
{/*
|
|
87
|
+
{/* 「…还有 N 条」:点一次只多加载 10 条(#188),不一次铺开全部 */}
|
|
84
88
|
{rest > 0 && (
|
|
85
89
|
<button
|
|
86
90
|
type="button"
|
|
87
91
|
className="trow child task-more"
|
|
88
|
-
title={`还有 ${rest}
|
|
92
|
+
title={`还有 ${rest} 条任务没铺开——点一次多加载 ${Math.min(SIDE_TASK_STEP, rest)} 条`}
|
|
89
93
|
onClick={(e) => {
|
|
90
94
|
e.stopPropagation();
|
|
91
|
-
|
|
95
|
+
setLimit((n) => n + SIDE_TASK_STEP);
|
|
92
96
|
}}
|
|
93
97
|
>
|
|
94
98
|
<span className="gico"><Icon name="dots" size={12} /></span>
|
|
95
99
|
<span className="nm">…还有 {rest} 条</span>
|
|
96
100
|
</button>
|
|
97
101
|
)}
|
|
98
|
-
{
|
|
102
|
+
{limit > SIDE_TASK_LIMIT && (
|
|
99
103
|
<button
|
|
100
104
|
type="button"
|
|
101
105
|
className="trow child task-more"
|
|
102
106
|
title="收起,只留前几条"
|
|
103
107
|
onClick={(e) => {
|
|
104
108
|
e.stopPropagation();
|
|
105
|
-
|
|
109
|
+
setLimit(SIDE_TASK_LIMIT);
|
|
106
110
|
}}
|
|
107
111
|
>
|
|
108
112
|
<span className="gico"><Icon name="chevron" size={12} /></span>
|
|
109
113
|
<span className="nm">收起</span>
|
|
110
114
|
</button>
|
|
111
115
|
)}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
{isBoard ? (
|
|
117
|
+
// 组任务必须带 board + 归属项目两个 frontmatter,侧栏无从选择——
|
|
118
|
+
// 入口给到组页(那里「+ 新建页」会预置本组语义),不在这里造假草稿。
|
|
119
|
+
<button
|
|
120
|
+
type="button"
|
|
121
|
+
className="trow child task-new"
|
|
122
|
+
title="到组页新建任务(需要选归属项目)"
|
|
123
|
+
onClick={(e) => {
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
onNavigate?.(base);
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
<span className="gico"><Icon name="plus" size={12} /></span>
|
|
129
|
+
<span className="nm">新建任务</span>
|
|
130
|
+
</button>
|
|
131
|
+
) : (
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
134
|
+
className="trow child task-new"
|
|
135
|
+
title="新建一页 MD(新页签打开;仓库还没有任务队列时先创建队列)"
|
|
136
|
+
onClick={(e) => {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
ensureQueueAndGo({ row, onNavigate, refreshLocal, toast, draft: true });
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
<span className="gico"><Icon name="plus" size={12} /></span>
|
|
142
|
+
<span className="nm">新建页</span>
|
|
143
|
+
</button>
|
|
144
|
+
)}
|
|
124
145
|
</>
|
|
125
146
|
);
|
|
126
147
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// UI 与其对齐:开闸门即清空并禁用上游段。
|
|
11
11
|
import { useState } from 'react';
|
|
12
12
|
import type { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
13
|
-
import { Modal as ModalRaw } from '
|
|
13
|
+
import { Modal as ModalRaw } from '../popup/index.jsx';
|
|
14
14
|
import { titleFromMd } from '../../modules/md/md-parse.js';
|
|
15
15
|
import { reaches as reachesVia } from '../../../../shared/graph.js';
|
|
16
16
|
import type { LocalTask } from '../../types.js';
|