devcontour-harness-ui 0.0.0-stage → 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +143 -2
- package/dist/app/assets/index-Det9VYJC.css +1 -0
- package/dist/app/assets/index-veveke8K.js +9 -0
- package/dist/app/index.html +13 -0
- package/dist/demo/ru/view.sample.json +483 -0
- package/dist/demo/ru/work.accepted.sample.json +187 -0
- package/dist/demo/ru/work.sample.json +171 -0
- package/dist/demo/view.sample.json +483 -0
- package/dist/demo/work.accepted.sample.json +187 -0
- package/dist/demo/work.sample.json +171 -0
- package/dist/lib/cli.d.ts +2 -0
- package/dist/lib/cli.js +160 -0
- package/dist/lib/components/Activity.d.ts +13 -0
- package/dist/lib/components/Activity.js +19 -0
- package/dist/lib/components/Decisions.d.ts +6 -0
- package/dist/lib/components/Decisions.js +19 -0
- package/dist/lib/components/Health.d.ts +8 -0
- package/dist/lib/components/Health.js +24 -0
- package/dist/lib/components/History.d.ts +32 -0
- package/dist/lib/components/History.js +129 -0
- package/dist/lib/components/Overview.d.ts +19 -0
- package/dist/lib/components/Overview.js +54 -0
- package/dist/lib/components/Reviews.d.ts +23 -0
- package/dist/lib/components/Reviews.js +22 -0
- package/dist/lib/components/Settings.d.ts +21 -0
- package/dist/lib/components/Settings.js +77 -0
- package/dist/lib/components/WorkDetail.d.ts +18 -0
- package/dist/lib/components/WorkDetail.js +96 -0
- package/dist/lib/components/common.d.ts +71 -0
- package/dist/lib/components/common.js +85 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.js +12 -0
- package/dist/lib/model/compat.d.ts +36 -0
- package/dist/lib/model/compat.js +365 -0
- package/dist/lib/model/dict.d.ts +387 -0
- package/dist/lib/model/dict.js +1119 -0
- package/dist/lib/model/format.d.ts +34 -0
- package/dist/lib/model/format.js +88 -0
- package/dist/lib/model/i18n.d.ts +44 -0
- package/dist/lib/model/i18n.js +109 -0
- package/dist/lib/model/index.d.ts +6 -0
- package/dist/lib/model/index.js +8 -0
- package/dist/lib/model/source.d.ts +16 -0
- package/dist/lib/model/source.js +57 -0
- package/dist/lib/model/view.d.ts +474 -0
- package/dist/lib/model/view.js +10 -0
- package/dist/lib/server/harness.d.ts +44 -0
- package/dist/lib/server/harness.js +172 -0
- package/dist/lib/server/serve.d.ts +62 -0
- package/dist/lib/server/serve.js +302 -0
- package/dist/lib/styles.css +485 -0
- package/docs/design.md +1689 -0
- package/docs/harness-proposals.md +560 -0
- package/docs/release-notes/0.1.0-alpha.1.md +96 -0
- package/docs/release-notes/0.1.0-alpha.2.md +218 -0
- package/package.json +75 -4
- package/skills/harness-ui/SKILL.md +246 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { instantMs } from "../model/compat.js";
|
|
3
|
+
import { dict } from "../model/dict.js";
|
|
4
|
+
import { formatUsd, formatWindow, usd } from "../model/format.js";
|
|
5
|
+
import { Heading, Term, clockOf } from "./common.js";
|
|
6
|
+
const W = 600;
|
|
7
|
+
const H = 160;
|
|
8
|
+
const HOUR = 3_600_000;
|
|
9
|
+
/**
|
|
10
|
+
* Sums groups of buckets into hours when the bucket divides an hour and the
|
|
11
|
+
* window holds whole hours; otherwise keeps the buckets (a partial last hour
|
|
12
|
+
* would be drawn as wide as a full one).
|
|
13
|
+
*/
|
|
14
|
+
export function perHour(h, values) {
|
|
15
|
+
if (!(h.bucketMs > 0 &&
|
|
16
|
+
h.bucketMs < HOUR &&
|
|
17
|
+
HOUR % h.bucketMs === 0 &&
|
|
18
|
+
values.length % (HOUR / h.bucketMs) === 0))
|
|
19
|
+
return { values, hourly: h.bucketMs === HOUR, groupMs: h.bucketMs };
|
|
20
|
+
const k = HOUR / h.bucketMs;
|
|
21
|
+
const out = [];
|
|
22
|
+
for (let i = 0; i < values.length; i += k)
|
|
23
|
+
out.push(values.slice(i, i + k).reduce((a, b) => a + b, 0));
|
|
24
|
+
return { values: out, hourly: true, groupMs: HOUR };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Cumulative spend at the bucket boundaries: `values[0]` is the opening
|
|
28
|
+
* balance (`spendOpeningUsd`) at `from`, `values[i]` the total at the end of
|
|
29
|
+
* bucket i. The end is exact only when both the window and the opening are
|
|
30
|
+
* exact; an unknown window bound (or one this build does not know) makes it
|
|
31
|
+
* unknown, never a number.
|
|
32
|
+
*/
|
|
33
|
+
export function cumulativeSpend(h) {
|
|
34
|
+
const openingKnown = h.spendOpeningUsd.bound === 'exact' || h.spendOpeningUsd.bound === 'lower';
|
|
35
|
+
const windowKnown = h.spendBound === 'exact' || h.spendBound === 'lower';
|
|
36
|
+
let sum = openingKnown ? h.spendOpeningUsd.value : 0;
|
|
37
|
+
const values = [sum, ...h.spendUsd.map((x) => (sum += x))];
|
|
38
|
+
const lower = h.spendBound !== 'exact' || h.spendOpeningUsd.bound !== 'exact';
|
|
39
|
+
const bound = !windowKnown ? 'unknown' : lower ? 'lower' : 'exact';
|
|
40
|
+
return { values, openingKnown, lower, end: { value: sum, bound } };
|
|
41
|
+
}
|
|
42
|
+
const maxOf = (xs) => xs.reduce((a, b) => (b > a ? b : a), 0);
|
|
43
|
+
function Chart({ id, title, summary, series, stacked, line, guide, guideLabel, times, axis, t, format = String, legend, }) {
|
|
44
|
+
const n = series[0]?.values.length ?? 0;
|
|
45
|
+
const tops = Array.from({ length: n }, (_, i) => stacked
|
|
46
|
+
? series.reduce((a, s) => a + (s.values[i] ?? 0), 0)
|
|
47
|
+
: maxOf(series.map((s) => s.values[i] ?? 0)));
|
|
48
|
+
const max = Math.max(1, guide ?? 0, maxOf(tops)) * 1.08;
|
|
49
|
+
const y = (v) => H - (v / max) * H;
|
|
50
|
+
const slot = n ? W / n : W;
|
|
51
|
+
const marks = [];
|
|
52
|
+
if (line) {
|
|
53
|
+
// Boundary values: the first point is the opening balance at the window start.
|
|
54
|
+
const step = n > 1 ? W / (n - 1) : W;
|
|
55
|
+
const pts = series[0].values.map((v, i) => `${i * step},${y(v)}`);
|
|
56
|
+
marks.push(_jsx("polyline", { className: 'hui-line ' + series[0].cls + (line.dashed ? ' hui-dashed' : ''), points: pts.join(' '), fill: "none", vectorEffect: "non-scaling-stroke" }, "line"));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const bw = Math.max(1, (stacked ? slot : slot / series.length) - 2);
|
|
60
|
+
for (let i = 0; i < n; i++) {
|
|
61
|
+
let base = 0;
|
|
62
|
+
series.forEach((s, j) => {
|
|
63
|
+
const v = s.values[i] ?? 0;
|
|
64
|
+
if (v <= 0)
|
|
65
|
+
return;
|
|
66
|
+
const x = stacked ? i * slot + 1 : i * slot + 1 + j * (slot / series.length);
|
|
67
|
+
const top = stacked ? base + v : v;
|
|
68
|
+
marks.push(_jsx("rect", { className: 'hui-bar ' + s.cls, x: x, y: y(top), width: bw, height: Math.max(0, y(base) - y(top) - (stacked && base > 0 ? 1 : 0)), children: _jsx("title", { children: `${times[i]}: ${s.name} ${format(v)}` }) }, `${i}-${j}`));
|
|
69
|
+
if (stacked)
|
|
70
|
+
base += v;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return (_jsxs("figure", { className: "hui-panel hui-chart", "data-testid": `chart-${id}`, "aria-labelledby": `hui-${id}-title`, children: [_jsxs("figcaption", { children: [_jsx("h3", { className: "hui-subtitle", id: `hui-${id}-title`, children: title }), _jsx("p", { className: "hui-chart-summary", "data-testid": `summary-${id}`, children: summary })] }), legend ? _jsx("div", { className: "hui-legend", children: legend }) : null, _jsxs("svg", { className: "hui-svg", viewBox: `0 0 ${W} ${H}`, preserveAspectRatio: "none", role: "img", "aria-labelledby": `hui-${id}-title`, focusable: "false", children: [_jsx("line", { className: "hui-axis", x1: "0", y1: H, x2: W, y2: H, vectorEffect: "non-scaling-stroke" }), marks, guide !== undefined ? (_jsx("line", { className: "hui-guide", x1: "0", x2: W, y1: y(guide), y2: y(guide), vectorEffect: "non-scaling-stroke", children: _jsx("title", { children: guideLabel }) })) : null] }), _jsxs("div", { className: "hui-axis-labels", "aria-hidden": "true", children: [_jsx("span", { children: axis[0] }), _jsx("span", { children: axis[1] }), _jsx("span", { children: axis[2] })] }), _jsx("div", { className: "hui-sr", children: _jsxs("table", { children: [_jsx("caption", { children: t.history.dataTable(title) }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: t.history.time }), series.map((s) => (_jsx("th", { scope: "col", children: s.name }, s.name)))] }) }), _jsx("tbody", { children: times.map((time, i) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: time }), series.map((s) => (_jsx("td", { children: format(s.values[i] ?? 0) }, s.name)))] }, i))) })] }) })] }));
|
|
75
|
+
}
|
|
76
|
+
const Key = ({ cls, children, dashed }) => (_jsxs("span", { className: "hui-key", children: [_jsx("span", { className: 'hui-swatch ' + cls + (dashed ? ' hui-swatch-dashed' : ''), "aria-hidden": "true" }), children] }));
|
|
77
|
+
export function History({ view, lang = 'ru', timeZone, now: nowProp }) {
|
|
78
|
+
const t = dict(lang);
|
|
79
|
+
// Clocks of another day than the view's carry a date, so a 24 h window reads unambiguously.
|
|
80
|
+
const now = nowProp ?? instantMs(view.generatedAt);
|
|
81
|
+
const v = t.history;
|
|
82
|
+
const h = view.history;
|
|
83
|
+
const from = instantMs(h.from);
|
|
84
|
+
// A finite number can still be outside the Date range: unknown, never a crash.
|
|
85
|
+
const clock = (ms) => Number.isFinite(ms) && Math.abs(ms) <= 8.64e15
|
|
86
|
+
? clockOf(new Date(ms).toISOString(), t, timeZone, now)
|
|
87
|
+
: t.unknown;
|
|
88
|
+
const series = [
|
|
89
|
+
h.load,
|
|
90
|
+
h.attemptsStarted,
|
|
91
|
+
h.attemptsFailed,
|
|
92
|
+
h.gatesPassed,
|
|
93
|
+
h.gatesFailed,
|
|
94
|
+
h.gatesReused,
|
|
95
|
+
h.spendUsd,
|
|
96
|
+
];
|
|
97
|
+
const n = h.load.length;
|
|
98
|
+
const aligned = n > 0 && series.every((s) => s.length === n);
|
|
99
|
+
const sum = (xs) => xs.reduce((a, b) => a + b, 0);
|
|
100
|
+
const timesOf = (count, stepMs) => Array.from({ length: count }, (_, i) => clock(from + i * stepMs));
|
|
101
|
+
const axis = [
|
|
102
|
+
clockOf(h.from, t, timeZone, now),
|
|
103
|
+
clock((instantMs(h.from) + instantMs(h.to)) / 2),
|
|
104
|
+
clockOf(h.to, t, timeZone, now),
|
|
105
|
+
];
|
|
106
|
+
const times = timesOf(n, h.bucketMs);
|
|
107
|
+
const started = perHour(h, h.attemptsStarted);
|
|
108
|
+
const failed = perHour(h, h.attemptsFailed);
|
|
109
|
+
const hourTimes = timesOf(started.values.length, started.groupMs);
|
|
110
|
+
const spend = cumulativeSpend(h);
|
|
111
|
+
const slots = view.settings.concurrency;
|
|
112
|
+
return (_jsxs("section", { className: "hui hui-history", "aria-labelledby": "hui-history-title", lang: lang, children: [_jsx(Heading, { t: t, level: 2, id: "hui-history-title", children: v.label }), _jsx("p", { className: "hui-muted", "data-testid": "history-window", children: v.window(clockOf(h.from, t, timeZone, now), clockOf(h.to, t, timeZone, now), formatWindow(h.bucketMs, lang)) }), !aligned ? (_jsx("p", { className: "hui-panel hui-bad", "data-testid": "history-misaligned", children: v.misaligned })) : (_jsxs("div", { className: "hui-charts", children: [_jsx(Chart, { id: "load", title: v.load, t: t, times: times, axis: axis, series: [{ name: v.peak, values: h.load, cls: 'hui-s1' }], guide: slots, guideLabel: v.slotsLine(slots), summary: v.loadSummary(maxOf(h.load), slots), legend: _jsxs(_Fragment, { children: [_jsx(Key, { cls: "hui-s1", children: v.peak }), _jsx(Key, { cls: "hui-guide-key", dashed: true, children: v.slotsLine(slots) })] }) }), _jsx(Chart, { id: "attempts", title: started.hourly ? v.attempts : v.attemptsBucket, t: t, times: hourTimes, axis: axis, series: [
|
|
113
|
+
{ name: v.started, values: started.values, cls: 'hui-s1' },
|
|
114
|
+
{ name: v.failed, values: failed.values, cls: 'hui-s2' },
|
|
115
|
+
], summary: (started.hourly ? v.attemptsSummary : v.attemptsSummaryBucket)(sum(h.attemptsStarted), sum(h.attemptsFailed), maxOf(started.values)), legend: _jsxs(_Fragment, { children: [_jsx(Key, { cls: "hui-s1", children: v.started }), _jsx(Key, { cls: "hui-s2", children: v.failed })] }) }), _jsx(Chart, { id: "gates", title: v.gates, t: t, times: times, axis: axis, stacked: true, series: [
|
|
116
|
+
{ name: v.passed, values: h.gatesPassed, cls: 'hui-s1' },
|
|
117
|
+
{ name: v.gateFailed, values: h.gatesFailed, cls: 'hui-s2' },
|
|
118
|
+
], summary: _jsxs(_Fragment, { children: [v.gatesSummary(sum(h.gatesPassed), sum(h.gatesFailed), sum(h.gatesReused)), " "] }), legend: _jsxs(_Fragment, { children: [_jsx(Key, { cls: "hui-s1", children: v.passed }), _jsx(Key, { cls: "hui-s2", children: v.gateFailed })] }) }), _jsx(Chart, { id: "spend", title: v.spend, t: t, axis: axis, line: { dashed: spend.lower }, times: timesOf(n + 1, h.bucketMs), series: [
|
|
119
|
+
{
|
|
120
|
+
name: v.cumulative + (spend.lower ? ` (${v.lowerBound})` : ''),
|
|
121
|
+
values: spend.values,
|
|
122
|
+
cls: 'hui-s1',
|
|
123
|
+
},
|
|
124
|
+
], format: (x) => usd(x), ...(h.budgetUsd !== undefined
|
|
125
|
+
? { guide: h.budgetUsd, guideLabel: v.budgetLine(usd(h.budgetUsd)) }
|
|
126
|
+
: {}), summary: _jsxs(_Fragment, { children: [v.spendSummary(formatUsd(spend.end, lang), h.budgetUsd !== undefined ? usd(h.budgetUsd) : undefined), ' ', spend.openingKnown
|
|
127
|
+
? v.spendOpening(formatUsd(h.spendOpeningUsd, lang))
|
|
128
|
+
: v.spendOpeningUnknown, h.budgetUsd === undefined ? ` ${v.noBudgetLine}.` : ''] }), legend: _jsxs(_Fragment, { children: [_jsxs(Key, { cls: "hui-s1", dashed: spend.lower, children: [v.cumulative, spend.lower ? ` — ${v.lowerBound}` : ''] }), h.budgetUsd !== undefined ? (_jsx(Key, { cls: "hui-guide-key", dashed: true, children: v.budgetLine(usd(h.budgetUsd)) })) : null] }) })] })), _jsxs("div", { className: "hui-terms", children: [_jsx(Term, { id: "gates", t: t, named: true }), _jsx(Term, { id: "lowerBound", t: t, named: true }), _jsx(Term, { id: "attempt", t: t, named: true })] })] }));
|
|
129
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { OperatorView, ViewHealth } from '../model/view.ts';
|
|
2
|
+
import { type ScreenProps } from './common.tsx';
|
|
3
|
+
export interface OverviewProps extends ScreenProps {
|
|
4
|
+
view: OperatorView;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The most severe budget row, whatever `budgeting` says: a row the producer
|
|
8
|
+
* sent is never hidden. `undefined` only when there are no rows.
|
|
9
|
+
*/
|
|
10
|
+
export declare function worstBudget(health: ViewHealth): {
|
|
11
|
+
scope: "work" | "group" | "total";
|
|
12
|
+
id?: string;
|
|
13
|
+
state: "within" | "exceeded" | "undetermined";
|
|
14
|
+
spentUsd: import("../model/view.ts").Bounded;
|
|
15
|
+
limitUsd?: number;
|
|
16
|
+
spentMs?: number;
|
|
17
|
+
limitMs?: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
export declare function Overview({ view, now, onOpenWork, workHref, lang, timeZone, }: OverviewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { KNOWN_QUESTION_STATES, SLOT_STAGES, formatDuration, formatElapsed, formatUsd, questionStatus, stageLabel, usd, } from "../model/format.js";
|
|
3
|
+
import { instantMs } from "../model/compat.js";
|
|
4
|
+
import { dict, label } from "../model/dict.js";
|
|
5
|
+
import { footerSentence, headerSentence } from "../model/i18n.js";
|
|
6
|
+
import { AcceptedLine, BlockerLine, Clipped, Heading, StageStatus, Term, WorkRef, actorLabel, clockOf, } from "./common.js";
|
|
7
|
+
const severityOrder = ['exceeded', 'undetermined', 'within'];
|
|
8
|
+
/**
|
|
9
|
+
* The most severe budget row, whatever `budgeting` says: a row the producer
|
|
10
|
+
* sent is never hidden. `undefined` only when there are no rows.
|
|
11
|
+
*/
|
|
12
|
+
export function worstBudget(health) {
|
|
13
|
+
if (!health.budgets.length)
|
|
14
|
+
return undefined;
|
|
15
|
+
const rank = (s) => {
|
|
16
|
+
const i = severityOrder.indexOf(s);
|
|
17
|
+
return i < 0 ? 1 : i; // unknown state reads as undetermined
|
|
18
|
+
};
|
|
19
|
+
return [...health.budgets].sort((a, b) => rank(a.state) - rank(b.state))[0];
|
|
20
|
+
}
|
|
21
|
+
export function Overview({ view, now, onOpenWork, workHref, lang = 'ru', timeZone, }) {
|
|
22
|
+
const t = dict(lang);
|
|
23
|
+
const o = t.overview;
|
|
24
|
+
const clock = now ?? instantMs(view.generatedAt);
|
|
25
|
+
const links = { onOpenWork, workHref };
|
|
26
|
+
const { progress, health } = view;
|
|
27
|
+
const running = view.works.filter((w) => SLOT_STAGES.has(w.stage.name));
|
|
28
|
+
const asking = view.questions.filter((q) => questionStatus(q).needsAnswer);
|
|
29
|
+
const otherQuestions = view.questions.filter((q) => !questionStatus(q).needsAnswer);
|
|
30
|
+
const budget = worstBudget(health);
|
|
31
|
+
// Works listed with a location; the count itself is `progress.done`.
|
|
32
|
+
const accepted = view.works.filter((w) => w.target !== undefined);
|
|
33
|
+
const waiting = view.works.filter((w) => w.blockers.length > 0 || w.stage.name === 'stopped' || w.stage.name === 'blocked');
|
|
34
|
+
const deciding = view.escalations.filter((e) => e.actor === 'operator' || e.actor === 'lead');
|
|
35
|
+
const count = (stage) => Object.hasOwn(progress.byStage, stage) ? Number(progress.byStage[stage]) || 0 : 0;
|
|
36
|
+
const sentence = headerSentence({
|
|
37
|
+
running: progress.running,
|
|
38
|
+
queued: count('queued'),
|
|
39
|
+
stopped: count('stopped'),
|
|
40
|
+
paused: progress.queue.paused,
|
|
41
|
+
questions: asking.length,
|
|
42
|
+
decisions: view.escalations.filter((e) => e.actor === 'operator').length,
|
|
43
|
+
waitingOperator: progress.waitingOperator,
|
|
44
|
+
// A clipped list or a question state this build does not know makes the
|
|
45
|
+
// count a floor: the sentence then never says "nothing is needed".
|
|
46
|
+
incomplete: Boolean(view.truncated?.questions || view.truncated?.escalations) ||
|
|
47
|
+
view.questions.some((q) => !KNOWN_QUESTION_STATES.has(String(q.state))),
|
|
48
|
+
}, lang);
|
|
49
|
+
const inspect = (requestId) => (_jsxs("code", { children: ["harness input-show --state <state> --request ", requestId] }));
|
|
50
|
+
return (_jsxs("section", { className: "hui hui-overview", "aria-label": o.label, lang: lang, children: [_jsxs("header", { className: "hui-row hui-header", children: [_jsx("h2", { className: "hui-title", children: "Harness" }), _jsx("span", { className: 'hui-badge ' + (progress.queue.paused ? 'hui-warn' : 'hui-ok'), "data-testid": "queue-state", children: progress.queue.paused ? o.queuePaused(progress.queue.reason ?? '') : o.queueRunning }), progress.queue.paused ? (_jsxs("span", { "data-status": "blocked", "data-testid": "queue-who", children: [progress.queue.detail ? _jsxs("span", { children: [progress.queue.detail, " \u2014 "] }) : null, _jsx("span", { className: "hui-who", children: o.queueWho(actorLabel(t, progress.queue.actor), progress.queue.action ?? '') })] })) : null, _jsx("span", { className: "hui-muted", children: o.acceptedOf(progress.done, progress.total) })] }), _jsx("p", { className: "hui-lead", "data-testid": "sentence", children: sentence }), view.works.length ? (_jsxs("div", { className: "hui-panel", "data-testid": "plan", children: [_jsx(Heading, { t: t, term: "stage", children: o.plan }), _jsx("ol", { className: "hui-plan", children: view.works.map((w) => (_jsxs("li", { className: 'hui-plan-step' + (SLOT_STAGES.has(w.stage.name) ? ' hui-current' : ''), children: [_jsx(WorkRef, { id: w.id, ...links }), " ", _jsx(StageStatus, { w: w, lang: lang, linkProps: links }), w.dependsOn?.length ? (_jsxs("span", { className: "hui-muted", children: [" ", o.after(w.dependsOn.join(', '))] })) : null] }, w.id))) }), view.truncated?.works ? _jsx("p", { className: "hui-muted", children: o.planClipped }) : null] })) : null, _jsxs("div", { className: "hui-panel", "data-testid": "needs-you", children: [_jsx(Heading, { t: t, term: "technical", children: o.needsYou(asking.length) }), asking.length === 0 ? (_jsx("p", { className: "hui-muted", children: view.truncated?.questions ? t.header.unknownClipped : o.noQuestions })) : (_jsx("ul", { className: "hui-list", children: asking.map((q) => (_jsxs("li", { className: "hui-item", children: [_jsx("span", { className: "hui-badge hui-warn", children: t.question.severity(q.severity) }), ' ', _jsx(WorkRef, { id: q.workId, ...links }), " ", q.title ? _jsx("span", { children: q.title }) : null, q.plain ? (_jsxs("div", { children: [t.question.whatChanges, " ", q.plain] })) : null, _jsxs("div", { className: "hui-muted", children: [questionStatus(q, lang).text, " ", t.question.full, " ", inspect(q.requestId), " (", t.question.version(q.version), ")."] })] }, q.requestId))) })), _jsx(Clipped, { n: view.truncated?.questions, t: t }), otherQuestions.length ? (_jsx("ul", { className: "hui-list hui-secondary", "data-testid": "other-questions", children: otherQuestions.map((q) => (_jsxs("li", { className: "hui-item hui-muted", children: [_jsx(WorkRef, { id: q.workId, ...links }), " ", _jsx("code", { children: q.requestId }), ":", ' ', questionStatus(q, lang).text] }, q.requestId))) })) : null] }), _jsxs("div", { className: "hui-panel", "data-testid": "now", children: [_jsx(Heading, { t: t, term: "attempt", children: o.now(progress.running, view.settings.concurrency) }), running.length === 0 && progress.running === 0 ? (_jsx("p", { className: "hui-muted", children: o.nothingRunning })) : (_jsx("ul", { className: "hui-list", children: running.map((w) => (_jsxs("li", { className: "hui-item", children: [_jsxs("div", { className: "hui-row", children: [_jsx(WorkRef, { id: w.id, ...links }), _jsx("span", { className: "hui-badge", children: stageLabel(w.stage.name, lang) }), w.stage.step ? _jsx("code", { className: "hui-muted", children: w.stage.step }) : null, w.liveness && w.liveness !== 'active' ? (_jsx("span", { className: "hui-badge hui-warn", children: label(t.liveness, w.liveness) })) : null, w.stage.since ? (_jsx("span", { className: "hui-muted", children: formatElapsed(w.stage.since, clock, lang) })) : null, w.stage.typical ? (_jsx("span", { className: "hui-muted", children: t.typicalRange(formatDuration(w.stage.typical.p50Ms, lang), formatDuration(w.stage.typical.p90Ms, lang)) })) : null] }), _jsxs("div", { className: "hui-muted", children: [w.attempts.line ??
|
|
51
|
+
o.attemptsShort(w.attempts.used, w.attempts.max, w.attempts.left), w.attempts.lastFailure ? `; ${o.lastStopped(w.attempts.lastFailure.plain)}` : ''] })] }, w.id))) })), progress.running > running.length ? (_jsx("p", { className: "hui-muted", "data-testid": "running-truncated", children: o.runningUnlisted(progress.running - running.length) })) : null] }), _jsxs("div", { className: "hui-panel", "data-testid": "decisions", children: [_jsx(Heading, { t: t, term: "escalation", children: o.decisions(deciding.length) }), deciding.length === 0 ? (_jsx("p", { className: "hui-muted", children: view.truncated?.escalations ? t.header.unknownClipped : o.noDecisions })) : (_jsx("ul", { className: "hui-list", children: deciding.map((e, i) => (_jsxs("li", { className: "hui-item", "data-status": "blocked", children: [e.workId ? _jsx(WorkRef, { id: e.workId, ...links }) : _jsx("code", { children: e.subject ?? '—' }), ' ', _jsx("code", { className: "hui-muted", children: e.code }), ' ', _jsx("span", { className: "hui-who", children: o.whoActs(actorLabel(t, e.actor), e.action) }), ' ', _jsxs("span", { className: "hui-muted", children: ["(", clockOf(e.since, t, timeZone, now), ")"] })] }, i))) })), _jsx(Clipped, { n: view.truncated?.escalations, t: t })] }), _jsxs("div", { className: "hui-panel", "data-testid": "waiting", children: [_jsx(Heading, { t: t, term: "waitsQueue", children: o.waiting }), waiting.length === 0 ? (_jsx("p", { className: "hui-muted", children: o.noWaiting })) : (_jsx("ul", { className: "hui-list", children: waiting.map((w) => (_jsxs("li", { className: "hui-item", children: [_jsx(WorkRef, { id: w.id, ...links }), ' ', _jsx("span", { className: "hui-badge", children: stageLabel(w.stage.name, lang) }), _jsx("ul", { className: "hui-list hui-nested", children: w.blockers.length ? (w.blockers.map((b, i) => _jsx(BlockerLine, { b: b, t: t }, i))) : w.stage.needs ? (_jsxs("li", { className: "hui-item", "data-status": "blocked", children: [w.stage.needs.action, " \u2014", ' ', _jsx("span", { className: "hui-who", children: w.stage.needs.actor === null
|
|
52
|
+
? t.blocker.nobody
|
|
53
|
+
: t.blocker.whoActs(actorLabel(t, w.stage.needs.actor)) })] })) : (_jsxs("li", { className: "hui-item", "data-status": "blocked", children: [t.blocker.noReason(w.stage.name), " \u2014", ' ', _jsx("span", { className: "hui-who", children: t.blocker.whoActs(t.unknown) })] })) })] }, w.id))) }))] }), accepted.length || progress.done ? (_jsxs("div", { className: "hui-panel", "data-testid": "accepted", children: [_jsx(Heading, { t: t, term: "accepted", children: o.accepted(progress.done) }), _jsx("ul", { className: "hui-list", children: accepted.map((w) => (_jsxs("li", { className: "hui-item", children: [_jsx(WorkRef, { id: w.id, ...links }), " ", _jsx("code", { className: "hui-muted", children: w.target.ref }), _jsx(AcceptedLine, { w: w, lang: lang, linkProps: links })] }, w.id))) }), progress.done > accepted.length ? (_jsx("p", { className: "hui-muted", "data-testid": "accepted-unlisted", children: o.acceptedUnlisted(progress.done - accepted.length, Boolean(view.truncated?.works)) })) : null] })) : null, _jsxs("dl", { className: "hui-grid", "data-testid": "health", children: [_jsxs("div", { children: [_jsx("dt", { children: o.budget }), budget ? (_jsxs("dd", { className: budget.state === 'within' ? '' : 'hui-bad', children: [formatUsd(budget.spentUsd, lang), budget.limitUsd !== undefined ? ` ${t.ofLimit(usd(budget.limitUsd))}` : '', " (", label(t.budgetScope, budget.scope), budget.id ? ` ${budget.id}` : '', ": ", label(t.budgetState, budget.state), ")"] })) : (_jsxs("dd", { "data-testid": "no-budget", children: [health.budgeting === 'off' ? o.noBudget : o.budgetUnknown, ";", ' ', o.spent(formatUsd(health.spentTotalUsd, lang))] }))] }), _jsxs("div", { children: [_jsx("dt", { children: o.controller }), _jsx("dd", { className: health.controller.present ? '' : 'hui-bad', children: health.controller.present ? o.controllerPresent : o.controllerAbsent })] }), _jsxs("div", { children: [_jsx("dt", { children: o.stalled }), _jsx("dd", { className: health.stalledAttempts ? 'hui-bad' : '', children: health.stalledAttempts })] }), _jsxs("div", { children: [_jsx("dt", { children: o.drift }), _jsxs("dd", { children: [health.drift.drifted, health.drift.unavailable ? ` (${o.driftNotChecked(health.drift.unavailable)})` : ''] })] })] }), _jsxs("div", { className: "hui-terms", children: [_jsx(Term, { id: "controller", t: t, named: true }), _jsx(Term, { id: "drift", t: t, named: true }), _jsx(Term, { id: "lowerBound", t: t, named: true })] }), health.warnings.length ? (_jsx("ul", { className: "hui-list hui-secondary", "data-testid": "warnings", "aria-label": o.warnings, children: health.warnings.map((w, i) => (_jsxs("li", { className: "hui-item", children: [_jsx("code", { className: "hui-muted", children: w.code }), " ", w.message] }, i))) })) : null, _jsx("footer", { className: "hui-muted hui-footer", "data-testid": "footer", children: footerSentence(view.generatedAt, lang, timeZone, now) })] }));
|
|
54
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Dict, Lang } from '../model/dict.ts';
|
|
2
|
+
import type { Escalation, OperatorView, ReviewSubjectView } from '../model/view.ts';
|
|
3
|
+
import { type ScreenProps } from './common.tsx';
|
|
4
|
+
export interface ReviewsProps extends ScreenProps {
|
|
5
|
+
view: OperatorView;
|
|
6
|
+
/** Findings start collapsed (narrow screens, design §5.3). */
|
|
7
|
+
collapseFindings?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** One review subject as a card: counters, findings with decisions, escalation. */
|
|
10
|
+
export declare function ReviewSubjectCard({ r, lang, links, collapsed, }: {
|
|
11
|
+
r: ReviewSubjectView;
|
|
12
|
+
lang: Lang;
|
|
13
|
+
links: Pick<ScreenProps, 'onOpenWork' | 'workHref'>;
|
|
14
|
+
collapsed?: boolean;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function EscalationList({ items, t, links, timeZone, now, }: {
|
|
17
|
+
items: Escalation[];
|
|
18
|
+
t: Dict;
|
|
19
|
+
links: Pick<ScreenProps, 'onOpenWork' | 'workHref'>;
|
|
20
|
+
timeZone?: string;
|
|
21
|
+
now?: number;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function Reviews({ view, lang, onOpenWork, workHref, timeZone, now, collapseFindings, }: ReviewsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { dict, label } from "../model/dict.js";
|
|
3
|
+
import { formatUsd } from "../model/format.js";
|
|
4
|
+
import { Clipped, Heading, WorkRef, actorLabel, clockOf } from "./common.js";
|
|
5
|
+
const bindingText = (b, t) => b ? [b.runtime, b.model].filter(Boolean).join(' · ') : t.reviews.reviewerUnknown;
|
|
6
|
+
/** One review subject as a card: counters, findings with decisions, escalation. */
|
|
7
|
+
export function ReviewSubjectCard({ r, lang, links, collapsed, }) {
|
|
8
|
+
const t = dict(lang);
|
|
9
|
+
const v = t.reviews;
|
|
10
|
+
return (_jsxs("article", { className: "hui-panel hui-card", "data-testid": `review-${r.kind}-${r.subject}`, children: [_jsxs("div", { className: "hui-row", children: [_jsx("strong", { children: _jsx("code", { children: r.subject }) }), _jsx("span", { className: "hui-badge", children: label(v.kind, r.kind) }), _jsx("span", { className: 'hui-badge ' + (r.approved ? 'hui-ok' : 'hui-warn'), children: r.approved ? v.approved : v.notApproved }), r.workId ? _jsx(WorkRef, { id: r.workId, ...links }) : null, r.sameVendor ? _jsx("span", { className: "hui-badge hui-warn", children: v.sameVendor }) : null] }), r.line ? _jsx("p", { className: "hui-muted", children: r.line }) : null, _jsxs("ul", { className: "hui-facts", children: [_jsx("li", { children: v.rounds(r.rounds.used, r.rounds.max) }), _jsx("li", { children: v.open(r.open.blocking, r.open.notes) }), _jsx("li", { children: v.acceptedLimits(r.accepted) }), _jsx("li", { children: v.reviewer(bindingText(r.reviewer, t)) }), _jsxs("li", { children: [formatUsd(r.spend.usd, lang), " \u00B7 ", t.calls(r.spend.calls)] })] }), _jsxs("details", { className: "hui-findings", open: !collapsed, children: [_jsx("summary", { children: v.findings(r.findings.length) }), r.findings.length === 0 ? (_jsx("p", { className: "hui-muted", children: v.noFindings })) : (_jsx("ul", { className: "hui-list", children: r.findings.map((f) => (_jsxs("li", { className: "hui-item", "data-testid": `finding-${f.id}`, children: [_jsx("code", { children: f.id }), " ", _jsx("span", { className: "hui-badge", children: f.severity }), ' ', _jsx("span", { children: label(v.finding, f.status) }), f.rounds !== undefined ? (_jsxs("span", { className: "hui-muted", children: [" \u00B7 ", v.findingRounds(f.rounds)] })) : null, f.disposition ? (_jsx("div", { className: "hui-who", children: v.decidedBy(label(v.disposition, f.disposition.decision), actorLabel(t, f.disposition.by), f.disposition.round) })) : null, f.title ? _jsx("div", { className: "hui-muted", children: f.title }) : null] }, f.id))) }))] }), r.escalation ? (_jsxs("p", { className: "hui-escalation", "data-status": "blocked", children: ["\u26A0 ", v.escalation(r.escalation.requestId, r.escalation.findings.join(', ')), " (", r.escalation.answered ? v.escalationAnswered : v.escalationOpen, ")"] })) : null] }));
|
|
11
|
+
}
|
|
12
|
+
export function EscalationList({ items, t, links, timeZone, now, }) {
|
|
13
|
+
if (!items.length)
|
|
14
|
+
return _jsx("p", { className: "hui-muted", children: t.reviews.noEscalations });
|
|
15
|
+
return (_jsx("ul", { className: "hui-list", children: items.map((e, i) => (_jsxs("li", { className: "hui-item", "data-status": "blocked", children: [e.workId ? _jsx(WorkRef, { id: e.workId, ...links }) : null, e.subject ? _jsxs("code", { children: [" ", e.subject] }) : null, " ", _jsx("code", { className: "hui-muted", children: e.code }), ' ', _jsx("span", { className: "hui-who", children: t.overview.whoActs(actorLabel(t, e.actor), e.action) }), ' ', _jsxs("span", { className: "hui-muted", children: ["(", clockOf(e.since, t, timeZone, now), ")"] })] }, i))) }));
|
|
16
|
+
}
|
|
17
|
+
export function Reviews({ view, lang = 'ru', onOpenWork, workHref, timeZone, now, collapseFindings, }) {
|
|
18
|
+
const t = dict(lang);
|
|
19
|
+
const v = t.reviews;
|
|
20
|
+
const links = { onOpenWork, workHref };
|
|
21
|
+
return (_jsxs("section", { className: "hui hui-reviews", "aria-labelledby": "hui-reviews-title", lang: lang, children: [_jsx(Heading, { t: t, term: "review", level: 2, id: "hui-reviews-title", children: v.label }), _jsxs("div", { className: "hui-panel", "data-testid": "escalations", children: [_jsx(Heading, { t: t, term: "escalation", children: v.escalations(view.escalations.length) }), _jsx(EscalationList, { items: view.escalations, t: t, links: links, timeZone: timeZone, ...(now !== undefined ? { now } : {}) }), _jsx(Clipped, { n: view.truncated?.escalations, t: t })] }), view.reviews.length === 0 ? (_jsx("p", { className: "hui-muted", children: v.none })) : (_jsxs(_Fragment, { children: [_jsxs("table", { className: "hui-table", "data-testid": "reviews-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: v.col.subject }), _jsx("th", { scope: "col", children: v.col.kind }), _jsx("th", { scope: "col", children: v.col.rounds }), _jsx("th", { scope: "col", children: v.col.open }), _jsx("th", { scope: "col", children: v.col.accepted }), _jsx("th", { scope: "col", children: v.col.reviewer })] }) }), _jsx("tbody", { children: view.reviews.map((r) => (_jsxs("tr", { children: [_jsx("td", { "data-label": v.col.subject, children: _jsx("code", { children: r.subject }) }), _jsx("td", { "data-label": v.col.kind, children: label(v.kind, r.kind) }), _jsx("td", { "data-label": v.col.rounds, children: v.rounds(r.rounds.used, r.rounds.max) }), _jsx("td", { "data-label": v.col.open, children: v.open(r.open.blocking, r.open.notes) }), _jsx("td", { "data-label": v.col.accepted, children: r.accepted }), _jsx("td", { "data-label": v.col.reviewer, children: bindingText(r.reviewer, t) })] }, r.kind + ':' + r.subject))) })] }), view.reviews.map((r) => (_jsx(ReviewSubjectCard, { r: r, lang: lang, links: links, collapsed: Boolean(collapseFindings) }, r.kind + ':' + r.subject)))] })), _jsx(Clipped, { n: view.truncated?.reviews, t: t }), _jsx(Clipped, { n: view.truncated?.findings, t: t })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OperatorView, ReviewRuleView, RoleBinding } from '../model/view.ts';
|
|
2
|
+
import { type ScreenProps } from './common.tsx';
|
|
3
|
+
export interface SettingsProps extends Pick<ScreenProps, 'lang'> {
|
|
4
|
+
view: OperatorView;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The code-review rule in force for a role binding: a role rule (for this
|
|
8
|
+
* repository, or for any), then the repository rule, then the global rule.
|
|
9
|
+
* `undefined` when the view lists none (e.g. the list was clipped).
|
|
10
|
+
*/
|
|
11
|
+
export declare function effectiveCodeReview(rules: ReviewRuleView[], r: Pick<RoleBinding, 'role' | 'repositoryId'>): ReviewRuleView | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Role and repository pairs to show the effective code reviewer for: each
|
|
14
|
+
* role binding, plus each repository a code-review rule names, plus "other
|
|
15
|
+
* repositories" for each role. Display work over the listed rules only.
|
|
16
|
+
*/
|
|
17
|
+
export declare function reviewPairs(roles: RoleBinding[], rules: ReviewRuleView[]): {
|
|
18
|
+
role: string;
|
|
19
|
+
repositoryId?: string;
|
|
20
|
+
}[];
|
|
21
|
+
export declare function Settings({ view, lang }: SettingsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Settings screen (read-only): who works, who reviews, when you are asked,
|
|
3
|
+
// limits, budgets, timeouts, the lean layer. Every value has its unit; the
|
|
4
|
+
// "default" mark appears only for paths in `settings.defaulted`. For each
|
|
5
|
+
// role (and repository) the effective code reviewer and where it comes from
|
|
6
|
+
// are shown, by the harness resolution role -> repository -> global.
|
|
7
|
+
import { dict, label } from "../model/dict.js";
|
|
8
|
+
import { formatDuration, usd } from "../model/format.js";
|
|
9
|
+
import { Clipped, Heading } from "./common.js";
|
|
10
|
+
const bindingText = (b, t) => t.settings.binding(b.runtime, b.model, b.effort);
|
|
11
|
+
/**
|
|
12
|
+
* The code-review rule in force for a role binding: a role rule (for this
|
|
13
|
+
* repository, or for any), then the repository rule, then the global rule.
|
|
14
|
+
* `undefined` when the view lists none (e.g. the list was clipped).
|
|
15
|
+
*/
|
|
16
|
+
export function effectiveCodeReview(rules, r) {
|
|
17
|
+
const code = rules.filter((x) => x.kind === 'code');
|
|
18
|
+
return (code.find((x) => x.scope === 'role' && x.role === r.role && x.repositoryId === r.repositoryId) ??
|
|
19
|
+
code.find((x) => x.scope === 'role' && x.role === r.role && x.repositoryId === undefined) ??
|
|
20
|
+
(r.repositoryId !== undefined
|
|
21
|
+
? code.find((x) => x.scope === 'repository' && x.repositoryId === r.repositoryId)
|
|
22
|
+
: undefined) ??
|
|
23
|
+
code.find((x) => x.scope === 'global'));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Role and repository pairs to show the effective code reviewer for: each
|
|
27
|
+
* role binding, plus each repository a code-review rule names, plus "other
|
|
28
|
+
* repositories" for each role. Display work over the listed rules only.
|
|
29
|
+
*/
|
|
30
|
+
export function reviewPairs(roles, rules) {
|
|
31
|
+
const repos = new Set();
|
|
32
|
+
for (const r of roles)
|
|
33
|
+
if (r.repositoryId)
|
|
34
|
+
repos.add(r.repositoryId);
|
|
35
|
+
for (const r of rules)
|
|
36
|
+
if (r.kind === 'code' && r.repositoryId)
|
|
37
|
+
repos.add(r.repositoryId);
|
|
38
|
+
const out = [];
|
|
39
|
+
const seen = new Set();
|
|
40
|
+
const add = (role, repositoryId) => {
|
|
41
|
+
const k = role + '\0' + (repositoryId ?? '');
|
|
42
|
+
if (seen.has(k))
|
|
43
|
+
return;
|
|
44
|
+
seen.add(k);
|
|
45
|
+
out.push(repositoryId === undefined ? { role } : { role, repositoryId });
|
|
46
|
+
};
|
|
47
|
+
for (const role of new Set(roles.map((r) => r.role))) {
|
|
48
|
+
add(role);
|
|
49
|
+
for (const repo of [...repos].sort())
|
|
50
|
+
add(role, repo);
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
export function Settings({ view, lang = 'ru' }) {
|
|
55
|
+
const t = dict(lang);
|
|
56
|
+
const v = t.settings;
|
|
57
|
+
const s = view.settings;
|
|
58
|
+
const th = s.thresholds;
|
|
59
|
+
const isDefault = (path) => s.defaulted.some((d) => d === path || path.startsWith(d + '.'));
|
|
60
|
+
const row = (term, value, path) => (_jsxs("div", { className: "hui-def", children: [_jsx("dt", { children: term }), _jsxs("dd", { children: [value, path && isDefault(path) ? (_jsx("span", { className: "hui-badge hui-default", "data-testid": `default-${path}`, children: t.byDefault })) : null] })] }, term));
|
|
61
|
+
const scopeText = (r) => v.scopeOf(label(v.scope, r.scope), [r.role, r.repositoryId].filter(Boolean).join(' / ') || undefined);
|
|
62
|
+
const badge = (path) => isDefault(path) ? (_jsx("span", { className: "hui-badge hui-default", "data-testid": `default-${path}`, children: t.byDefault })) : null;
|
|
63
|
+
const pairs = reviewPairs(s.roles, s.reviews);
|
|
64
|
+
const rulesClipped = Boolean(view.truncated?.reviewRules || view.truncated?.roles);
|
|
65
|
+
return (_jsxs("section", { className: "hui hui-settings", "aria-labelledby": "hui-settings-title", lang: lang, children: [_jsx(Heading, { t: t, level: 2, id: "hui-settings-title", children: v.label }), _jsxs("div", { className: "hui-panel", "data-testid": "settings-who", children: [_jsx(Heading, { t: t, term: "writer", children: v.who }), _jsxs("dl", { className: "hui-defs", children: [s.roles.map((r) => row(`${v.role(r.role, r.repositoryId)} — ${v.writer}`, bindingText(r.writer, t))), row(v.approvalMode, label(v.approval, s.approvalMode), 'approvalMode'), row(v.mode, label(v.modes, s.mode), 'mode'), row(v.concurrency, String(s.concurrency), 'concurrency')] }), _jsx(Clipped, { n: view.truncated?.roles, t: t })] }), _jsxs("div", { className: "hui-panel", "data-testid": "settings-reviewers", children: [_jsx(Heading, { t: t, term: "review", children: v.reviewers }), _jsx("ul", { className: "hui-list", children: s.reviews.map((r, i) => (_jsxs("li", { className: "hui-item", children: [_jsx("strong", { children: v.rule(label(t.reviews.kind, r.kind), scopeText(r)) }), " \u2014", ' ', bindingText(r.reviewer, t), ";", ' ', r.alternates.length
|
|
66
|
+
? v.alternates(r.alternates.map((b) => bindingText(b, t)).join(', '))
|
|
67
|
+
: v.noAlternates, "; ", label(v.vendor, r.vendor)] }, i))) }), _jsx(Clipped, { n: view.truncated?.reviewRules, t: t }), _jsx("h4", { className: "hui-minor", children: v.effective }), _jsx("ul", { className: "hui-list", "data-testid": "settings-effective", children: pairs.map((r, i) => {
|
|
68
|
+
const rule = effectiveCodeReview(s.reviews, r);
|
|
69
|
+
return (_jsxs("li", { className: "hui-item", children: [r.repositoryId === undefined && pairs.some((p) => p.repositoryId !== undefined)
|
|
70
|
+
? `${v.role(r.role, undefined)} ${v.anyRepo}`
|
|
71
|
+
: v.role(r.role, r.repositoryId), ":", ' ', rule
|
|
72
|
+
? `${bindingText(rule.reviewer, t)} (${v.effectiveFrom(scopeText(rule))})`
|
|
73
|
+
: `${v.effectiveNone} (${t.noData})`] }, i));
|
|
74
|
+
}) }), rulesClipped ? _jsx("p", { className: "hui-warn-text", children: v.effectiveClipped }) : null] }), _jsxs("div", { className: "hui-panel", "data-testid": "settings-ask", children: [_jsx(Heading, { t: t, term: "technical", children: v.ask }), _jsxs("ul", { className: "hui-list", children: [_jsxs("li", { children: [v.threshold(th.inputSeverity), " ", badge('thresholds.inputSeverity')] }), _jsxs("li", { children: [v.leadMax(th.leadAnswersMaxSeverity), " ", badge('thresholds.leadAnswersMaxSeverity')] }), _jsxs("li", { "data-testid": "settings-technical", children: [v.technical(th.leadAnswersTechnical === true), ' ', badge('thresholds.leadAnswersTechnical')] }), _jsxs("li", { children: [v.criticalPaths(th.criticalPaths), " ", badge('thresholds.criticalPaths')] })] })] }), _jsxs("div", { className: "hui-panel", "data-testid": "settings-limits", children: [_jsx(Heading, { t: t, term: "attempt", children: v.limits }), _jsxs("dl", { className: "hui-defs", children: [row(v.maxAttempts, String(th.maxAttempts), 'thresholds.maxAttempts'), row(v.repairBudget, String(th.repairBudget), 'thresholds.repairBudget'), row(v.maxNeutral, String(th.maxNeutralFailures), 'thresholds.maxNeutralFailures'), row(v.roundCap, String(th.reviewRoundCap), 'thresholds.reviewRoundCap'), row(v.escalationRounds, String(th.reviewEscalationRounds), 'thresholds.reviewEscalationRounds')] })] }), _jsxs("div", { className: "hui-panel", "data-testid": "settings-budgets", children: [_jsx(Heading, { t: t, term: "lowerBound", children: v.budgets }), s.budgets.length ? (_jsx("ul", { className: "hui-list", children: s.budgets.map((b, i) => (_jsx("li", { children: v.budgetRow(label(t.budgetScope, b.scope), b.usd !== undefined ? usd(b.usd) : undefined, b.timeMs !== undefined ? formatDuration(b.timeMs, lang) : undefined) }, i))) })) : (_jsx("p", { className: "hui-muted", children: v.noBudgets })), _jsx(Clipped, { n: view.truncated?.budgets, t: t }), _jsx("dl", { className: "hui-defs", children: row(v.onUnknown, s.budgetOnUnknown !== undefined ? label(v.onUnknownValue, s.budgetOnUnknown) : t.noData, 'budgetOnUnknown') })] }), _jsxs("div", { className: "hui-panel", "data-testid": "settings-timeouts", children: [_jsx(Heading, { t: t, term: "stalled", children: v.timeouts }), _jsxs("dl", { className: "hui-defs", children: [row(v.runTimeout, formatDuration(s.timeouts.runTimeoutMs, lang), 'timeouts.runTimeoutMs'), row(v.lease, formatDuration(s.timeouts.leaseMs, lang), 'timeouts.leaseMs'), row(v.gateFloor, s.timeouts.gateTimeoutFloorMs !== undefined
|
|
75
|
+
? formatDuration(s.timeouts.gateTimeoutFloorMs, lang)
|
|
76
|
+
: v.notSet, 'timeouts.gateTimeoutFloorMs'), row(v.stallLabel, v.stall(formatDuration(s.timeouts.stall.quietMs, lang), formatDuration(s.timeouts.stall.stalledMs, lang), label(v.stallAction, s.timeouts.stall.action), formatDuration(s.timeouts.stall.intervalMs, lang)), 'timeouts.stall'), row(v.lean, label(v.leanState, s.lean.state), 'lean')] })] }), _jsxs("footer", { className: "hui-muted hui-footer", children: [v.digest(s.policyDigest), " \u00B7 ", t.app.readOnly] })] }));
|
|
77
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Dict } from '../model/dict.ts';
|
|
2
|
+
import type { DriftView, VerificationRow, WorkDetailView } from '../model/view.ts';
|
|
3
|
+
import { type ScreenProps } from './common.tsx';
|
|
4
|
+
export interface WorkDetailProps extends ScreenProps {
|
|
5
|
+
detail: WorkDetailView;
|
|
6
|
+
}
|
|
7
|
+
/** The words of one verification row: result, method and who, never a bare "checked". */
|
|
8
|
+
export declare function verificationWords(r: VerificationRow, t: Dict): {
|
|
9
|
+
result: string;
|
|
10
|
+
how: string;
|
|
11
|
+
by: string;
|
|
12
|
+
determined: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function DriftLine({ d, t }: {
|
|
15
|
+
d: DriftView;
|
|
16
|
+
t: Dict;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function WorkDetail({ detail, lang, timeZone, now, onOpenWork, workHref, }: WorkDetailProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Work detail screen (`harness view --work <id>`): where the work is now,
|
|
3
|
+
// its stages, why it was retried, what was checked and how, spend, what is
|
|
4
|
+
// in the way, its questions and reviews, and where the accepted result is.
|
|
5
|
+
// Pure render of a `WorkDetailView`; no fetching, no writes.
|
|
6
|
+
import { instantMs } from "../model/compat.js";
|
|
7
|
+
import { dict, label } from "../model/dict.js";
|
|
8
|
+
import { SLOT_STAGES, formatDuration, formatElapsed, formatUsd, questionStatus, stageLabel, } from "../model/format.js";
|
|
9
|
+
import { AcceptedLine, BlockerLine, Heading, StageStatus, Term, WorkRef, actorLabel, clockOf, } from "./common.js";
|
|
10
|
+
import { ReviewSubjectCard } from "./Reviews.js";
|
|
11
|
+
/** Results that claim something was determined: these rows must say how and by whom. */
|
|
12
|
+
const DETERMINED = new Set(['passed', 'failed', 'reused']);
|
|
13
|
+
/** The words of one verification row: result, method and who, never a bare "checked". */
|
|
14
|
+
export function verificationWords(r, t) {
|
|
15
|
+
const w = t.work;
|
|
16
|
+
const result = Object.hasOwn(w.result, r.result) ? w.result[r.result] : w.resultOther(r.result);
|
|
17
|
+
let how;
|
|
18
|
+
switch (r.how) {
|
|
19
|
+
case 'executed':
|
|
20
|
+
how = w.howExecuted(r.attempt);
|
|
21
|
+
break;
|
|
22
|
+
case 'reused':
|
|
23
|
+
how = w.howReused(r.attempt);
|
|
24
|
+
break;
|
|
25
|
+
case 'read':
|
|
26
|
+
how = w.howRead;
|
|
27
|
+
break;
|
|
28
|
+
case 'not-checked':
|
|
29
|
+
how = w.howNotChecked;
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
how = w.howUnknown(String(r.how));
|
|
33
|
+
}
|
|
34
|
+
const by = r.by ? w.by(label(t.actor, r.by)) : w.byUnknown;
|
|
35
|
+
return { result, how, by, determined: DETERMINED.has(r.result) || r.how !== 'not-checked' };
|
|
36
|
+
}
|
|
37
|
+
export function DriftLine({ d, t }) {
|
|
38
|
+
const parts = [
|
|
39
|
+
t.drift.row(d.ref, d.acceptedSha.slice(0, 12), d.head ? d.head.slice(0, 12) : t.drift.headUnknown),
|
|
40
|
+
];
|
|
41
|
+
if (d.commitsSinceAccepted !== undefined)
|
|
42
|
+
parts.push(t.drift.commits(d.commitsSinceAccepted));
|
|
43
|
+
if (d.filesSinceAccepted !== undefined)
|
|
44
|
+
parts.push(t.drift.files(d.filesSinceAccepted));
|
|
45
|
+
if (d.diverged)
|
|
46
|
+
parts.push(t.drift.diverged);
|
|
47
|
+
if (d.unavailable !== undefined)
|
|
48
|
+
parts.push(t.drift.unavailable(d.unavailable));
|
|
49
|
+
return _jsx(_Fragment, { children: parts.join('; ') });
|
|
50
|
+
}
|
|
51
|
+
export function WorkDetail({ detail, lang = 'ru', timeZone, now, onOpenWork, workHref, }) {
|
|
52
|
+
const t = dict(lang);
|
|
53
|
+
const w = t.work;
|
|
54
|
+
const work = detail.work;
|
|
55
|
+
const links = { onOpenWork, workHref };
|
|
56
|
+
const clock = now ?? instantMs(detail.generatedAt);
|
|
57
|
+
const latest = detail.attempts[0];
|
|
58
|
+
const a = work.attempts;
|
|
59
|
+
const accepted = work.stage.name === 'done' || work.target !== undefined;
|
|
60
|
+
const verificationHref = (workHref ? workHref(work.id) : '') + '#verification';
|
|
61
|
+
const clipped = (what, n) => n ? _jsx("p", { className: "hui-muted hui-clipped", children: w.detailClipped(what, n) }) : null;
|
|
62
|
+
// Stage strip: the latest attempt's stages with their outcome, then the stages ahead.
|
|
63
|
+
const seen = new Set();
|
|
64
|
+
const steps = [];
|
|
65
|
+
for (const s of latest?.stages ?? []) {
|
|
66
|
+
seen.add(s.stage);
|
|
67
|
+
steps.push({
|
|
68
|
+
stage: s.stage,
|
|
69
|
+
state: s.outcome === 'passed'
|
|
70
|
+
? w.stagePassed
|
|
71
|
+
: s.outcome === 'failed'
|
|
72
|
+
? w.stageFailed
|
|
73
|
+
: s.stage === work.stage.name && SLOT_STAGES.has(s.stage)
|
|
74
|
+
? w.stageCurrent
|
|
75
|
+
: w.stageNoOutcome,
|
|
76
|
+
...(s.durationMs !== undefined ? { durationMs: s.durationMs } : {}),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (!seen.has(work.stage.name) && SLOT_STAGES.has(work.stage.name))
|
|
80
|
+
steps.push({ stage: work.stage.name, state: w.stageCurrent });
|
|
81
|
+
for (const n of work.stage.next)
|
|
82
|
+
if (!seen.has(n))
|
|
83
|
+
steps.push({ stage: n, state: w.stageAhead });
|
|
84
|
+
return (_jsxs("section", { className: "hui hui-work", "aria-labelledby": "hui-work-title", lang: lang, children: [_jsxs("header", { className: "hui-row hui-header", children: [_jsxs("h2", { className: "hui-title", id: "hui-work-title", children: [_jsx("code", { children: work.id }), work.title ? _jsxs("span", { className: "hui-work-title", children: [" ", work.title] }) : null] }), _jsx(StageStatus, { w: work, lang: lang, linkProps: links, verificationHref: verificationHref }), work.liveness ? (_jsx("span", { className: 'hui-badge' + (work.liveness === 'active' ? '' : ' hui-warn'), children: label(t.liveness, work.liveness) })) : null] }), _jsxs("div", { className: "hui-panel", "data-testid": "work-now", children: [_jsx(Heading, { t: t, term: "stage", children: w.now }), _jsxs("p", { children: [_jsx(StageStatus, { w: work, lang: lang, linkProps: links, verificationHref: verificationHref }), work.stage.step ? (_jsxs(_Fragment, { children: [' ', "(", _jsx("code", { children: work.stage.step }), ")"] })) : null, work.stage.since
|
|
85
|
+
? ' ' +
|
|
86
|
+
w.since(clockOf(work.stage.since, t, timeZone, now), formatElapsed(work.stage.since, clock, lang))
|
|
87
|
+
: '', work.stage.typical
|
|
88
|
+
? '; ' +
|
|
89
|
+
t.typicalRange(formatDuration(work.stage.typical.p50Ms, lang), formatDuration(work.stage.typical.p90Ms, lang))
|
|
90
|
+
: '', work.stage.step || work.stage.since || work.stage.typical ? '.' : '', ' ', work.stage.next.length
|
|
91
|
+
? w.next(work.stage.next.map((s) => stageLabel(s, lang).toLowerCase()).join(', '))
|
|
92
|
+
: w.nothingNext] }), work.stage.needs ? (_jsx("p", { "data-status": "blocked", children: w.needs(actorLabel(t, work.stage.needs.actor), work.stage.needs.action) })) : null, work.runtime ? (_jsxs("p", { className: "hui-muted", children: [t.actor.writer, ": ", [work.runtime, work.model].filter(Boolean).join(' · ')] })) : null] }), _jsxs("div", { className: "hui-panel", "data-testid": "work-stages", children: [_jsx(Heading, { t: t, term: "gates", children: w.stages }), _jsx("ol", { className: "hui-steps", children: steps.map((s, i) => (_jsxs("li", { className: "hui-step", children: [_jsx("span", { children: stageLabel(s.stage, lang) }), ' ', _jsxs("span", { className: "hui-muted", children: ["\u2014 ", s.state, s.durationMs !== undefined ? `, ${formatDuration(s.durationMs, lang)}` : ''] })] }, i))) }), clipped(w.clippedName.stages, detail.truncated?.stages), _jsx("div", { className: "hui-terms", children: _jsx(Term, { id: "integration", t: t, named: true }) })] }), a.failed > 0 || a.interrupted > 0 || a.lastFailure ? (_jsxs("div", { className: "hui-panel", "data-testid": "why-retry", children: [_jsx(Heading, { t: t, term: "attempt", children: w.whyRetry }), _jsxs("p", { children: [w.attemptsLine(a.used, a.max, a.left), ' ', a.lastFailure ? (_jsxs(_Fragment, { children: [w.lastFailure(a.lastFailure.attempt, a.lastFailure.plain), ' ', w.failureGroup(label(t.bucket, a.lastFailure.bucket))] })) : a.failed > 0 ? (w.failureUnknown) : null] })] })) : null, _jsxs("div", { className: "hui-panel", "data-testid": "work-attempts", children: [_jsx(Heading, { t: t, term: "attempt", children: w.attempts }), a.line ? _jsx("p", { className: "hui-muted", children: a.line }) : null, _jsxs("p", { "data-testid": "work-counters", children: [w.rechecks(a.rechecks), " ", w.neutral(a.neutral.used, a.neutral.max), a.interrupted ? ' ' + w.interrupted(a.interrupted) : ''] }), _jsxs("div", { className: "hui-terms", children: [_jsx(Term, { id: "recheck", t: t, named: true }), _jsx(Term, { id: "neutral", t: t, named: true })] }), detail.attempts.length === 0 ? (_jsx("p", { className: "hui-muted", children: w.noAttempts })) : (_jsx("ul", { className: "hui-list", children: detail.attempts.map((r) => (_jsxs("li", { className: "hui-item", children: [_jsx("strong", { children: w.attemptRow(r.attempt) }), ' ', _jsx("span", { className: "hui-badge", children: label(w.attemptStatus, r.status) }), ' ', r.failureBucket ? _jsxs("span", { children: [label(t.bucket, r.failureBucket), " \u00B7 "] }) : null, _jsxs("span", { className: "hui-muted", children: [[r.runtime, r.model].filter(Boolean).join(' · '), " \u00B7", ' ', w.startedAt(clockOf(r.startedAt, t, timeZone, now)), r.finishedAt ? ', ' + w.finishedAt(clockOf(r.finishedAt, t, timeZone, now)) : ''] }), r.interrupted ? _jsx("div", { className: "hui-muted", children: w.interruptedRow }) : null] }, r.attempt))) })), clipped(w.attempts, detail.truncated?.attempts)] }), _jsxs("div", { className: "hui-panel", "data-testid": "work-verification", children: [_jsx(Heading, { t: t, term: "gates", id: "verification", children: w.whatChecked }), detail.verification === undefined ? (_jsx("p", { className: "hui-muted", "data-testid": "no-verification", children: w.noVerification })) : detail.verification.length === 0 ? (_jsx("p", { className: "hui-muted", children: w.emptyVerification })) : (_jsx("ul", { className: "hui-list hui-checks", children: detail.verification.map((r, i) => {
|
|
93
|
+
const words = verificationWords(r, t);
|
|
94
|
+
return (_jsxs("li", { className: "hui-item hui-check", "data-status": words.determined ? 'checked' : 'not-checked', children: [_jsx("code", { children: r.gate }), ' ', _jsxs("span", { className: "hui-muted", children: ["(", r.kind === 'review' ? w.reviewRow : w.gate, r.phase ? ', ' + label(w.phase, r.phase) : '', ")"] }), ' — ', _jsx("span", { children: words.result }), " \u00B7 ", _jsx("span", { className: "hui-how", children: words.how }), words.determined ? (_jsxs(_Fragment, { children: [' ', "\u00B7 ", _jsx("span", { className: "hui-who", children: words.by })] })) : null, r.at ? (_jsxs("span", { className: "hui-muted", children: [" \u00B7 ", clockOf(r.at, t, timeZone, now)] })) : null] }, i));
|
|
95
|
+
}) })), clipped(w.whatChecked, detail.truncated?.verification)] }), _jsxs("div", { className: "hui-panel hui-split", "data-testid": "work-spend", children: [_jsxs("div", { children: [_jsx(Heading, { t: t, term: "lowerBound", children: w.spend }), _jsx("p", { children: w.spendLine(formatUsd(work.spend.usd, lang), t.calls(work.spend.calls), formatDuration(work.spend.durationMs, lang)) })] }), _jsxs("div", { children: [_jsx(Heading, { t: t, term: "waitsQueue", children: w.blockers }), work.blockers.length ? (_jsx("ul", { className: "hui-list", children: work.blockers.map((b, i) => (_jsx(BlockerLine, { b: b, t: t }, i))) })) : (_jsx("p", { className: "hui-muted", children: w.noBlockers })), clipped(w.clippedName.blockers, detail.truncated?.blockers)] })] }), _jsxs("div", { className: "hui-panel", "data-testid": "work-questions", children: [_jsx(Heading, { t: t, term: "technical", children: w.questions }), detail.questions.length === 0 ? (_jsx("p", { className: "hui-muted", children: w.noQuestions })) : (_jsx("ul", { className: "hui-list", children: detail.questions.map((q) => (_jsxs("li", { className: "hui-item", children: [_jsx("code", { children: q.requestId }), ' ', _jsx("span", { className: "hui-badge", children: t.question.severity(q.severity) }), ' ', q.title ? _jsx("span", { children: q.title }) : null, q.plain ? (_jsxs("div", { children: [t.question.whatChanges, " ", q.plain] })) : null, _jsxs("div", { className: "hui-muted", children: [questionStatus(q, lang).text, q.answeredBy ? ' ' + t.question.answeredBy(actorLabel(t, q.answeredBy)) : ''] })] }, q.requestId))) })), clipped(w.clippedName.questions, detail.truncated?.questions)] }), _jsxs("div", { className: "hui-panel", "data-testid": "work-reviews", children: [_jsx(Heading, { t: t, term: "review", children: w.reviews }), detail.reviews.length === 0 ? (_jsx("p", { className: "hui-muted", children: w.noReviews })) : (detail.reviews.map((r) => (_jsx(ReviewSubjectCard, { r: r, lang: lang, links: links }, r.kind + ':' + r.subject)))), clipped(w.clippedName.reviews, detail.truncated?.reviews), clipped(w.clippedName.findings, detail.truncated?.findings)] }), _jsxs("div", { className: "hui-panel", "data-testid": "work-accepted", children: [_jsx(Heading, { t: t, term: "accepted", children: w.accepted }), accepted ? (_jsx(AcceptedLine, { w: work, lang: lang, linkProps: links, verificationHref: verificationHref })) : (_jsx("p", { children: t.target.notYet })), _jsx(Heading, { t: t, term: "drift", children: w.drift }), _jsx("p", { "data-testid": "work-drift", children: detail.drift ? (_jsx(DriftLine, { d: detail.drift, t: t })) : !accepted ? (w.notAccepted) : work.target ? (w.noDriftAccepted) : (w.noDriftUnknown) })] }), work.dependsOn?.length ? (_jsxs("p", { className: "hui-muted", children: [t.overview.after(''), work.dependsOn.map((id, i) => (_jsxs("span", { children: [i ? ', ' : '', _jsx(WorkRef, { id: id, ...links })] }, id)))] })) : null, clipped(w.clippedName.dependsOn, detail.truncated?.dependsOn)] }));
|
|
96
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type Dict, type GlossaryId, type Lang } from '../model/dict.ts';
|
|
3
|
+
import type { Actor, BlockerView, WorkView } from '../model/view.ts';
|
|
4
|
+
/** Props every screen takes. */
|
|
5
|
+
export interface ScreenProps {
|
|
6
|
+
/** Panel language; Russian is first-class and the default. */
|
|
7
|
+
lang?: Lang;
|
|
8
|
+
/** IANA time zone for clocks; defaults to the viewer's. */
|
|
9
|
+
timeZone?: string;
|
|
10
|
+
/** Clock for elapsed times, epoch ms; defaults to the view's `generatedAt` (deterministic). */
|
|
11
|
+
now?: number;
|
|
12
|
+
/** Host navigation to a work order (a button); without it and `workHref`, ids are plain text. */
|
|
13
|
+
onOpenWork?: (workId: string) => void;
|
|
14
|
+
/** Link target of a work order (an anchor); wins over `onOpenWork`. */
|
|
15
|
+
workHref?: (workId: string) => string;
|
|
16
|
+
}
|
|
17
|
+
/** «что это значит»: a `<details>` disclosure from the glossary (design §12). */
|
|
18
|
+
export declare function Term({ id, t, named }: {
|
|
19
|
+
id: GlossaryId;
|
|
20
|
+
t: Dict;
|
|
21
|
+
named?: boolean;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
/** Section heading with an optional glossary disclosure beside it. */
|
|
24
|
+
export declare function Heading({ children, term, t, id, level, }: {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
term?: GlossaryId;
|
|
27
|
+
t: Dict;
|
|
28
|
+
id?: string;
|
|
29
|
+
level?: 2 | 3;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
export declare function WorkRef({ id, onOpenWork, workHref, suffix, children, }: Pick<ScreenProps, 'onOpenWork' | 'workHref'> & {
|
|
32
|
+
id: string;
|
|
33
|
+
/** Fragment appended to the link, e.g. `#verification`. */
|
|
34
|
+
suffix?: string;
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
/** Clock of an instant, or "unknown" — never a guess. */
|
|
38
|
+
export declare function clockOf(iso: string | undefined, t: Dict, timeZone?: string, nowMs?: number): string;
|
|
39
|
+
export declare const actorLabel: (t: Dict, actor: Actor | string | null | undefined) => string;
|
|
40
|
+
/** One reason a work waits: the plain text or the code, and who acts. */
|
|
41
|
+
export declare function BlockerLine({ b, t }: {
|
|
42
|
+
b: BlockerView;
|
|
43
|
+
t: Dict;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* Where an accepted work is, with a link to its verification rows. Only for
|
|
47
|
+
* works the harness reports as accepted (`stage.name: done` or a target).
|
|
48
|
+
*/
|
|
49
|
+
export declare function AcceptedLine({ w, lang, linkProps, verificationHref, }: {
|
|
50
|
+
w: Pick<WorkView, 'id' | 'target' | 'resultSha'>;
|
|
51
|
+
lang: Lang;
|
|
52
|
+
linkProps: Pick<ScreenProps, 'onOpenWork' | 'workHref'>;
|
|
53
|
+
/** In-page link to the rows (work detail); otherwise the work link with `#verification`. */
|
|
54
|
+
verificationHref?: string;
|
|
55
|
+
}): import("react").JSX.Element;
|
|
56
|
+
/** A note that a list was clipped by the projection. */
|
|
57
|
+
export declare function Clipped({ n, t }: {
|
|
58
|
+
n: number | undefined;
|
|
59
|
+
t: Dict;
|
|
60
|
+
}): import("react").JSX.Element | null;
|
|
61
|
+
/**
|
|
62
|
+
* A stage badge that keeps the wording rules: an accepted stage says where
|
|
63
|
+
* the result is and links to its checks; a stopped or waiting-on-conditions
|
|
64
|
+
* stage says why and who acts. Other stages are a plain badge.
|
|
65
|
+
*/
|
|
66
|
+
export declare function StageStatus({ w, lang, linkProps, verificationHref, }: {
|
|
67
|
+
w: Pick<WorkView, 'id' | 'stage' | 'blockers' | 'target'>;
|
|
68
|
+
lang: Lang;
|
|
69
|
+
linkProps: Pick<ScreenProps, 'onOpenWork' | 'workHref'>;
|
|
70
|
+
verificationHref?: string;
|
|
71
|
+
}): import("react").JSX.Element;
|