File size: 7,065 Bytes
494c9e4
 
 
 
 
 
1f66b27
 
17037b0
1f66b27
17037b0
1f66b27
042658f
 
 
 
 
494c9e4
1f66b27
312e591
 
 
 
 
b704fe2
 
1f66b27
494c9e4
 
b925659
1f66b27
 
 
 
b925659
 
 
494c9e4
 
1f66b27
494c9e4
 
 
 
1f66b27
17037b0
 
 
 
1f66b27
17037b0
 
 
 
 
 
 
 
 
 
1f66b27
17037b0
1f66b27
17037b0
494c9e4
17037b0
 
494c9e4
 
 
 
 
 
 
2764e14
 
312e591
 
17037b0
2764e14
 
1f66b27
17037b0
494c9e4
17037b0
494c9e4
 
 
 
2764e14
 
 
 
312e591
 
 
 
 
494c9e4
 
 
b925659
1f66b27
 
b925659
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494c9e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
966d483
 
 
 
 
 
 
494c9e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
// 语义分析相关样式(section、查询输入、历史下拉、loader)

@use "loaders";
@use "query-history-dropdown" as qh;
@use "lmf-readout" as lmf;

// 选项行:语义区、Chat、归因等复用
.options-row {
  // 1lh(控件 line-height)+ 上下 padding(3px×2) + 边框(1px×2)
  --options-control-block-size: calc(1lh + 6px + 2px);

  // 仅非 hidden 时设 flex,否则会覆盖浏览器对 [hidden] 的 display:none(同 .options-group)
  &:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .options-group {
    // 仅非 hidden 时设 flex,否则会覆盖浏览器对 [hidden] 的 display:none(同 gen-attr-dag-replay-value-wrap)
    &:not([hidden]) {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    &.options-group-right {
      margin-left: auto;
    }

    // 组内「主控」标签/下拉:比默认更醒目(仅直接子级,避免加粗单位后缀等嵌套 label)
    &.options-group--emphasis {
      > .options-label,
      > .options-select {
        font-weight: 700;
      }
    }
  }

  .options-label {
    font-size: 9pt;
    color: var(--text-muted);
  }

  label.options-label:has(> input[type='checkbox']):not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    min-block-size: var(--options-control-block-size);
    cursor: pointer;
    user-select: none;
  }

  input[type='checkbox'] {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
  }

  .options-select {
    box-sizing: border-box;
    block-size: var(--options-control-block-size);
    padding: 3px 6px;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.2;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
    min-width: 100px;
  }

  // Max new tokens(completion-options-row partial);须在 semantic-analysis 中定义——Chat 不加载 causal_flow.scss
  .semantic-threshold-input,
  .gen-attr-max-tokens-input,
  .gen-attr-dag-measure-width-input {
    box-sizing: border-box;
    flex: 0 0 auto;
    min-width: 0;
    block-size: var(--options-control-block-size);
    padding: 3px 6px;
    font-size: inherit;
    line-height: 1.2;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
    text-align: right;
    inline-size: 4rem;
    max-inline-size: 100%;
    width: 4em;

    &:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
  }
}

// Analyze 下方 Semantic Query 总开关:与 gen_attribute「Raw prompt mode」同款(未勾选整行灰色,勾选正文色)
.textarea-wrapper .options-row.semantic-analysis-enable-row {
  label.options-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary, var(--text-color));

    &:has(> input[type='checkbox']:not(:checked)) {
      color: var(--text-muted);
    }
  }

  input[type='checkbox'] {
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
  }
}

// 语义分析区(在 button-group 与 histogram 之间,仅在 semantic_analysis 模式下显示)
.semantic-analysis-section {
  margin-top: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-color);

  .semantic-index-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;

    .semantic-index-model {
      flex: 1 1 auto;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 8pt;
      color: var(--text-muted);
      min-width: 150px;
      min-height: 32px;
      text-align: center;
    }

    .semantic-index-model.is-hidden {
      visibility: hidden;
      opacity: 0;
    }
  }

  .semantic-analysis-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;

    .semantic-search-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .semantic-search-actions {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      min-width: 0;  // 允许内部长文案在 wrap 时换行,而非撑破父级后裁切
    }

    .semantic-match-degree {
      font-size: 9pt;
      color: var(--text-muted, #666);
      white-space: nowrap;
      flex-shrink: 0;  // 参与布局,且不被 flex 挤没

      :root[data-theme="dark"] & {
        color: var(--text-muted, #999);
      }
    }

    // flex-grow: 0 — 输入区宽度不随右侧(匹配度/Stop·Search 切换)变化,Search 按钮相对行首位置固定
    .semantic-search-input-wrapper {
      flex: 0 1 300px;
      min-width: 100px;
      max-width: 300px;
      position: relative;
    }

    .semantic-search-input {
      width: 100%;
      box-sizing: border-box;
      padding: 6px 28px 6px 10px;
      font-family: inherit;
      border: 1px solid var(--input-border);
      border-radius: 4px;
      background: var(--input-bg);
      color: var(--text-color);

      // 搜索中 readOnly:不显示编辑光标、不可点入
      &:read-only {
        caret-color: transparent;
        cursor: default;
        pointer-events: none;
      }
    }

    .semantic-search-clear {
      position: absolute;
      right: 6px;
      top: 50%;
      transform: translateY(-50%);
      width: 16px;
      height: 16px;
      padding: 0;
      outline: none;
      display: none;
      align-items: center;
      justify-content: center;

      &.is-visible { display: flex; }
    }

    .semantic-search-history-dropdown {
      @include qh.query-history-dropdown;
    }
  }
}

// 语义索引 loader:与 loadersmall 同风格,独立控制(不受 isGlobalLoading 影响)
.semantic-index-loader {
  @extend .loadersmall;
}

// 语义搜索 loader:与 semantic-index-loader 同风格
.semantic-search-loader {
  @extend .loadersmall;
}

// 语义分析 debug 信息(文本渲染区下方,仅在有 debug 数据时显示)
.semantic-debug-info {
  margin-top: 8px;
  padding: 8px;
  font-size: 9pt;
  color: var(--text-muted, #666);
  border-top: 1px solid var(--border-color);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;  // 允许在 flex 中收缩
  max-width: 100%;
  box-sizing: border-box;

  .semantic-debug-abbrev pre {
    margin: 0 0 6px 0;
    font-size: inherit;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  // TopK 图表:与 tooltip 一致,宽度更大,与上方打印区留间隔
  .semantic-debug-topk-chart {
    margin-top: 20px;
  }
}

// 语义分析阶段级进度:参与 flex 布局,占据实际宽度,避免绝对定位溢出被裁切/遮挡
.semantic-progress {
  display: none;
  font-size: 9pt;
  color: var(--text-muted, #666);
  white-space: nowrap;
  line-height: 1.2;
  flex-shrink: 0;

  :root[data-theme="dark"] & {
    color: var(--text-muted, #999);
  }
}