nx-kv 0.68.3 → 0.69.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.
Files changed (145) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/package.json +1 -1
  3. package/src/core/attachmentdb/query.ts +10 -1
  4. package/src/core/attachmentdb/resources.ts +4 -16
  5. package/src/core/db/bootstrap.ts +4 -3
  6. package/src/core/db/import-json/links.ts +2 -2
  7. package/src/core/db/import-json/repos.ts +3 -24
  8. package/src/core/db/import-json/tasks.ts +92 -7
  9. package/src/core/db/import-json.ts +1 -2
  10. package/src/core/db/migrations/index.ts +8 -0
  11. package/src/core/db/migrations/v16-data.ts +166 -0
  12. package/src/core/db/migrations/v16.sql +15 -0
  13. package/src/core/db/migrations/v17-data.ts +110 -0
  14. package/src/core/db/migrations/v17.sql +112 -0
  15. package/src/core/db/migrations/v18.sql +24 -0
  16. package/src/core/db/repo-match.ts +52 -0
  17. package/src/core/db/seed-templates.ts +46 -11
  18. package/src/core/db/verify.ts +2 -2
  19. package/src/core/db/version.ts +7 -1
  20. package/src/modules/claim/groupctx.ts +1 -1
  21. package/src/modules/claim/host.ts +5 -5
  22. package/src/modules/goals/plugins/timegoal-task-store.ts +1 -1
  23. package/src/modules/localtask/actions/_manifest.generated.ts +3 -0
  24. package/src/modules/localtask/actions/localtask-add.ts +4 -4
  25. package/src/modules/localtask/actions/localtask-boardtasks.ts +40 -40
  26. package/src/modules/localtask/actions/localtask-reopen.ts +5 -0
  27. package/src/modules/localtask/actions/localtask-sync-queues.ts +35 -0
  28. package/src/modules/localtask/actions/localtask-tasks.ts +3 -2
  29. package/src/modules/localtask/actions/localtask-update.ts +6 -0
  30. package/src/modules/localtask/infra/repo/goals.ts +2 -2
  31. package/src/modules/localtask/infra/repo/links.ts +1 -1
  32. package/src/modules/localtask/infra/repo/rows.ts +16 -0
  33. package/src/modules/localtask/infra/repo/tasks.ts +45 -41
  34. package/src/modules/localtask/infra/repo/topics.ts +61 -4
  35. package/src/modules/localtask/lifecycle/add.ts +15 -23
  36. package/src/modules/localtask/lifecycle/task-lifecycle.ts +7 -7
  37. package/src/modules/localtask/lifecycle/task-ops.ts +22 -11
  38. package/src/modules/localtask/lifecycle/task-view.ts +17 -11
  39. package/src/modules/localtask/lifecycle/topics.ts +82 -4
  40. package/src/modules/localtask/lifecycle/update.ts +28 -29
  41. package/src/modules/localtask/ops/attach-resource.ts +3 -4
  42. package/src/modules/localtask/ops/attach.ts +2 -2
  43. package/src/modules/localtask/ops/board-target.ts +8 -28
  44. package/src/modules/repos/actions/board-add.ts +5 -1
  45. package/src/modules/repos/actions/board-assign.ts +5 -1
  46. package/src/modules/repos/actions/board-remove.ts +5 -1
  47. package/src/modules/repos/actions/repo-add.ts +5 -1
  48. package/src/modules/repos/actions/repo-update.ts +5 -1
  49. package/src/modules/repos/boards/transfer.ts +3 -2
  50. package/src/modules/repos/orchestrate.ts +17 -0
  51. package/src/modules/repos/transfer/export.ts +24 -18
  52. package/src/modules/templates/actions/template-update.ts +1 -1
  53. package/src/modules/templates/service.ts +3 -0
  54. package/src/web/frontend/api/cli-tree.json +17 -2
  55. package/src/web/frontend/api/client.generated.ts +12 -4
  56. package/src/web/frontend/components/Introduction/style.css +1 -1
  57. package/src/web/frontend/components/layout/vsc-crumbs-model.ts +16 -8
  58. package/src/web/frontend/components/layout/vsc-crumbs.css +9 -16
  59. package/src/web/frontend/components/layout/vsc-crumbs.tsx +63 -57
  60. package/src/web/frontend/components/md/attachments/attach-modal.tsx +1 -1
  61. package/src/web/frontend/components/md/hooks/use-live-preview.ts +1 -1
  62. package/src/web/frontend/components/md/model/divider/index.ts +0 -3
  63. package/src/web/frontend/components/md/panes/live-block.tsx +3 -11
  64. package/src/web/frontend/components/md/panes/md-panes-helpers.ts +1 -3
  65. package/src/web/frontend/components/md/panes/md-panes-keys.ts +1 -2
  66. package/src/web/frontend/components/md/panes/md-panes.tsx +2 -4
  67. package/src/web/frontend/components/popup/index.tsx +17 -3
  68. package/src/web/frontend/components/popup/style.css +9 -0
  69. package/src/web/frontend/components/sidebar/model.ts +2 -2
  70. package/src/web/frontend/components/tool-acts/modules.ts +1 -0
  71. package/src/web/frontend/modules/md/doc-store.ts +6 -0
  72. package/src/web/frontend/modules/md/md-blocks.ts +4 -43
  73. package/src/web/frontend/modules/md/md-parse.ts +2 -5
  74. package/src/web/frontend/modules/md/md-render.ts +2 -2
  75. package/src/web/frontend/modules/md/styles/docs.css +1 -1
  76. package/src/web/frontend/modules/md/styles/editor.css +0 -26
  77. package/src/web/frontend/modules/prompts/template-preview.ts +5 -6
  78. package/src/web/frontend/page/dag/index.tsx +6 -5
  79. package/src/web/frontend/page/dir/task-actions.ts +16 -13
  80. package/src/web/frontend/page/dir/task-beside.ts +10 -20
  81. package/src/web/frontend/page/dir/task-board-section.tsx +3 -5
  82. package/src/web/frontend/page/dir/task-derived-ctx.ts +10 -5
  83. package/src/web/frontend/page/dir/task-utils.ts +9 -1
  84. package/src/web/frontend/page/dir/task.tsx +4 -4
  85. package/src/web/frontend/page/group/index.tsx +8 -8
  86. package/src/web/frontend/page/progress/index.tsx +7 -11
  87. package/src/web/frontend/page/repos/api.ts +5 -0
  88. package/src/web/frontend/page/repos/index.tsx +12 -1
  89. package/src/web/frontend/page/templates/index.tsx +9 -0
  90. package/src/web/frontend/page/templates/template-list.tsx +2 -1
  91. package/src/web/frontend/styles/base.css +1 -1
  92. package/src/web/frontend/styles/bindings.css +1 -1
  93. package/src/web/public/assets/app-context-DPFYOrgE.js +1 -0
  94. package/src/web/public/assets/{bar-DEY9q8mI.js → bar-I4qGaKTO.js} +1 -1
  95. package/src/web/public/assets/board-view-jt8QixVg.js +1 -0
  96. package/src/web/public/assets/{button-BRGGaUcY.js → button-VP4pjVsx.js} +1 -1
  97. package/src/web/public/assets/{composer-launch-DEHhs8k_.js → composer-launch-C20VCKMu.js} +1 -1
  98. package/src/web/public/assets/composer-panel-C3ET4SBT.js +1 -0
  99. package/src/web/public/assets/dag-xQRISqLX.js +1 -0
  100. package/src/web/public/assets/{dir-C8HhVpFz.js → dir-B-UPu7OY.js} +1 -1
  101. package/src/web/public/assets/{doc-DgYKv2wo.css → doc-Ka-2V5jn.css} +1 -1
  102. package/src/web/public/assets/doc-zDLeR8PE.js +6 -0
  103. package/src/web/public/assets/group-Hh-NL_sa.js +1 -0
  104. package/src/web/public/assets/{index-CUnLXQWJ.css → index-DXJxcKIU.css} +1 -1
  105. package/src/web/public/assets/index-Di6ErKBG.js +3 -0
  106. package/src/web/public/assets/md-history-B7TamGno.js +45 -0
  107. package/src/web/public/assets/md-parse-BjzYV8n7.js +6 -0
  108. package/src/web/public/assets/{member-picker-BJ-Ucm-9.js → member-picker-BtWykPer.js} +1 -1
  109. package/src/web/public/assets/{popup-BdVXUaJk.js → popup-DLfU1TXG.js} +1 -1
  110. package/src/web/public/assets/{popup-CHK8uSG4.css → popup-DzBICcYS.css} +1 -1
  111. package/src/web/public/assets/progress-CQAvP9-n.js +3 -0
  112. package/src/web/public/assets/{refs-Cb9pmVsb.js → refs-C6rZJhnb.js} +1 -1
  113. package/src/web/public/assets/{reopen-text-C3dnqygC.js → reopen-text-D0eQ2XAC.js} +1 -1
  114. package/src/web/public/assets/repo-form-modal-DpwLdBYp.js +1 -0
  115. package/src/web/public/assets/repos-BjVw1SQ2.js +12 -0
  116. package/src/web/public/assets/{route-crumb-DvXzznKm.js → route-crumb-DS76cmRK.js} +1 -1
  117. package/src/web/public/assets/{settings-BiqKrd8o.js → settings-C1NfJqNk.js} +1 -1
  118. package/src/web/public/assets/{task-j7fMfJUp.css → task-Dcd2eA8B.css} +1 -1
  119. package/src/web/public/assets/task-Ddr-iU14.js +14 -0
  120. package/src/web/public/assets/task-ops-s9kkuLcK.js +2 -0
  121. package/src/web/public/assets/task-utils-Y-j-zi8J.js +1 -0
  122. package/src/web/public/assets/template-preview-EM3OQ1Rc.js +1 -0
  123. package/src/web/public/assets/templates-BnEJVU91.js +10 -0
  124. package/src/web/public/assets/{tool-bar-CAMqYt5j.js → tool-bar-NHeX0Kmo.js} +2 -2
  125. package/src/web/public/assets/use-rail-drag-4iK6t5ab.js +1 -0
  126. package/src/web/public/index.html +15 -15
  127. package/src/shared/frontmatter.ts +0 -107
  128. package/src/web/public/assets/app-context-KCsdqNTq.js +0 -1
  129. package/src/web/public/assets/board-view-C8OQhkyi.js +0 -1
  130. package/src/web/public/assets/composer-panel-Cke_nbex.js +0 -1
  131. package/src/web/public/assets/dag-BvkJhdpX.js +0 -1
  132. package/src/web/public/assets/doc-R8KHVCxp.js +0 -6
  133. package/src/web/public/assets/group-d9wqo1pL.js +0 -1
  134. package/src/web/public/assets/index-DqTSNBzX.js +0 -3
  135. package/src/web/public/assets/md-history-BR2jLhFQ.js +0 -47
  136. package/src/web/public/assets/progress-CLSIX544.js +0 -3
  137. package/src/web/public/assets/repo-form-modal-awEPCcJK.js +0 -1
  138. package/src/web/public/assets/repos-CIgKjolu.js +0 -12
  139. package/src/web/public/assets/task-C664y4Vd.js +0 -14
  140. package/src/web/public/assets/task-ops-D8L16-TP.js +0 -2
  141. package/src/web/public/assets/task-status-Cjsm0xF7.js +0 -7
  142. package/src/web/public/assets/task-utils-Dh33OFKe.js +0 -1
  143. package/src/web/public/assets/template-preview-CjQ-ucPt.js +0 -1
  144. package/src/web/public/assets/templates-BZ1EM7W4.js +0 -10
  145. package/src/web/public/assets/use-rail-drag-C3GpkThI.js +0 -1
