kalamishere commited on
Commit
4e4df63
·
1 Parent(s): 53ecf26

Variant title bars: mint fill on the meter, muted track behind

Browse files
Files changed (2) hide show
  1. app.py +7 -2
  2. theme.py +5 -1
app.py CHANGED
@@ -1194,13 +1194,18 @@ def _variants_prompt_card_html(prompt_text: str) -> str:
1194
 
1195
 
1196
  def _bars(v: int) -> str:
1197
- """Map a 0–100 score to a 4-block bar string. Quartiles at 12/38/63/88."""
 
 
 
 
 
1198
  if v >= 88: n = 4
1199
  elif v >= 63: n = 3
1200
  elif v >= 38: n = 2
1201
  elif v >= 12: n = 1
1202
  else: n = 0
1203
- return "▮" * n + "▯" * (4 - n)
1204
 
1205
 
1206
  def _variant_title_html(idx: int, breakdown: dict | None) -> str:
 
1194
 
1195
 
1196
  def _bars(v: int) -> str:
1197
+ """Map a 0–100 score to a 4-block bar HTML string. Quartiles at 12/38/63/88.
1198
+
1199
+ Returns inline HTML with a `.fill` span on the filled portion so the
1200
+ measured axis (mint) reads as colour-coded fill against the muted
1201
+ `▯` track behind it — that's the metering colour the variant titles
1202
+ rely on for at-a-glance match strength."""
1203
  if v >= 88: n = 4
1204
  elif v >= 63: n = 3
1205
  elif v >= 38: n = 2
1206
  elif v >= 12: n = 1
1207
  else: n = 0
1208
+ return f'<span class="fill">{"▮" * n}</span>{"▯" * (4 - n)}'
1209
 
1210
 
1211
  def _variant_title_html(idx: int, breakdown: dict | None) -> str:
theme.py CHANGED
@@ -432,12 +432,16 @@ h3 { font-size: 13px; color: #C9CDD4; }
432
  font-family: 'JetBrains Mono', monospace;
433
  font-size: 10px;
434
  line-height: 1.2;
435
- color: #C9CDD4;
436
  text-align: left;
437
  flex: 1;
438
  overflow: hidden;
439
  text-overflow: ellipsis;
440
  }
 
 
 
 
441
  .dc-variant-title .bars.placeholder {
442
  color: #3A3F47; /* faded — pre-regen state */
443
  }
 
432
  font-family: 'JetBrains Mono', monospace;
433
  font-size: 10px;
434
  line-height: 1.2;
435
+ color: #5E6671; /* track behind the meter — muted grey */
436
  text-align: left;
437
  flex: 1;
438
  overflow: hidden;
439
  text-overflow: ellipsis;
440
  }
441
+ .dc-variant-title .bars .fill {
442
+ color: #5BE0C8; /* mint — measured axis, the metering colour */
443
+ font-weight: 600;
444
+ }
445
  .dc-variant-title .bars.placeholder {
446
  color: #3A3F47; /* faded — pre-regen state */
447
  }