hermes-trace/static/hermes-trace.css
XLion c299f41806
feat: add Copy Response + Reasoning banner button to turn detail
Add a dashed-border banner between User Input and Response cards that
copies both response content and reasoning content in a combined format:

---
Response:
{response}
---
Reasoning:
{reasoning}

- template/turn_detail.html: conditional banner (only when reasoning exists)
- static/hermes-trace.css: .detail-card-banner styles (dashed border, hover
  accent)
- static/hermes-trace.js: click handler + _copyResponsePlusReasoning() that
  scans DOM for Response/Reasoning cards and combines their <pre> content
2026-07-30 23:08:09 +08:00

862 lines
17 KiB
CSS

:root {
--bg: #0d1117;
--bg-card: #161b22;
--bg-hover: #1c2128;
--border: #30363d;
--text: #e6edf3;
--text-dim: #8b949e;
--accent: #58a6ff;
--green: #3fb950;
--yellow: #d29922;
--red: #f85149;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: var(--bg);
color: var(--text);
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: 14px;
line-height: 1.5;
padding: 20px;
}
/* Alpine.js: hide elements until initialized */
[x-cloak] { display: none !important; }
a {
color: var(--accent);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1, h2, h3 {
font-weight: 600;
margin-bottom: 12px;
}
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.container {
max-width: 100%;
padding: 0 4px;
margin: 0 auto;
}
table {
width: 100%;
border-collapse: collapse;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 6px;
overflow: hidden;
}
th {
background: var(--bg-hover);
padding: 10px 12px;
text-align: left;
font-weight: 600;
color: var(--text-dim);
text-transform: uppercase;
font-size: 11px;
letter-spacing: 0.5px;
border-bottom: 1px solid var(--border);
}
td {
padding: 10px 12px;
border-bottom: 1px solid var(--border);
vertical-align: top;
}
tr:last-child td {
border-bottom: none;
}
tr:hover {
background: var(--bg-hover);
}
.badge {
display: inline-block;
padding: 2px 6px;
border-radius: 4px;
font-size: 11px;
font-weight: 500;
}
.badge-green {
background: rgba(63, 185, 80, 0.15);
color: var(--green);
}
.badge-yellow {
background: rgba(210, 146, 34, 0.15);
color: var(--yellow);
}
.badge-red {
background: rgba(248, 81, 73, 0.15);
color: var(--red);
}
.badge-dim {
background: rgba(139, 148, 158, 0.12);
color: var(--text-dim);
}
pre {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 4px;
padding: 12px;
overflow-x: auto;
font-size: 12px;
line-height: 1.4;
color: var(--text);
margin: 8px 0;
}
pre code {
background: none;
padding: 0;
}
.error {
color: var(--red);
padding: 20px;
text-align: center;
}
.empty-state {
color: var(--text-dim);
padding: 40px;
text-align: center;
}
.subtitle {
color: var(--text-dim);
margin-bottom: 16px;
font-size: 13px;
}
.nav-link {
display: inline-block;
margin-bottom: 16px;
font-size: 13px;
}
.nav-link:hover {
text-decoration: underline;
}
.models-cell {
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@media (max-width: 768px) {
body {
padding: 12px;
}
table {
font-size: 12px;
}
th, td {
padding: 6px 8px;
}
.models-cell {
max-width: 120px;
}
}
/* ── Session Table ── */
.session-table-wrapper {
overflow-x: auto;
}
.session-table {
width: 100%;
border-collapse: collapse;
background: var(--bg-card);
border: 1px solid var(--border);
table-layout: fixed;
}
.session-table th {
position: sticky;
top: 0;
z-index: 10;
background: var(--bg-hover);
padding: 8px 10px;
text-align: center;
font-weight: 600;
color: var(--text-dim);
text-transform: none;
font-size: 11px;
letter-spacing: 0.3px;
border-bottom: 1px solid var(--border);
}
.session-table td {
padding: 8px 10px;
border-bottom: 1px solid var(--border);
vertical-align: middle;
font-size: 13px;
overflow: hidden;
}
.session-table tbody tr {
cursor: pointer;
transition: background 0.1s;
}
.session-table tbody tr:hover {
background: var(--bg-hover);
}
.session-table tbody tr:last-child td {
border-bottom: none;
}
.tr-llmcall td {
border-bottom-color: transparent;
}
.tr-toolcall {
cursor: pointer;
transition: background 0.1s;
}
.tr-toolcall td {
padding-top: 2px;
padding-bottom: 2px;
background: var(--bg);
border-bottom: 1px solid var(--border);
font-size: 12px;
}
.tr-toolcall:hover td {
background: #0f1419;
}
.col-time { width: 170px; min-width: 170px; }
.col-call { width: 115px; min-width: 115px; }
.col-input { width: auto; min-width: 0; }
.col-response { width: auto; min-width: 0; }
.col-latency { width: 90px; min-width: 90px; }
.col-model { width: 150px; min-width: 150px; }
.cell-time {
white-space: nowrap;
font-variant-numeric: tabular-nums;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
color: var(--text-dim);
font-size: 12px;
text-align: center;
overflow: visible;
}
.cell-call {
font-weight: 600;
white-space: nowrap;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
}
.cell-text {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #c0c8d0;
font-size: 12px;
}
.cell-latency {
text-align: center;
font-variant-numeric: tabular-nums;
font-weight: 600;
}
.cell-model {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
}
/* ── Call column badges ── */
.call-badge {
display: inline-flex;
align-items: center;
max-width: 100%;
min-width: 0;
overflow: hidden;
white-space: nowrap;
}
.call-badge .label {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tool-badge {
display: inline-flex;
align-items: center;
max-width: 100%;
min-width: 0;
overflow: hidden;
white-space: nowrap;
}
.tool-arrow {
flex: 0 0 auto;
margin-right: 3px;
}
.tool-label {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.latency-fast { color: var(--text-dim); }
.latency-medium { color: var(--yellow); }
.latency-slow { color: #e07b1a; }
.latency-very-slow { color: var(--red); font-weight: 700; }
.tr-toolcall td:first-child {
border-left: none;
}
.tr-toolcall .cell-tool-meta {
overflow: hidden;
white-space: nowrap;
box-sizing: border-box;
padding-left: 24px;
border-left: 2px solid rgba(180, 130, 30, 0.30);
color: #c8a030;
}
/* ── Selected row ── */
.tr-llmcall.tr-selected {
background: rgba(88, 166, 255, 0.06);
}
.tr-llmcall.tr-selected td:first-child {
box-shadow: inset 3px 0 0 var(--accent);
}
.tr-llmcall.tr-selected:hover {
background: rgba(88, 166, 255, 0.10);
}
/* ── Detail Overlay Panel ── */
.detail-overlay {
position: fixed;
top: 0;
right: 0;
width: 50%;
height: 100vh;
background: var(--bg-card);
transform: translateX(100%);
transition: transform 0.25s ease;
z-index: 1000;
display: flex;
flex-direction: column;
box-shadow: -4px 0 16px rgba(0,0,0,0.35);
}
.detail-overlay.open {
transform: translateX(0);
}
.detail-overlay.no-transition {
transition: none !important;
}
.detail-overlay-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
background: var(--bg-hover);
}
.detail-overlay-title {
font-size: 14px;
font-weight: 600;
}
.detail-overlay-close {
background: none;
border: none;
color: var(--text-dim);
font-size: 26px;
cursor: pointer;
line-height: 1;
padding: 2px 10px;
border-radius: 4px;
}
.detail-overlay-close:hover {
color: var(--text);
background: var(--bg-card);
}
.detail-overlay-body {
flex: 1;
overflow-y: auto;
}
.resize-handle {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 4px;
cursor: col-resize;
z-index: 1001;
background: transparent;
transition: background 0.15s;
}
.resize-handle:hover,
.resize-handle.active {
background: var(--accent);
}
/* ── Trace Nav ── */
.trace-nav {
display: flex;
align-items: center;
gap: 16px;
padding: 8px 12px;
border-bottom: 1px solid var(--border);
margin-bottom: 0;
flex-shrink: 0;
}
.trace-nav h2 {
font-size: 15px;
margin: 0;
flex: 1;
}
.trace-nav h2 code {
font-size: 13px;
color: var(--text-dim);
}
.trace-nav .turn-summary {
color: var(--text-dim);
font-size: 12px;
font-variant-numeric: tabular-nums;
margin-left: auto;
}
.trace-nav .turn-summary strong {
color: var(--text);
font-weight: 600;
}
.trace-nav .nav-link {
margin: 0;
}
/* ── JSON pretty/raw toggle ── */
.json-toggle {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 3px;
color: var(--text-dim);
cursor: pointer;
font-family: inherit;
font-size: 10px;
padding: 2px 8px;
text-transform: uppercase;
letter-spacing: 0.3px;
transition: all 0.15s;
line-height: 1.5;
}
.json-toggle:hover {
border-color: var(--accent);
color: var(--accent);
}
.json-toggle-on {
background: rgba(88, 166, 255, 0.12);
border-color: var(--accent);
color: var(--accent);
}
/* ── Turn Detail ── */
.td-pre {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 4px;
padding: 10px 12px;
overflow-x: auto;
font-size: 12px;
line-height: 1.4;
color: var(--text);
margin: 0;
white-space: pre-wrap;
word-break: break-word;
max-height: 300px;
overflow-y: auto;
}
.tc-focused {
outline: 2px solid var(--accent);
outline-offset: -1px;
border-radius: 4px;
}
/* ── Textarea for safe large-JSON display ── */
.td-textarea {
width: 100%;
min-height: 120px;
max-height: 70vh;
background: var(--bg);
color: var(--text);
border: 1px solid var(--border);
border-radius: 4px;
padding: 10px 14px;
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: 12px;
line-height: 1.4;
resize: vertical;
outline: none;
tab-size: 2;
}
.td-textarea:focus {
border-color: var(--accent);
}
/* ── Copy Button ── */
.copy-btn {
background: none;
border: 1px solid var(--border);
border-radius: 3px;
color: var(--text-dim);
cursor: pointer;
font-family: inherit;
font-size: 13px;
padding: 0 5px;
line-height: 1.6;
transition: all 0.15s;
flex-shrink: 0;
}
.copy-btn:hover {
border-color: var(--accent);
color: var(--accent);
background: rgba(88, 166, 255, 0.08);
}
/* ── Finish reason chip colors ── */
.fr-stop { color: var(--green); }
.fr-tool_calls { color: var(--accent); }
.fr-length { color: #e07b1a; }
.fr-error { color: var(--red); }
.fr-content_filter { color: var(--red); }
/* ── Detail tabs ── */
.detail-tabs {
display: flex;
border-bottom: 1px solid var(--border);
background: var(--bg-hover);
flex-shrink: 0;
}
.detail-tab {
padding: 8px 16px;
font-size: 12px;
font-weight: 500;
color: var(--text-dim);
cursor: pointer;
border: none;
background: none;
font-family: inherit;
border-bottom: 2px solid transparent;
transition: all 0.15s;
margin-bottom: -1px;
}
.detail-tab:hover {
color: var(--text);
background: rgba(255,255,255,0.03);
}
.detail-tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
.detail-tab-content {
padding: 0;
}
.detail-tab-content .tab-pane {
padding: 12px 16px;
}
/* ── Metadata chips bar ── */
.chip-bar {
display: flex;
flex-wrap: wrap;
gap: 6px;
padding: 8px 16px;
border-bottom: 1px solid var(--border);
background: var(--bg-card);
}
.chip {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px 10px;
background: rgba(88, 166, 255, 0.06);
border: 1px solid rgba(88, 166, 255, 0.12);
border-radius: 4px;
font-size: 11px;
color: var(--text);
white-space: nowrap;
position: relative;
}
.chip-label {
color: var(--text-dim);
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.3px;
font-weight: 600;
}
.chip-num {
font-variant-numeric: tabular-nums;
font-weight: 600;
}
.chip-fr {
font-size: 11px;
font-weight: 600;
}
/* ── Token usage tooltip ── */
.chip-tooltip {
position: absolute;
top: calc(100% + 4px);
left: 0;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 6px;
padding: 8px 12px;
z-index: 60;
min-width: 190px;
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
font-size: 11px;
line-height: 1.5;
}
.chip-tooltip-title {
font-size: 12px;
font-weight: 600;
margin-bottom: 6px;
padding-bottom: 4px;
border-bottom: 1px solid var(--border);
}
.chip-tooltip-section {
margin-bottom: 2px;
}
.chip-tooltip-section-hdr {
display: flex;
justify-content: space-between;
font-weight: 600;
color: var(--text);
padding: 2px 0;
}
.chip-tooltip-row {
display: flex;
justify-content: space-between;
gap: 16px;
padding: 1px 0 1px 8px;
color: var(--text-dim);
}
.chip-tooltip-row span:last-child {
color: var(--text);
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.chip-tt-total {
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.chip-tooltip-divider {
border-top: 1px solid var(--border);
margin: 4px 0;
}
.chip-tooltip-footer {
display: flex;
justify-content: space-between;
border-top: 1px solid var(--border);
margin-top: 4px;
padding-top: 4px;
font-weight: 600;
}
.chip-tooltip-footer .chip-tt-total {
color: var(--accent);
}
/* ── Detail section cards ── */
.detail-card {
border: 1px solid var(--border);
border-radius: 4px;
background: var(--bg);
margin-bottom: 10px;
}
.detail-card-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 6px 10px;
background: var(--bg-hover);
border-bottom: 1px solid var(--border);
font-size: 12px;
font-weight: 600;
}
.detail-card-body {
padding: 8px 10px;
}
.detail-card-body pre {
margin: 0;
background: none;
border: none;
padding: 0;
font-size: 12px;
line-height: 1.45;
white-space: pre-wrap;
word-break: break-word;
}
.detail-card-scroll {
max-height: 280px;
overflow-y: auto;
}
.detail-card-scroll.response-scroll {
max-height: 240px;
}
/* ── Tool call card ── */
.tc-card {
border: 1px solid var(--border);
border-radius: 4px;
background: var(--bg);
margin-bottom: 8px;
}
.tc-card-header {
display: flex;
align-items: center;
gap: 8px;
padding: 5px 10px;
background: var(--bg-hover);
border-bottom: 1px solid var(--border);
font-size: 12px;
}
.tc-card-name {
font-weight: 600;
color: var(--yellow);
}
.tc-card-latency {
margin-left: auto;
color: var(--text-dim);
font-variant-numeric: tabular-nums;
}
.tc-card-body {
padding: 6px 10px;
}
.tc-card-body .detail-card {
margin-bottom: 6px;
}
.tc-card-body .detail-card:last-child {
margin-bottom: 0;
}
.tc-card-empty {
padding: 20px 16px;
text-align: center;
color: var(--text-dim);
font-size: 13px;
}
/* ── JSON tab ── */
.json-section {
border: 1px solid var(--border);
border-radius: 4px;
background: var(--bg);
margin-bottom: 10px;
}
.json-section-header {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 10px;
background: var(--bg-hover);
border-bottom: 1px solid var(--border);
font-size: 12px;
font-weight: 600;
}
.json-section-body {
padding: 6px 10px;
}
.json-section-body .td-textarea {
min-height: 280px;
max-height: 60vh;
}
.json-empty {
padding: 16px;
text-align: center;
color: var(--text-dim);
font-size: 12px;
}
/* ── Detail header ── */
.detail-title {
font-size: 14px;
font-weight: 600;
display: flex;
align-items: center;
gap: 8px;
}
.detail-title-id {
font-size: 12px;
font-weight: 400;
color: var(--text-dim);
}
.detail-title-model {
margin-left: auto;
font-size: 11px;
font-weight: 500;
}
/* ── Detail loading state ── */
.detail-loading {
padding: 24px;
text-align: center;
color: var(--text-dim);
}
/* ── Keyboard focus for clickable rows ── */
.tr-llmcall:focus-visible,
.tr-toolcall:focus-visible {
outline: 2px solid var(--accent);
outline-offset: -2px;
}
/* ── Payload empty hint ── */
.td-load-hint {
padding: 16px;
text-align: center;
color: var(--text-dim);
font-size: 12px;
}
/* ── Copy Response + Reasoning banner ── */
.detail-card-banner {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 10px 16px;
margin: 12px 0;
border: 1px dashed var(--border);
border-radius: 6px;
background: var(--bg-hover);
cursor: pointer;
font-size: 13px;
color: var(--text-dim);
transition: all 0.15s;
user-select: none;
}
.detail-card-banner:hover {
border-color: var(--accent);
color: var(--accent);
background: rgba(88, 166, 255, 0.06);
}