@@ -5,6 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as boardsNs from '../boards.js';
8
+ import { orchestrateQuiet } from '../orchestrate.js';
8
9
  const boards: any = boardsNs;
9
10
 
10
11
  /** board.assign 的入参契约(CLI 与 HTTP 共用同一份)。 */
@@ -29,7 +30,10 @@ export class BoardAssignAction extends ActionBase<typeof input> {
29
30
  })
30
31
  override async run(ctx: ActionInput<this['_input']>) {
31
32
 
32
- return boards.assignRepo(ctx);
33
+ const r: any = await boards.assignRepo(ctx);
34
+ // #199:成员编排(加/移出成员)后自动刷新队列(幂等只补不删;失败不拦编排)。
35
+ await orchestrateQuiet();
36
+ return r;
33
37
 
34
38
  }
35
39
  }
@@ -5,6 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as boardsNs from '../boards.js';
8
+ import { orchestrateQuiet } from '../orchestrate.js';
8
9
  const boards: any = boardsNs;
9
10
 
10
11
  /** board.remove 的入参契约(CLI 与 HTTP 共用同一份)。 */
@@ -24,7 +25,10 @@ export class BoardRemoveAction extends ActionBase<typeof input> {
24
25
  })
25
26
  override async run(ctx: ActionInput<this['_input']>) {
26
27
 
27
- return boards.removeBoard(ctx.id);
28
+ const r: any = await boards.removeBoard(ctx.id);
29
+ // #199:删组后自动刷新队列(幂等只补不删;失败不拦编排)。
30
+ await orchestrateQuiet();
31
+ return r;
28
32
 
29
33
  }
