007d22eb83
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.
20 lines
597 B
JavaScript
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);
|
|
}
|