fix(ui): active session title uses var(--gold) instead of hardcoded #e8a030 (fixes #440)
This commit is contained in:
committed by
Hermes Agent
parent
2400e14a31
commit
3776b09f4a
@@ -172,7 +172,7 @@
|
|||||||
.session-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;overflow:hidden;}
|
.session-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;overflow:hidden;}
|
||||||
.session-title-row{display:flex;align-items:flex-start;gap:8px;min-width:0;}
|
.session-title-row{display:flex;align-items:flex-start;gap:8px;min-width:0;}
|
||||||
.session-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text);}
|
.session-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text);}
|
||||||
.session-item.active .session-title{color:#e8a030;}
|
.session-item.active .session-title{color:var(--gold);}
|
||||||
.session-time{display:none;}
|
.session-time{display:none;}
|
||||||
.session-meta{font-size:11px;line-height:1.35;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
.session-meta{font-size:11px;line-height:1.35;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
/* ── Session action trigger + dropdown ── */
|
/* ── Session action trigger + dropdown ── */
|
||||||
|
|||||||
51
tests/test_sprint40_ui_polish.py
Normal file
51
tests/test_sprint40_ui_polish.py
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
"""
|
||||||
|
Sprint 40 UI Polish Tests: Active session title uses CSS theme variable (issue #440).
|
||||||
|
|
||||||
|
Covers:
|
||||||
|
- .session-item.active .session-title uses var(--gold) instead of hardcoded #e8a030
|
||||||
|
- The hardcoded amber color #e8a030 is NOT present in the active session title rule
|
||||||
|
"""
|
||||||
|
import pathlib
|
||||||
|
import re
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
REPO_ROOT = pathlib.Path(__file__).parent.parent
|
||||||
|
STYLE_CSS = (REPO_ROOT / "static" / "style.css").read_text()
|
||||||
|
|
||||||
|
|
||||||
|
class TestActiveSessionTitleThemeColor(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_active_session_title_uses_theme_variable(self):
|
||||||
|
"""
|
||||||
|
.session-item.active .session-title must use var(--gold) not a hardcoded hex.
|
||||||
|
The light-theme override line (data-theme="light") is allowed to keep its own
|
||||||
|
hardcoded color; we only check the base/dark rule.
|
||||||
|
"""
|
||||||
|
# Find all lines that match the active session title selector
|
||||||
|
lines = STYLE_CSS.splitlines()
|
||||||
|
base_rule_lines = [
|
||||||
|
line for line in lines
|
||||||
|
if ".session-item.active .session-title" in line
|
||||||
|
and 'data-theme="light"' not in line
|
||||||
|
]
|
||||||
|
|
||||||
|
self.assertTrue(
|
||||||
|
len(base_rule_lines) >= 1,
|
||||||
|
"Could not find .session-item.active .session-title base rule in style.css"
|
||||||
|
)
|
||||||
|
|
||||||
|
for line in base_rule_lines:
|
||||||
|
self.assertIn(
|
||||||
|
"var(--gold)",
|
||||||
|
line,
|
||||||
|
f"Expected var(--gold) in active session title rule, got: {line.strip()}"
|
||||||
|
)
|
||||||
|
self.assertNotIn(
|
||||||
|
"#e8a030",
|
||||||
|
line,
|
||||||
|
f"Hardcoded #e8a030 must be removed from active session title rule: {line.strip()}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
Reference in New Issue
Block a user