Changeset 0.22.9 (#151)

This commit is contained in:
2026-03-04 17:39:22 +00:00
parent 7e26a2a261
commit 6ed76fb2d3
27 changed files with 3392 additions and 3224 deletions

View File

@@ -7,7 +7,15 @@
<title>{{block "title" .}}Chat Switchboard{{end}}</title>
<link rel="icon" type="image/svg+xml" href="{{.BasePath}}/favicon.svg?v={{.Version}}">
<link rel="icon" type="image/x-icon" href="{{.BasePath}}/favicon.ico?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/styles.css?v={{.Version}}">
{{/* Decomposed from monolithic styles.css (v0.22.9) */}}
<link rel="stylesheet" href="{{.BasePath}}/css/variables.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/layout.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/primitives.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/modals.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/chat.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/panels.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/surfaces.css?v={{.Version}}">
<link rel="stylesheet" href="{{.BasePath}}/css/splash.css?v={{.Version}}">
{{if eq .Surface "chat"}}{{template "css-chat" .}}{{end}}
{{if eq .Surface "editor"}}{{template "css-editor" .}}{{end}}
<style>
@@ -73,6 +81,56 @@
{{if eq .Surface "editor"}}{{template "scripts-editor" .}}{{end}}
{{if eq .Surface "notes"}}{{template "scripts-notes" .}}{{end}}
{{if eq .Surface "settings"}}{{template "scripts-settings" .}}{{end}}
{{/* ── Debug Log Modal (all surfaces) ───── */}}
<div id="debugModal" class="modal-overlay">
<div class="modal-content modal-lg">
<div class="modal-header">
<h2>Debug Log</h2>
<button class="modal-close" onclick="closeModal('debugModal')"></button>
</div>
<div class="modal-tabs">
<button class="debug-tab active" data-tab="console" onclick="switchDebugTab('console')">Console <span id="debugConsoleCount" class="badge">0</span></button>
<button class="debug-tab" data-tab="network" onclick="switchDebugTab('network')">Network <span id="debugNetworkCount" class="badge">0</span></button>
<button class="debug-tab" data-tab="state" onclick="switchDebugTab('state')">State</button>
<button class="debug-tab" data-tab="repl" onclick="switchDebugTab('repl')">REPL</button>
</div>
<div class="modal-body" style="padding:0;height:400px;overflow:hidden;">
<div id="debugConsoleTab" class="debug-tab-content" style="display:block;height:100%;overflow-y:auto;">
<div style="padding:8px;display:flex;gap:8px;align-items:center;">
<label><input type="checkbox" id="debugFilterErrors"> Errors only</label>
<label><input type="checkbox" id="debugAutoScroll" checked> Auto-scroll</label>
</div>
<div id="debugConsoleContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;"></div>
</div>
<div id="debugNetworkTab" class="debug-tab-content" style="display:none;height:100%;overflow-y:auto;">
<div id="debugNetworkContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;"></div>
</div>
<div id="debugStateTab" class="debug-tab-content" style="display:none;height:100%;overflow-y:auto;">
<div id="debugStateContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;white-space:pre-wrap;"></div>
</div>
<div id="debugReplTab" class="debug-tab-content" style="display:none;height:100%;display:flex;flex-direction:column;">
<div id="replOutput" style="flex:1;overflow-y:auto;font-family:monospace;font-size:12px;padding:8px;"></div>
<div style="border-top:1px solid var(--border);padding:8px;">
<input type="text" id="replInput" placeholder="Type expression…" style="width:100%;font-family:monospace;font-size:12px;">
</div>
</div>
</div>
<div class="modal-footer" style="display:flex;justify-content:space-between;align-items:center;">
<div style="display:flex;gap:8px;">
<button class="btn-danger btn-small" onclick="runDebugDiagnostics()">Diagnostics</button>
<button class="btn-danger btn-small" onclick="purgeCache()">Purge Cache</button>
</div>
<div style="display:flex;gap:8px;">
<button class="btn-secondary btn-small" onclick="clearDebugLog()">Clear</button>
<button class="btn-secondary btn-small" onclick="copyDebugLog()">Copy</button>
<button class="btn-secondary btn-small" onclick="exportDebugLog()">Export</button>
</div>
</div>
</div>
</div>
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/debug.js?v={{.Version}}"></script>
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/repl.js?v={{.Version}}"></script>
</body>
</html>
{{end}}

View File

@@ -58,7 +58,7 @@
.hero-content { position: relative; z-index: 1; max-width: 520px; }
.hero-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 1.5rem; }
.hero-brand-icon { font-size: 40px; line-height: 1; }
.hero-brand-icon { width: 40px; height: 40px; }
.hero-brand-text { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.hero-brand-text .hl { color: var(--accent); }
@@ -182,7 +182,7 @@
<div class="hero-orb"></div>
<div class="hero-content">
<div class="hero-brand anim anim-1">
<span class="hero-brand-icon">&#x1F500;</span>
<img class="hero-brand-icon" src="{{.BasePath}}/favicon.svg?v={{.Version}}" alt="Chat Switchboard">
<span class="hero-brand-text">Chat <span class="hl">Switchboard</span></span>
</div>
<h1 class="anim anim-2">Your AI conversations,<br>your infrastructure</h1>
@@ -197,7 +197,7 @@
<span class="hero-pill ac"><span class="hero-pill-icon">&#x1F50D;</span> Web Search Tools</span>
<span class="hero-pill pu"><span class="hero-pill-icon">&#x1F4DD;</span> Notes &amp; Memory</span>
</div>
<p class="hero-version anim anim-5">v{{.Version}} &middot; gobha.ai</p>
<p class="hero-version anim anim-5">v{{.Version}}{{if .Environment}} &middot; {{.Environment}}{{end}}</p>
</div>
</div>

View File

@@ -97,7 +97,7 @@
</div>
{{end}}
{{/* CSS: consolidated into styles.css */}}
{{/* CSS: loaded via base.html (variables, layout, primitives, modals, chat, panels, surfaces, splash) */}}
{{define "css-admin"}}{{end}}
{{/* Scripts */}}

View File

@@ -175,7 +175,7 @@ window.addEventListener('unhandledrejection', function(e) {
</button>
<button id="menuDebug" class="flyout-item" style="display:none;">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"/><path d="M12 6V12L16 14"/></svg>
<span>Debug Console</span>
<span>Debug Log</span>
</button>
<hr class="flyout-divider">
<button id="menuSignout" class="flyout-item flyout-danger">
@@ -643,44 +643,7 @@ window.addEventListener('unhandledrejection', function(e) {
</div>
</div>
{{/* ── Debug Modal ─────────────────────────── */}}
<div id="debugModal" class="modal-overlay">
<div class="modal-content modal-lg">
<div class="modal-header">
<h2>Debug Console</h2>
<button class="modal-close" onclick="closeModal('debugModal')"></button>
</div>
<div class="modal-tabs">
<button class="debug-tab active" data-dtab="console" onclick="switchDebugTab('console')">Console</button>
<button class="debug-tab" data-dtab="network" onclick="switchDebugTab('network')">Network</button>
<button class="debug-tab" data-dtab="state" onclick="switchDebugTab('state')">State</button>
<button class="debug-tab" data-dtab="repl" onclick="switchDebugTab('repl')">REPL</button>
</div>
<div class="modal-body" style="padding:0;height:400px;overflow:hidden;">
<div id="debugConsoleTab" class="debug-tab-content" style="display:block;height:100%;overflow-y:auto;">
<div style="padding:8px;display:flex;gap:8px;align-items:center;">
<label><input type="checkbox" id="debugAutoScroll" checked> Auto-scroll</label>
<label><input type="checkbox" id="debugFilterErrors"> Errors only</label>
<span id="debugConsoleCount" class="badge">0</span>
</div>
<div id="debugConsoleContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;"></div>
</div>
<div id="debugNetworkTab" class="debug-tab-content" style="display:none;height:100%;overflow-y:auto;">
<div style="padding:8px;"><span id="debugNetworkCount" class="badge">0</span> requests</div>
<div id="debugNetworkContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;"></div>
</div>
<div id="debugStateTab" class="debug-tab-content" style="display:none;height:100%;overflow-y:auto;">
<div id="debugStateContent" class="debug-content" style="font-family:monospace;font-size:12px;padding:8px;white-space:pre-wrap;"></div>
</div>
<div id="debugReplTab" class="debug-tab-content" style="display:none;height:100%;display:flex;flex-direction:column;">
<div id="replOutput" style="flex:1;overflow-y:auto;font-family:monospace;font-size:12px;padding:8px;"></div>
<div style="border-top:1px solid var(--border);padding:8px;">
<input type="text" id="replInput" placeholder="Type expression…" style="width:100%;font-family:monospace;font-size:12px;">
</div>
</div>
</div>
</div>
</div>
{{/* ── Debug Modal moved to base.html (available on all surfaces) ── */}}
{{/* ── Notification bell is now inside .chat-header ── */}}
@@ -726,8 +689,7 @@ window.addEventListener('unhandledrejection', function(e) {
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/purify.min.js" onerror="this.onerror=null;this.src='https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.2.4/purify.min.js'"></script>
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/codemirror/codemirror.bundle.js?v={{$.Version}}" onerror="console.warn('[CM6] Bundle not available — falling back to textarea')"></script>
{{/* App JS — order matches index.html (minus api/events/ui-primitives already in base) */}}
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/debug.js?v={{$.Version}}"></script>
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/repl.js?v={{$.Version}}"></script>
{{/* debug.js and repl.js now loaded in base.html for all surfaces */}}
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/extensions.js?v={{$.Version}}"></script>
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/panels.js?v={{$.Version}}"></script>
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/js/ui-format.js?v={{$.Version}}"></script>

View File

@@ -111,7 +111,7 @@
<div id="toastContainer" class="toast-container"></div>
{{end}}
{{/* CSS: consolidated into styles.css */}}
{{/* CSS: loaded via base.html (variables, layout, primitives, modals, chat, panels, surfaces, splash) */}}
{{define "css-editor"}}
<link rel="stylesheet" href="{{.BasePath}}/css/editor-mode.css?v={{.Version}}">
{{end}}

View File

@@ -71,7 +71,7 @@
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/memory-ui.js?v={{.Version}}"></script>
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/notifications.js?v={{.Version}}"></script>
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/panels.js?v={{.Version}}"></script>
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/debug.js?v={{.Version}}"></script>
{{/* debug.js now loaded in base.html for all surfaces */}}
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/projects-ui.js?v={{.Version}}"></script>
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/app.js?v={{.Version}}"></script>
<script nonce="{{.CSPNonce}}">

View File

@@ -150,7 +150,7 @@
<div id="toastContainer" class="toast-container"></div>
{{end}}
{{/* CSS: consolidated into styles.css */}}
{{/* CSS: loaded via base.html (variables, layout, primitives, modals, chat, panels, surfaces, splash) */}}
{{define "css-settings"}}{{end}}
{{/* Scripts */}}