dsh-knit 0.23.0 → 0.24.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.
@@ -35,8 +35,6 @@ window.__ModuleLoader__.load({
35
35
  'count.code.filtered': '{hit} / {total} 个代码文件',
36
36
  'count.media': '{n} 个媒体',
37
37
  'count.media.filtered': '{hit} / {total} 个媒体',
38
- 'count.all': '{n} 项',
39
- 'count.all.filtered': '{hit} / {total} 项',
40
38
  'action.refresh': '刷新',
41
39
  'path.openTitle': '在文件管理器中打开',
42
40
  'peek.empty': '这个工作区里还没有 Markdown 文档。',
@@ -47,7 +45,6 @@ window.__ModuleLoader__.load({
47
45
  'sort.relevanceTitle': '按与当前对话的相关性排序(纯本地关键词匹配,不调模型)',
48
46
  'sort.timeTitle': '按文件修改时间倒序',
49
47
 
50
- 'kind.all': '全部',
51
48
  'kind.doc': '文档',
52
49
  // v0.19:「代码」这一档。文案口径刻意保持朴素 —— 不写「代码知识库 / AI Code
53
50
  // Intelligence / 智能代码分析」。Knit 只是把**当前任务真正需要的**代码文件
@@ -143,12 +140,18 @@ window.__ModuleLoader__.load({
143
140
  // 所以它们一色到底(都是 caption 灰),靠**字**区分,不靠颜色。
144
141
  'context.pinned': '固定上下文',
145
142
  'context.pinnedHint': '你自己标记的',
143
+ // v0.25:Git 变更关联。**与三层平行的一区**,不参与 01…0N 的编号。
144
+ 'context.changes': '变更关联',
145
+ 'context.changesHint': '由未提交的改动牵出来的',
146
+ 'context.changesEmpty': '{files} 个变更文件,没有找到关联证据',
147
+ 'context.changesUnreadable': '读不到 Git 变更状态:{reason}',
146
148
  'prov.retrieval': '检索',
147
149
  'prov.relation': '关系',
148
150
  'prov.manual': '用户固定',
149
151
  // v0.23:第四档来源。它**只**由「标题 + 摘要」的向量与任务相似而来 ——
150
152
  // 不是关键词命中、也不是关系证据,而且只可能落在「相关」那一层。
151
153
  'prov.semantic': '语义相关',
154
+ 'prov.change': '变更关联',
152
155
  'control.pin': '固定',
153
156
  'control.unpin': '取消固定',
154
157
  'control.exclude': '排除',
@@ -172,10 +175,24 @@ window.__ModuleLoader__.load({
172
175
  // v0.21.x(2026-10-09 用户规格):排除之后的候选数原来是一个**光数字**(只有
173
176
  // 「→ 79」),现在给它一个名字 —— 状态摘要里每一格都必须能独立读懂。
174
177
  'pipe.candidates': '候选 {n}',
175
- 'pipe.rank': 'BM25 词法检索',
178
+ 'pipe.rank': 'BM25 检索',
176
179
  // ⚠️ 「关系 N 条」说的是**这一份包里带了几条关系证据**(三层各条 relations 之和),
177
180
  // 不是工作区里的关系总数、也不是候选数(那两类数字宿主另有字段,这里不展示)。
178
181
  'pipe.relations': '关系 {n} 条',
182
+ // v0.25:状态行里那一格(**默认关**)。关着也出现 —— 藏起来用户就永远打不开这个功能。
183
+ 'pipe.changesOff': '变更',
184
+ 'pipe.changesOn': '变更 {n}',
185
+ 'pipe.changesUnavailable': '变更 —',
186
+ 'changes.titleOff': '按 Git 变更查找需要一起检查的文件(只读:只跑一条 git status,不执行任何写操作)',
187
+ 'changes.titleOn': '{files} 个变更文件 · {related} 条关联证据 · 点一下关闭',
188
+ 'changes.titleUnavailable': '读不到 Git 变更状态:{reason}',
189
+ 'changes.reason.notARepo': '不是 Git 工作区',
190
+ 'changes.reason.gitMissing': '找不到 git 命令',
191
+ 'changes.reason.timeout': 'git 读取超时',
192
+ 'changes.reason.tooLarge': 'git 输出过大(已截断)',
193
+ 'changes.reason.failed': 'git 读取失败',
194
+ 'changes.reason.request': '变更关联接口请求失败',
195
+ 'changes.reason.unknown': '原因未知',
179
196
  // ⚠️ 「固定 N」= 有几篇被你固定、因此**从三层移出**进了固定区(pack.pinned 的长度)。
180
197
  // 不写「固定覆盖」这种内部说法;也不带量词 —— 固定对象可能是文档、代码或媒体。
181
198
  'pipe.pin': '固定 {n}',
@@ -190,9 +207,9 @@ window.__ModuleLoader__.load({
190
207
  'sem.mode.hybrid': '混合',
191
208
  'sem.mode.lexicalTitle': '词法检索:BM25 + IDF,纯本地、零模型调用(默认)',
192
209
  'sem.mode.hybridTitle': '混合检索(实验):在词法候选之外补充语义候选;需要先配置 provider',
193
- // 2026-10-11:检索模式改成**搜索框右端的小下拉** —— 这两个是按钮上的短标签(带一个 ⌄)。
194
- 'sem.mode.lexicalShort': '词法⌄',
195
- 'sem.mode.hybridShort': '混合⌄',
210
+ // ⚠️ 2026-10-13:原来的 sem.mode.lexicalShort / hybridShort 两个**短标签键已删除** ——
211
+ // 检索方式的可见文案改成状态行的 pipe.rank / pipe.rankHybrid(实际生效的模式),
212
+ // 键留着只会变成没人渲染的死键(i18n 的键集对齐守卫也查不出「定义了但没人用」)。
196
213
  // 菜单里两个选项的副文案(长解释收进菜单,工具栏不再挤第三组)
197
214
  'sem.mode.lexicalOption': '词法检索',
198
215
  'sem.mode.hybridOption': '混合检索 · 实验',
@@ -371,8 +388,6 @@ window.__ModuleLoader__.load({
371
388
  'count.code.filtered': '{hit} / {total} code files',
372
389
  'count.media': '{n} media',
373
390
  'count.media.filtered': '{hit} / {total} media',
374
- 'count.all': '{n} items',
375
- 'count.all.filtered': '{hit} / {total} items',
376
391
  'action.refresh': 'Refresh',
377
392
  'path.openTitle': 'Open in file manager',
378
393
  'peek.empty': 'No Markdown documents in this workspace yet.',
@@ -383,7 +398,6 @@ window.__ModuleLoader__.load({
383
398
  'sort.relevanceTitle': 'Sort by relevance to the current conversation (local keyword matching, no model call)',
384
399
  'sort.timeTitle': 'Sort by file modified time, newest first',
385
400
 
386
- 'kind.all': 'All',
387
401
  'kind.doc': 'Docs',
388
402
  'kind.code': 'Code',
389
403
  // 2026-10-06: user picked 「媒体」 for the tab + the "All" section title, so English
@@ -466,11 +480,16 @@ window.__ModuleLoader__.load({
466
480
  // in, not how strong it is — so they share one colour and differ by word.
467
481
  'context.pinned': 'Pinned',
468
482
  'context.pinnedHint': 'you marked these',
483
+ 'context.changes': 'Tied to changes',
484
+ 'context.changesHint': 'pulled in by your uncommitted edits',
485
+ 'context.changesEmpty': '{files} changed file(s), no related evidence found',
486
+ 'context.changesUnreadable': 'Git change status unavailable: {reason}',
469
487
  'prov.retrieval': 'retrieved',
470
488
  'prov.relation': 'relation',
471
489
  'prov.manual': 'pinned',
472
490
  // v0.23: the fourth provenance (semantic) — same neutral, lowercase word group.
473
491
  'prov.semantic': 'semantic',
492
+ 'prov.change': 'change',
474
493
  'control.pin': 'Pin',
475
494
  'control.unpin': 'Unpin',
476
495
  'control.exclude': 'Exclude',
@@ -488,8 +507,21 @@ window.__ModuleLoader__.load({
488
507
  'pipe.collect': '{n} collected',
489
508
  'pipe.exclude': '{n} excluded',
490
509
  'pipe.candidates': '{n} candidates',
491
- 'pipe.rank': 'BM25 lexical retrieval',
510
+ 'pipe.rank': 'BM25 retrieval',
492
511
  'pipe.relations': '{n} relations',
512
+ 'pipe.changesOff': 'Changes',
513
+ 'pipe.changesOn': 'Changes {n}',
514
+ 'pipe.changesUnavailable': 'Changes —',
515
+ 'changes.titleOff': 'Find the files to check alongside your Git changes (read-only: one git status, no write commands)',
516
+ 'changes.titleOn': '{files} changed file(s) · {related} related by evidence · click to turn off',
517
+ 'changes.titleUnavailable': 'Git change status unavailable: {reason}',
518
+ 'changes.reason.notARepo': 'not a Git working tree',
519
+ 'changes.reason.gitMissing': 'git command not found',
520
+ 'changes.reason.timeout': 'git timed out',
521
+ 'changes.reason.tooLarge': 'git output too large (truncated)',
522
+ 'changes.reason.failed': 'git read failed',
523
+ 'changes.reason.request': 'the change-links request failed',
524
+ 'changes.reason.unknown': 'unknown reason',
493
525
  'pipe.pin': '{n} pinned',
494
526
  'pipe.pack': '{n} in pack',
495
527
  // v0.23 (Phase A): hybrid retrieval. This cell states the mode **in effect**, not the click.
@@ -500,8 +532,6 @@ window.__ModuleLoader__.load({
500
532
  'sem.mode.hybrid': 'Hybrid',
501
533
  'sem.mode.lexicalTitle': 'Lexical retrieval: BM25 + IDF, fully local, no model call (default)',
502
534
  'sem.mode.hybridTitle': 'Hybrid retrieval (experimental): adds semantic candidates on top of lexical ones; needs a configured provider',
503
- 'sem.mode.lexicalShort': 'lexical⌄',
504
- 'sem.mode.hybridShort': 'hybrid⌄',
505
535
  'sem.mode.lexicalOption': 'Lexical retrieval',
506
536
  'sem.mode.hybridOption': 'Hybrid retrieval · experimental',
507
537
  'sem.mode.lexicalDesc': 'Default: keeps the current BM25 + IDF ranking.',
@@ -758,6 +788,9 @@ window.__ModuleLoader__.load({
758
788
  const BS_TAB_ID = 'knit:recent'
759
789
 
760
790
  const LIST_API = '/knit/api/recent'
791
+ /* v0.25:Git 变更关联的**独立接口**。它与列表接口分开,所以「列表的响应形状」
792
+ 不会被这个功能碰到;关掉功能时客户端连这个请求都不发。 */
793
+ const CHANGES_API = '/knit/api/changes'
761
794
  const DOC_API = '/knit/api/doc'
762
795
  const RAW_API = '/knit/api/raw'
763
796
  // v0.12:某篇的「谁引用了它 / 它引用了谁」。与上面三条一样是**同源相对地址**,
@@ -798,6 +831,8 @@ window.__ModuleLoader__.load({
798
831
  它要用户显式选、并且配了 provider 才会真的跑 —— 「零模型调用 / 零网络出口」
799
832
  这条对外承诺只在默认模式成立(细则见 v0.23 方案 §2 的文案纪律)。 */
800
833
  const RETRIEVAL_KEY = 'dsh-knit:retrieval'
834
+ /** v0.25:Git 变更关联的开关。**默认关** —— 不写这一项就是关。 */
835
+ const CHANGES_KEY = 'dsh-knit:changes'
801
836
  /** 语义 provider 的**唯一写路由**;读走 `/api/recent` 的 `semantic.provider`。 */
802
837
  const SEMANTIC_API = '/knit/api/semantic'
803
838
 
@@ -811,7 +846,6 @@ window.__ModuleLoader__.load({
811
846
  */
812
847
  const KIND_CODE = 'code'
813
848
  const KIND_MEDIA = 'media'
814
- const KIND_ALL = 'all'
815
849
 
816
850
  /**
817
851
  * v0.19:分类层给的「生成产物」档(`.map` / `*.min.js` / `package-lock.json` …)。
@@ -1029,9 +1063,10 @@ body[data-ds-dark-theme] .knit-root{
1029
1063
  外框、.knit-seg 内部竖线、.knit-filter。CSS 里统一写 0.5px(与官方 .wSkVaW_header 的 .5px 同值)。
1030
1064
  ⚠️ 选中态只改**底色 + 字重 600**(不是 700),hover 只改底色 —— 不许 scale / translate /
1031
1065
  box-shadow(md §五)。暗色下靠 --knit-active-bg 这个 token,不写死颜色。
1032
- ⚠️ 2026-10-09(v0.21.x 用户规格):这一行现在是**三组一行**,顺序就是控件顺序,
1033
- 别再挪 —— ① 排序「相关 / 最新」(灰底分段控件)② 一条浅灰竖线
1034
- ③ 类型「文档 / 代码 / 媒体 / 全部」(下划线页签)④ 搜索框(排尾、贴右、宽度自适应)。
1066
+ ⚠️ 2026-10-09(v0.21.x 用户规格)/ 2026-10-12(v0.23.1 用户裁决):这一行是
1067
+ **两组 + 一个右对齐容器**,顺序就是控件顺序,别再挪 —— ① 排序「相关 / 最新」(灰底分段控件)
1068
+ ② 一条浅灰竖线 ③ 类型「文档 / 代码 / 媒体」(下划线页签,**三档**)
1069
+ ④ .knit-bar-right:检索模式小下拉(只在相关档出现)+ 搜索框(贴右、宽度自适应、唯一可伸缩项)。
1035
1070
  那根竖线是**边界**,不是把六个选项连成一个整体:排序与类型是两个互不干扰的条件,
1036
1071
  搜索只过滤当前范围、不重置它们(用户规格 §三.3)。 */
1037
1072
  .knit-bar{display:flex;align-items:center;gap:8px;padding:0 12px 8px;flex:none}
@@ -1061,10 +1096,10 @@ body[data-ds-dark-theme] .knit-root{
1061
1096
  font-size:13px;background:transparent;color:var(--dsw-alias-label-primary,#e8eaed);
1062
1097
  border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12))}
1063
1098
  .knit-semcfg-note{flex:1 1 100%;font-size:11px;line-height:1.5;color:var(--dsw-alias-label-secondary,#9aa0a6)}
1064
- /* 排序组与类型组之间**就这一根线**(用户规格 §二.2:中间用一条浅灰竖线与排序区隔开)。
1065
- 色号取 .knit-seg 外框、.knit-filter 描边同一个 border-l3 ⇒ 三处一样淡;粗细写 1px ——
1066
- 0.5px 的竖线在高分屏上会淡到看不见,它不是描边而是分隔。纯装饰:aria-hidden。 */
1067
- .knit-bar-sep{flex:none;width:1px;height:16px;background:var(--dsw-alias-border-l3,rgba(255,255,255,.12))}
1099
+ /* 排序组与类型组之间**不再有竖线**(2026-10-12 用户裁决:「最新跟文档之间那条竖线可以去掉」)——
1100
+ 那根线的节点、类名与 CSS 规则**整体删除**,两组现在只靠 .knit-bar 的 gap 分隔。
1101
+ 留档:从前那根线取 .knit-seg 外框 / .knit-filter 描边同一个 border-l3(三处一样淡)、
1102
+ 粗细 1px(0.5px 在高分屏上看不见)、纯装饰 aria-hidden —— 这些理由随它一起作废。 */
1068
1103
  .knit-seg{display:inline-flex;flex:none;border-radius:10px;overflow:hidden;
1069
1104
  border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12))}
1070
1105
  .knit-seg-btn{height:28px;padding:0 15px;cursor:pointer;font-size:13px;font-weight:400;
@@ -1081,29 +1116,78 @@ body[data-ds-dark-theme] .knit-root{
1081
1116
  v0.23(2026-10-11 用户裁决):描边从 input 挪到**外层容器** —— 因为检索模式那个小下拉
1082
1117
  就贴在容器右端(中间一条细左线),两者共用一圈描边才像一个整体控件。
1083
1118
  焦点态挪到 :focus-within(输入框与下拉谁拿到焦点,外框都亮)—— 行为与原来一致。 */
1084
- .knit-searchwrap{display:flex;align-items:center;flex:1 1 180px;min-width:0;max-width:240px;margin-left:auto;
1119
+ /* v0.23.1:右侧两个控件的**右对齐容器** —— 检索模式在搜索框左边。
1120
+ margin-left:auto 从搜索框移交到这里;容器自身可缩(min-width:0),
1121
+ 里面**只有搜索框**是 flex:1 1 的可伸缩项 ⇒ 窄屏先缩搜索框。
1122
+ ⚠️ 这段注释里不许出现反引号 —— 整个 CSS 在一个模板串里。 */
1123
+ .knit-bar-right{display:flex;align-items:center;gap:8px;margin-left:auto;min-width:0;justify-content:flex-end}
1124
+ .knit-searchwrap{display:flex;align-items:center;flex:1 1 180px;min-width:0;max-width:240px;
1085
1125
  border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12));border-radius:10px;
1086
1126
  transition:border-color .16s ease}
1087
1127
  .knit-searchwrap:focus-within{border-color:var(--knit-accent)}
1088
1128
  .knit-filter{flex:1 1 auto;min-width:0;height:28px;padding:0 12px;border:none;border-radius:10px;font-size:13px;
1089
1129
  background:transparent;color:var(--dsw-alias-label-primary,#e8eaed);outline:none}
1090
- /* 检索模式:搜索框右端的小下拉。**只在相关档出现**,不出现时搜索框自己占满,
1091
- 没有空位、也没有置灰的禁用态。 */
1092
- .knit-retmode{position:relative;flex:none}
1093
- .knit-retmode-btn{height:28px;padding:0 10px;cursor:pointer;font-size:12px;font-weight:400;white-space:nowrap;
1094
- border:none;border-left:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12));
1095
- background:transparent;color:var(--dsw-alias-label-secondary,#9aa0a6)}
1096
- .knit-retmode-btn:hover{background:var(--knit-hover-bg,rgba(255,255,255,.03));
1097
- color:var(--dsw-alias-label-primary,#e8eaed)}
1098
- .knit-retmode-btn[aria-expanded="true"]{background:var(--knit-active-bg,rgba(255,255,255,.085));
1099
- color:var(--dsw-alias-label-primary,#e8eaed)}
1100
- .knit-retmenu{position:absolute;right:0;top:32px;z-index:20;width:272px;padding:6px;text-align:left;
1130
+ /* v0.24(2026-10-12 用户裁决 + Demo 参考):检索方式做成状态行里**可点的状态格**。
1131
+ 外观(2026-10-12 第三次裁决,用户:「UI 视觉参考命中段那种来修改」):
1132
+ **逐条对齐 .knit-hit(命中段)那套** —— 这是同一份视觉语言的复用,不是新造一个控件:
1133
+ · 底 = --knit-chip-bg(三档灰底里最深那档,命中段同源;比行选中那档深一点);
1134
+ · 圆角 6px、内边距 1px 6px、描边一根都没有(与命中段逐字同值);
1135
+ · 字色 = 次级灰,hover / 键盘焦点 → 主文本色 + 下划线(命中段同款提示);
1136
+ · **字号 / 行高 / 字重与命中段逐字同值**(font:inherit + font-size:11px + line-height:15px、
1137
+ 不设 font-weight ⇒ 跟随所在行):2026-10-13 用户裁决「字号与背景胶囊修改成命中段一样」。
1138
+ ⚠️ 这一格因此比它所在的状态行(10.5px)**大 0.5px** —— 那是有意的:它是这一行里唯一的可点控件,
1139
+ 与命中段同一档,才让人一眼认出「这两处是同一类东西」。 */
1140
+ .knit-pipe-method-wrap{position:relative;flex:none}
1141
+ .knit-pipe-method{display:inline-flex;align-items:center;flex:none;white-space:nowrap;cursor:pointer;
1142
+ padding:1px 6px;border:0;outline:none;border-radius:6px;
1143
+ background:var(--knit-chip-bg,rgba(255,255,255,.12));
1144
+ font:inherit;font-size:11px;line-height:15px;
1145
+ color:var(--dsw-alias-label-secondary,#61666b)}
1146
+ /* 悬停只提亮颜色;**下划线给包文字的那一层**,不给按钮本身 ——
1147
+ 父级的 text-decoration 会传播到全部子节点、子级又无法取消,
1148
+ 所以写在按钮上会让箭头 › 也一起被划上(2026-10-13 用户裁决)。 */
1149
+ .knit-pipe-method:hover,.knit-pipe-method:focus-visible{color:var(--dsw-alias-label-primary,#e8eaed)}
1150
+ .knit-pipe-method:hover .knit-pipe-method-label,
1151
+ .knit-pipe-method:focus-visible .knit-pipe-method-label{text-decoration:underline}
1152
+ .knit-pipe-method[aria-expanded="true"]{color:var(--dsw-alias-label-primary,#e8eaed)}
1153
+ /* v0.25:Git 变更关联那一格。**与检索方式复用同一份视觉语言**(同 --knit-chip-bg、同圆角 6px、
1154
+ 同内边距 1px 6px、同字号 11px / 行高 15px),但它是个**二态开关**:没有菜单、没有箭头。
1155
+ 开态只把字色提到主文本色(属性选择器 aria-pressed=true)—— **不换底色、不用品牌色**,
1156
+ 与检索方式「展开态」那条规则同一个手法:同一行里同类物,靠字重/字色分层,不靠颜色。
1157
+ ⚠️ 尾随的 › 在检索方式那边才画;这一格没有箭头,所以下划线直接给文字层即可。 */
1158
+ .knit-pipe-changes{display:inline-flex;align-items:center;flex:none;white-space:nowrap;cursor:pointer;
1159
+ padding:1px 6px;border:0;outline:none;border-radius:6px;
1160
+ background:var(--knit-chip-bg,rgba(255,255,255,.12));
1161
+ font:inherit;font-size:11px;line-height:15px;
1162
+ color:var(--dsw-alias-label-secondary,#61666b);transition:color .14s ease}
1163
+ .knit-pipe-changes:hover,.knit-pipe-changes:focus-visible{color:var(--dsw-alias-label-primary,#e8eaed)}
1164
+ .knit-pipe-changes:hover .knit-pipe-changes-label,
1165
+ .knit-pipe-changes:focus-visible .knit-pipe-changes-label{text-decoration:underline}
1166
+ .knit-pipe-changes[aria-pressed="true"]{color:var(--dsw-alias-label-primary,#e8eaed)}
1167
+ @media (prefers-reduced-motion:reduce){.knit-pipe-changes{transition:none}}
1168
+ /* 箭头:与「最近读取」行最右端那个 › 同一套视觉语言(同字形),基础态旋转 90° 变成「朝下」。
1169
+ ⚠️ 展开态用 **横向翻转 scaleX(-1)**,不是对调角度、也不是 scaleY(-1)(2026-10-13 用户裁决:
1170
+ 「修改成横向翻转……默认箭头向下,交互展开箭头向上」)。
1171
+ · 对调成 rotate(-90deg) ⇒ 箭头在 0.14s 里**原地转 180°**(像风车),读起来是「在转」;
1172
+ · **scaleY(-1) 是空操作** —— › 这个字形本来就沿水平轴对称,上下镜像后一模一样,
1173
+ 矩阵算出来仍是朝下(曾经写错过一次,被用户当场抓到,现在有几何守卫盯着);
1174
+ · scaleX(-1) 才是「同一个字形左右翻个面」:先把 › 镜像成 ‹,再转 90° ⇒ 朝上。
1175
+ ⇒ 关=朝下、开=朝上,过程是横向翻转。 */
1176
+ .knit-pipe-method-go{display:inline-block;margin-left:3px;font-size:12px;line-height:1;
1177
+ transform:rotate(90deg);transition:transform .14s ease}
1178
+ .knit-pipe-method[aria-expanded="true"] .knit-pipe-method-go{transform:rotate(90deg) scaleX(-1)}
1179
+ @media (prefers-reduced-motion:reduce){.knit-pipe-method-go{transition:none}}
1180
+ .knit-retmenu{position:absolute;left:0;top:22px;z-index:20;width:272px;padding:6px;text-align:left;
1101
1181
  background:var(--dsw-alias-bg-base,#151517);border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12));
1102
1182
  border-radius:10px;box-shadow:0 10px 26px rgba(0,0,0,.28)}
1103
- .knit-retmenu-item{display:block;width:100%;text-align:left;cursor:pointer;padding:8px 9px;border-radius:8px;
1183
+ /* 菜单里那两个可选项:**沿用命中段那套**(2026-10-12 用户裁决「对,就这样修改」)——
1184
+ 圆角 6px(命中段同值)、选中态底 = --knit-chip-bg(命中段那档);
1185
+ 菜单**面板本身**仍是浮层(bg-base + l3 描边 + 阴影 + 10px 圆角):浮层必须读起来像浮层,
1186
+ 把它也压成灰胶囊就没有层级了。 */
1187
+ .knit-retmenu-item{display:block;width:100%;text-align:left;cursor:pointer;padding:8px 9px;border-radius:6px;
1104
1188
  border:none;background:transparent;color:var(--dsw-alias-label-primary,#e8eaed)}
1105
1189
  .knit-retmenu-item:hover{background:var(--knit-hover-bg,rgba(255,255,255,.03))}
1106
- .knit-retmenu-item.active{background:var(--knit-active-bg,rgba(255,255,255,.085))}
1190
+ .knit-retmenu-item.active{background:var(--knit-chip-bg,rgba(255,255,255,.12))}
1107
1191
  .knit-retmenu-item strong{display:block;font-size:12.5px;font-weight:600}
1108
1192
  .knit-retmenu-item span{display:block;margin-top:3px;font-size:11px;line-height:1.5;
1109
1193
  color:var(--dsw-alias-label-secondary,#9aa0a6)}
@@ -1111,7 +1195,7 @@ body[data-ds-dark-theme] .knit-root{
1111
1195
  border-top:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12));
1112
1196
  color:var(--dsw-alias-label-secondary,#9aa0a6)}
1113
1197
  .knit-retmenu-cfg{display:block;width:100%;text-align:left;cursor:pointer;padding:7px 9px;border:none;
1114
- background:transparent;color:var(--dsw-alias-label-primary,#e8eaed);font-size:12px}
1198
+ border-radius:6px;background:transparent;color:var(--dsw-alias-label-primary,#e8eaed);font-size:12px}
1115
1199
  .knit-retmenu-cfg:hover{background:var(--knit-hover-bg,rgba(255,255,255,.03))}
1116
1200
  .knit-filter::placeholder{color:var(--dsw-alias-label-caption,#80868b)}
1117
1201
  /* v0.15「使用情况」→ v0.18「Context Usage Lens」:**列表上方的一块轻量观察层**。
@@ -1702,7 +1786,7 @@ body[data-ds-dark-theme] .knit-preview{box-shadow:0 -8px 24px rgba(0,0,0,.38)}
1702
1786
  2px 下划线表达,页签条本身不画线(也不是「下划线悬空」:它画在自己的文字下面)。
1703
1787
  ⚠️ 排序切换(.knit-seg-btn,Design §18)是**另一个控件**,它保持灰底不变。
1704
1788
  ⚠️ 2026-10-09(v0.21.x 用户规格):这一组从**自己一行**搬进了 .knit-bar,排在排序组
1705
- 右边、与它之间隔一根 .knit-bar-sep。于是这里**不再自带左右 12px 内边距**(那是
1789
+ 右边(2026-10-12 起中间**没有竖线了** —— 靠 .knit-bar 的 gap 分开)。于是这里**不再自带左右 12px 内边距**(那是
1706
1790
  .knit-bar 的事,再写一遍就是双重缩进、两组对不齐)。下划线式选中态**保持不变** ——
1707
1791
  用户这次说「选中项用浅色背景或文字强调即可」,下划线 + 主色文字正是「文字强调」,
1708
1792
  而且它覆盖 2026-09-29 那条「不要灰底」的裁决,不要因为并排就退回灰底按钮。 */
@@ -1879,11 +1963,14 @@ video.knit-preview-media{width:100%;background:#000}
1879
1963
 
1880
1964
  /**
1881
1965
  * 读上次选择的列表类型,非法值回落到 doc。
1882
- * @returns {'doc'|'media'|'all'} 类型
1966
+ *
1967
+ * v0.23.1:「全部」档已整体删除 ⇒ 白名单里的 `'all'` 也删掉 ——
1968
+ * 老用户 localStorage 里存着 `'all'` 时**回落到 `文档`**(不空白、不抛)。
1969
+ * @returns {'doc'|'code'|'media'} 类型
1883
1970
  */
1884
1971
  function readKindPref() {
1885
1972
  const v = readPref(KIND_KEY)
1886
- return v === KIND_MEDIA || v === KIND_ALL || v === KIND_CODE ? v : KIND_DOC
1973
+ return v === KIND_MEDIA || v === KIND_CODE ? v : KIND_DOC
1887
1974
  }
1888
1975
 
1889
1976
  /**
@@ -1902,6 +1989,28 @@ video.knit-preview-media{width:100%;background:#000}
1902
1989
  return readPref(RETRIEVAL_KEY) === 'hybrid' ? 'hybrid' : 'lexical'
1903
1990
  }
1904
1991
 
1992
+ /**
1993
+ * 读「Git 变更关联」开关。**没写过、写坏了都是关** —— 默认值必须是「不动基础检索行为」那一个。
1994
+ * @returns {boolean} 是否开启
1995
+ */
1996
+ function readChangesPref() {
1997
+ return readPref(CHANGES_KEY) === '1'
1998
+ }
1999
+
2000
+ /** 宿主给的 Git 原因码 → i18n 键(与 `semanticReasonKey` 同一条纪律:宿主只给码)。 */
2001
+ function changeReasonKey(reason) {
2002
+ if (reason === 'not-a-repo') return 'changes.reason.notARepo'
2003
+ if (reason === 'git-missing') return 'changes.reason.gitMissing'
2004
+ if (reason === 'timeout') return 'changes.reason.timeout'
2005
+ if (reason === 'output-too-large') return 'changes.reason.tooLarge'
2006
+ if (reason === 'failed-fatal') return 'changes.reason.failed'
2007
+ // v0.25 收尾:这一条**不是**宿主的原因码,而是客户端自己的 —— 独立接口那次请求本身
2008
+ // 失败(网络/解析异常、非 ok 响应)。「读不到 git」与「没问到」是两件事,不许都写成
2009
+ // 「原因未知」,否则用户分不清该去检查仓库还是该重试。
2010
+ if (reason === 'request') return 'changes.reason.request'
2011
+ return 'changes.reason.unknown'
2012
+ }
2013
+
1905
2014
  /**
1906
2015
  * provider 地址是不是**本机回环**。只有回环才敢说「内容不离开这台机器」;
1907
2016
  * 其它(含空地址)一律按「会发送到你配置的服务」披露 —— 宁可说得重一点。
@@ -2137,6 +2246,81 @@ video.knit-preview-media{width:100%;background:#000}
2137
2246
  return !!doc && (doc.kind === 'image' || doc.kind === 'video')
2138
2247
  }
2139
2248
 
2249
+ /**
2250
+ * v0.25 收尾:把独立接口那份载荷归成**三种状态之一**(状态行与列表提示共用同一个判断)。
2251
+ *
2252
+ * @param {object|null} data - `state.changes`
2253
+ * @returns {{read: boolean, reason: string|null, filesTotal: number, hasRows: boolean}}
2254
+ * `read=false` ⇒ 读不到(接口失败或 git 读不到),`reason` 是给用户看的原因码;
2255
+ * `read=true` ⇒ 拿到了 git 事实,`filesTotal` 是变更文件数。
2256
+ */
2257
+ function changeStatusOf(data) {
2258
+ if (!data) return { read: false, reason: null, filesTotal: 0 }
2259
+ if (data.failed === true) return { read: false, reason: data.reason || 'request', filesTotal: 0 }
2260
+ const git = data.git || null
2261
+ if (!git || git.available !== true) {
2262
+ return { read: false, reason: (git && git.reason) || 'unknown', filesTotal: 0 }
2263
+ }
2264
+ return { read: true, reason: null, filesTotal: Number(git.filesTotal) || 0 }
2265
+ }
2266
+
2267
+ /**
2268
+ * v0.25:`/knit/api/changes` 的**专用结构** → 列表行(只做形状映射,不做判断)。
2269
+ *
2270
+ * 宿主给的是「变更起点 / 关联目标 / 关系类型 / 行号」这套事实;这里把它摊成与列表行
2271
+ * 同形状的一层,好让**既有那套行渲染 + 证据弹层**直接用上(零第二条渲染路径)。
2272
+ * 两个刻意的决定:
2273
+ * · `provenance: 'change'` 是**客户端自己**给这一区贴的来源词(宿主的结构里没有这个词),
2274
+ * 只决定行右端那个「变更关联」;**不给 `reason`** —— 见下面那段说明;
2275
+ * · 证据行映射回 `{type, dir, other: 起点, line}`:`other` = 那个被改过的文件,
2276
+ * 与 v0.21 的行级证据**逐字同源**,所以弹层里「谁 · 什么 · 第几行」照旧可读。
2277
+ *
2278
+ * @param {object|null} data - `/knit/api/changes` 的载荷
2279
+ * @returns {Array<object>} 行(没有数据 ⇒ 空数组,调用方据此不渲染这一区)
2280
+ */
2281
+ function changeRowsOf(data) {
2282
+ const links = (data && Array.isArray(data.links)) ? data.links : []
2283
+ return links.map((link) => ({
2284
+ rel: link.target,
2285
+ title: link.title || link.target,
2286
+ summary: link.summary || '',
2287
+ mtimeMs: link.mtimeMs,
2288
+ kind: link.kind,
2289
+ source: link.source,
2290
+ provenance: 'change',
2291
+ // ⚠️ **刻意不给 `reason`**(v0.25 收尾):`changeRelated` 那个理由码曾经让宿主
2292
+ // 「声明了一个自己不再产出」的码。现在「为什么在这一区」由**区标题 + 提示句**回答
2293
+ // (「变更关联 / 由未提交的改动牵出」),每一行的**具体依据**在证据弹层里
2294
+ // (类型 + 起点 + 行号)—— 行级渲染本来就不给没有 reason 的条目出那一行。
2295
+ relations: (Array.isArray(link.evidence) ? link.evidence : []).map((e) => ({
2296
+ type: e.type,
2297
+ dir: e.dir,
2298
+ other: e.origin,
2299
+ // `line` 是 `null` 时**不给这个键** —— 弹层据此说「文件名约定,没行号」
2300
+ ...(Number.isInteger(e.line) ? { line: e.line } : {}),
2301
+ })),
2302
+ ...(Number.isInteger(link.evidenceTotal) && link.evidenceTotal > (Array.isArray(link.evidence) ? link.evidence.length : 0)
2303
+ ? { relationsTotal: link.evidenceTotal } : {}),
2304
+ }))
2305
+ }
2306
+
2307
+ /**
2308
+ * 一个条目符不符合过滤框里的那串字(标题 / 摘要 / 相对路径)。
2309
+ *
2310
+ * v0.25 抽出来的:`visibleDocs`(列表那一份)与「变更关联」区都要用同一条判据 ——
2311
+ * 用户在搜索框里打了字,两处都该跟着收窄,而**两处都不许**各自写一份。
2312
+ *
2313
+ * @param {object} doc - 条目(面板条目或宿主给的记录)
2314
+ * @param {string} q - 已经 trim + toLowerCase 过的查询串;空串表示不过滤
2315
+ * @returns {boolean}
2316
+ */
2317
+ function docMatchesQuery(doc, q) {
2318
+ if (!q) return true
2319
+ return String(doc.title || '').toLowerCase().includes(q)
2320
+ || String(doc.summary || '').toLowerCase().includes(q)
2321
+ || String(doc.rel || '').toLowerCase().includes(q)
2322
+ }
2323
+
2140
2324
  /**
2141
2325
  * 命中片段的**行号区间**文本(v0.20,需求 §11 / §12)。
2142
2326
  *
@@ -3789,6 +3973,16 @@ video.knit-preview-media{width:100%;background:#000}
3789
3973
  // v0.15「使用情况」的开闸状态(默认关,见 `USAGE_KEY`)。放在最后 —— 前几个 hook
3790
3974
  // 的顺序被测试按位预置,别插队。
3791
3975
  const [usageOn, setUsageOn] = React.useState(readUsagePref)
3976
+ /* v0.25:Git 变更关联开关。偏好记在 localStorage(与排序 / 类型 / 检索模式同一族),
3977
+ **默认关**。关着时请求里不带 `changes=1` ⇒ 宿主一个 git 进程都不 spawn。
3978
+ ⚠️ **刻意声明在 `usageOn` 之后**:`test/client.test.mjs` 用**指数 seed** 来打开
3979
+ 「使用情况」(hook 下标 15),插在它前面会把后面所有下标顶开一位。
3980
+ 新 hook 一律往**末尾**追加,别插队。 */
3981
+ const [changesOn, setChangesOn] = React.useState(readChangesPref)
3982
+ /* v0.25(第二轮修订):变更关联来自**独立接口** `/knit/api/changes`,不再挂在
3983
+ `/api/recent` 的 `context` 上 —— 所以它有自己的状态槽。**必须追加在末尾**:
3984
+ 前面的 hook 位置被 `test/client.test.mjs` 按位预置。 */
3985
+ const [changesData, setChangesData] = React.useState(null)
3792
3986
 
3793
3987
  // v0.17:两个折叠块的开合状态(上下文外读取 / 最近一次变化)。
3794
3988
  // **纯瞬时 UI 状态** —— 不写 pref、不进 `dsh-knit:*` 存储,刷新即回默认(收起)。
@@ -3850,6 +4044,8 @@ video.knit-preview-media{width:100%;background:#000}
3850
4044
  // 没打开「使用情况」的会话,宿主侧一个事件都不读。
3851
4045
  // v0.23:`retrieval` 是**选填**参数 —— 老宿主忽略它(那就等于词法),
3852
4046
  // 而词法模式下宿主**一次 provider 调用都不会发**(方案 §9.2 判据 1)。
4047
+ // ⚠️ v0.25(第二轮修订):`/api/recent` 上**一个字节的变更关联都没有** ——
4048
+ // 它的响应形状与 v0.24 逐字相同。变更关联走**独立接口**,见下面那次 fetch。
3853
4049
  const url = `${LIST_API}?sessionId=${encodeURIComponent(sessionId)}&limit=40&sort=${sort}&kind=${kind}&retrieval=${sort === 'relevance' && retrieval === 'hybrid' ? 'hybrid' : 'lexical'}${usageOn ? '&usage=1' : ''}`
3854
4050
  const res = await fetch(url, { headers: { accept: 'application/json' }, cache: 'no-store' })
3855
4051
  const data = await res.json()
@@ -3885,11 +4081,41 @@ video.knit-preview-media{width:100%;background:#000}
3885
4081
  if (!live()) return
3886
4082
  setState({ status: 'error', docs: [], root: '', total: 0, error: String((error && error.message) || error), mode: 'time', context: null, usage: null })
3887
4083
  }
4084
+ /* v0.25(第二轮修订):**独立接口** `/knit/api/changes`。
4085
+ · 关着时**一个请求都不发**(宿主因此一个 git 进程都不 spawn)——判据 5 的客户端那一半;
4086
+ · 只在「相关」序要它(时间序没有 Context Pack,变更关联无处可落);
4087
+ · 复用宿主刚刚那次扫描(服务端 8 s 同窗)⇒ 两个请求 = 一次扫描 + 一次 git;
4088
+ · 失败一律降级成 `null`(这一区消失),**绝不带坏列表** —— 列表已经落好了。 */
4089
+ const wantChanges = sort === 'relevance' && changesOn
4090
+ if (!wantChanges) {
4091
+ setChangesData((prev) => (prev === null ? prev : null))
4092
+ return
4093
+ }
4094
+ try {
4095
+ // ⚠️ **没有 `kind` 参数**:这一路固定用「文档 + 代码」那一份不分档语料,
4096
+ // 和面板当前在哪个档位无关(档位只切列表那一栏)。
4097
+ const res = await fetch(`${CHANGES_API}?sessionId=${encodeURIComponent(sessionId)}&limit=40&sort=relevance`, {
4098
+ headers: { accept: 'application/json' }, cache: 'no-store',
4099
+ })
4100
+ const data = await res.json()
4101
+ if (!live()) return
4102
+ setChangesData((prev) => {
4103
+ // ⚠️ 「请求失败」与「读不到 git」**不许**都变成 `null`:`null` 是「这个功能没开」,
4104
+ // 用它表示失败会让用户以为「没有变更」。失败有自己的形状(见 `changeStatusOf`)。
4105
+ if (!data || !data.ok) return { failed: true, reason: 'request' }
4106
+ // 载荷一字未变就返回**同一个对象**,React 跳过这次更新(与列表同一套去重理由)
4107
+ const sig = JSON.stringify(data)
4108
+ return (prev && prev.sig === sig) ? prev : { ...data, sig }
4109
+ })
4110
+ } catch {
4111
+ if (!live()) return
4112
+ setChangesData({ failed: true, reason: 'request' })
4113
+ }
3888
4114
  // 「读了多久」是按分钟变的相对时间:只有**分钟数**真的变了才落一次刷新信号(其余时候
3889
4115
  // 返回同一个值,React 直接跳过这次更新)。标签读的是渲染时刻的钟,不受这里影响。
3890
4116
  const now = Date.now()
3891
4117
  bumpTick((prev) => (Math.floor(now / 60000) === Math.floor(prev / 60000) ? prev : now))
3892
- }, [sessionId, sort, kind, usageOn, retrieval])
4118
+ }, [sessionId, sort, kind, usageOn, retrieval, changesOn])
3893
4119
 
3894
4120
  React.useEffect(() => {
3895
4121
  // 看不见就一个定时器都不挂:`visible` 变回 true 时本 effect 重跑,立刻 load 一次。
@@ -3941,20 +4167,9 @@ video.knit-preview-media{width:100%;background:#000}
3941
4167
  const all = Array.isArray(state.docs) ? state.docs : []
3942
4168
  const q = query.trim().toLowerCase()
3943
4169
  if (!q) return all
3944
- return all.filter((doc) =>
3945
- String(doc.title || '').toLowerCase().includes(q)
3946
- || String(doc.summary || '').toLowerCase().includes(q)
3947
- || String(doc.rel || '').toLowerCase().includes(q))
4170
+ return all.filter((doc) => docMatchesQuery(doc, q))
3948
4171
  }, [state.docs, query])
3949
4172
 
3950
- /* ── 「全部」= **整份包的原样**(v0.23 方案 A,2026-10-12 用户裁决)──────
3951
- 三层(主要 / 辅助 / 相关)里**文档与代码混排**,顺序就是阅读顺序;没有类型分区、
3952
- 没有「每区 4 条」、没有「查看全部 →」。媒体**不在包里**(宿主已把媒体剔出装配),
3953
- 所以它们在三层之后**单独一个不截断的网格**,也不会与层里的条目重复。
3954
- ⇒ 四个类型档的关系因此变得一句话说得清:`全部` = 包的原样;
3955
- `文档 / 代码 / 媒体` = 把同一个包(或同一批语料)过滤到某类。 */
3956
- const allRows = kind === KIND_ALL ? visibleDocs.filter((doc) => !isMedia(doc)) : []
3957
- const allMedia = kind === KIND_ALL ? visibleDocs.filter(isMedia) : []
3958
4173
  // ResizeObserver 量到的是 .knit-list(它自己也有左右内边距),
3959
4174
  // 网格的可用宽度 = 列表宽度 − 列表内边距 − 网格内边距。
3960
4175
  // 文档列表**没有列数可算**:永远一个文档一行(见 `DOC_GRID` 那段说明)。
@@ -4022,7 +4237,9 @@ video.knit-preview-media{width:100%;background:#000}
4022
4237
  // (AGENTS.md §6.5 同一个坑踩过三次)。
4023
4238
  h('div', { className: 'knit-tierline', role: 'presentation' },
4024
4239
  h('span', { className: 'knit-tiername' }, t(section.titleKey)),
4025
- section.hintKey ? h('span', { className: 'knit-tierhint' }, t(section.hintKey)) : null),
4240
+ section.hintKey
4241
+ ? h('span', { className: 'knit-tierhint' }, t(section.hintKey, section.hintParams))
4242
+ : null),
4026
4243
  // ⚠️ 幽灵行(正在离开的)也走 `docsGrid`,所以它照样是一个 `.knit-doc` ——
4027
4244
  // 会被 `byClass` 数到,但**不在** `navDocs` 里(键盘与 cursor 都到不了)。
4028
4245
  docsGrid(withGhosts(section.key, section.docs), view.numbers, section.key === 'primary', true)))
@@ -4057,9 +4274,8 @@ video.knit-preview-media{width:100%;background:#000}
4057
4274
  */
4058
4275
  const contextView = React.useMemo(() => {
4059
4276
  const pack = state.context
4060
- // v0.23:`全部` 与 `文档`/`代码` 走**同一条**分层渲染路径 —— 区别只在
4061
- // `visibleDocs` 是哪个类型档过滤出来的那一批(媒体由下面的末尾网格接手)。
4062
- if (!relevance || (kind !== KIND_DOC && kind !== KIND_CODE && kind !== KIND_ALL) || !pack) return null
4277
+ // v0.23.1:只认「文档 / 代码」两档 —— 「全部」档已整体删除(2026-10-12 用户裁决)。
4278
+ if (!relevance || (kind !== KIND_DOC && kind !== KIND_CODE) || !pack) return null
4063
4279
  const tiers = [
4064
4280
  ['primary', 'context.primary', 'context.primaryHint'],
4065
4281
  ['supporting', 'context.supporting', 'context.supportingHint'],
@@ -4092,6 +4308,45 @@ video.knit-preview-media{width:100%;background:#000}
4092
4308
  if (pinned.length > 0) {
4093
4309
  sections.push({ key: 'pinned', titleKey: 'context.pinned', hintKey: 'context.pinnedHint', docs: pinned })
4094
4310
  }
4311
+ /* v0.25:**Git 变更关联**。它与固定区是同一类东西:一组有证据、但**不属于这一轮名次**的
4312
+ 条目,所以独立成一区、不编号(`numbers` 那边一并跳过它)。
4313
+ ⚠️ 这里**不能**用 `visible`(它来自 `state.docs` 那 40 条的切片)—— 一条变更关联的
4314
+ 文件很可能排在 40 名之外,用 `visible` 过滤会让整区凭空空掉。它只受**过滤框**约束,
4315
+ 与用户在搜索框里打的字保持一致。 */
4316
+ const changeRows = changeRowsOf(changesData)
4317
+ // ⚠️ 这里**自己派生一次**,不复用状态行那份 `changeStatus`:那个常量声明在这个
4318
+ // useMemo **之后**(靠近状态行的渲染),引它会 `Cannot access before initialization`
4319
+ // —— 运行时直接白屏(写完当场被测试抓到)。同一个纯函数、同一个入参,不会分叉。
4320
+ const changeState = changeStatusOf(changesData)
4321
+ const q = query.trim().toLowerCase()
4322
+ const changeDocs = changeRows.filter((item) => !isMedia(item) && docMatchesQuery(item, q)).map(withHits)
4323
+ if (changeDocs.length > 0) {
4324
+ sections.push({ key: 'changes', titleKey: 'context.changes', hintKey: 'context.changesHint', docs: changeDocs })
4325
+ } else if (changesOn && changesData !== null && !changeState.read) {
4326
+ /* v0.25 收尾:**读不到时把原因直接写出来**,不再只放在悬停里。
4327
+ 为什么加这一条:真人反馈(2026-10-13)—— 用户看到那一格写「变更 —」,
4328
+ 读成了「这个数据没记录到」,而真正的原因是「这个工作区不是 Git 仓库」,
4329
+ 它只藏在 `title` 里,不悬停就看不见。
4330
+ ⚠️ 条件里的 `changesData !== null` 是必须的:功能刚打开、第一次取数还没回来时
4331
+ `read` 也是 false,那时写「原因未知」是**假话**(不是读不到,是还没读到)。
4332
+ 那一瞬间不出这一区,等下一条轮询落地。 */
4333
+ sections.push({
4334
+ key: 'changes', titleKey: 'context.changes', hintKey: 'context.changesUnreadable',
4335
+ hintParams: { reason: t(changeReasonKey(changeState.reason)) },
4336
+ docs: [],
4337
+ })
4338
+ } else if (changesOn && changeState.read && changeState.filesTotal > 0) {
4339
+ /* v0.25 收尾:**有变更、但一条关联证据都没有**时要说得出来。
4340
+ 这一区是**只带提示句、不带行**的(区头照常出现)—— 用户因此能区分
4341
+ 「没有变更」(那一格写 0,这里什么都不出)与「有变更但没找到该一起看的」。
4342
+ 读不到 git 的那种情况**不在这里**:它的提示在状态行那一格(「变更 —」 + 悬停原因),
4343
+ 因为「读不到」不是一条列表内容。 */
4344
+ sections.push({
4345
+ key: 'changes', titleKey: 'context.changes',
4346
+ hintKey: 'context.changesEmpty', hintParams: { files: changeState.filesTotal },
4347
+ docs: [],
4348
+ })
4349
+ }
4095
4350
  for (const [tierKey, titleKey, hintKey] of tiers) {
4096
4351
  const items = Array.isArray(pack[tierKey]) ? pack[tierKey] : []
4097
4352
  const docs = items.filter((item) => visible.has(item.rel)).map(withHits)
@@ -4105,6 +4360,8 @@ video.knit-preview-media{width:100%;background:#000}
4105
4360
  }
4106
4361
  // 固定区里的也在包里 —— 它们同样不该出现在「其他相关文档」。
4107
4362
  for (const item of (Array.isArray(pack.pinned) ? pack.pinned : [])) placed.add(item.rel)
4363
+ // 变更关联区里的也不再出现在「其他相关文档」(同一篇不该在两处出现)
4364
+ for (const item of changeRows) placed.add(item.rel)
4108
4365
  const rest = visibleDocs.filter((doc) => !isMedia(doc) && !placed.has(doc.rel))
4109
4366
  if (rest.length > 0) {
4110
4367
  sections.push({ key: 'other', titleKey: 'context.other', hintKey: '', docs: rest })
@@ -4116,27 +4373,23 @@ video.knit-preview-media{width:100%;background:#000}
4116
4373
  // v0.21:**固定区也不编号** —— 它的位置由用户决定,不由阅读顺序决定。
4117
4374
  const numbers = new Map()
4118
4375
  for (const section of sections) {
4119
- if (section.key === 'other' || section.key === 'pinned') continue
4376
+ if (section.key === 'other' || section.key === 'pinned' || section.key === 'changes') continue
4120
4377
  for (const doc of section.docs) numbers.set(doc.rel, numbers.size + 1)
4121
4378
  }
4122
4379
  // 键盘到达顺序 = 屏幕上从上到下的顺序(分组顺序 + 组内顺序)
4123
4380
  const flat = []
4124
4381
  for (const section of sections) for (const doc of section.docs) flat.push(doc)
4125
4382
  return { sections, flat, numbers }
4126
- }, [relevance, kind, state.context, visibleDocs])
4383
+ }, [relevance, kind, state.context, changesData, visibleDocs, query])
4127
4384
 
4128
4385
  /**
4129
4386
  * 键盘与 cursor 真正能到达的条目。
4130
4387
  *
4131
4388
  * 分了层时必须是**三层里那些真的渲染出来的条目**(`contextView.flat`)——
4132
4389
  * 否则「其他相关文档」区里的条目键盘到不了,而已经在 Related 层里的条目
4133
- * 会被算两次。「全部」档里文档只到上限,媒体全部可达。
4390
+ * 会被算两次。(媒体档走的是网格,`visibleDocs` 就是那批媒体。)
4134
4391
  */
4135
- const navDocs = kind === KIND_ALL
4136
- // 「全部」:三层里真的渲染出来的那些(文档 + 代码)**加上**末尾网格里的媒体 ——
4137
- // 媒体不是行,但它照样要能被键盘选中、也能被预览。
4138
- ? (contextView ? contextView.flat : allRows).concat(allMedia)
4139
- : (contextView ? contextView.flat : visibleDocs)
4392
+ const navDocs = contextView ? contextView.flat : visibleDocs
4140
4393
 
4141
4394
  // cursor 消失(被过滤掉 / 被上限截断 / 列表刷新)时落回第一项
4142
4395
  React.useEffect(() => {
@@ -4504,6 +4757,16 @@ video.knit-preview-media{width:100%;background:#000}
4504
4757
  setSemNotice('')
4505
4758
  }, [])
4506
4759
 
4760
+ /**
4761
+ * v0.25:切换「Git 变更关联」并记住偏好。**只切偏好** —— 真正跑 git 的是宿主,
4762
+ * 下一次 `load()` 会带上 `changes=1`。关掉时请求里就不带了(宿主零开销)。
4763
+ * @param {boolean} value - 是否开启
4764
+ */
4765
+ const pickChanges = React.useCallback((value) => {
4766
+ writePref(CHANGES_KEY, value ? '1' : '0')
4767
+ setChangesOn(value)
4768
+ }, [])
4769
+
4507
4770
  /** 切换列表类型并记住偏好;同时收起上一类型的预览。 */
4508
4771
  const pickKind = React.useCallback((value) => {
4509
4772
  writePref(KIND_KEY, value)
@@ -4621,7 +4884,7 @@ video.knit-preview-media{width:100%;background:#000}
4621
4884
  if (semCfgOpen) focusFirst('.knit-semcfg-input')
4622
4885
  }, [semCfgOpen])
4623
4886
 
4624
- /** 点面板别处就收起菜单。判据用「点在 `.knit-retmode` 之内就放过」——
4887
+ /** 点面板别处就收起菜单。判据用「点在 `.knit-pipe-method-wrap` 之内就放过」——
4625
4888
  * 否则按钮自己的点击会先关(pointerdown)再开(click),菜单根本打不开。
4626
4889
  * ⚠️ 测试替身里 `window.addEventListener` 是空实现 ⇒ 这条只在真机生效,
4627
4890
  * 所以 Esc 那条**必须**另外挂在按钮与菜单上(可被断言)。 */
@@ -4629,7 +4892,7 @@ video.knit-preview-media{width:100%;background:#000}
4629
4892
  if (!retMenuOpen) return undefined
4630
4893
  const onPointerDown = (event) => {
4631
4894
  const node = event && event.target
4632
- if (node && typeof node.closest === 'function' && node.closest('.knit-retmode')) return
4895
+ if (node && typeof node.closest === 'function' && node.closest('.knit-pipe-method-wrap')) return
4633
4896
  setRetMenuOpen(false)
4634
4897
  }
4635
4898
  window.addEventListener('pointerdown', onPointerDown)
@@ -4696,9 +4959,8 @@ video.knit-preview-media{width:100%;background:#000}
4696
4959
  }
4697
4960
  return rows
4698
4961
  }
4699
- // 平铺(时间序 / 没有包):**媒体不进行**,它们走末尾那个网格。
4700
- const flatRows = kind === KIND_ALL ? allRows : visibleDocs
4701
- return flatRows.map((doc, index) => (
4962
+ // 平铺(时间序 / 没有包):媒体档走网格、不进行。
4963
+ return visibleDocs.map((doc, index) => (
4702
4964
  { rel: doc.rel, tierKey: MOTION_TIER_FLAT, index, doc }))
4703
4965
  })()
4704
4966
  const motion = (() => {
@@ -4863,15 +5125,9 @@ video.knit-preview-media{width:100%;background:#000}
4863
5125
  ? h('div', { className: 'knit-msg' }, t('list.noMatch', { query: query.trim() }))
4864
5126
  : kind === KIND_MEDIA
4865
5127
  ? mediaGrid(visibleDocs)
4866
- : kind === KIND_ALL
4867
- // 「全部」= 包的原样(或时间序下一条平铺的最近改动)+ 末尾**不截断**的媒体网格。
4868
- // 顺序是语义的一部分:媒体排在整份阅读顺序之后,不与层里的条目穿插。
4869
- ? h(React.Fragment, null,
4870
- contextView ? contextBody(contextView) : docsGrid(withGhosts(MOTION_TIER_FLAT, allRows)),
4871
- allMedia.length > 0 ? mediaGrid(allMedia) : null)
4872
- : contextView
4873
- ? contextBody(contextView)
4874
- : docsGrid(withGhosts(MOTION_TIER_FLAT, visibleDocs))
5128
+ : contextView
5129
+ ? contextBody(contextView)
5130
+ : docsGrid(withGhosts(MOTION_TIER_FLAT, visibleDocs))
4875
5131
 
4876
5132
  // 排序说明那一行(.knit-topic)**2026-09-30 已整体删除**:排序方式由头部那个
4877
5133
  // 「相关 / 最新」切换按钮自己表达(按钮上就写着当前选的是哪个),再补一句
@@ -5126,9 +5382,7 @@ video.knit-preview-media{width:100%;background:#000}
5126
5382
  ? (filtering ? 'count.media.filtered' : 'count.media')
5127
5383
  : kind === KIND_CODE
5128
5384
  ? (filtering ? 'count.code.filtered' : 'count.code')
5129
- : kind === KIND_ALL
5130
- ? (filtering ? 'count.all.filtered' : 'count.all')
5131
- : (filtering ? 'count.filtered' : 'count')
5385
+ : (filtering ? 'count.filtered' : 'count')
5132
5386
  // 可见文本 = 纯数字;整句(含量词)只出现在 title 里。
5133
5387
  const countText = filtering
5134
5388
  ? `${visibleDocs.length} / ${state.total}`
@@ -5274,6 +5528,90 @@ video.knit-preview-media{width:100%;background:#000}
5274
5528
  : (isLoopbackBase(semForm0.base)
5275
5529
  ? t('sem.disclose.local')
5276
5530
  : t('sem.disclose.remote', { base: semForm0.base }))))
5531
+ /* v0.24(2026-10-12 用户裁决 + Demo 参考):检索方式不再是工具栏里的下拉,
5532
+ 而是状态行里一个**可点的状态格**(`BM25 词法检索 ›`)—— 虚线下划线 + 小箭头提示可点。
5533
+ 菜单**相对这一格定位**(`.knit-retmenu{left:0;top:22px}`),内容与行为逐字沿用原来的:
5534
+ 两个选项(menuitemradio / aria-checked)+ 现状说明 + 「不可用时就地配置」入口。
5535
+ ⚠️ 这一格说的是**实际生效**的模式(`semLive`):点了混合但不可用时,宿主回的是 lexical,
5536
+ 所以它仍然显示「BM25 词法检索」—— 不许把它写成「用户点了什么」。 */
5537
+ const pipeMethodNode = h('div', { className: 'knit-pipe-method-wrap' },
5538
+ h('button', {
5539
+ type: 'button',
5540
+ className: 'knit-pipe-method',
5541
+ 'aria-haspopup': 'true',
5542
+ 'aria-expanded': retMenuOpen,
5543
+ // 悬停给**整句话**(长键在这里被用上;菜单里则是逐选项的副文案)
5544
+ title: t(retrieval === 'hybrid' ? 'sem.mode.hybridTitle' : 'sem.mode.lexicalTitle'),
5545
+ onClick: () => setRetMenuOpen((value) => !value),
5546
+ onKeyDown: closeRetMenuOnEscape,
5547
+ },
5548
+ // 文字单独一层:悬停的下划线只划它,不划右边那个箭头(见 CSS 注释)。
5549
+ h('span', { className: 'knit-pipe-method-label' }, t(semLive ? 'pipe.rankHybrid' : 'pipe.rank')),
5550
+ // 箭头是**装饰**(对读屏隐藏),可访问名由上面的 title 承担。
5551
+ // 字形复用「最近读取」行最右端那个 `›`,CSS 旋转 90° 朝下、展开时转回朝上。
5552
+ h('span', { className: 'knit-pipe-method-go', 'aria-hidden': 'true' }, '›')),
5553
+ retMenuOpen ? h('div', {
5554
+ className: 'knit-retmenu',
5555
+ role: 'menu',
5556
+ 'aria-label': t('sem.mode.aria'),
5557
+ onKeyDown: closeRetMenuOnEscape,
5558
+ },
5559
+ [['lexical', 'sem.mode.lexicalOption', 'sem.mode.lexicalDesc'],
5560
+ ['hybrid', 'sem.mode.hybridOption', 'sem.mode.hybridDesc']].map(([value, labelKey, descKey]) =>
5561
+ h('button', {
5562
+ type: 'button',
5563
+ key: value,
5564
+ role: 'menuitemradio',
5565
+ 'aria-checked': retrieval === value,
5566
+ className: `knit-retmenu-item${retrieval === value ? ' active' : ''}`,
5567
+ onClick: () => { pickRetrieval(value); setRetMenuOpen(false) },
5568
+ },
5569
+ h('strong', null, t(labelKey)),
5570
+ h('span', null, t(descKey)))),
5571
+ // 状态行:如实写这一档现在到底生效成什么(判据 5 的界面面)
5572
+ h('div', { className: 'knit-retmenu-note' }, semStateText),
5573
+ // 就地配置入口:只在「选了混合且没生效」时给;点开的是那行最小配置区
5574
+ semCanConfigure ? h('button', {
5575
+ type: 'button',
5576
+ className: 'knit-retmenu-cfg',
5577
+ onClick: () => { setRetMenuOpen(false); setSemCfgOpen((value) => !value) },
5578
+ }, t(semCfgOpen ? 'sem.cfg.hide' : 'sem.cfg.show')) : null) : null)
5579
+ /* v0.25:Git 变更关联那一格(见上面 CSS 的说明)。三种话术,都由**宿主的事实**决定:
5580
+ 关着 / 开着且有数 / 开着但读不到(写原因)。读完就关也不会留下悬念。 */
5581
+ /* v0.25(第二轮修订):这一格的数字来自**独立接口**的那份载荷,不再来自 Context Pack。
5582
+ v0.25 收尾:**三种状态必须互相可辨**(这是原来那版最实的一个缺口 ——
5583
+ 请求失败时那一格显示成「关着」的样子,用户会把「读不到」读成「没有变更」):
5584
+ · 关着 → 归一成 `null` → 「变更」
5585
+ · 开着但读不到 → `failed` / `git.available === false` → 「变更 —」+ 悬停写原因
5586
+ · 开着且读到了 → `git.available === true` → 「变更 N」(N = 变更文件数)
5587
+ ⚠️ 「有变更但没有关联」与「有变更且有关联」在状态行上是同一个 `变更 N` ——
5588
+ 它们的区别在**列表里那一区的提示句**(见 `contextView`),不在这一格。 */
5589
+ const changeStatus = changeStatusOf(changesData)
5590
+ const changeInfo = changeStatus.read ? { ...changeStatus, relatedTotal: Number(changesData.linksTotal) || 0 } : null
5591
+ const changeFiles = changeInfo && Number.isFinite(changeInfo.filesTotal) ? changeInfo.filesTotal : 0
5592
+ const changesLabel = !changesOn
5593
+ ? t('pipe.changesOff')
5594
+ : (!changeStatus.read
5595
+ ? t('pipe.changesUnavailable')
5596
+ : t('pipe.changesOn', { n: changeFiles }))
5597
+ const changesTitle = !changesOn
5598
+ ? t('changes.titleOff')
5599
+ : (!changeStatus.read
5600
+ ? t('changes.titleUnavailable', { reason: t(changeReasonKey(changeStatus.reason)) })
5601
+ : t('changes.titleOn', {
5602
+ files: changeFiles,
5603
+ related: changeInfo ? (Number(changeInfo.relatedTotal) || 0) : 0,
5604
+ }))
5605
+ const changesNode = h('button', {
5606
+ type: 'button',
5607
+ className: 'knit-pipe-changes',
5608
+ 'aria-pressed': changesOn ? 'true' : 'false',
5609
+ title: changesTitle,
5610
+ onClick: (event) => {
5611
+ if (event && typeof event.stopPropagation === 'function') event.stopPropagation()
5612
+ pickChanges(!changesOn)
5613
+ },
5614
+ }, h('span', { className: 'knit-pipe-changes-label' }, changesLabel))
5277
5615
  const pipeNode = h('div', { className: 'knit-pipe' },
5278
5616
  pipeCell(t('pipe.collect', { n: collected })),
5279
5617
  pipeDot(),
@@ -5283,12 +5621,16 @@ video.knit-preview-media{width:100%;background:#000}
5283
5621
  pipeSep(),
5284
5622
  // 这一格说的是**实际生效**的模式(`semantic.mode`),不是你点了什么:
5285
5623
  // 点了混合但不可用时,宿主回的是 lexical,这里就必须还写「BM25 词法检索」。
5286
- pipeCell(t(semLive ? 'pipe.rankHybrid' : 'pipe.rank')),
5624
+ pipeMethodNode,
5287
5625
  ...(semLive ? [pipeDot(), pipeCell(t('pipe.semantic', { n: semCandidateCount }))] : []),
5288
5626
  pipeDot(),
5289
5627
  pipeCell(t('pipe.relations', { n: relCount })),
5290
5628
  pipeDot(),
5291
5629
  pipeCell(t('pipe.pin', { n: pinnedCount })),
5630
+ pipeDot(),
5631
+ // v0.25:入口就是这一格 —— **默认关**,关着也出现(藏起来用户就永远打不开)。
5632
+ // 它说的是宿主回的**事实**(几个变更文件 / 读不到的原因),不是「你点了什么」。
5633
+ changesNode,
5292
5634
  pipeSep(),
5293
5635
  // 唯一略微加重的一格:它是这一行里被后续阶段消费的那个数字(需求 §三.8:
5294
5636
  // 只提字重,不用品牌色、不做徽章)。
@@ -5330,7 +5672,7 @@ video.knit-preview-media{width:100%;background:#000}
5330
5672
  h('button', { className: 'knit-btn', onClick: load, title: t('action.refreshNow') }, t('action.refresh'))),
5331
5673
  h('div', { className: 'knit-bar' },
5332
5674
  /* v0.21.x(2026-10-09 用户规格):三组一行 —— 排序 | 类型 | 搜索。
5333
- ① 排序与类型**不做成一个整体**:中间那根 `.knit-bar-sep` 就是边界,两个条件各管各的。
5675
+ ① 排序与类型**不做成一个整体**:两组各管各的(中间的竖线 2026-10-12 已删除,靠 gap 分界)。
5334
5676
  ② 搜索排最后、贴最右:它只过滤当前列表,不重置排序与类型(§三.3)。
5335
5677
  ③ 六个选项彼此独立 —— 选「代码」再选「最新」= 最新的代码。
5336
5678
  顺序即控件顺序,别再挪(细则在 CSS 那边的 .knit-bar / .knit-filter 注释里)。 */
@@ -5345,12 +5687,13 @@ video.knit-preview-media{width:100%;background:#000}
5345
5687
  onClick: () => pickSort('time'),
5346
5688
  title: t('sort.timeTitle'),
5347
5689
  }, t('sort.time'))),
5348
- // 排序组 / 类型组之间**就这一根线**(2026-10-09 用户规格 §二.2)。
5349
- h('span', { className: 'knit-bar-sep', 'aria-hidden': 'true' }),
5690
+ // ⚠️ 2026-10-12 用户裁决:排序组与类型组之间**那根竖线去掉了** —— 它的类名与 CSS 规则都已整体删除。
5691
+ // 两组靠 `.knit-bar` 的 gap 分开就够 —— 「边界」不再需要一根线来表达。
5350
5692
  h('div', { className: 'knit-types', role: 'tablist', 'aria-label': t('kind.title') },
5351
- // v0.19:四档「文档 / 代码 / 媒体 / 全部」。**没有第二层分类** ——
5352
- // 代码里不再按语言(JS / TS / Python…)分组(需求 §46:不给代码加视觉层级压迫)。
5353
- [[KIND_DOC, 'kind.doc'], [KIND_CODE, 'kind.code'], [KIND_MEDIA, 'kind.media'], [KIND_ALL, 'kind.all']].map(([value, labelKey]) =>
5693
+ // v0.23.1(2026-10-12 用户裁决):**三档**「文档 / 代码 / 媒体」——
5694
+ // 「全部」那一档连同它的混合浏览视图在整个界面上删除了(三档等距、页签样式不变)。
5695
+ // **没有第二层分类** —— 代码里不按语言(JS / TS / Python…)分组(需求 §46)。
5696
+ [[KIND_DOC, 'kind.doc'], [KIND_CODE, 'kind.code'], [KIND_MEDIA, 'kind.media']].map(([value, labelKey]) =>
5354
5697
  h('button', {
5355
5698
  type: 'button',
5356
5699
  key: value,
@@ -5360,61 +5703,25 @@ video.knit-preview-media{width:100%;background:#000}
5360
5703
  title: t('kind.title'),
5361
5704
  onClick: () => pickKind(value),
5362
5705
  }, t(labelKey)))),
5363
- /* v0.23(2026-10-11 用户裁决):检索模式从「左端第三组」改成**贴在搜索框右端的小下拉**
5364
- (形态照 `02_方案与 Demo/Knit-v0.22-v0.24-Demo.html` 那份原型,用户觉得那种更好:
5365
- 左端只留「排序 | 类型」两组、不再挤第三组,长解释收进菜单)。
5366
- 只在「相关」档出现;**未配 provider 也出现**(菜单里如实说状态 + 就地给配置入口)。
5367
- ⚠️ 它是**搜索框容器里的第二个孩子** —— 出现/不出现都不改左端布局:
5368
- 藏起来时搜索框自己占满,没有空位、没有置灰的死控件。
5706
+ /* v0.24(2026-10-12 用户裁决):**检索方式搬去状态行了**(见下面 `pipeMethodNode`),
5707
+ 工具栏第二行只剩三样:排序、类型、搜索框。
5708
+ `[相关|最新] [文档|代码|媒体] …………………………… [ ……搜索框…… ]`
5709
+ ⚠️ 搜索框仍靠右:`margin-left:auto` 由它外面的 `.knit-bar-right` 承担(容器没被撤掉,
5710
+ 只是里面从「检索方式 + 搜索框」变成「只有搜索框」)。
5711
+ ⚠️ 容器里**只有搜索框**是 `flex:1 1 …` 的可伸缩项 —— 窄屏先缩它;排序 / 类型一律 `flex:none`。
5369
5712
  ⚠️ 搜索仍是对**当前这一份列表**再过滤,不动排序与类型。 */
5370
- h('div', { className: 'knit-searchwrap' },
5371
- h('input', {
5372
- className: 'knit-filter',
5373
- value: query,
5374
- placeholder: t('filter.placeholder'),
5375
- 'aria-label': t('filter.aria'),
5376
- onChange: (event) => setQuery(event.target.value),
5377
- onKeyDown: (event) => {
5378
- if (event.key === 'Escape') { event.stopPropagation(); setQuery('') }
5379
- },
5380
- }),
5381
- showRetrieval ? h('div', { className: 'knit-retmode' },
5382
- h('button', {
5383
- type: 'button',
5384
- className: 'knit-retmode-btn',
5385
- 'aria-haspopup': 'true',
5386
- 'aria-expanded': retMenuOpen,
5387
- // 悬停提示给**整句话**(两根长键在这里被用上;菜单里则是逐选项的副文案)
5388
- title: t(retrieval === 'hybrid' ? 'sem.mode.hybridTitle' : 'sem.mode.lexicalTitle'),
5389
- onClick: () => setRetMenuOpen((value) => !value),
5390
- onKeyDown: closeRetMenuOnEscape,
5391
- }, t(retrieval === 'hybrid' ? 'sem.mode.hybridShort' : 'sem.mode.lexicalShort')),
5392
- retMenuOpen ? h('div', {
5393
- className: 'knit-retmenu',
5394
- role: 'menu',
5395
- 'aria-label': t('sem.mode.aria'),
5396
- onKeyDown: closeRetMenuOnEscape,
5397
- },
5398
- [['lexical', 'sem.mode.lexicalOption', 'sem.mode.lexicalDesc'],
5399
- ['hybrid', 'sem.mode.hybridOption', 'sem.mode.hybridDesc']].map(([value, labelKey, descKey]) =>
5400
- h('button', {
5401
- type: 'button',
5402
- key: value,
5403
- role: 'menuitemradio',
5404
- 'aria-checked': retrieval === value,
5405
- className: `knit-retmenu-item${retrieval === value ? ' active' : ''}`,
5406
- onClick: () => { pickRetrieval(value); setRetMenuOpen(false) },
5713
+ h('div', { className: 'knit-bar-right' },
5714
+ h('div', { className: 'knit-searchwrap' },
5715
+ h('input', {
5716
+ className: 'knit-filter',
5717
+ value: query,
5718
+ placeholder: t('filter.placeholder'),
5719
+ 'aria-label': t('filter.aria'),
5720
+ onChange: (event) => setQuery(event.target.value),
5721
+ onKeyDown: (event) => {
5722
+ if (event.key === 'Escape') { event.stopPropagation(); setQuery('') }
5407
5723
  },
5408
- h('strong', null, t(labelKey)),
5409
- h('span', null, t(descKey)))),
5410
- // 状态行:如实写这一档现在到底生效成什么(判据 5 的界面面)
5411
- h('div', { className: 'knit-retmenu-note' }, semStateText),
5412
- // 就地配置入口:只在「选了混合且没生效」时给;点开的是 Phase A 那行最小配置区
5413
- semCanConfigure ? h('button', {
5414
- type: 'button',
5415
- className: 'knit-retmenu-cfg',
5416
- onClick: () => { setRetMenuOpen(false); setSemCfgOpen((value) => !value) },
5417
- }, t(semCfgOpen ? 'sem.cfg.hide' : 'sem.cfg.show')) : null) : null) : null)),
5724
+ })))),
5418
5725
  /* ── v0.21:检索状态摘要 + 排除说明(需求 §6.3)──────────────────────
5419
5726
  两条都是**事实行**,都在列表上方、都只在相关序出现(那是唯一有「包」的视图)。
5420
5727
  ⚠️ 它们的排位是**紧贴工具栏**的(2026-10-09 用户反馈):观察层排在它们下面,