1
0

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:
Alexander Whitestone
2026-03-11 09:52:57 -04:00
committed by GitHub
parent 07f2c1b41e
commit 622a6a9204
30 changed files with 2171 additions and 2065 deletions

View File

@@ -108,95 +108,4 @@
{% endif %}
</div>
<style>
.mc-providers-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1rem;
margin-top: 1rem;
}
.mc-provider-card {
background: rgba(10, 15, 30, 0.6);
border: 1px solid var(--mc-border);
border-radius: 0.5rem;
padding: 1rem;
}
.mc-provider-card.provider-healthy {
border-left: 4px solid #28a745;
}
.mc-provider-card.provider-degraded {
border-left: 4px solid #ffc107;
}
.mc-provider-card.provider-unhealthy {
border-left: 4px solid #dc3545;
}
.provider-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.provider-header h3 {
margin: 0;
font-size: 1.1rem;
}
.provider-meta {
display: flex;
gap: 0.5rem;
margin-bottom: 0.5rem;
font-size: 0.85rem;
color: var(--mc-text-secondary);
}
.provider-circuit {
font-size: 0.85rem;
margin-bottom: 0.75rem;
padding: 0.25rem 0.5rem;
background: rgba(0,0,0,0.3);
border-radius: 0.25rem;
}
.circuit-closed { color: #28a745; }
.circuit-open { color: #dc3545; }
.circuit-half_open { color: #ffc107; }
.provider-metrics {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 0.5rem;
text-align: center;
}
.metric {
padding: 0.5rem;
background: rgba(0,0,0,0.2);
border-radius: 0.25rem;
}
.metric-value {
display: block;
font-size: 1.1rem;
font-weight: 600;
color: var(--mc-gold);
}
.metric-label {
display: block;
font-size: 0.75rem;
color: var(--mc-text-secondary);
}
.mc-alert-small {
margin-top: 0.75rem;
padding: 0.5rem;
font-size: 0.85rem;
}
</style>
{% endblock %}