fix: nav group label alignment + impact badge bubble dots
Browse filesReplace HIGH/MED/LOW text on impact badge with filled dot indicators
(βββ / βββ / βββ) to avoid confusion with source reliability labels.
Fix sidebar nav group headers misaligned with radio circles by switching
::before from display:block to flex:0 0 100% with flex-wrap on parent.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- dashboard/components.py +15 -13
- dashboard/theme.py +10 -3
dashboard/components.py
CHANGED
|
@@ -7,9 +7,6 @@ from dashboard.theme import (
|
|
| 7 |
WARN_BG, WARN_BORDER,
|
| 8 |
BULL_BG, BULL_BORDER, BEAR_BG, BEAR_BORDER,
|
| 9 |
PURPLE, AI_BG, AI_BORDER, AI_COLOR, AI_BADGE_BG,
|
| 10 |
-
IMPACT_HIGH_BG, IMPACT_HIGH_TEXT,
|
| 11 |
-
IMPACT_MED_BG, IMPACT_MED_TEXT,
|
| 12 |
-
IMPACT_LOW_BG, IMPACT_LOW_TEXT, IMPACT_LOW_BORDER,
|
| 13 |
RADIUS_CHIP,
|
| 14 |
)
|
| 15 |
|
|
@@ -26,21 +23,26 @@ def reliability_badge(r: str) -> str:
|
|
| 26 |
|
| 27 |
# ββ Impact badge βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 28 |
|
| 29 |
-
|
| 30 |
-
"HIGH": (
|
| 31 |
-
"MEDIUM": (
|
| 32 |
-
"LOW": (
|
| 33 |
}
|
| 34 |
|
| 35 |
def impact_badge(level: str) -> str:
|
| 36 |
-
|
| 37 |
-
if not
|
| 38 |
return ""
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
return (
|
| 41 |
-
f'<span title="Impact: {level}" style="
|
| 42 |
-
f'border:1px solid
|
| 43 |
-
f'font-size:0.
|
|
|
|
| 44 |
)
|
| 45 |
|
| 46 |
|
|
|
|
| 7 |
WARN_BG, WARN_BORDER,
|
| 8 |
BULL_BG, BULL_BORDER, BEAR_BG, BEAR_BORDER,
|
| 9 |
PURPLE, AI_BG, AI_BORDER, AI_COLOR, AI_BADGE_BG,
|
|
|
|
|
|
|
|
|
|
| 10 |
RADIUS_CHIP,
|
| 11 |
)
|
| 12 |
|
|
|
|
| 23 |
|
| 24 |
# ββ Impact badge βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 25 |
|
| 26 |
+
_IMPACT_DOT_COLORS = {
|
| 27 |
+
"HIGH": ("#0f172a", 3),
|
| 28 |
+
"MEDIUM": ("#64748b", 2),
|
| 29 |
+
"LOW": ("#94a3b8", 1),
|
| 30 |
}
|
| 31 |
|
| 32 |
def impact_badge(level: str) -> str:
|
| 33 |
+
spec = _IMPACT_DOT_COLORS.get(level)
|
| 34 |
+
if not spec:
|
| 35 |
return ""
|
| 36 |
+
color, filled = spec
|
| 37 |
+
dots = "".join(
|
| 38 |
+
f'<span style="color:{color if i < filled else "#d1d5db"};font-size:0.55rem;line-height:1;">β</span>'
|
| 39 |
+
for i in range(3)
|
| 40 |
+
)
|
| 41 |
return (
|
| 42 |
+
f'<span title="Impact: {level}" style="display:inline-flex;align-items:center;gap:3px;'
|
| 43 |
+
f'background:#f8fafc;border:1px solid #e2e8f0;border-radius:4px;padding:1px 7px;">'
|
| 44 |
+
f'<span style="font-size:0.6rem;font-weight:600;color:#64748b;letter-spacing:0.05em;">impact</span>'
|
| 45 |
+
f'{dots}</span>'
|
| 46 |
)
|
| 47 |
|
| 48 |
|
dashboard/theme.py
CHANGED
|
@@ -258,10 +258,17 @@ def inject_global_css() -> None:
|
|
| 258 |
}
|
| 259 |
|
| 260 |
/* ββ Sidebar nav group separators ββββββββββββββββββββββββββββββββββββ */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
/* Before Verdict (1st item) β "BRIEF" group label */
|
| 262 |
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(1)::before {
|
| 263 |
content: "BRIEF";
|
| 264 |
-
|
| 265 |
font-size: 0.55rem !important;
|
| 266 |
font-weight: 700 !important;
|
| 267 |
text-transform: uppercase;
|
|
@@ -276,7 +283,7 @@ def inject_global_css() -> None:
|
|
| 276 |
}
|
| 277 |
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(3)::before {
|
| 278 |
content: "DEEP DIVE";
|
| 279 |
-
|
| 280 |
font-size: 0.55rem !important;
|
| 281 |
font-weight: 700 !important;
|
| 282 |
text-transform: uppercase;
|
|
@@ -291,7 +298,7 @@ def inject_global_css() -> None:
|
|
| 291 |
}
|
| 292 |
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(6)::before {
|
| 293 |
content: "FORWARD";
|
| 294 |
-
|
| 295 |
font-size: 0.55rem !important;
|
| 296 |
font-weight: 700 !important;
|
| 297 |
text-transform: uppercase;
|
|
|
|
| 258 |
}
|
| 259 |
|
| 260 |
/* ββ Sidebar nav group separators ββββββββββββββββββββββββββββββββββββ */
|
| 261 |
+
/* Labels with group headers need flex-wrap so ::before spans full row */
|
| 262 |
+
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(1),
|
| 263 |
+
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(3),
|
| 264 |
+
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(6) {
|
| 265 |
+
flex-wrap: wrap !important;
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
/* Before Verdict (1st item) β "BRIEF" group label */
|
| 269 |
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(1)::before {
|
| 270 |
content: "BRIEF";
|
| 271 |
+
flex: 0 0 100%;
|
| 272 |
font-size: 0.55rem !important;
|
| 273 |
font-weight: 700 !important;
|
| 274 |
text-transform: uppercase;
|
|
|
|
| 283 |
}
|
| 284 |
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(3)::before {
|
| 285 |
content: "DEEP DIVE";
|
| 286 |
+
flex: 0 0 100%;
|
| 287 |
font-size: 0.55rem !important;
|
| 288 |
font-weight: 700 !important;
|
| 289 |
text-transform: uppercase;
|
|
|
|
| 298 |
}
|
| 299 |
[data-testid="stSidebar"] [data-testid="stRadio"] label:nth-child(6)::before {
|
| 300 |
content: "FORWARD";
|
| 301 |
+
flex: 0 0 100%;
|
| 302 |
font-size: 0.55rem !important;
|
| 303 |
font-weight: 700 !important;
|
| 304 |
text-transform: uppercase;
|