build-logs viewer: add --crust var + aria-expanded on row buttons (argus nits)

This commit is contained in:
iris 2026-05-31 21:02:28 +02:00 committed by mara
commit c4ce91b61f
3 changed files with 11 additions and 4 deletions

View file

@ -487,7 +487,7 @@ a:hover {
.journal-refresh { font-size: 0.75em; padding: 0.15em 0.5em; } .journal-refresh { font-size: 0.75em; padding: 0.15em 0.5em; }
.journal-output { .journal-output {
margin: 0; margin: 0;
background: #11111b; background: var(--crust);
color: var(--fg); color: var(--fg);
border: 1px solid var(--purple-dim); border: 1px solid var(--purple-dim);
padding: 0.5em 0.7em; padding: 0.5em 0.7em;
@ -572,7 +572,7 @@ a:hover {
.build-logs-detail { padding: 0 0.4em 0.4em; } .build-logs-detail { padding: 0 0.4em 0.4em; }
.build-logs-output { .build-logs-output {
margin: 0; margin: 0;
background: #11111b; background: var(--crust);
color: var(--fg); color: var(--fg);
border: 1px solid var(--purple-dim); border: 1px solid var(--purple-dim);
padding: 0.5em 0.7em; padding: 0.5em 0.7em;

View file

@ -1126,7 +1126,7 @@ window.marked = marked;
const age = h.started_at const age = h.started_at
? fmtAgeSecs(nowUnix - h.started_at) + ' ago' : '?'; ? fmtAgeSecs(nowUnix - h.started_at) + ' ago' : '?';
const rowBtn = el('button', const rowBtn = el('button',
{ type: 'button', class: 'build-logs-row-btn' }, { type: 'button', class: 'build-logs-row-btn', 'aria-expanded': 'false' },
el('span', { class: `badge ${statusCls}` }, statusLabel), el('span', { class: `badge ${statusCls}` }, statusLabel),
el('span', { class: 'build-logs-kind' }, h.kind), el('span', { class: 'build-logs-kind' }, h.kind),
el('span', { class: 'build-logs-age meta' }, age), el('span', { class: 'build-logs-age meta' }, age),
@ -1136,10 +1136,15 @@ window.marked = marked;
detail.hidden = true; detail.hidden = true;
let loaded = false; let loaded = false;
rowBtn.addEventListener('click', async () => { rowBtn.addEventListener('click', async () => {
if (!detail.hidden) { detail.hidden = true; return; } if (!detail.hidden) {
detail.hidden = true;
rowBtn.setAttribute('aria-expanded', 'false');
return;
}
if (!loaded) { if (!loaded) {
detail.textContent = 'fetching…'; detail.textContent = 'fetching…';
detail.hidden = false; detail.hidden = false;
rowBtn.setAttribute('aria-expanded', 'true');
try { try {
const r2 = await fetch('/api/build-logs/id/' + h.id); const r2 = await fetch('/api/build-logs/id/' + h.id);
if (!r2.ok) { if (!r2.ok) {
@ -1156,6 +1161,7 @@ window.marked = marked;
} }
} else { } else {
detail.hidden = false; detail.hidden = false;
rowBtn.setAttribute('aria-expanded', 'true');
} }
}); });
li.append(rowBtn, detail); li.append(rowBtn, detail);

View file

@ -5,6 +5,7 @@
:root { :root {
--bg: #1e1e2e; /* base */ --bg: #1e1e2e; /* base */
--bg-elev: #181825; /* mantle */ --bg-elev: #181825; /* mantle */
--crust: #11111b; /* crust — terminal background */
--fg: #cdd6f4; /* text */ --fg: #cdd6f4; /* text */
--muted: #7f849c; /* overlay1 */ --muted: #7f849c; /* overlay1 */
--purple: #cba6f7; /* mauve */ --purple: #cba6f7; /* mauve */