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

@@ -2,148 +2,7 @@
{% block title %}{{ page_title }}{% endblock %}
{% block extra_styles %}
<style>
@media (min-width: 769px) {
.mobile-only { display: none; }
}
@media (max-width: 768px) {
.desktop-message { display: none; }
}
.mobile-only {
display: flex;
flex-direction: column;
gap: 12px;
padding-bottom: 20px;
}
.quick-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
padding: 14px;
}
.quick-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 52px;
border-radius: var(--radius-md);
font-family: var(--font);
font-size: 13px;
font-weight: 600;
letter-spacing: 0.06em;
text-decoration: none;
color: var(--text-bright);
border: 1px solid var(--border);
background: rgba(24, 10, 45, 0.6);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
-webkit-tap-highlight-color: transparent;
touch-action: manipulation;
}
.quick-btn:hover { color: var(--text-bright); text-decoration: none; }
.quick-btn:active { transform: scale(0.96); }
.quick-btn.voice {
border-color: var(--border-glow);
background: rgba(124, 58, 237, 0.15);
}
.quick-btn.voice:active {
box-shadow: 0 0 18px rgba(124, 58, 237, 0.3);
}
.mobile-chat-wrap {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.mobile-chat-log {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 14px;
max-height: 300px;
}
.mobile-chat-input {
display: flex;
gap: 8px;
padding: 10px 14px;
padding-bottom: max(10px, env(safe-area-inset-bottom));
background: rgba(24, 10, 45, 0.9);
border-top: 1px solid var(--border);
}
.mobile-chat-input input {
flex: 1;
background: rgba(8, 4, 18, 0.75);
border: 1px solid var(--border);
border-radius: var(--radius-md);
color: var(--text-bright);
font-family: var(--font);
font-size: 16px;
padding: 10px 12px;
min-height: 44px;
}
.mobile-chat-input input:focus {
outline: none;
border-color: var(--border-glow);
box-shadow: 0 0 0 1px var(--border-glow), 0 0 8px rgba(124, 58, 237, 0.2);
}
.mobile-chat-input input::placeholder { color: var(--text-dim); }
.mobile-chat-input button {
background: var(--border-glow);
border: none;
border-radius: var(--radius-md);
color: var(--text-bright);
font-family: var(--font);
font-size: 12px;
font-weight: 700;
padding: 0 16px;
min-height: 44px;
letter-spacing: 0.1em;
transition: background 0.15s, transform 0.1s;
touch-action: manipulation;
}
.mobile-chat-input button:active { transform: scale(0.96); }
.mobile-agents-list {
padding: 14px;
display: flex;
flex-direction: column;
gap: 8px;
}
.mobile-chat-msg {
margin-bottom: 12px;
}
.mobile-chat-msg .meta {
font-size: 10px;
letter-spacing: 0.1em;
margin-bottom: 3px;
}
.mobile-chat-msg.user .meta { color: var(--orange); }
.mobile-chat-msg.timmy .meta { color: var(--purple); }
.mobile-chat-msg .bubble {
background: rgba(24, 10, 45, 0.8);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 10px 12px;
font-size: 13px;
line-height: 1.6;
color: var(--text);
}
.mobile-chat-msg.timmy .bubble {
border-left: 3px solid var(--purple);
}
.mobile-chat-msg.user .bubble {
border-color: var(--border-glow);
}
</style>
{% endblock %}
{% block extra_styles %}{% endblock %}
{% block content %}
<div class="mobile-only">