diff --git a/internal/web/handler.go b/internal/web/handler.go index 59c803b..0ad8bb4 100644 --- a/internal/web/handler.go +++ b/internal/web/handler.go @@ -986,9 +986,10 @@ const queryLogHTML = ` .state-pill.review { background: #78350f; } .state-pill.allowed { background: #14532d; } .state-pill.observed { background: #1e293b; } - .action-icon { width: 1.9rem; height: 1.9rem; padding: 0; border-radius: .5rem; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; font-size: .95rem; } - .action-icon.block { background: #dc2626; color: white; } - .action-icon.unblock { background: #475569; color: white; } + .action-icon { width: 1.55rem; height: 1.55rem; min-width: 1.55rem; padding: 0; border-radius: .45rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #334155; cursor: pointer; line-height: 1; vertical-align: middle; background: #0f172a; color: #e2e8f0; } + .action-icon svg { width: .9rem; height: .9rem; display: block; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; } + .action-icon.block { background: #3f0b14; border-color: #7f1d1d; color: #fecaca; } + .action-icon.unblock { background: #172033; border-color: #334155; color: #cbd5e1; } .tabulator { background: transparent; border: 0; font-size: .92rem; width: 100% !important; } .tabulator .tabulator-header { background: #0f172a; border-bottom: 1px solid #334155; } .tabulator .tabulator-header .tabulator-header-contents { width: 100% !important; } @@ -1296,13 +1297,20 @@ const queryLogHTML = ` return '' + escapeHtml(visual.short) + ''; } + function actionIconSVG(kind) { + if (kind === 'unblock') { + return ''; + } + return ''; + } + function renderActions(item) { const actions = item.actions || {}; if (actions.can_unblock) { - return ''; + return ''; } if (actions.can_block) { - return ''; + return ''; } return '—'; } diff --git a/internal/web/handler_test.go b/internal/web/handler_test.go index 2aa6f2f..18c3f85 100644 --- a/internal/web/handler_test.go +++ b/internal/web/handler_test.go @@ -202,6 +202,9 @@ func TestHandlerServesOverviewAndManualActions(t *testing.T) { if !strings.Contains(queryLogBody, `.status-code`) || strings.Contains(queryLogBody, `.status-pill`) { t.Fatalf("requests log page should use the simplified status styling") } + if !strings.Contains(queryLogBody, `function actionIconSVG(kind)`) || strings.Contains(queryLogBody, `🔓`) || strings.Contains(queryLogBody, `⛔`) { + t.Fatalf("requests log page should use compact SVG action icons") + } if !strings.Contains(queryLogBody, `.tabulator .tabulator-tableholder .tabulator-table { min-width: 100% !important; width: 100% !important; }`) { t.Fatalf("requests log page should keep the tabulator body at full width") }