Files
pipelines/web/src/format.js
T
alan 007d22eb83 web: split app.js into view modules
Pure move, behaviour unchanged: app.js is now the shell (boot, state, client wiring, connection/banner, navigation and routes, render dispatch, header). Views live under src/views with shared DOM and format helpers. client.js stays DOM-free; no circular imports; every server-derived string still uses textContent.
2026-10-19 16:37:31 +01:00

20 lines
597 B
JavaScript

// Shared display formatting and small status helpers used by the view modules.
// The date, duration and size formatters themselves live in their pure modules
// (runs.js, artifacts.js); this module owns the DOM-facing status mapping.
import { ChangeKind } from "./changes.js";
export function isExecuting(run) {
return Boolean(run && run.executing);
}
export function changeKindTone(kind) {
if (kind === ChangeKind.Added) return "ok";
if (kind === ChangeKind.Deleted) return "bad";
return "muted";
}
export function describeError(error) {
return error?.message || String(error);
}