@icen.ai/ui 0.8.1 → 0.9.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/AGENTS.md +49 -6
- package/README.md +12 -9
- package/dist/behaviors/ai-branch.d.mts +19 -0
- package/dist/behaviors/ai-branch.mjs +217 -0
- package/dist/behaviors/ai-chat.d.mts +8 -6
- package/dist/behaviors/ai-chat.mjs +68 -8
- package/dist/behaviors/ai-composer.mjs +108 -20
- package/dist/behaviors/ai-feedback.d.mts +26 -0
- package/dist/behaviors/ai-feedback.mjs +303 -0
- package/dist/behaviors/ai-panel.d.mts +15 -1
- package/dist/behaviors/ai-panel.mjs +26 -0
- package/dist/behaviors/ai-threads.d.mts +38 -0
- package/dist/behaviors/ai-threads.mjs +319 -0
- package/dist/behaviors/ai-tool.mjs +5 -0
- package/dist/behaviors/ai-tools.mjs +5 -0
- package/dist/behaviors/charts.d.mts +103 -1
- package/dist/behaviors/charts.mjs +795 -0
- package/dist/behaviors/events.d.mts +193 -0
- package/dist/behaviors/kb-access.d.mts +34 -0
- package/dist/behaviors/kb-access.mjs +569 -0
- package/dist/behaviors/kb-acl.d.mts +50 -0
- package/dist/behaviors/kb-acl.mjs +405 -0
- package/dist/behaviors/kb-answer.d.mts +38 -0
- package/dist/behaviors/kb-answer.mjs +2055 -0
- package/dist/behaviors/kb-audit.d.mts +23 -0
- package/dist/behaviors/kb-audit.mjs +375 -0
- package/dist/behaviors/kb-canvas.d.mts +44 -0
- package/dist/behaviors/kb-canvas.mjs +589 -0
- package/dist/behaviors/kb-chain.d.mts +15 -0
- package/dist/behaviors/kb-chain.mjs +270 -0
- package/dist/behaviors/kb-checkpoint.d.mts +16 -0
- package/dist/behaviors/kb-checkpoint.mjs +342 -0
- package/dist/behaviors/kb-chunks.d.mts +31 -0
- package/dist/behaviors/kb-chunks.mjs +475 -0
- package/dist/behaviors/kb-citation.d.mts +38 -0
- package/dist/behaviors/kb-citation.mjs +677 -0
- package/dist/behaviors/kb-clarify.d.mts +20 -0
- package/dist/behaviors/kb-clarify.mjs +248 -0
- package/dist/behaviors/kb-conflict.d.mts +22 -0
- package/dist/behaviors/kb-conflict.mjs +284 -0
- package/dist/behaviors/kb-connector.d.mts +17 -0
- package/dist/behaviors/kb-connector.mjs +375 -0
- package/dist/behaviors/kb-core.d.mts +529 -0
- package/dist/behaviors/kb-core.mjs +890 -0
- package/dist/behaviors/kb-eval.d.mts +22 -0
- package/dist/behaviors/kb-eval.mjs +408 -0
- package/dist/behaviors/kb-explain.d.mts +11 -0
- package/dist/behaviors/kb-explain.mjs +243 -0
- package/dist/behaviors/kb-filter.d.mts +31 -0
- package/dist/behaviors/kb-filter.mjs +587 -0
- package/dist/behaviors/kb-gap.d.mts +27 -0
- package/dist/behaviors/kb-gap.mjs +273 -0
- package/dist/behaviors/kb-hittest.d.mts +34 -0
- package/dist/behaviors/kb-hittest.mjs +409 -0
- package/dist/behaviors/kb-metadata.d.mts +29 -0
- package/dist/behaviors/kb-metadata.mjs +326 -0
- package/dist/behaviors/kb-passage.d.mts +41 -0
- package/dist/behaviors/kb-passage.mjs +529 -0
- package/dist/behaviors/kb-pipeline.d.mts +18 -0
- package/dist/behaviors/kb-pipeline.mjs +381 -0
- package/dist/behaviors/kb-qa.d.mts +26 -0
- package/dist/behaviors/kb-qa.mjs +332 -0
- package/dist/behaviors/kb-rerank.d.mts +20 -0
- package/dist/behaviors/kb-rerank.mjs +315 -0
- package/dist/behaviors/kb-retrieval.d.mts +49 -0
- package/dist/behaviors/kb-retrieval.mjs +746 -0
- package/dist/behaviors/kb-review.d.mts +44 -0
- package/dist/behaviors/kb-review.mjs +451 -0
- package/dist/behaviors/kb-sandbox.d.mts +33 -0
- package/dist/behaviors/kb-sandbox.mjs +325 -0
- package/dist/behaviors/kb-segment.d.mts +32 -0
- package/dist/behaviors/kb-segment.mjs +499 -0
- package/dist/behaviors/kb-sources.d.mts +27 -0
- package/dist/behaviors/kb-sources.mjs +373 -0
- package/dist/behaviors/kb-sql.d.mts +43 -0
- package/dist/behaviors/kb-sql.mjs +948 -0
- package/dist/behaviors/kb-trace.d.mts +16 -0
- package/dist/behaviors/kb-trace.mjs +414 -0
- package/dist/behaviors/kb-visibility.d.mts +44 -0
- package/dist/behaviors/kb-visibility.mjs +403 -0
- package/dist/behaviors/kb-who-can.d.mts +32 -0
- package/dist/behaviors/kb-who-can.mjs +379 -0
- package/dist/components/ai-branch.mjs +3 -0
- package/dist/components/ai-chat.css +295 -0
- package/dist/components/ai-feedback.mjs +3 -0
- package/dist/components/ai-panel.css +217 -0
- package/dist/components/ai-threads.mjs +3 -0
- package/dist/components/chart-graph.css +57 -0
- package/dist/components/chart-graph.mjs +4 -0
- package/dist/components/chart-map.mjs +3 -0
- package/dist/components/chart-scatter.mjs +1 -1
- package/dist/components/charts.css +32 -0
- package/dist/components/charts.mjs +1 -0
- package/dist/components/kb-access.mjs +4 -0
- package/dist/components/kb-acl.mjs +4 -0
- package/dist/components/kb-agent.css +481 -0
- package/dist/components/kb-answer.mjs +4 -0
- package/dist/components/kb-audit.mjs +4 -0
- package/dist/components/kb-canvas.mjs +4 -0
- package/dist/components/kb-chain.mjs +4 -0
- package/dist/components/kb-checkpoint.mjs +4 -0
- package/dist/components/kb-chunks.mjs +4 -0
- package/dist/components/kb-citation.mjs +4 -0
- package/dist/components/kb-clarify.mjs +4 -0
- package/dist/components/kb-conflict.mjs +4 -0
- package/dist/components/kb-connector.mjs +4 -0
- package/dist/components/kb-data.css +649 -0
- package/dist/components/kb-eval.mjs +4 -0
- package/dist/components/kb-explain.mjs +4 -0
- package/dist/components/kb-filter.mjs +4 -0
- package/dist/components/kb-gap.mjs +4 -0
- package/dist/components/kb-ground.css +566 -0
- package/dist/components/kb-hittest.mjs +4 -0
- package/dist/components/kb-ingest.css +898 -0
- package/dist/components/kb-metadata.mjs +4 -0
- package/dist/components/kb-ops.css +548 -0
- package/dist/components/kb-passage.mjs +4 -0
- package/dist/components/kb-perm.css +444 -0
- package/dist/components/kb-pipeline.mjs +4 -0
- package/dist/components/kb-qa.mjs +4 -0
- package/dist/components/kb-rerank.mjs +4 -0
- package/dist/components/kb-retrieval.mjs +4 -0
- package/dist/components/kb-review.mjs +4 -0
- package/dist/components/kb-sandbox.mjs +4 -0
- package/dist/components/kb-search.css +940 -0
- package/dist/components/kb-segment.mjs +4 -0
- package/dist/components/kb-sources.mjs +4 -0
- package/dist/components/kb-sql.mjs +4 -0
- package/dist/components/kb-trace.mjs +4 -0
- package/dist/components/kb-visibility.mjs +4 -0
- package/dist/components/kb-who-can.mjs +4 -0
- package/dist/components/kb.css +252 -0
- package/dist/components/kb.mjs +9 -0
- package/dist/index.d.mts +37 -2
- package/dist/index.mjs +8555 -205
- package/dist/registry.json +325 -3
- package/dist/ui.css +5451 -45
- package/docs/research/2026-10-03-ai-kb-components.md +392 -0
- package/docs/research/2026-10-03-kb-permissions.md +992 -0
- package/docs/spec/kb-family.md +443 -0
- package/package.json +2 -2
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @icen.ai/ui — kb-ops.css(治理域:kb-trace / kb-review / kb-gap / kb-eval)
|
|
3
|
+
* 共享原语在 kb.css(.kb-row/.kb-num/.kb-score/.kb-dot/.kb-chip/.kb-key/.kb-empty…),
|
|
4
|
+
* 本文件只做本域专属结构。DOM 契约见 docs/spec/kb-family.md §5.19–5.22 与各 behavior 头注释。
|
|
5
|
+
*
|
|
6
|
+
* 治理域纪律(spec §2):整体 muted,告警才 warning/error;数字一律 .kb-num;
|
|
7
|
+
* 动效 ≤240ms ease-out、流式脉冲 1.6s;只用 --token-* 与 kb.css 原语。
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/* ═══════════════ kb-trace:span 树 ═══════════════ */
|
|
11
|
+
|
|
12
|
+
.kb-trace { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
13
|
+
|
|
14
|
+
/* 行:caret | kind 徽标(定宽对齐)| name | 耗时条 | elapsed;--depth×16px 缩进 */
|
|
15
|
+
.kb-span {
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: 14px 64px minmax(0, 1fr) minmax(48px, 128px) 56px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 8px;
|
|
20
|
+
min-height: 26px;
|
|
21
|
+
padding: 2px 8px 2px calc(8px + var(--depth, 0) * 16px);
|
|
22
|
+
border: none;
|
|
23
|
+
background: none;
|
|
24
|
+
border-radius: var(--radius-sm, 6px);
|
|
25
|
+
font: inherit;
|
|
26
|
+
font-size: 12.5px;
|
|
27
|
+
color: var(--token-text-muted);
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
text-align: left;
|
|
30
|
+
width: 100%;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
.kb-span:hover { background: var(--token-bg-soft); color: var(--token-text); }
|
|
34
|
+
.kb-span:focus-visible { outline: 2px solid var(--token-accent); outline-offset: -2px; }
|
|
35
|
+
|
|
36
|
+
/* 子 span 行前 1px 竖线(缩进连线) */
|
|
37
|
+
.kb-span--child::before {
|
|
38
|
+
content: '';
|
|
39
|
+
position: absolute;
|
|
40
|
+
left: calc(var(--depth, 1) * 16px - 4px);
|
|
41
|
+
top: 0;
|
|
42
|
+
bottom: 0;
|
|
43
|
+
width: 1px;
|
|
44
|
+
background: var(--token-line-soft);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* caret(有子才显;hidden 占位保持列对齐):CSS 三角,展开旋转 90° */
|
|
48
|
+
.kb-span-caret {
|
|
49
|
+
width: 0;
|
|
50
|
+
height: 0;
|
|
51
|
+
border-left: 4px solid var(--token-text-faint);
|
|
52
|
+
border-top: 3px solid transparent;
|
|
53
|
+
border-bottom: 3px solid transparent;
|
|
54
|
+
transition: transform 0.16s ease-out;
|
|
55
|
+
}
|
|
56
|
+
.kb-span[aria-expanded='true'] .kb-span-caret { transform: rotate(90deg); }
|
|
57
|
+
|
|
58
|
+
/* kind 徽标:中性线框;retrieval 为 accent 线框(证据域主角) */
|
|
59
|
+
.kb-span-kind {
|
|
60
|
+
font-size: 10.5px;
|
|
61
|
+
line-height: 1;
|
|
62
|
+
letter-spacing: 0.3px;
|
|
63
|
+
color: var(--token-text-faint);
|
|
64
|
+
border: 1px solid var(--token-line-soft);
|
|
65
|
+
border-radius: 999px;
|
|
66
|
+
padding: 2.5px 7px;
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
justify-self: start;
|
|
69
|
+
}
|
|
70
|
+
.kb-span.is-retrieval .kb-span-kind {
|
|
71
|
+
color: var(--token-accent);
|
|
72
|
+
border-color: color-mix(in srgb, var(--token-accent) 45%, transparent);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.kb-span-name {
|
|
76
|
+
min-width: 0;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
color: var(--token-text);
|
|
81
|
+
font-size: 12.5px;
|
|
82
|
+
}
|
|
83
|
+
.kb-span.is-cancel { opacity: 0.6; }
|
|
84
|
+
|
|
85
|
+
/* 耗时条:宽度 = elapsedMs / 同级最大(行内 style);error 红 / running 脉冲 */
|
|
86
|
+
.kb-span-bar {
|
|
87
|
+
justify-self: start;
|
|
88
|
+
width: 0%;
|
|
89
|
+
height: 4px;
|
|
90
|
+
border-radius: 2px;
|
|
91
|
+
background: var(--token-line);
|
|
92
|
+
transition: width 0.16s ease-out;
|
|
93
|
+
}
|
|
94
|
+
.kb-span.is-error .kb-span-bar { background: var(--token-danger, var(--token-error)); }
|
|
95
|
+
.kb-span.is-running .kb-span-bar {
|
|
96
|
+
background: var(--token-accent);
|
|
97
|
+
animation: kb-ops-pulse 1.6s ease-in-out infinite;
|
|
98
|
+
}
|
|
99
|
+
.kb-span > .kb-num { justify-self: end; }
|
|
100
|
+
|
|
101
|
+
@keyframes kb-ops-pulse {
|
|
102
|
+
0%, 100% { opacity: 1; }
|
|
103
|
+
50% { opacity: 0.35; }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* 展开体(.kb-fold-body 语义同构):缩进 depth+1、左侧 2px 证据线由 border 承担 */
|
|
107
|
+
.kb-trace-body {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
gap: 6px;
|
|
111
|
+
margin: 0 8px 2px calc(16px + (var(--depth, 0) + 1) * 16px);
|
|
112
|
+
padding: 6px 10px;
|
|
113
|
+
border-left: 2px solid var(--token-line-soft);
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
color: var(--token-text-muted);
|
|
116
|
+
}
|
|
117
|
+
.kb-trace-detail { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
|
|
118
|
+
.kb-trace-usage { display: flex; flex-wrap: wrap; gap: 4px 12px; }
|
|
119
|
+
.kb-trace-error { color: var(--token-danger, var(--token-error)); font-size: 12px; word-break: break-word; }
|
|
120
|
+
|
|
121
|
+
/* retrieval span 内嵌迷你命中列表(rank + title + .kb-score 序数条) */
|
|
122
|
+
.kb-trace-hits { display: flex; flex-direction: column; gap: 2px; }
|
|
123
|
+
.kb-trace-hit {
|
|
124
|
+
display: grid;
|
|
125
|
+
grid-template-columns: 18px minmax(0, 1fr) minmax(88px, 140px);
|
|
126
|
+
align-items: center;
|
|
127
|
+
gap: 8px;
|
|
128
|
+
min-height: 22px;
|
|
129
|
+
}
|
|
130
|
+
.kb-trace-hit-rank { text-align: right; color: var(--token-text-faint); }
|
|
131
|
+
.kb-trace-hit-title {
|
|
132
|
+
font-size: 12px;
|
|
133
|
+
color: var(--token-text-muted);
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* ═══════════════ kb-review:标注队列 ═══════════════ */
|
|
140
|
+
|
|
141
|
+
.kb-review {
|
|
142
|
+
display: grid;
|
|
143
|
+
grid-template-columns: 300px minmax(0, 1fr);
|
|
144
|
+
gap: 16px;
|
|
145
|
+
align-items: start;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* 左:队列列表 */
|
|
149
|
+
.kb-review-queue { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
|
|
150
|
+
.kb-review-filter { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--token-text-faint); }
|
|
151
|
+
.kb-review-filter-select,
|
|
152
|
+
.kb-review-assign {
|
|
153
|
+
font: inherit;
|
|
154
|
+
font-size: 12px;
|
|
155
|
+
color: var(--token-text);
|
|
156
|
+
background: var(--token-bg-soft);
|
|
157
|
+
border: 1px solid var(--token-line-soft);
|
|
158
|
+
border-radius: var(--radius-sm, 6px);
|
|
159
|
+
padding: 2px 6px;
|
|
160
|
+
max-width: 180px;
|
|
161
|
+
}
|
|
162
|
+
.kb-review-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
|
|
163
|
+
|
|
164
|
+
.kb-review-item {
|
|
165
|
+
display: grid;
|
|
166
|
+
grid-template-columns: auto minmax(0, 1fr) auto auto;
|
|
167
|
+
align-items: center;
|
|
168
|
+
gap: 8px;
|
|
169
|
+
min-height: 28px;
|
|
170
|
+
padding: 3px 8px;
|
|
171
|
+
border: none;
|
|
172
|
+
background: none;
|
|
173
|
+
border-radius: var(--radius-sm, 6px);
|
|
174
|
+
font: inherit;
|
|
175
|
+
font-size: 12.5px;
|
|
176
|
+
color: var(--token-text-muted);
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
text-align: left;
|
|
179
|
+
}
|
|
180
|
+
.kb-review-item:hover { background: var(--token-bg-soft); color: var(--token-text); }
|
|
181
|
+
.kb-review-item:focus-visible { outline: 2px solid var(--token-accent); outline-offset: -2px; }
|
|
182
|
+
.kb-review-item.is-active {
|
|
183
|
+
background: var(--token-bg-soft);
|
|
184
|
+
color: var(--token-text);
|
|
185
|
+
box-shadow: inset 2px 0 0 var(--token-accent);
|
|
186
|
+
}
|
|
187
|
+
.kb-review-item.is-done .kb-review-item-title { color: var(--token-text-faint); }
|
|
188
|
+
.kb-review-item-title {
|
|
189
|
+
min-width: 0;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
text-overflow: ellipsis;
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
}
|
|
194
|
+
.kb-review-item-kind {
|
|
195
|
+
font-size: 10.5px;
|
|
196
|
+
line-height: 1;
|
|
197
|
+
color: var(--token-text-faint);
|
|
198
|
+
border: 1px solid var(--token-line-soft);
|
|
199
|
+
border-radius: 999px;
|
|
200
|
+
padding: 2px 6px;
|
|
201
|
+
white-space: nowrap;
|
|
202
|
+
}
|
|
203
|
+
.kb-review-item-assignee { font-size: 11px; color: var(--token-text-faint); white-space: nowrap; }
|
|
204
|
+
|
|
205
|
+
/* 右:审查卡(全键盘流挂载点) */
|
|
206
|
+
.kb-review-card {
|
|
207
|
+
position: relative;
|
|
208
|
+
display: flex;
|
|
209
|
+
flex-direction: column;
|
|
210
|
+
gap: 12px;
|
|
211
|
+
padding: 14px;
|
|
212
|
+
border: 1px solid var(--token-line-soft);
|
|
213
|
+
border-radius: var(--radius-md, 8px);
|
|
214
|
+
background: var(--token-surface, var(--token-bg));
|
|
215
|
+
}
|
|
216
|
+
.kb-review-card:focus-visible { outline: 2px solid var(--token-accent); outline-offset: -2px; }
|
|
217
|
+
.kb-review-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
218
|
+
.kb-review-card-kind {
|
|
219
|
+
font-size: 10.5px;
|
|
220
|
+
line-height: 1;
|
|
221
|
+
color: var(--token-text-faint);
|
|
222
|
+
border: 1px solid var(--token-line-soft);
|
|
223
|
+
border-radius: 999px;
|
|
224
|
+
padding: 2.5px 7px;
|
|
225
|
+
white-space: nowrap;
|
|
226
|
+
}
|
|
227
|
+
.kb-review-card-title {
|
|
228
|
+
flex: 1 1 auto;
|
|
229
|
+
min-width: 0;
|
|
230
|
+
overflow: hidden;
|
|
231
|
+
text-overflow: ellipsis;
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
font-size: 13px;
|
|
234
|
+
font-weight: 600;
|
|
235
|
+
color: var(--token-text);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* rubric 行:categorical chips / numeric 滑杆 */
|
|
239
|
+
.kb-review-rubrics { display: flex; flex-direction: column; gap: 10px; }
|
|
240
|
+
.kb-review-rubric {
|
|
241
|
+
display: flex;
|
|
242
|
+
flex-direction: column;
|
|
243
|
+
gap: 6px;
|
|
244
|
+
padding: 8px 10px;
|
|
245
|
+
background: var(--token-bg-soft);
|
|
246
|
+
border-radius: var(--radius-sm, 6px);
|
|
247
|
+
}
|
|
248
|
+
.kb-review-rubric-name { font-size: 12.5px; font-weight: 500; color: var(--token-text); }
|
|
249
|
+
.kb-review-rubric-desc { font-size: 11.5px; font-weight: 400; color: var(--token-text-faint); margin-left: 6px; }
|
|
250
|
+
|
|
251
|
+
.kb-review-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
252
|
+
.kb-review-chip {
|
|
253
|
+
display: inline-flex;
|
|
254
|
+
align-items: center;
|
|
255
|
+
gap: 6px;
|
|
256
|
+
font: inherit;
|
|
257
|
+
font-size: 12px;
|
|
258
|
+
color: var(--token-text-muted);
|
|
259
|
+
background: var(--token-bg);
|
|
260
|
+
border: 1px solid var(--token-line-soft);
|
|
261
|
+
border-radius: 999px;
|
|
262
|
+
padding: 3px 10px;
|
|
263
|
+
cursor: pointer;
|
|
264
|
+
}
|
|
265
|
+
.kb-review-chip:hover { border-color: var(--token-line); color: var(--token-text); }
|
|
266
|
+
.kb-review-chip:focus-visible { outline: 2px solid var(--token-accent); outline-offset: 1px; }
|
|
267
|
+
.kb-review-chip.is-on {
|
|
268
|
+
color: var(--token-accent);
|
|
269
|
+
border-color: color-mix(in srgb, var(--token-accent) 50%, transparent);
|
|
270
|
+
background: var(--token-accent-subtle, transparent);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.kb-review-slider-row { display: flex; align-items: center; gap: 10px; }
|
|
274
|
+
.kb-review-slider { flex: 1 1 auto; accent-color: var(--token-accent); }
|
|
275
|
+
.kb-review-slider-value { min-width: 34px; text-align: right; }
|
|
276
|
+
|
|
277
|
+
/* 底部:唯一的 accent 级主行动(一屏一个主行动纪律) */
|
|
278
|
+
.kb-review-foot { display: flex; align-items: center; gap: 10px; }
|
|
279
|
+
.kb-review-submit {
|
|
280
|
+
display: inline-flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
gap: 8px;
|
|
283
|
+
font: inherit;
|
|
284
|
+
font-size: 12.5px;
|
|
285
|
+
color: var(--token-on-accent, #fff);
|
|
286
|
+
background: var(--token-accent);
|
|
287
|
+
border: none;
|
|
288
|
+
border-radius: var(--radius-sm, 6px);
|
|
289
|
+
padding: 6px 14px;
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
}
|
|
292
|
+
.kb-review-submit:hover { background: var(--token-accent-deep, var(--token-accent)); }
|
|
293
|
+
.kb-review-submit:focus-visible { outline: 2px solid var(--token-accent); outline-offset: 2px; }
|
|
294
|
+
.kb-review-hint { font-size: 11.5px; color: var(--token-text-faint); }
|
|
295
|
+
|
|
296
|
+
/* 快捷键小浮层(? 切换;复用 .kb-key 键位帽) */
|
|
297
|
+
.kb-review-keys {
|
|
298
|
+
position: absolute;
|
|
299
|
+
top: 8px;
|
|
300
|
+
right: 8px;
|
|
301
|
+
z-index: 2;
|
|
302
|
+
display: flex;
|
|
303
|
+
flex-direction: column;
|
|
304
|
+
gap: 6px;
|
|
305
|
+
padding: 10px 12px;
|
|
306
|
+
min-width: 208px;
|
|
307
|
+
background: var(--token-surface, var(--token-bg));
|
|
308
|
+
border: 1px solid var(--token-line-soft);
|
|
309
|
+
border-radius: var(--radius-md, 8px);
|
|
310
|
+
box-shadow: var(--token-shadow-elevated, none);
|
|
311
|
+
}
|
|
312
|
+
.kb-review-keys-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--token-text-muted); }
|
|
313
|
+
.kb-review-keys-row .kb-key { flex: 0 0 auto; }
|
|
314
|
+
|
|
315
|
+
/* ═══════════════ kb-gap:无答案分析 ═══════════════ */
|
|
316
|
+
|
|
317
|
+
.kb-gap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
|
|
318
|
+
|
|
319
|
+
/* 迷你趋势:纯 div/i 柱(高度行内 %;不依赖 charts) */
|
|
320
|
+
.kb-gap-trend {
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: flex-end;
|
|
323
|
+
gap: 4px;
|
|
324
|
+
height: 40px;
|
|
325
|
+
padding: 2px 2px 0;
|
|
326
|
+
}
|
|
327
|
+
.kb-gap-bar {
|
|
328
|
+
flex: 1 1 0;
|
|
329
|
+
min-width: 4px;
|
|
330
|
+
max-width: 28px;
|
|
331
|
+
background: var(--token-line);
|
|
332
|
+
border-radius: 2px 2px 0 0;
|
|
333
|
+
align-self: flex-end;
|
|
334
|
+
}
|
|
335
|
+
.kb-gap-bar:hover { background: var(--token-accent); }
|
|
336
|
+
|
|
337
|
+
/* 表:query(mono)| 次数 | 占比 | 零点击率 | 最近出现 | 行动钮 */
|
|
338
|
+
.kb-gap-table { display: flex; flex-direction: column; min-width: 0; }
|
|
339
|
+
.kb-gap-row {
|
|
340
|
+
display: grid;
|
|
341
|
+
grid-template-columns: minmax(180px, 1fr) 56px 64px 72px 96px auto;
|
|
342
|
+
align-items: center;
|
|
343
|
+
gap: 10px;
|
|
344
|
+
min-height: 32px;
|
|
345
|
+
padding: 3px 8px;
|
|
346
|
+
border-bottom: 1px solid var(--token-line-soft);
|
|
347
|
+
}
|
|
348
|
+
.kb-gap-row:last-child { border-bottom: none; }
|
|
349
|
+
.kb-gap-row--head {
|
|
350
|
+
min-height: 28px;
|
|
351
|
+
font-size: 11px;
|
|
352
|
+
color: var(--token-text-faint);
|
|
353
|
+
border-bottom: 1px solid var(--token-line);
|
|
354
|
+
}
|
|
355
|
+
.kb-gap-query {
|
|
356
|
+
font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
357
|
+
font-size: 12px;
|
|
358
|
+
color: var(--token-text);
|
|
359
|
+
overflow: hidden;
|
|
360
|
+
text-overflow: ellipsis;
|
|
361
|
+
white-space: nowrap;
|
|
362
|
+
}
|
|
363
|
+
.kb-gap-num { text-align: right; }
|
|
364
|
+
.kb-gap-head-zero { white-space: nowrap; }
|
|
365
|
+
/* 口径注释:「零点击 ≠ 失败」(小字 + title tooltip;不上告警色) */
|
|
366
|
+
.kb-gap-note {
|
|
367
|
+
margin-left: 6px;
|
|
368
|
+
font-size: 10.5px;
|
|
369
|
+
color: var(--token-text-faint);
|
|
370
|
+
border-bottom: 1px dashed var(--token-line-soft);
|
|
371
|
+
cursor: help;
|
|
372
|
+
}
|
|
373
|
+
.kb-gap-lastseen { font-size: 11.5px; color: var(--token-text-faint); text-align: right; white-space: nowrap; }
|
|
374
|
+
.kb-gap-actions { display: inline-flex; gap: 6px; justify-self: end; }
|
|
375
|
+
.kb-gap-action {
|
|
376
|
+
font: inherit;
|
|
377
|
+
font-size: 11.5px;
|
|
378
|
+
color: var(--token-text-muted);
|
|
379
|
+
background: none;
|
|
380
|
+
border: 1px solid var(--token-line-soft);
|
|
381
|
+
border-radius: var(--radius-sm, 6px);
|
|
382
|
+
padding: 2px 8px;
|
|
383
|
+
cursor: pointer;
|
|
384
|
+
white-space: nowrap;
|
|
385
|
+
}
|
|
386
|
+
.kb-gap-action:hover { color: var(--token-text); border-color: var(--token-line); }
|
|
387
|
+
.kb-gap-action:focus-visible { outline: 2px solid var(--token-accent); outline-offset: 1px; }
|
|
388
|
+
|
|
389
|
+
/* ═══════════════ kb-eval:评估对比 ═══════════════ */
|
|
390
|
+
|
|
391
|
+
.kb-eval { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
|
|
392
|
+
|
|
393
|
+
.kb-eval-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--token-text-faint); }
|
|
394
|
+
.kb-eval-run {
|
|
395
|
+
font: inherit;
|
|
396
|
+
font-size: 12px;
|
|
397
|
+
color: var(--token-text);
|
|
398
|
+
background: var(--token-bg-soft);
|
|
399
|
+
border: 1px solid var(--token-line-soft);
|
|
400
|
+
border-radius: var(--radius-sm, 6px);
|
|
401
|
+
padding: 2px 8px;
|
|
402
|
+
max-width: 220px;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/* Summary 判级行(告警才上色:improvement 绿 / regression 红 / tradeoff 警示 / tie 中性) */
|
|
406
|
+
.kb-eval-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--token-text-muted); }
|
|
407
|
+
.kb-eval-grade {
|
|
408
|
+
display: inline-flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: 6px;
|
|
411
|
+
font-size: 11.5px;
|
|
412
|
+
border: 1px solid var(--token-line-soft);
|
|
413
|
+
border-radius: 999px;
|
|
414
|
+
padding: 2.5px 9px;
|
|
415
|
+
color: var(--token-text-faint);
|
|
416
|
+
}
|
|
417
|
+
.kb-eval-grade.is-improvement {
|
|
418
|
+
color: var(--token-success);
|
|
419
|
+
border-color: color-mix(in srgb, var(--token-success) 45%, transparent);
|
|
420
|
+
background: color-mix(in srgb, var(--token-success) 8%, transparent);
|
|
421
|
+
}
|
|
422
|
+
.kb-eval-grade.is-regression {
|
|
423
|
+
color: var(--token-danger, var(--token-error));
|
|
424
|
+
border-color: color-mix(in srgb, var(--token-danger, var(--token-error)) 45%, transparent);
|
|
425
|
+
background: color-mix(in srgb, var(--token-danger, var(--token-error)) 8%, transparent);
|
|
426
|
+
}
|
|
427
|
+
.kb-eval-grade.is-tradeoff {
|
|
428
|
+
color: var(--token-warning);
|
|
429
|
+
border-color: color-mix(in srgb, var(--token-warning) 45%, transparent);
|
|
430
|
+
background: var(--token-warning-muted, transparent);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.kb-eval-filter {
|
|
434
|
+
font: inherit;
|
|
435
|
+
font-size: 11.5px;
|
|
436
|
+
color: var(--token-text-muted);
|
|
437
|
+
background: none;
|
|
438
|
+
border: 1px solid var(--token-line-soft);
|
|
439
|
+
border-radius: 999px;
|
|
440
|
+
padding: 2px 10px;
|
|
441
|
+
cursor: pointer;
|
|
442
|
+
white-space: nowrap;
|
|
443
|
+
}
|
|
444
|
+
.kb-eval-filter:hover { color: var(--token-text); border-color: var(--token-line); }
|
|
445
|
+
.kb-eval-filter:focus-visible { outline: 2px solid var(--token-accent); outline-offset: 1px; }
|
|
446
|
+
.kb-eval-filter.is-on {
|
|
447
|
+
color: var(--token-accent);
|
|
448
|
+
border-color: color-mix(in srgb, var(--token-accent) 50%, transparent);
|
|
449
|
+
background: var(--token-accent-subtle, transparent);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/* 结果表:横向滚动容器 + 行内 grid 模板(列由 JS 按指标数生成) */
|
|
453
|
+
.kb-eval-tablewrap { overflow-x: auto; }
|
|
454
|
+
.kb-eval-table { display: flex; flex-direction: column; min-width: max-content; }
|
|
455
|
+
.kb-eval-grid {
|
|
456
|
+
display: grid;
|
|
457
|
+
align-items: center;
|
|
458
|
+
gap: 0;
|
|
459
|
+
}
|
|
460
|
+
.kb-eval-grid--head { border-bottom: 1px solid var(--token-line); }
|
|
461
|
+
.kb-eval-h {
|
|
462
|
+
font-size: 11px;
|
|
463
|
+
color: var(--token-text-faint);
|
|
464
|
+
padding: 4px 8px;
|
|
465
|
+
white-space: nowrap;
|
|
466
|
+
overflow: hidden;
|
|
467
|
+
text-overflow: ellipsis;
|
|
468
|
+
}
|
|
469
|
+
.kb-eval-h--group { text-align: center; border-left: 1px solid var(--token-line-soft); }
|
|
470
|
+
.kb-eval-h--sub { text-align: right; border-left: 1px solid var(--token-line-soft); }
|
|
471
|
+
|
|
472
|
+
.kb-eval-rowline { border-bottom: 1px solid var(--token-line-soft); cursor: pointer; }
|
|
473
|
+
.kb-eval-rowline:hover { background: var(--token-bg-soft); }
|
|
474
|
+
.kb-eval-rowline:focus-visible { outline: 2px solid var(--token-accent); outline-offset: -2px; }
|
|
475
|
+
.kb-eval-item:last-child .kb-eval-rowline { border-bottom: none; }
|
|
476
|
+
|
|
477
|
+
.kb-eval-cell {
|
|
478
|
+
min-width: 0;
|
|
479
|
+
padding: 4px 8px;
|
|
480
|
+
font-size: 12px;
|
|
481
|
+
color: var(--token-text-muted);
|
|
482
|
+
overflow: hidden;
|
|
483
|
+
text-overflow: ellipsis;
|
|
484
|
+
white-space: nowrap;
|
|
485
|
+
}
|
|
486
|
+
.kb-eval-cell--input { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
487
|
+
.kb-eval-key {
|
|
488
|
+
font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
489
|
+
font-size: 10.5px;
|
|
490
|
+
color: var(--token-text-faint);
|
|
491
|
+
overflow: hidden;
|
|
492
|
+
text-overflow: ellipsis;
|
|
493
|
+
}
|
|
494
|
+
.kb-eval-num { text-align: right; padding: 4px 8px; }
|
|
495
|
+
/* delta 列:宽 64 右对齐;is-up 绿 / is-down 红 */
|
|
496
|
+
.kb-eval-delta { min-width: 64px; }
|
|
497
|
+
.kb-eval-delta.is-up { color: var(--token-success); }
|
|
498
|
+
.kb-eval-delta.is-down { color: var(--token-danger, var(--token-error)); }
|
|
499
|
+
|
|
500
|
+
/* 展开体:双栏对照 + 字符级 diff(A 独有红 / B 独有绿,color-mix 底色) */
|
|
501
|
+
.kb-eval-detail {
|
|
502
|
+
display: grid;
|
|
503
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
504
|
+
gap: 10px;
|
|
505
|
+
padding: 10px 8px;
|
|
506
|
+
background: var(--token-bg-soft);
|
|
507
|
+
border-radius: var(--radius-sm, 6px);
|
|
508
|
+
}
|
|
509
|
+
.kb-eval-detail-col { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
|
|
510
|
+
.kb-eval-detail-label { font-size: 11px; color: var(--token-text-faint); }
|
|
511
|
+
.kb-eval-detail-pre {
|
|
512
|
+
margin: 0;
|
|
513
|
+
font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
514
|
+
font-size: 12px;
|
|
515
|
+
line-height: 1.6;
|
|
516
|
+
white-space: pre-wrap;
|
|
517
|
+
word-break: break-word;
|
|
518
|
+
color: var(--token-text-muted);
|
|
519
|
+
}
|
|
520
|
+
.kb-eval-detail-expected { grid-column: 1 / -1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
|
|
521
|
+
.kb-eval-diff-del {
|
|
522
|
+
background: color-mix(in srgb, var(--token-danger, var(--token-error)) 14%, transparent);
|
|
523
|
+
color: var(--token-danger, var(--token-error));
|
|
524
|
+
border-radius: 2px;
|
|
525
|
+
}
|
|
526
|
+
.kb-eval-diff-ins {
|
|
527
|
+
background: color-mix(in srgb, var(--token-success) 14%, transparent);
|
|
528
|
+
color: var(--token-success);
|
|
529
|
+
border-radius: 2px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* ═══════════════ hidden 属性优先(本文件的 display 声明不得击穿 [hidden]) ═══════════════ */
|
|
533
|
+
|
|
534
|
+
.kb-span[hidden],
|
|
535
|
+
.kb-trace-body[hidden],
|
|
536
|
+
.kb-review-keys[hidden],
|
|
537
|
+
.kb-eval-detail[hidden],
|
|
538
|
+
.kb-eval-item[hidden],
|
|
539
|
+
.kb-gap-row[hidden] { display: none; }
|
|
540
|
+
|
|
541
|
+
/* ═══════════════ 动效退化(reduced-motion:瞬时) ═══════════════ */
|
|
542
|
+
|
|
543
|
+
@media (prefers-reduced-motion: reduce) {
|
|
544
|
+
.kb-span-caret,
|
|
545
|
+
.kb-span-bar,
|
|
546
|
+
.kb-gap-bar { transition: none; }
|
|
547
|
+
.kb-span.is-running .kb-span-bar { animation: none; }
|
|
548
|
+
}
|