From 4140a347be475e4c2f791eb0611d3f6b092d4105 Mon Sep 17 00:00:00 2001 From: realZachi <109552121+realZachi@users.noreply.github.com> Date: Sun, 25 Jan 2026 13:45:21 +0100 Subject: [PATCH] feat(debug): implement compact event log and debug layout --- ui/src/styles/components.css | 100 +++++++++++++++++++++++++++++++++ ui/src/ui/views/debug.ts | 104 +++++++++++++++++------------------ 2 files changed, 152 insertions(+), 52 deletions(-) diff --git a/ui/src/styles/components.css b/ui/src/styles/components.css index 870698d8d..8df714331 100644 --- a/ui/src/styles/components.css +++ b/ui/src/styles/components.css @@ -687,6 +687,106 @@ } } +/* =========================================== + Event Log - Compact debug view + =========================================== */ + +.event-log { + display: grid; + gap: 6px; +} + +.event-log-item { + border: 1px solid var(--border); + border-radius: var(--radius-md); + background: var(--card); + overflow: hidden; +} + +.event-log-header { + display: flex; + align-items: center; + gap: 12px; + padding: 8px 12px; + background: var(--secondary); + border-bottom: 1px solid var(--border); +} + +.event-log-name { + font-family: var(--mono); + font-size: 12px; + font-weight: 600; + color: var(--text-strong); +} + +.event-log-time { + font-family: var(--mono); + font-size: 11px; + color: var(--muted); + margin-left: auto; +} + +.event-log-payload { + margin: 0; + border: none; + border-radius: 0; + background: transparent; + font-size: 11px; + line-height: 1.4; + padding: 8px 12px; + max-height: 200px; +} + +/* =========================================== + Debug View Layout + =========================================== */ + +.debug-grid { + display: grid; + grid-template-columns: 1fr 1fr; + grid-template-rows: auto; + gap: 14px; +} + +.debug-right-stack { + display: flex; + flex-direction: column; + gap: 14px; + height: fit-content; + max-height: 100%; +} + +.debug-models-card > .code-block { + margin-top: 8px; + max-height: 280px; +} + +.rpc-form { + display: flex; + flex-direction: column; + gap: 10px; + margin-top: 12px; +} + +.rpc-input-row { + display: flex; + gap: 10px; + align-items: flex-end; +} + +.rpc-params { + font-family: var(--mono); + font-size: 12px; + resize: vertical; + min-height: 60px; +} + +@media (max-width: 768px) { + .debug-grid { + grid-template-columns: 1fr; + } +} + /* =========================================== Chips - Compact and punchy =========================================== */ diff --git a/ui/src/ui/views/debug.ts b/ui/src/ui/views/debug.ts index 35e2e1af2..171ab2917 100644 --- a/ui/src/ui/views/debug.ts +++ b/ui/src/ui/views/debug.ts @@ -22,7 +22,8 @@ export type DebugProps = { export function renderDebug(props: DebugProps) { return html` -
+
+
@@ -49,51 +50,52 @@ export function renderDebug(props: DebugProps) {
-
-
Manual RPC
-
Send a raw gateway method with JSON params.
-
- - + +
+
+
Manual RPC
+
Send a raw gateway method with JSON params.
+
+
+ + +
+ +
+ ${props.callError + ? html`
+ ${props.callError} +
` + : nothing} + ${props.callResult + ? html`
${props.callResult}
` + : nothing}
-
- -
- ${props.callError - ? html`
- ${props.callError} -
` - : nothing} - ${props.callResult - ? html`
${props.callResult}
` - : nothing} -
-
-
-
Models
-
Catalog from models.list.
-
${JSON.stringify(
-        props.models ?? [],
-        null,
-        2,
-      )}
+
+
Models
+
Catalog from models.list.
+
${JSON.stringify(props.models ?? [], null, 2)}
+
+
@@ -102,17 +104,15 @@ export function renderDebug(props: DebugProps) { ${props.eventLog.length === 0 ? html`
No events yet.
` : html` -
+
${props.eventLog.map( (evt) => html` -
-
-
${evt.event}
-
${new Date(evt.ts).toLocaleTimeString()}
-
-
-
${formatEventPayload(evt.payload)}
+
+
+ ${evt.event} + ${new Date(evt.ts).toLocaleTimeString()}
+
${formatEventPayload(evt.payload)}
`, )}