polish: extract inline CSS, add connection status, panel macro, favicon, ollama cache, toast system (#164)
Major:
- Extract all inline <style> blocks from 22 Jinja2 templates into
static/css/mission-control.css — single cacheable stylesheet
- Add tox lint check that fails on inline <style> in templates
Minor:
1. Connection status indicator in topbar (green/amber/red dot) reflecting
WebSocket + Ollama reachability, with auto-reconnect
2. Jinja2 {% macro panel(title) %} in macros.html — eliminates repeated
.card.mc-panel markup; index.html converted as example
3. SVG favicon (purple T + orange dot)
4. 30-second TTL cache on _check_ollama() to avoid blocking the event loop
on every health poll (asyncio.to_thread was already in place)
5. Toast notification system (McToast.show) for transient status messages —
wired into connection status for Ollama/WebSocket state changes
Enforcement:
- CLAUDE.md updated with conventions 11-14 (no inline CSS, use panel macro,
use toasts, never block the event loop)
- tox lint + pre-push environments now fail on inline <style> blocks
https://claude.ai/code/session_014FQ785MQdyJQ4BAXrRSo9w
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
07f2c1b41e
commit
622a6a9204
6
tox.ini
6
tox.ini
@@ -4,7 +4,7 @@ no_package = true
|
||||
|
||||
# ── Base ─────────────────────────────────────────────────────────────────────
|
||||
[testenv]
|
||||
allowlist_externals = timeout, perl, docker, mkdir
|
||||
allowlist_externals = timeout, perl, docker, mkdir, bash, grep
|
||||
commands_pre = pip install -e ".[dev]" --quiet
|
||||
|
||||
setenv =
|
||||
@@ -15,7 +15,7 @@ setenv =
|
||||
# ── Lint & Format ────────────────────────────────────────────────────────────
|
||||
|
||||
[testenv:lint]
|
||||
description = Check formatting (black), import order (isort), security (bandit)
|
||||
description = Check formatting (black), import order (isort), security (bandit), no inline CSS
|
||||
commands_pre =
|
||||
deps =
|
||||
black
|
||||
@@ -25,6 +25,7 @@ commands =
|
||||
black --check --line-length 100 src/ tests/
|
||||
isort --check-only --profile black --line-length 100 src/ tests/
|
||||
bandit -r src/ -ll -s B101,B104,B307,B310,B324,B601,B608 -q
|
||||
bash -c 'files=$(grep -rl "<style" src/dashboard/templates/ --include="*.html" 2>/dev/null); if [ -n "$files" ]; then echo "ERROR: inline <style> blocks found — move CSS to static/css/mission-control.css:"; echo "$files"; exit 1; fi; echo "No inline CSS — OK"'
|
||||
|
||||
[testenv:format]
|
||||
description = Auto-format code with black + isort
|
||||
@@ -133,6 +134,7 @@ commands =
|
||||
black --check --line-length 100 src/ tests/
|
||||
isort --check-only --profile black --line-length 100 src/ tests/
|
||||
bandit -r src/ -ll -s B101,B104,B307,B310,B324,B601,B608 -q
|
||||
bash -c 'files=$(grep -rl "<style" src/dashboard/templates/ --include="*.html" 2>/dev/null); if [ -n "$files" ]; then echo "ERROR: inline <style> blocks found — move CSS to static/css/mission-control.css:"; echo "$files"; exit 1; fi; echo "No inline CSS — OK"'
|
||||
mkdir -p reports
|
||||
pytest tests/ \
|
||||
--cov=src \
|
||||
|
||||
Reference in New Issue
Block a user