Files
archie/ui/src/tasks/task-actions.ts
T
sam 5e1e365c05 feat(webui): events counts, YAML reading, log rows and dashboard filters
Four findings from the ui-redesign verification pass, each with the module that
owns the rule and the test that pins it.

- events: the three-step strip's and the tab chips' counts move out of the SFC
  into events/counts.ts -- one read per step, an unreadable count stays blank
  rather than reading as zero (events-counts.test.ts).
- workflows: workflows/workflow-yaml.ts reads the editor's YAML with a real
  parser (the yaml package, not a line scanner) to drive the read-only Steps
  preview and a live validity indicator; the editor gains a line-number gutter
  and light syntax colouring behind the textarea. Step types and their settings
  are not served to the dashboard, so those remain the server's to check on
  save, and a save it refuses still reports its own reason.
- tasks: an ERROR log row is a block rather than only red text (lib/log.ts), the
  log pane ends with "End of attempt N - M lines", and the task head offers
  Archive when the server's own action list offers it (task-actions.ts, and
  TaskRowActions' new `only` narrows the list without inventing a control).
- dashboard: the live activity feed gains the All/Tasks/System filter
  (activity-filter.ts) and every quality-gate row gains a pass bar
  (pass-bar.ts) that is red when the gate is failing.

ui/dist regenerated; ui/package.json carries yaml ^2.9.1.
2026-09-30 11:41:33 +10:00

18 lines
720 B
TypeScript

/**
* Which lifecycle controls a surface renders.
*
* A task offers whatever the server says it offers -- the action list rides
* with the task -- so a status the server will not archive is never offered an
* Archive control here. A surface may narrow that list to the controls it has
* room for (the task head has room for one), but narrowing can only ever
* remove: a control the server did not send cannot be conjured by naming it.
*/
export function shownActionIds(
actions: readonly string[] | null | undefined,
only?: readonly string[],
): string[] {
if (!Array.isArray(actions)) return [];
if (!only || only.length === 0) return [...actions];
return actions.filter((id) => only.includes(id));
}