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.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// 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);
|
||||
}
|
||||
Reference in New Issue
Block a user