30
34
  }
@@ -5,6 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
+ import { orchestrateQuiet } from '../orchestrate.js';
8
9
  const service: any = serviceNs;
9
10
 
10
11
  /** repo.add 的入参契约(CLI 与 HTTP 共用同一份)。 */
@@ -32,11 +33,14 @@ export class RepoAddAction extends ActionBase<typeof input> {
32
33
  })
33
34
  override async run(ctx: ActionInput<this['_input']>) {
34
35
 
35
- return service.addRepo({
36
+ const r: any = await service.addRepo({
36
37
  ...ctx,
37
38
  // 给了 --key 就视为自定义;否则用显式的 --key-custom(缺省 false = 跟随 remote)
38
39
  keyCustom: ctx.key ? true : ctx['key-custom'] === true,
39
40
  });
41
+ // #199:登记即编排——补齐队列 topic(幂等,只补不删);失败不拦登记。
42
+ await orchestrateQuiet();
43
+ return r;
40
44
 
41
45
  }
42
46
  }
@@ -5,6 +5,7 @@ import { action } from '../../../runtime/action-decorator.js';
5
5
  import { z } from 'zod';
6
6
  import { ActionBase, type ActionInput } from '../../../runtime/action-base.js';
7
7
  import * as serviceNs from '../service.js';
8
+ import { orchestrateQuiet } from '../orchestrate.js';
8
9
  const service: any = serviceNs;
9
10
 
10
11
  /** repo.update 的入参契约(CLI 与 HTTP 共用同一份)。 */
@@ -42,7 +43,10 @@ export class RepoUpdateAction extends ActionBase<typeof input> {
42
43
  ...(ctx['get-loop-minutes'] !== undefined ? { waitMinutes: ctx['get-loop-minutes'] } : {}),
43
44
  };
44
45
  }
45
- return service.updateRepo(ctx.id, patch);
46
+ const r: any = await service.updateRepo(ctx.id, patch);
47
+ // #199:改登记路径也算编排——自动刷新队列(幂等只补不删;失败不拦编辑)。
48
+ await orchestrateQuiet();
49
+ return r;
46
50
 
47
51
  }
48
52
  }
@@ -1,4 +1,5 @@
1
1
  // 看板的导入导出(board import/export)与按前缀归组(board prefix,一次性命令)。
