feat: redesign history timeline — single-line, timestamp right-aligned
All checks were successful
CI / test (pull_request) Successful in 13s
CI / build-dev (pull_request) Has been skipped

Each event is now one row: label · old → new on the left, timestamp
right-aligned. Nothing is far from anything else. State changes use the
existing badge component for immediate visual recognition. The created
event reads 'instance created' in accent. Middle-dot separator keeps
field label and change value clearly associated without forced spacing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-28 15:06:09 -04:00
parent 94c4a0af51
commit 82c314f85c
2 changed files with 22 additions and 16 deletions

View File

@@ -193,21 +193,23 @@ async function renderDetailPage(vmid) {
? history.map(e => {
if (e.field === 'created') return `
<div class="tl-item tl-created">
<span class="tl-event">instance created</span>
<span class="tl-time">${fmtDateFull(e.changed_at)}</span>
<div class="tl-desc"><span class="tl-label">instance created</span></div>
</div>`;
const label = FIELD_LABELS[e.field] ?? esc(e.field);
const newCls = e.field === 'state'
? `badge ${esc(e.new_value)}`
: `tl-new ${stateClass(e.field, e.new_value)}`;
return `
<div class="tl-item">
<span class="tl-time">${fmtDateFull(e.changed_at)}</span>
<div class="tl-desc">
<div class="tl-event">
<span class="tl-label">${label}</span>
<span class="tl-change">
<span class="tl-old">${fmtHistVal(e.field, e.old_value)}</span>
<span class="tl-arrow">→</span>
<span class="tl-new ${stateClass(e.field, e.new_value)}">${fmtHistVal(e.field, e.new_value)}</span>
</span>
<span class="tl-sep">·</span>
<span class="tl-old">${fmtHistVal(e.field, e.old_value)}</span>
<span class="tl-arrow">→</span>
<span class="${newCls}">${fmtHistVal(e.field, e.new_value)}</span>
</div>
<span class="tl-time">${fmtDateFull(e.changed_at)}</span>
</div>`;
}).join('')
: '<div class="tl-empty">no history yet</div>';