- Add dashboard/store.py: MessageLog dataclass singleton tracking user/agent/error messages for the lifetime of the server process - agents.py: write each chat turn to MessageLog; add GET and DELETE /agents/timmy/history routes returning the history.html partial - partials/history.html: render stored messages by role (YOU / TIMMY / SYSTEM); falls back to the Mission Control init message when empty - index.html: chat-log loads history via hx-get on page start; new CLEAR button in panel header sends hx-delete to reset the log - style.css: add .mc-btn-clear (muted, red-on-hover for the header) - tests: autouse reset_message_log fixture in conftest; 5 new history tests covering empty state, recording, offline errors, clear, and post-clear state → 32 tests total, all passing https://claude.ai/code/session_01KZMfwBpLuiv6x9GbzTqbys
315 lines
9.9 KiB
CSS
315 lines
9.9 KiB
CSS
/* ── Mission Control palette ──────────────────────── */
|
|
:root {
|
|
--bg-deep: #060d14;
|
|
--bg-panel: #0c1824;
|
|
--bg-card: #0f2030;
|
|
--border: #1a3a55;
|
|
--border-glow: #1e4d72;
|
|
--text: #b8d0e8;
|
|
--text-dim: #4a7a9a;
|
|
--text-bright: #ddeeff;
|
|
--green: #00e87a;
|
|
--green-dim: #00704a;
|
|
--amber: #ffb800;
|
|
--amber-dim: #7a5800;
|
|
--red: #ff4455;
|
|
--red-dim: #7a1a22;
|
|
--blue: #00aaff;
|
|
--font: 'JetBrains Mono', 'Courier New', monospace;
|
|
--header-h: 52px;
|
|
|
|
/* Bootstrap dark-mode overrides */
|
|
--bs-body-bg: var(--bg-deep);
|
|
--bs-body-color: var(--text);
|
|
--bs-body-font-family: var(--font);
|
|
--bs-body-font-size: 13px;
|
|
--bs-card-bg: var(--bg-panel);
|
|
--bs-card-border-color: var(--border);
|
|
--bs-card-cap-bg: var(--bg-card);
|
|
--bs-card-cap-color: var(--text-dim);
|
|
--bs-border-color: var(--border);
|
|
--bs-form-control-bg: var(--bg-deep);
|
|
--bs-form-control-color: var(--text-bright);
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
body {
|
|
font-family: var(--font);
|
|
background: var(--bg-deep);
|
|
color: var(--text);
|
|
font-size: 13px;
|
|
min-height: 100dvh;
|
|
overflow-x: hidden;
|
|
overscroll-behavior: none;
|
|
}
|
|
|
|
/* ── Header ─────────────────────────────────────── */
|
|
.mc-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 12px 24px;
|
|
padding-top: max(12px, env(safe-area-inset-top));
|
|
background: var(--bg-panel);
|
|
border-bottom: 1px solid var(--border);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
.mc-header-left { display: flex; align-items: baseline; gap: 0; }
|
|
.mc-title {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--text-bright);
|
|
letter-spacing: 0.15em;
|
|
}
|
|
.mc-subtitle {
|
|
font-size: 11px;
|
|
color: var(--text-dim);
|
|
letter-spacing: 0.2em;
|
|
margin-left: 16px;
|
|
}
|
|
.mc-time {
|
|
font-size: 14px;
|
|
color: var(--blue);
|
|
letter-spacing: 0.1em;
|
|
}
|
|
|
|
/* ── Main layout ─────────────────────────────────── */
|
|
.mc-main {
|
|
padding: 16px;
|
|
height: calc(100dvh - var(--header-h));
|
|
overflow: hidden;
|
|
}
|
|
.mc-content {
|
|
height: 100%;
|
|
}
|
|
.mc-content > .row {
|
|
height: 100%;
|
|
}
|
|
|
|
/* ── Sidebar ─────────────────────────────────────── */
|
|
.mc-sidebar {
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* ── Chat column ─────────────────────────────────── */
|
|
.mc-chat-panel {
|
|
min-height: 0;
|
|
}
|
|
.mc-chat-panel > .card {
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* ── Panel / Card overrides ──────────────────────── */
|
|
.mc-panel {
|
|
background: var(--bg-panel);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
}
|
|
.mc-panel-header {
|
|
background: var(--bg-card);
|
|
border-bottom: 1px solid var(--border);
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
color: var(--text-dim);
|
|
letter-spacing: 0.2em;
|
|
text-transform: uppercase;
|
|
padding: 8px 14px;
|
|
}
|
|
|
|
/* ── Agent Card ──────────────────────────────────── */
|
|
.mc-agent-card {
|
|
border: 1px solid var(--border);
|
|
border-radius: 3px;
|
|
padding: 12px;
|
|
background: var(--bg-card);
|
|
}
|
|
.status-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
display: inline-block;
|
|
}
|
|
.status-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
|
|
.status-dot.amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
|
|
.status-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }
|
|
|
|
.agent-name {
|
|
font-size: 14px;
|
|
font-weight: 700;
|
|
color: var(--text-bright);
|
|
letter-spacing: 0.1em;
|
|
}
|
|
.agent-meta { font-size: 11px; line-height: 2; }
|
|
.meta-key { color: var(--text-dim); display: inline-block; width: 60px; }
|
|
.meta-val { color: var(--text); }
|
|
|
|
/* ── Health ──────────────────────────────────────── */
|
|
.health-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 7px 0;
|
|
border-bottom: 1px solid var(--border);
|
|
font-size: 12px;
|
|
}
|
|
.health-row:last-child { border-bottom: none; }
|
|
.health-label { color: var(--text-dim); letter-spacing: 0.08em; }
|
|
|
|
/* Status badges (use Bootstrap .badge base + mc-badge-* modifier) */
|
|
.mc-badge-up { background: var(--green-dim) !important; color: var(--green) !important; font-size: 10px; letter-spacing: 0.12em; border-radius: 2px; }
|
|
.mc-badge-down { background: var(--red-dim) !important; color: var(--red) !important; font-size: 10px; letter-spacing: 0.12em; border-radius: 2px; }
|
|
.mc-badge-ready { background: var(--amber-dim) !important; color: var(--amber) !important; font-size: 10px; letter-spacing: 0.12em; border-radius: 2px; }
|
|
|
|
/* ── Chat ────────────────────────────────────────── */
|
|
.chat-log {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
-webkit-overflow-scrolling: touch;
|
|
}
|
|
.chat-message { margin-bottom: 16px; }
|
|
.msg-meta {
|
|
font-size: 10px;
|
|
color: var(--text-dim);
|
|
margin-bottom: 4px;
|
|
letter-spacing: 0.12em;
|
|
}
|
|
.chat-message.user .msg-meta { color: var(--blue); }
|
|
.chat-message.agent .msg-meta { color: var(--green); }
|
|
.chat-message.error-msg .msg-meta { color: var(--red); }
|
|
|
|
.msg-body {
|
|
background: var(--bg-card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 3px;
|
|
padding: 10px 12px;
|
|
line-height: 1.65;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
.chat-message.user .msg-body { border-color: var(--border-glow); }
|
|
.chat-message.agent .msg-body { border-left: 3px solid var(--green); }
|
|
.chat-message.error-msg .msg-body { border-left: 3px solid var(--red); color: var(--red); }
|
|
|
|
/* ── Chat input footer ───────────────────────────── */
|
|
.mc-chat-footer {
|
|
padding: 12px 14px;
|
|
padding-bottom: max(12px, env(safe-area-inset-bottom));
|
|
background: var(--bg-card);
|
|
border-top: 1px solid var(--border);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.mc-btn-clear {
|
|
background: transparent;
|
|
border: 1px solid var(--border);
|
|
border-radius: 2px;
|
|
color: var(--text-dim);
|
|
font-family: var(--font);
|
|
font-size: 9px;
|
|
font-weight: 700;
|
|
padding: 3px 8px;
|
|
letter-spacing: 0.12em;
|
|
cursor: pointer;
|
|
transition: border-color 0.15s, color 0.15s;
|
|
touch-action: manipulation;
|
|
}
|
|
.mc-btn-clear:hover { border-color: var(--red); color: var(--red); }
|
|
|
|
/* Bootstrap form-control overrides */
|
|
.mc-input {
|
|
background: var(--bg-deep) !important;
|
|
border: 1px solid var(--border) !important;
|
|
border-radius: 3px !important;
|
|
color: var(--text-bright) !important;
|
|
font-family: var(--font) !important;
|
|
font-size: 13px !important;
|
|
}
|
|
.mc-input:focus {
|
|
border-color: var(--border-glow) !important;
|
|
box-shadow: 0 0 0 1px var(--border-glow) !important;
|
|
}
|
|
.mc-input::placeholder { color: var(--text-dim) !important; }
|
|
|
|
.mc-btn-send {
|
|
background: var(--border-glow);
|
|
border: none;
|
|
border-radius: 3px;
|
|
color: var(--text-bright);
|
|
font-family: var(--font);
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
padding: 8px 18px;
|
|
letter-spacing: 0.12em;
|
|
transition: background 0.15s, color 0.15s;
|
|
touch-action: manipulation;
|
|
white-space: nowrap;
|
|
}
|
|
.mc-btn-send:hover { background: var(--blue); color: var(--bg-deep); }
|
|
|
|
/* ── HTMX Loading ────────────────────────────────── */
|
|
.htmx-indicator { display: none; }
|
|
.htmx-request .htmx-indicator,
|
|
.htmx-request.htmx-indicator { display: inline-block; color: var(--amber); animation: blink 0.8s infinite; }
|
|
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
|
|
|
|
/* ── Scrollbar ───────────────────────────────────── */
|
|
::-webkit-scrollbar { width: 4px; }
|
|
::-webkit-scrollbar-track { background: var(--bg-deep); }
|
|
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
|
|
::-webkit-scrollbar-thumb:hover { background: var(--border-glow); }
|
|
|
|
|
|
/* ════════════════════════════════════════════════════
|
|
MOBILE (≤ 768 px)
|
|
════════════════════════════════════════════════════ */
|
|
@media (max-width: 768px) {
|
|
|
|
:root { --header-h: 44px; }
|
|
|
|
/* Compact header */
|
|
.mc-header { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
|
|
.mc-title { font-size: 14px; letter-spacing: 0.1em; }
|
|
.mc-subtitle { display: none; }
|
|
.mc-time { font-size: 12px; }
|
|
|
|
/* Full-height layout becomes scrollable column stack */
|
|
.mc-main { height: auto; overflow: visible; padding: 8px; }
|
|
.mc-content, .mc-content > .row { height: auto; }
|
|
|
|
/* Sidebar becomes a horizontal scroll strip */
|
|
.mc-sidebar {
|
|
flex-direction: row !important;
|
|
overflow-x: auto;
|
|
overflow-y: hidden;
|
|
scrollbar-width: none;
|
|
-webkit-overflow-scrolling: touch;
|
|
}
|
|
.mc-sidebar::-webkit-scrollbar { display: none; }
|
|
.mc-sidebar .mc-panel {
|
|
min-width: 200px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Chat fills remaining space with defined height */
|
|
.mc-chat-panel { min-height: 60dvh; }
|
|
.mc-chat-panel > .card { height: 60dvh; }
|
|
|
|
/* Tighter message padding */
|
|
.chat-log { padding: 10px !important; }
|
|
.msg-body { padding: 8px 10px; font-size: 13px; }
|
|
.chat-message { margin-bottom: 12px; }
|
|
|
|
/* Touch-friendly input */
|
|
.mc-chat-footer {
|
|
padding: 8px 10px;
|
|
padding-bottom: max(8px, env(safe-area-inset-bottom));
|
|
}
|
|
.mc-input { font-size: 16px !important; min-height: 44px; }
|
|
.mc-btn-send { min-height: 44px; min-width: 64px; font-size: 12px; padding: 0 14px; }
|
|
}
|