2
+ import { normRepoPath } from '../../../core/db/repo-match.js';
2
3
  import {
3
4
  loadStore,
4
5
  mutateStore,
@@ -43,7 +44,7 @@ export async function importBoards({ json }: { json?: unknown } = {}): Promise<I
43
44
  return mutateStore((s) => {
44
45
  const byName = new Map(s.repos.map((r): [string, string] => [String(r.name).trim(), deriveKey(r)]));
45
46
  // path 匹配(大小写不敏感、分隔符归一)——老格式的导入文件按 path 引用
46
- const byPath = new Map(s.repos.map((r): [string, string] => [String(r.path).toLowerCase().replace(/\\/g, '/'), deriveKey(r)]));
47
+ const byPath = new Map(s.repos.map((r): [string, string] => [normRepoPath(r.path), deriveKey(r)]));
47
48
  let created = 0;
48
49
  let merged = 0;
49
50
  let matched = 0;
@@ -65,7 +66,7 @@ export async function importBoards({ json }: { json?: unknown } = {}): Promise<I
65
66
  const k = e.key
66
67
  ? normalizeKey(e.key)
67
68
  : (e.path
68
- ? byPath.get(String(e.path).toLowerCase().replace(/\\/g, '/'))
69
+ ? byPath.get(normRepoPath(e.path))
69
70
  : (e.name ? byName.get(String(e.name).trim()) : null));
70
71
  if (!k) {
71
72
  unmatched.push({ board: nm, entry: e.key || e.path || e.name || '(空)' });
@@ -0,0 +1,17 @@
1
+ // 仓库/组的**编排后收口**(#199):编排动作(登记 / 改路径 / 建组 / 成员变更 / 删组)
2
+ // 执行成功后,补齐仓库与组各自的队列 topic。
3
+ //
4
+ // 为什么收在这一个文件:repos→localtask 是模块域间依赖,分层棘轮按文件数计数——
5
+ // 跨域通知只许从这一个文件过,新增编排动作必须复用 orchestrateQuiet(),
6
+ // 不许各自 `import('../localtask/service.js')`。
7
+ //
8
+ // 口径:队列是编排的**配套资源**,补建失败绝不拦主操作(syncQueuesQuiet 内部吞错)。
9
+ // 「仓库管理」页的「刷新队列」按钮是同一份逻辑的手动出口,兜历史数据缺口。
10
+
11
+ /** 编排完成后自动刷新队列(幂等只补不删;失败不拦主操作)。 */
12
+ export function orchestrateQuiet(): Promise<{ repos: number; groups: number }> {
13
+ return import('../localtask/service.js').then(
14
+ (lt: any) => lt.syncQueuesQuiet(),
15
+ () => ({ repos: 0, groups: 0 }),
16
+ );
17
+ }
@@ -88,7 +88,10 @@ const deriveKeyOf = (r: RepoEntry): string => service.deriveKey(r);
88
88
  export async function repoExport({ repoKeys, boardKeys, includeUnassigned = true }: RepoExportOptions = {}): Promise<ExportLayout> {
89
89
  const s: Store = await service.loadStore();
90
90
  const warnings: string[] = [];
91
- const keyOf = new Map<string, string>(s.repos.map((r): [string, string] => [r.id, service.deriveKey(r)]));
91
+ // 每行的 key 按行现算(deriveKey 只读行自身)。**不能用行 id 建 Map 索引**:
92
+ // id 来自 ext.legacy_id,自动登记/新登记的行没有它 → 多行 id 同时是 '',
93
+ // Map 互相覆盖会让所有无 id 行拿到同一条 key(#200 发版被 smoke 抓到的真 bug)。
94
+ const keyOfRow = deriveKeyOf;
92
95
  // 看板用**冻结 key**(库里落库的那个;改名过的组不随名字漂)
93
96
  const boardKeyOf = new Map<string, string>(s.boards.map((b): [string, string] => [b.id, service.storedBoardKey(b)]));
94
97
 
@@ -99,29 +102,32 @@ export async function repoExport({ repoKeys, boardKeys, includeUnassigned = true
99
102
  const memberKeysOf = (b: BoardEntry) => service.boardRepoKeys(b, s);
100
103
  const inAnyBoard = new Set(s.boards.flatMap(memberKeysOf));
101
104
  const selectedBoards = s.boards.filter((b) => wantBoard(boardKeyOf.get(b.id)!));
102
- // 选中的仓库 = 直接指定的 + 选中看板的成员 + (可选)未分组仓库
103
- const selectedIds = new Set<string>();
104
- for (const r of s.repos) {
105
- if (!wantRepo(keyOf.get(r.id)!)) continue;
106
- if (repoKeys?.length) selectedIds.add(r.id);
107
- }
105
+ // 选中的仓库 = 直接指定的 + 选中看板的成员 + (可选)未分组仓库。
106
+ // 用**数组下标**做选中标记:行 id 可能缺省(见上),不能当唯一键。
107
+ const selected = new Set<number>();
108
+ s.repos.forEach((r, idx) => {
109
+ if (wantRepo(keyOfRow(r))) selected.add(idx);
110
+ });
108
111
  for (const b of selectedBoards) {
109
112
  for (const k of memberKeysOf(b)) {
110
- const hit = s.repos.find((r) => deriveKeyOf(r) === k);
111
- if (hit) selectedIds.add(hit.id);
113
+ s.repos.forEach((r, idx) => {
114
+ if (deriveKeyOf(r) === k) selected.add(idx);
115
+ });
112
116
  }
113
117
  }
114
118
  if (includeUnassigned && !repoKeys?.length && !boardKeys?.length) {
115
- for (const r of s.repos) if (!inAnyBoard.has(deriveKeyOf(r))) selectedIds.add(r.id);
119
+ s.repos.forEach((r, idx) => {
120
+ if (!inAnyBoard.has(deriveKeyOf(r))) selected.add(idx);
121
+ });
116
122
  }
117
123
 
118
124
  const repos: ExportRepoEntry[] = [];
119
- for (const r of s.repos) {
120
- if (!selectedIds.has(r.id)) continue;
121
- const k = keyOf.get(r.id);
125
+ s.repos.forEach((r, idx) => {
126
+ if (!selected.has(idx)) return;
127
+ const k = keyOfRow(r);
122
128
  if (!k) {
123
129
  warnings.push(`仓库「${r.name}」没有可用的 key —— 已跳过(先 repo key refresh 或 repo key set)`);
124
- continue;
130
+ return;
125
131
  }
126
132
  const entry: ExportRepoEntry = {
127
133
  key: k,
@@ -148,7 +154,7 @@ export async function repoExport({ repoKeys, boardKeys, includeUnassigned = true
148
154
  warnings.push(`开发仓库「${r.name}」没有远程地址 —— 导入端只能按 key 登记,无法 clone`);
149
155
  }
150
156
  repos.push(entry);
151
- }
157
+ });
152
158
 
153
159
  const boardsOut: ExportBoardEntry[] = selectedBoards.map((b) => {
154
160
  const entry: ExportBoardEntry = {
@@ -188,9 +194,9 @@ export async function repoExport({ repoKeys, boardKeys, includeUnassigned = true
188
194
  const bkey = boardKeyOf.get(b.id);
189
195
  if (!bkey || !wantBoard(bkey)) continue;
190
196
  for (const l of Array.isArray(b.refs) ? b.refs : []) {
191
- const r = s.repos.find((x) => keyOf.get(x.id) === l.id);
197
+ const r = s.repos.find((x) => keyOfRow(x) === l.id);
192
198
  if (!r) continue;
193
- const rk = keyOf.get(r.id);
199
+ const rk = keyOfRow(r);
194
200
  if (!rk || !selectedKeySet.has(rk)) continue;
195
201
  let hit = links.find((x) => x.ref === rk);
196
202
  if (!hit) {
@@ -203,7 +209,7 @@ export async function repoExport({ repoKeys, boardKeys, includeUnassigned = true
203
209
  // 仓库级直接绑定:dev 的 linked({kind:'ref'})→ to 里追加 {repo}
204
210
  for (const d of s.repos) {
205
211
  if ((d.type || 'dev') === 'ref') continue;
206
- const dk = keyOf.get(d.id);
212
+ const dk = keyOfRow(d);
207
213
  if (!dk || !selectedKeySet.has(dk)) continue;
208
214
  for (const l of Array.isArray(d.linked) ? d.linked : []) {
209
215
  if (!l || l.kind !== 'ref') continue;
@@ -24,7 +24,7 @@ export class TemplateUpdateAction extends ActionBase<typeof input> {
24
24
  id: 'template.update',
25
25
  cli: ['template', 'update'],
26
26
  http: ['PATCH', '/api/templates/:id'],
27
- summary: '编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板的正文也可改)',
27
+ summary: '编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板不可改,出厂正文随版本升级自动覆盖)',
28
28
  args: ['id'],
29
29
  input,
30
30
  render: (d: any) => `已更新模板「${d.template.name}」(${d.template.id})`,
@@ -331,6 +331,9 @@ export async function updateTemplate({ id, name: rawName, body: rawBody, bodyFil
331
331
  return repo.txw((conn) => {
332
332
  const row = repo.templates.getRow(want, conn);
333
333
  if (!row) throw notFound(`没有 id 为 ${want} 的模板(template list 可查)`);
334
+ // #195:内置模板不允许修改——出厂正文由 seed 统一覆盖升级(INSERT ... DO UPDATE)。
335
+ // 放开通改会出现「用户改过的 builtin 下次开库又被覆盖」的错觉,索性从入口挡住。
336
+ if (row.builtin) throw badInput('内置模板不可修改(出厂正文随版本升级自动覆盖);要定制请新建一条自己的模板');
334
337
  const patch: any = {};
335
338
  if (rawName !== undefined) patch.name = normalizeName(rawName);
336
339
  if (bodyIn !== undefined) patch.body = normalizeBody(bodyIn);
@@ -1163,7 +1163,7 @@
1163
1163
  "action": {
1164
1164
  "id": "localtask.add",
1165
1165
  "module": "localtask",
1166
- "summary": "向某主题(工作目录)的队列回填一条任务(正文可多行;--file <文件|-> 从文件/标准输入读,长文本不必靠引号硬拼;有 wait 在等则即时投递,否则排队);--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务带工作组语义(正文 frontmatter:board + project + 双方介绍引用),并落进该项目的队列;正文自带 frontmatter 时同样认归属——补介绍引用,落点跟到项目队列(显式给过 --cwd 时不挪窝)",
1166
+ "summary": "向某主题(工作目录)的队列回填一条任务(正文可多行 markdown;--file <文件|-> 从文件/标准输入读,长文本不必靠引号硬拼;有 wait 在等则即时投递,否则排队);--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务落库归属(组队列 + 仓库队列两条 topic 关联,正文不写任何头),并落进该项目的队列",
1167
1167
  "usage": "localtask add",
1168
1168
  "http": "POST /api/localtasks"
1169
1169
  },
@@ -1514,6 +1514,21 @@
1514
1514
  },
1515
1515
  "children": []
1516
1516
  },
1517
+ {
1518
+ "name": "sync-queues",
1519
+ "path": [
1520
+ "localtask",
1521
+ "sync-queues"
1522
+ ],
1523
+ "action": {
1524
+ "id": "localtask.sync-queues",
1525
+ "module": "localtask",
1526
+ "summary": "补齐仓库 / 组缺的队列 topic(幂等,只补不删)——仓库管理页的「刷新队列」与编排后自动刷新走它",
1527
+ "usage": "localtask sync-queues",
1528
+ "http": "POST /api/localtask/queues/sync"
1529
+ },
1530
+ "children": []
1531
+ },
1517
1532
  {
1518
1533
  "name": "task",
1519
1534
  "path": [
@@ -1766,7 +1781,7 @@
1766
1781
  "action": {
1767
1782
  "id": "template.update",
1768
1783
  "module": "templates",
1769
- "summary": "编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板的正文也可改)",
1784
+ "summary": "编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板不可改,出厂正文随版本升级自动覆盖)",
1770
1785
  "usage": "template update",
1771
1786
  "http": "PATCH /api/templates/:id"
1772
1787
  },
@@ -83,6 +83,7 @@ import type {
83
83
  LocaltaskReopenAction,
84
84
  LocaltaskReorderAction,
85
85
  LocaltaskShowAction,
86
+ LocaltaskSyncQueuesAction,
86
87
  LocaltaskTaskRestoreAction,
87
88
  LocaltaskTasksAction,
88
89
  LocaltaskTimegoalLogAction,
@@ -296,7 +297,7 @@ export interface ApiClient {
296
297
  docRemove(input: z.input<InstanceType<typeof RepoDocRemoveAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoDocRemoveAction>['run']>>>;
297
298
  /** 取仓库完整知识:项目介绍 + 所属组(介绍/组内描述/绑定文档)+ 参考仓库(--md 拼成单篇 markdown;缺省当前目录) */
298
299
  knowledge(input?: z.input<InstanceType<typeof RepoKnowledgeAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof RepoKnowledgeAction>['run']>>>;
299
- /** 向某主题(工作目录)的队列回填一条任务(正文可多行;--file <文件|-> 从文件/标准输入读,长文本不必靠引号硬拼;有 wait 在等则即时投递,否则排队);--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务带工作组语义(正文 frontmatter:board + project + 双方介绍引用),并落进该项目的队列;正文自带 frontmatter 时同样认归属——补介绍引用,落点跟到项目队列(显式给过 --cwd 时不挪窝) */
300
+ /** 向某主题(工作目录)的队列回填一条任务(正文可多行 markdown;--file <文件|-> 从文件/标准输入读,长文本不必靠引号硬拼;有 wait 在等则即时投递,否则排队);--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务落库归属(组队列 + 仓库队列两条 topic 关联,正文不写任何头),并落进该项目的队列 */
300
301
  localtaskAdd(input?: z.input<InstanceType<typeof LocaltaskAddAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskAddAction>['run']>>>;
301
302
  /** 改一条附件绑定的说明(desc):--attachment <资源 id> --note <说明>(只动说明,角色/位置不变) */
302
303
  attachNote(input: z.input<InstanceType<typeof LocaltaskAttachNoteAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskAttachNoteAction>['run']>>>;
@@ -344,6 +345,8 @@ export interface ApiClient {
344
345
  reorder(input: z.input<InstanceType<typeof LocaltaskReorderAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskReorderAction>['run']>>>;
345
346
  /** 查看单条任务(按 --id,定位到 --cwd 主题或 --key);正文引用附件时带附件清单与本地路径(自动下载跟随本机设置) */
346
347
  show(input: z.input<InstanceType<typeof LocaltaskShowAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskShowAction>['run']>>>;
348
+ /** 补齐仓库 / 组缺的队列 topic(幂等,只补不删)——仓库管理页的「刷新队列」与编排后自动刷新走它 */
349
+ syncQueues(): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskSyncQueuesAction>['run']>>>;
347
350
  /** 恢复一条被删除(软删除)的任务(撤销删除) */
348
351
  restore(input: z.input<InstanceType<typeof LocaltaskTaskRestoreAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof LocaltaskTaskRestoreAction>['run']>>>;
349
352
  /** 看一个主题的任务清单(按 --key 或 --cwd 定位):--q 关键字过滤、--limit 只取最新 N 条(时间倒序);只回列表字段(含各时间戳/轮次/总结),不含正文 */
@@ -372,7 +375,7 @@ export interface ApiClient {
372
375
  templateRemove(input: z.input<InstanceType<typeof TemplateRemoveAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TemplateRemoveAction>['run']>>>;
373
376
  /** 调整任务模板顺序(--ids a,b,c 按新序落库 sort_order;未列出的模板保持原位) */
374
377
  templateReorder(input: z.input<InstanceType<typeof TemplateReorderAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TemplateReorderAction>['run']>>>;
375
- /** 编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板的正文也可改) */
378
+ /** 编辑任务模板(--name 改名 / --body 改正文 / --scope 改可见域,只改传入项;多行正文用 --body-file;内置模板不可改,出厂正文随版本升级自动覆盖) */
376
379
  templateUpdate(input: z.input<InstanceType<typeof TemplateUpdateAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TemplateUpdateAction>['run']>>>;
377
380
  /** 时间运算 + 原文回显 prompt + 写入一次状态日志;每次必须提供当前现状 --summary */
378
381
  timegoalCheck(input: z.input<InstanceType<typeof TimegoalCheckAction>['_input']>): Promise<Awaited<ReturnType<InstanceType<typeof TimegoalCheckAction>['run']>>>;
@@ -1085,7 +1088,7 @@ export function createApiClient(transport: Transport): ApiClient {
1085
1088
  async reopen(input: z.input<InstanceType<typeof LocaltaskReopenAction>['_input']>) {
1086
1089
  const inp = input ?? ({} as z.input<InstanceType<typeof LocaltaskReopenAction>['_input']>);
1087
1090
  const path = `/api/localtasks/reopen`;
1088
- const body = { "id": inp["id"], "cwd": inp["cwd"], "key": inp["key"], "text": inp["text"], "kind": inp["kind"], "quote": inp["quote"], "feedback": inp["feedback"], "feedbackHeading": inp["feedbackHeading"], "feedbackBold": inp["feedbackBold"] };
1091
+ const body = { "id": inp["id"], "cwd": inp["cwd"], "key": inp["key"], "text": inp["text"], "kind": inp["kind"], "quote": inp["quote"], "feedback": inp["feedback"], "feedbackHeading": inp["feedbackHeading"], "feedbackBold": inp["feedbackBold"], "project": inp["project"], "board": inp["board"] };
1089
1092
  return (await transport.request("POST", path, body)) as Awaited<ReturnType<InstanceType<typeof LocaltaskReopenAction>['run']>>;
1090
1093
  },
1091
1094
  // action: localtask.reorder
@@ -1107,6 +1110,11 @@ export function createApiClient(transport: Transport): ApiClient {
1107
1110
  if (query) path += path.includes('?') ? '&' + query : '?' + query;
1108
1111
  return (await transport.request("GET", path)) as Awaited<ReturnType<InstanceType<typeof LocaltaskShowAction>['run']>>;
1109
1112
  },
1113
+ // action: localtask.sync-queues
1114
+ async syncQueues() {
1115
+ const path = `/api/localtask/queues/sync`;
1116
+ return (await transport.request("POST", path, undefined)) as Awaited<ReturnType<InstanceType<typeof LocaltaskSyncQueuesAction>['run']>>;
1117
+ },
1110
1118
  // action: localtask.task.restore
1111
1119
  async restore(input: z.input<InstanceType<typeof LocaltaskTaskRestoreAction>['_input']>) {
1112
1120
  const inp = input ?? ({} as z.input<InstanceType<typeof LocaltaskTaskRestoreAction>['_input']>);
@@ -1165,7 +1173,7 @@ export function createApiClient(transport: Transport): ApiClient {
1165
1173
  async localtaskUpdate(input: z.input<InstanceType<typeof LocaltaskUpdateAction>['_input']>) {
1166
1174
  const inp = input ?? ({} as z.input<InstanceType<typeof LocaltaskUpdateAction>['_input']>);
1167
1175
  const path = `/api/localtasks/item`;
1168
- const body = { "id": inp["id"], "text": inp["text"], "cwd": inp["cwd"], "key": inp["key"], "duration": inp["duration"], "goal-prompt": inp["goal-prompt"], "goalPrompt": inp["goalPrompt"], "clear-goal": inp["clear-goal"], "clearGoal": inp["clearGoal"], "block-by": inp["block-by"], "blockBy": inp["blockBy"], "clear-block-by": inp["clear-block-by"], "clearBlockBy": inp["clearBlockBy"], "gate": inp["gate"] };
1176
+ const body = { "id": inp["id"], "text": inp["text"], "cwd": inp["cwd"], "key": inp["key"], "duration": inp["duration"], "goal-prompt": inp["goal-prompt"], "goalPrompt": inp["goalPrompt"], "clear-goal": inp["clear-goal"], "clearGoal": inp["clearGoal"], "block-by": inp["block-by"], "blockBy": inp["blockBy"], "clear-block-by": inp["clear-block-by"], "clearBlockBy": inp["clearBlockBy"], "gate": inp["gate"], "project": inp["project"], "board": inp["board"] };
1169
1177
  return (await transport.request("PATCH", path, body)) as Awaited<ReturnType<InstanceType<typeof LocaltaskUpdateAction>['run']>>;
1170
1178
  },
1171
1179
  // action: localtask.get
@@ -3,7 +3,7 @@
3
3
  .nx-intro{
4
4
  border:1px solid var(--line,#E4E2DC);
5
5
  border-radius:8px;
6
- background:#FBFAF8;
6
+ background:#f9f8f7;
7
7
  margin:0 0 12px;
8
8
  }
9
9
  .nx-intro-head{
@@ -21,11 +21,13 @@ const findGroupTaskBridge = findGroupTask as unknown as (
21
21
  taskId: string | number,
22
22
  ) => { board?: BoardRow | null; topic?: LocalTopic | null; taskRow?: LocalTask | null };
23
23
 
24
- /** 同级下拉的一项:hash 直跳;nsId 特殊(先切侧栏命名空间再落它的首个成员页)。 */
24
+ /** 同级下拉的一项:hash 直跳;nsId 特殊(先切侧栏命名空间再落它的首个成员页)。
25
+ taskId = 任务段下拉的任务条目(#261:hover 双按钮用——复制该任务路径 / 旁路预览)。 */
25
26
  export interface VscSibling {
26
27
  label: string;
27
28
  hash: string;
28
29
  nsId?: string;
30
+ taskId?: string;
29
31
  note?: string;
30
32
  }
31
33
 
@@ -195,6 +197,7 @@ export function vscTrailOf(
195
197
  taskSiblings.push({
196
198
  label: '#' + String(t.id) + statusNote(t),
197
199
  hash: anchor + '?task=' + encodeURIComponent(String(t.id)),
200
+ taskId: String(t.id),
198
201
  });
199
202
  }
200
203
  }
@@ -219,14 +222,19 @@ export function vscTrailOf(
219
222
  };
220
223
  }
221
224
 
222
- /** 复制内容(#254 偏好两态)。draft 无任务号:两种偏好都退回原始路径。 */
223
- export function copyPayloadOf(trail: VscTrail, style: 'raw' | 'prompt' | undefined): string {
224
- const base = trail.cwd || trail.dirName;
225
- const raw = base + (trail.taskId ? ' #' + trail.taskId : ' (draft)');
226
- if (style !== 'prompt' || !trail.taskId) return raw;
225
+ /** 单个任务的复制载荷(#261:下拉任务条目 hover 复制用;draft 无任务号退回原始路径)。 */
226
+ export function taskCopyPayload(cwd: string, dirName: string, taskId: string, style: 'raw' | 'prompt' | undefined): string {
227
+ const base = cwd || dirName;
228
+ if (!taskId) return base + ' (draft)';
229
+ if (style !== 'prompt') return base + ' #' + taskId;
227
230
  return [
228
- `任务 #${trail.taskId} 在队列「${trail.dirName}」(cwd:${base})`,
229
- `查看:nx-kv localtask show --id ${trail.taskId} --cwd "${base}" --json`,
231
+ `任务 #${taskId} 在队列「${dirName}」(cwd:${base})`,
232
+ `查看:nx-kv localtask show --id ${taskId} --cwd "${base}" --json`,
230
233
  `领取处理:nx-kv localtask get --cwd "${base}" --json`,
231
234
  ].join('\n');
232
235
  }
236
+
237
+ /** 复制内容(#254 偏好两态)——当前任务即 trail 上的 taskCopyPayload。 */
238
+ export function copyPayloadOf(trail: VscTrail, style: 'raw' | 'prompt' | undefined): string {
239
+ return taskCopyPayload(trail.cwd, trail.dirName, trail.taskId, style);
240
+ }
@@ -54,33 +54,26 @@
54
54
  color: var(--ink, #16181c);
55
55
  font-weight: 600;
56
56
  }
57
- /* 任务段 hover 的两个 icon btn(#259:复制路径 + 预览原文)——平时隐身,
58
- 悬浮任务段(或键盘聚焦其按钮)才亮 */
59
- .vsc-acts {
60
- flex: none;
61
- display: inline-flex;
62
- align-items: center;
63
- gap: 1px;
64
- opacity: 0;
65
- transition: opacity 0.12s;
66
- }
67
- .vsc-crumb.is-cur:hover .vsc-acts,
68
- .vsc-acts:focus-within {
69
- opacity: 1;
70
- }
57
+ /* 复制钮:悬浮整行(或键盘聚焦)才亮——复制当前任务的路径 + 任务号(偏好两态) */
71
58
  .vsc-copy {
72
59
  flex: none;
73
60
  border: 0;
74
61
  background: none;
75
62
  cursor: pointer;
76
63
  color: var(--mid, #838a93);
77
- width: 22px;
78
- height: 22px;
64
+ width: 24px;
65
+ height: 24px;
79
66
  border-radius: 6px;
80
67
  display: inline-flex;
81
68
  align-items: center;
82
69
  justify-content: center;
83
70
  padding: 0;
71
+ opacity: 0;
72
+ transition: opacity 0.12s;
73
+ }
74
+ .vsc-crumbs:hover .vsc-copy,
75
+ .vsc-copy:focus-visible {
76
+ opacity: 1;
84
77
  }
85
78
  .vsc-copy:hover {
86
79
  background: var(--soft, #f1f0ec);
@@ -1,6 +1,7 @@
1
- // VS Code 式面包屑(任务页顶条,#254/#259):段间「>」分隔、点段弹同级下拉(定宽 150、
2
- // 超高容器内滚);悬浮任务段亮出**两个** icon btn——复制(路径复制偏好两态)与预览
3
- // (打开旁路原文子侧边栏,onPreview 由宿主任务页给)。
1
+ // VS Code 式面包屑(任务页顶条,#254/#259/#261):段间「>」分隔、点段弹同级下拉
2
+ // (定宽 150、超高容器内滚、贴视口夹取);悬浮整行亮出**复制**钮(路径复制偏好两态);
3
+ // 下拉里的**任务条目** hover 亮出双操作——复制该任务路径 + 预览(旁路打开该任务原文,
4
+ // onPreviewTask 由宿主任务页给)。#261 明确:双按钮在下拉条目上,不在当前任务段上。
4
5
  // 旧 RouteBreadcrumb([ 目录 / #N ] 方括号式)继续服务其余页面;任务页只换这条。
5
6
  import { useMemo, useState } from 'react';
6
7
  import { useApp } from '../../app-context.jsx';
@@ -8,8 +9,8 @@ import { PopMenu } from '../popup/index.jsx';
8
9
  import type { PopMenuItem } from '../popup/index.jsx';
9
10
  import { Icon } from '../icons.jsx';
10
11
  import { useToast } from '../toast/index.jsx';
11
- import { copyPayloadOf, nsFirstTargetOf, vscTrailOf } from './vsc-crumbs-model.js';
12
- import type { VscSegment, VscSibling } from './vsc-crumbs-model.js';
12
+ import { copyPayloadOf, nsFirstTargetOf, taskCopyPayload, vscTrailOf } from './vsc-crumbs-model.js';
13
+ import type { VscSegment, VscSibling, VscTrail } from './vsc-crumbs-model.js';
13
14
  import './vsc-crumbs.css';
14
15
 
15
16
  interface MenuState {
@@ -19,11 +20,11 @@ interface MenuState {
19
20
  items: Array<PopMenuItem | string>;
20
21
  }
21
22
 
22
- export default function VscCrumbs({ onPreview }: { onPreview?: (() => void) | null } = {}) {
23
+ export default function VscCrumbs({ onPreviewTask }: { onPreviewTask?: ((taskId: string) => void) | null } = {}) {
23
24
  const app = useApp();
24
25
  const toast = useToast();
25
26
  const [menu, setMenu] = useState<MenuState | null>(null);
26
- const trail = useMemo(
27
+ const trail: VscTrail | null = useMemo(
27
28
  () => vscTrailOf(app.route, app.rows || [], app.repoData || {}, app.prefs || {}),
28
29
  [app.route, app.rows, app.repoData, app.prefs]
29
30
  );
@@ -31,6 +32,15 @@ export default function VscCrumbs({ onPreview }: { onPreview?: (() => void) | nu
31
32
 
32
33
  const style = app.prefs && app.prefs.copyPathStyle === 'prompt' ? 'prompt' : 'raw';
33
34
 
35
+ const copyText = async (text: string, what: string) => {
36
+ try {
37
+ await navigator.clipboard.writeText(text);
38
+ toast(what);
39
+ } catch {
40
+ toast('复制失败:剪贴板不可用');
41
+ }
42
+ };
43
+
34
44
  const openSiblings = (seg: VscSegment, e: { clientX: number; clientY: number }) => {
35
45
  if (!seg.siblings.length) return;
36
46
  setMenu({
@@ -52,20 +62,33 @@ export default function VscCrumbs({ onPreview }: { onPreview?: (() => void) | nu
52
62
  }
53
63
  if (s.hash && app.onNavigate) app.onNavigate(s.hash);
54
64
  },
65
+ // #261 验收:下拉任务条目 hover 出双操作——复制该任务路径 + 预览该任务原文
66
+ hoverActions:
67
+ s.taskId && seg.kind === 'task' ? (
68
+ <>
69
+ <span
70
+ role="button"
71
+ title={style === 'prompt' ? '复制该任务的访问提示词' : '复制该任务的路径 + 任务号'}
72
+ onClick={() =>
73
+ copyText(
74
+ taskCopyPayload(trail.cwd, trail.dirName, s.taskId || '', style),
75
+ style === 'prompt' ? '已复制访问提示词' : '已复制路径'
76
+ )
77
+ }
78
+ >
79
+ <Icon name="copy" size={12} />
80
+ </span>
81
+ {onPreviewTask && (
82
+ <span role="button" title="预览原文(旁路打开)" onClick={() => onPreviewTask(s.taskId || '')}>
83
+ <Icon name="eye" size={12} />
84
+ </span>
85
+ )}
86
+ </>
87
+ ) : undefined,
55
88
  })),
56
89
  });
57
90
  };
58
91
 
59
- const copy = async () => {
60
- const text = copyPayloadOf(trail, style);
61
- try {
62
- await navigator.clipboard.writeText(text);
63
- toast(style === 'prompt' ? '已复制访问提示词' : '已复制路径');
64
- } catch {
65
- toast('复制失败:剪贴板不可用');
66
- }
67
- };
68
-
69
92
  const copyTitle =
70
93
  style === 'prompt'
71
94
  ? '复制访问提示词(CLI 指令 + 引导)——设置 → 偏好可切换为原始路径'
@@ -74,47 +97,30 @@ export default function VscCrumbs({ onPreview }: { onPreview?: (() => void) | nu
74
97
  return (
75
98
  <div className="vsc-crumbs">
76
99
  <nav className="vsc-crumbs-path" aria-label="当前位置">
77
- {trail.segments.map((seg, i) => {
78
- const isCur = i === trail.segments.length - 1;
79
- return (
80
- <span key={seg.kind} className={'vsc-crumb' + (isCur ? ' is-cur' : '')}>
81
- {i > 0 && (
82
- <span className="vsc-sep" aria-hidden>
83
- &gt;
84
- </span>
85
- )}
86
- <button
87
- type="button"
88
- className="vsc-crumb-t"
89
- disabled={!seg.siblings.length}
90
- title={seg.siblings.length ? `显示「${seg.label}」的同级` : seg.label}
91
- onClick={(e) => openSiblings(seg, e)}
92
- >
93
- {seg.label}
94
- </button>
95
- {/* #259 验收:任务段 hover 出两个 icon btn——复制路径 + 预览原文(旁路子侧边栏) */}
96
- {isCur && (
97
- <span className="vsc-acts">
98
- <button type="button" className="vsc-copy" title={copyTitle} aria-label={copyTitle} onClick={copy}>
99
- <Icon name="copy" size={13} />
100
- </button>
101
- {onPreview && (
102
- <button
103
- type="button"
104
- className="vsc-copy"
105
- title="预览原文(旁路打开)"
106
- aria-label="预览原文"
107
- onClick={onPreview}
108
- >
109
- <Icon name="eye" size={13} />
110
- </button>
111
- )}
112
- </span>
113
- )}
114
- </span>
115
- );
116
- })}
100
+ {trail.segments.map((seg, i) => (
101
+ <span key={seg.kind} className={'vsc-crumb' + (i === trail.segments.length - 1 ? ' is-cur' : '')}>
102
+ {i > 0 && (
103
+ <span className="vsc-sep" aria-hidden>
104
+ &gt;
105
+ </span>
106
+ )}
107
+ <button
108
+ type="button"
109
+ className="vsc-crumb-t"
110
+ disabled={!seg.siblings.length}
111
+ title={seg.siblings.length ? `显示「${seg.label}」的同级` : seg.label}
112
+ onClick={(e) => openSiblings(seg, e)}
113
+ >
114
+ {seg.label}
115
+ </button>
116
+ </span>
117
+ ))}
117
118
  </nav>
119
+ {/* #254:悬浮整行亮出复制钮(当前任务的路径 + 任务号,按偏好两态) */}
120
+ <button type="button" className="vsc-copy" title={copyTitle} aria-label={copyTitle}
121
+ onClick={() => copyText(copyPayloadOf(trail, style), style === 'prompt' ? '已复制访问提示词' : '已复制路径')}>
122
+ <Icon name="copy" size={13} />
123
+ </button>
118
124
  {menu && <PopMenu x={menu.x} y={menu.y} width={menu.width} items={menu.items} onClose={() => setMenu(null)} />}
119
125
  </div>
120
126
  );
@@ -337,7 +337,7 @@ export default function AttachModal({
337
337
 
338
338
  const taskList = useMemo(() => {
339
339
  // #183:任务搜索与 topic 页共用 modules/board/task-search.ts 的同一份引擎
340
- // (空格分词 AND / 剥 frontmatter / 通配 / 编号前缀),弹窗不再自己写 includes。
340
+ // (空格分词 AND / 通配 / 编号前缀),弹窗不再自己写 includes。
341
341
  const pool = taskOptions.filter((t) => String(t.id) !== String(hostId));
342
342
  return filterTasks(pool, taskSearch).slice(0, 12);
343
343
  }, [taskOptions, taskSearch, hostId]);