@molecule/app-ide-react 1.13.0 → 1.15.0
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/README.md +578 -1
- package/dist/command-metadata.d.ts.map +1 -1
- package/dist/command-metadata.js +7 -2
- package/dist/command-metadata.js.map +1 -1
- package/dist/components/ChatPanel.d.ts +9 -1
- package/dist/components/ChatPanel.d.ts.map +1 -1
- package/dist/components/ChatPanel.js +177 -18
- package/dist/components/ChatPanel.js.map +1 -1
- package/dist/components/TestsBar.d.ts +55 -0
- package/dist/components/TestsBar.d.ts.map +1 -0
- package/dist/components/TestsBar.js +296 -0
- package/dist/components/TestsBar.js.map +1 -0
- package/dist/components/TestsCard.d.ts +78 -0
- package/dist/components/TestsCard.d.ts.map +1 -0
- package/dist/components/TestsCard.js +247 -0
- package/dist/components/TestsCard.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/tests-bar-utilities.d.ts +129 -0
- package/dist/components/tests-bar-utilities.d.ts.map +1 -0
- package/dist/components/tests-bar-utilities.js +236 -0
- package/dist/components/tests-bar-utilities.js.map +1 -0
- package/dist/components/tests-card-utilities.d.ts +175 -0
- package/dist/components/tests-card-utilities.d.ts.map +1 -0
- package/dist/components/tests-card-utilities.js +333 -0
- package/dist/components/tests-card-utilities.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +136 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Tests bar — the project's own tests, listed and runnable from the chat
|
|
3
|
+
* composer, in the same slot and the same visual language as the "N uncommitted
|
|
4
|
+
* files" bar right below it.
|
|
5
|
+
*
|
|
6
|
+
* Collapsed it is one dense row: a chevron, "N tests", and the last run's
|
|
7
|
+
* summary (a green passed count, a red failed count, or a spinner while a run
|
|
8
|
+
* is live), with the run controls on the right. Expanded it lists every test,
|
|
9
|
+
* grouped **End-to-end** then **Unit** and then by workspace, each row carrying
|
|
10
|
+
* its own status pill and Run button, with the live output in a scrolling
|
|
11
|
+
* monospace block and a failure's output kept under its row after the run ends.
|
|
12
|
+
*
|
|
13
|
+
* The end-to-end specs are the point: the host runs them through the
|
|
14
|
+
* `@molecule/app-e2e-preview` bond chain every scaffolded app carries, so each
|
|
15
|
+
* spec drives the LIVE PREVIEW the person is looking at — no browser binary in
|
|
16
|
+
* the sandbox. That also means **the preview has to be open**: with no page
|
|
17
|
+
* connected, the driver waits and then fails saying so. The bar says this next
|
|
18
|
+
* to the end-to-end group rather than letting the failure be a mystery.
|
|
19
|
+
*
|
|
20
|
+
* The bar owns no routes. It calls the two host callbacks
|
|
21
|
+
* ({@link ChatPanelProps.listTests}, {@link ChatPanelProps.runTests}) and folds
|
|
22
|
+
* what the run streams back through {@link applyTestRunEvent}.
|
|
23
|
+
*
|
|
24
|
+
* @module
|
|
25
|
+
*/
|
|
26
|
+
import type { JSX } from 'react';
|
|
27
|
+
import type { TestList, TestRunEvent, TestRunHandle, TestSelection } from '../types.js';
|
|
28
|
+
/** Props for {@link TestsBar}. */
|
|
29
|
+
export interface TestsBarProps {
|
|
30
|
+
/** Lists the project's tests — see {@link ChatPanelProps.listTests}. */
|
|
31
|
+
listTests: () => Promise<TestList>;
|
|
32
|
+
/** Runs a selection — see {@link ChatPanelProps.runTests}. */
|
|
33
|
+
runTests: (selection: TestSelection, onEvent: (event: TestRunEvent) => void) => TestRunHandle;
|
|
34
|
+
/** Whether this viewer may run tests at all (a viewer may not). */
|
|
35
|
+
canRun: boolean;
|
|
36
|
+
/** Whether the environment that runs them is up (a running sandbox). */
|
|
37
|
+
available: boolean;
|
|
38
|
+
/** Bump to re-list — the host passes its file-change tick so new specs appear. */
|
|
39
|
+
refreshKey?: number;
|
|
40
|
+
/** Grow the hit areas for touch, matching the commit bar's coarse-pointer rules. */
|
|
41
|
+
isCoarse?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The Tests bar. Renders nothing at all until the host's list resolves with at
|
|
45
|
+
* least one test — an empty bar above the composer would be pure noise in a
|
|
46
|
+
* project that has no tests yet.
|
|
47
|
+
*
|
|
48
|
+
* @param props - See {@link TestsBarProps}.
|
|
49
|
+
* @returns The bar, or `null` when there is nothing to show.
|
|
50
|
+
*/
|
|
51
|
+
export declare function TestsBar({ listTests, runTests, canRun, available, refreshKey, isCoarse, }: TestsBarProps): JSX.Element | null;
|
|
52
|
+
export declare namespace TestsBar {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=TestsBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestsBar.d.ts","sourceRoot":"","sources":["../../src/components/TestsBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAA;AAM/C,OAAO,KAAK,EAGV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EAEd,MAAM,aAAa,CAAA;AAapB,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,SAAS,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAA;IAClC,8DAA8D;IAC9D,QAAQ,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,KAAK,aAAa,CAAA;IAC7F,mEAAmE;IACnE,MAAM,EAAE,OAAO,CAAA;IACf,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAA;IAClB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAuDD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,GACT,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAiZpC;yBAxZe,QAAQ"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { t } from '@molecule/app-i18n';
|
|
4
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
5
|
+
import { applyTestRunEvent, countByKind, EMPTY_RUN_STATE, failRun, groupTests, isRowRunning, summarizeResults, testRowLabel, } from './tests-bar-utilities.js';
|
|
6
|
+
/** The theme's success color, with the same fallback the commit bar's green button uses. */
|
|
7
|
+
const PASS_COLOR = 'var(--mol-color-success, #3fb950)';
|
|
8
|
+
/** The theme's error color, with a fallback matching the commit bar's deletion red. */
|
|
9
|
+
const FAIL_COLOR = 'var(--mol-color-error, #f85149)';
|
|
10
|
+
/**
|
|
11
|
+
* Heading name for a group's project directory: its path as the host named it
|
|
12
|
+
* (`app`, `my-app/app`, …), or the translated "Project" for the workspace root,
|
|
13
|
+
* which has no name of its own.
|
|
14
|
+
*
|
|
15
|
+
* @param label - The group's label (`null` for the root).
|
|
16
|
+
* @returns The text to render.
|
|
17
|
+
*/
|
|
18
|
+
function workspaceLabel(label) {
|
|
19
|
+
return label ?? t('ide.tests.workspace.root', undefined, { defaultValue: 'Project' });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Human label for a kind.
|
|
23
|
+
*
|
|
24
|
+
* @param kind - The kind.
|
|
25
|
+
* @returns The translated label.
|
|
26
|
+
*/
|
|
27
|
+
function kindLabel(kind) {
|
|
28
|
+
return kind === 'e2e'
|
|
29
|
+
? t('ide.tests.kind.e2e', undefined, { defaultValue: 'End-to-end' })
|
|
30
|
+
: t('ide.tests.kind.unit', undefined, { defaultValue: 'Unit' });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The colour a status pill renders in.
|
|
34
|
+
*
|
|
35
|
+
* @param status - The status.
|
|
36
|
+
* @returns A CSS colour value.
|
|
37
|
+
*/
|
|
38
|
+
function statusColor(status) {
|
|
39
|
+
if (status === 'passed')
|
|
40
|
+
return PASS_COLOR;
|
|
41
|
+
if (status === 'failed')
|
|
42
|
+
return FAIL_COLOR;
|
|
43
|
+
return 'inherit';
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The short label a status pill shows.
|
|
47
|
+
*
|
|
48
|
+
* @param status - The status.
|
|
49
|
+
* @returns The translated label.
|
|
50
|
+
*/
|
|
51
|
+
function statusLabel(status) {
|
|
52
|
+
if (status === 'passed')
|
|
53
|
+
return t('ide.tests.statusPassed', undefined, { defaultValue: 'Passed' });
|
|
54
|
+
if (status === 'failed')
|
|
55
|
+
return t('ide.tests.statusFailed', undefined, { defaultValue: 'Failed' });
|
|
56
|
+
return t('ide.tests.statusSkipped', undefined, { defaultValue: 'Skipped' });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The Tests bar. Renders nothing at all until the host's list resolves with at
|
|
60
|
+
* least one test — an empty bar above the composer would be pure noise in a
|
|
61
|
+
* project that has no tests yet.
|
|
62
|
+
*
|
|
63
|
+
* @param props - See {@link TestsBarProps}.
|
|
64
|
+
* @returns The bar, or `null` when there is nothing to show.
|
|
65
|
+
*/
|
|
66
|
+
export function TestsBar({ listTests, runTests, canRun, available, refreshKey, isCoarse, }) {
|
|
67
|
+
const cm = getClassMap();
|
|
68
|
+
const [expanded, setExpanded] = useState(false);
|
|
69
|
+
const [tests, setTests] = useState([]);
|
|
70
|
+
const [listError, setListError] = useState(null);
|
|
71
|
+
const [run, setRun] = useState(EMPTY_RUN_STATE);
|
|
72
|
+
const [showOutput, setShowOutput] = useState(true);
|
|
73
|
+
const handleRef = useRef(null);
|
|
74
|
+
const outputRef = useRef(null);
|
|
75
|
+
// Live for the async list callback, so a list that resolves after the bar
|
|
76
|
+
// unmounted never sets state on a dead component.
|
|
77
|
+
const mountedRef = useRef(true);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
mountedRef.current = true;
|
|
80
|
+
return () => {
|
|
81
|
+
mountedRef.current = false;
|
|
82
|
+
handleRef.current?.cancel();
|
|
83
|
+
};
|
|
84
|
+
}, []);
|
|
85
|
+
const refresh = useCallback(async () => {
|
|
86
|
+
// Nothing can be discovered while the environment is down, and an empty
|
|
87
|
+
// answer would WIPE the list the person was reading. Keep what was last
|
|
88
|
+
// listed (with its statuses) and let the disabled reason explain itself.
|
|
89
|
+
if (!available)
|
|
90
|
+
return;
|
|
91
|
+
try {
|
|
92
|
+
const list = await listTests();
|
|
93
|
+
if (!mountedRef.current)
|
|
94
|
+
return;
|
|
95
|
+
setTests(list.tests ?? []);
|
|
96
|
+
setListError(null);
|
|
97
|
+
}
|
|
98
|
+
catch (_error) {
|
|
99
|
+
if (!mountedRef.current)
|
|
100
|
+
return;
|
|
101
|
+
setListError(t('ide.tests.listError', undefined, {
|
|
102
|
+
defaultValue: 'Could not list this project’s tests.',
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
}, [listTests, available]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
void refresh();
|
|
108
|
+
}, [refresh, refreshKey]);
|
|
109
|
+
// Keep the live output scrolled to the newest line unless the reader has
|
|
110
|
+
// scrolled up inside the block themselves.
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
const el = outputRef.current;
|
|
113
|
+
if (!el)
|
|
114
|
+
return;
|
|
115
|
+
if (el.scrollHeight - el.scrollTop - el.clientHeight > 40)
|
|
116
|
+
return;
|
|
117
|
+
el.scrollTop = el.scrollHeight;
|
|
118
|
+
}, [run.output]);
|
|
119
|
+
const groups = useMemo(() => groupTests(tests), [tests]);
|
|
120
|
+
const counts = useMemo(() => countByKind(tests), [tests]);
|
|
121
|
+
const summary = useMemo(() => summarizeResults(tests, run.results), [tests, run.results]);
|
|
122
|
+
const start = useCallback((selection) => {
|
|
123
|
+
if (!canRun || !available || run.running)
|
|
124
|
+
return;
|
|
125
|
+
setExpanded(true);
|
|
126
|
+
setShowOutput(true);
|
|
127
|
+
// Seed a running state immediately: the host's `start` event may be a
|
|
128
|
+
// round trip away, and a Run button that appears to do nothing is the
|
|
129
|
+
// failure this feature is supposed to remove.
|
|
130
|
+
setRun((prev) => ({
|
|
131
|
+
...prev,
|
|
132
|
+
running: true,
|
|
133
|
+
outcome: null,
|
|
134
|
+
error: null,
|
|
135
|
+
output: [],
|
|
136
|
+
currentId: null,
|
|
137
|
+
queued: selection.ids ?? [],
|
|
138
|
+
startedAt: Date.now(),
|
|
139
|
+
durationMs: null,
|
|
140
|
+
}));
|
|
141
|
+
try {
|
|
142
|
+
handleRef.current = runTests(selection, (event) => {
|
|
143
|
+
if (!mountedRef.current)
|
|
144
|
+
return;
|
|
145
|
+
setRun((prev) => applyTestRunEvent(prev, event));
|
|
146
|
+
if (event.type === 'done') {
|
|
147
|
+
handleRef.current = null;
|
|
148
|
+
// A run can create, rename or delete nothing — but it CAN reveal a
|
|
149
|
+
// spec the agent wrote mid-run, so re-list once it settles.
|
|
150
|
+
void refresh();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
setRun((prev) => failRun(prev, error instanceof Error
|
|
156
|
+
? error.message
|
|
157
|
+
: t('ide.tests.runError', undefined, {
|
|
158
|
+
defaultValue: 'The test run could not start.',
|
|
159
|
+
})));
|
|
160
|
+
}
|
|
161
|
+
}, [canRun, available, run.running, runTests, refresh]);
|
|
162
|
+
const cancel = useCallback(() => {
|
|
163
|
+
handleRef.current?.cancel();
|
|
164
|
+
handleRef.current = null;
|
|
165
|
+
setRun((prev) => ({ ...prev, running: false, currentId: null, outcome: 'cancelled' }));
|
|
166
|
+
}, []);
|
|
167
|
+
if (tests.length === 0 && !listError)
|
|
168
|
+
return null;
|
|
169
|
+
const disabledReason = !canRun
|
|
170
|
+
? t('ide.tests.viewerCannotRun', undefined, {
|
|
171
|
+
defaultValue: 'Only editors can run this project’s tests.',
|
|
172
|
+
})
|
|
173
|
+
: !available
|
|
174
|
+
? t('ide.tests.needsSandbox', undefined, {
|
|
175
|
+
defaultValue: 'Start the project to run its tests.',
|
|
176
|
+
})
|
|
177
|
+
: null;
|
|
178
|
+
const runnable = canRun && available && !run.running;
|
|
179
|
+
const rowMinHeight = isCoarse ? { minHeight: 32 } : {};
|
|
180
|
+
const actionStyle = {
|
|
181
|
+
flexShrink: 0,
|
|
182
|
+
...(isCoarse ? { minHeight: 36 } : {}),
|
|
183
|
+
};
|
|
184
|
+
return (_jsxs("div", { "data-mol-id": "tests-bar", style: {
|
|
185
|
+
borderTop: '1px solid rgba(128,128,128,0.15)',
|
|
186
|
+
// Same box model as the commit bar directly below, so the two read as
|
|
187
|
+
// one stack of bars rather than two unrelated strips.
|
|
188
|
+
padding: '8px 8px 8px 10px',
|
|
189
|
+
}, children: [_jsxs("div", { style: {
|
|
190
|
+
display: 'flex',
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
justifyContent: 'space-between',
|
|
193
|
+
gap: 8,
|
|
194
|
+
// Phone widths: the controls drop under the label instead of pushing
|
|
195
|
+
// the bar into a horizontal scroll.
|
|
196
|
+
flexWrap: 'wrap',
|
|
197
|
+
}, children: [_jsxs("div", { role: "button", tabIndex: 0, "data-mol-id": "tests-bar-toggle", "aria-expanded": expanded, onClick: () => setExpanded((v) => !v), onKeyDown: (e) => {
|
|
198
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
setExpanded((v) => !v);
|
|
201
|
+
}
|
|
202
|
+
}, style: {
|
|
203
|
+
display: 'flex',
|
|
204
|
+
alignItems: 'center',
|
|
205
|
+
gap: 4,
|
|
206
|
+
cursor: 'pointer',
|
|
207
|
+
minWidth: 0,
|
|
208
|
+
...(isCoarse ? { minHeight: 36 } : {}),
|
|
209
|
+
}, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "12", height: "12", "aria-hidden": "true", style: {
|
|
210
|
+
transform: expanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
211
|
+
transition: 'transform 120ms',
|
|
212
|
+
opacity: 0.5,
|
|
213
|
+
flexShrink: 0,
|
|
214
|
+
}, children: _jsx("path", { d: "M6 4l4 4-4 4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), children: t('ide.tests.testCount', { count: tests.length }, { defaultValue: '{{count}} tests' }) }), run.running ? (_jsxs("span", { "data-mol-id": "tests-bar-running", className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { display: 'inline-flex', alignItems: 'center', gap: 4 }, children: [_jsx("span", { className: cm.spinner({ size: 'xs' }), "aria-hidden": "true" }), t('ide.tests.running', undefined, { defaultValue: 'Running…' })] })) : (summary.reported > 0 && (_jsxs("span", { "data-mol-id": "tests-bar-summary", className: cm.textSize('xs'), style: { display: 'inline-flex', alignItems: 'center', gap: 6 }, children: [summary.passed > 0 && (_jsx("span", { style: { color: PASS_COLOR }, children: t('ide.tests.passedCount', { count: summary.passed }, { defaultValue: '{{count}} passed' }) })), summary.failed > 0 && (_jsx("span", { style: { color: FAIL_COLOR }, children: t('ide.tests.failedCount', { count: summary.failed }, { defaultValue: '{{count}} failed' }) }))] })))] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' }, children: [counts.e2e > 0 && (_jsx("button", { type: "button", "data-mol-id": "tests-bar-run-e2e", onClick: (e) => {
|
|
215
|
+
e.stopPropagation();
|
|
216
|
+
start({ kind: 'e2e' });
|
|
217
|
+
}, disabled: !runnable, title: disabledReason ?? undefined, className: cm.cn(cm.button({ variant: 'ghost', size: 'xs' })), style: actionStyle, children: t('ide.tests.runE2e', undefined, { defaultValue: 'Run e2e' }) })), counts.unit > 0 && (_jsx("button", { type: "button", "data-mol-id": "tests-bar-run-unit", onClick: (e) => {
|
|
218
|
+
e.stopPropagation();
|
|
219
|
+
start({ kind: 'unit' });
|
|
220
|
+
}, disabled: !runnable, title: disabledReason ?? undefined, className: cm.cn(cm.button({ variant: 'ghost', size: 'xs' })), style: actionStyle, children: t('ide.tests.runUnit', undefined, { defaultValue: 'Run unit' }) })), run.running ? (_jsx("button", { type: "button", "data-mol-id": "tests-bar-cancel", onClick: (e) => {
|
|
221
|
+
e.stopPropagation();
|
|
222
|
+
cancel();
|
|
223
|
+
}, className: cm.cn(cm.button({ variant: 'solid', color: 'secondary', size: 'xs' })), style: actionStyle, children: t('ide.tests.stop', undefined, { defaultValue: 'Stop' }) })) : (_jsx("button", { type: "button", "data-mol-id": "tests-bar-run-all", onClick: (e) => {
|
|
224
|
+
e.stopPropagation();
|
|
225
|
+
start({ kind: 'all' });
|
|
226
|
+
}, disabled: !runnable, title: disabledReason ?? undefined, className: cm.cn(cm.button({ variant: 'solid', color: 'primary', size: 'xs' })), style: actionStyle, children: t('ide.tests.runAll', undefined, { defaultValue: 'Run all' }) }))] })] }), disabledReason && (_jsx("div", { "data-mol-id": "tests-bar-disabled-reason", className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { marginTop: 4, paddingLeft: 16 }, children: disabledReason })), listError && (_jsx("div", { "data-mol-id": "tests-bar-list-error", className: cm.cn(cm.textError, cm.textSize('xs')), style: { marginTop: 4, paddingLeft: 16 }, children: listError })), run.error && (_jsx("div", { "data-mol-id": "tests-bar-run-error", className: cm.cn(cm.textError, cm.textSize('xs')), style: { marginTop: 4, paddingLeft: 16, lineHeight: 1.4 }, children: run.error })), !run.running && run.outcome === 'cancelled' && !run.error && (_jsx("div", { "data-mol-id": "tests-bar-cancelled", className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { marginTop: 4, paddingLeft: 16 }, children: t('ide.tests.cancelled', undefined, { defaultValue: 'Run stopped.' }) })), expanded && (_jsx("div", { "data-mol-id": "tests-bar-list", style: { marginTop: 4, paddingLeft: 16, maxHeight: 260, overflowY: 'auto' }, children: groups.map((group) => (_jsx(TestsBarGroup, { group: group, run: run, runnable: runnable, disabledReason: disabledReason, rowMinHeight: rowMinHeight, actionStyle: actionStyle, onRun: start }, `${group.kind}:${group.workspace}`))) })), (run.running || run.output.length > 0) && (_jsxs("div", { style: { marginTop: 6, paddingLeft: 16 }, children: [_jsx("button", { type: "button", "data-mol-id": "tests-bar-output-toggle", "aria-expanded": showOutput, onClick: () => setShowOutput((v) => !v), className: cm.cn(cm.button({ variant: 'ghost', size: 'xs' })), style: actionStyle, children: showOutput
|
|
227
|
+
? t('ide.tests.hideOutput', undefined, { defaultValue: 'Hide output' })
|
|
228
|
+
: t('ide.tests.showOutput', undefined, { defaultValue: 'Show output' }) }), showOutput && (_jsx("pre", { ref: outputRef, "data-mol-id": "tests-bar-output", className: cm.textSize('xs'), style: {
|
|
229
|
+
margin: '4px 0 0',
|
|
230
|
+
padding: '6px 8px',
|
|
231
|
+
borderRadius: 4,
|
|
232
|
+
border: '1px solid rgba(128,128,128,0.25)',
|
|
233
|
+
whiteSpace: 'pre-wrap',
|
|
234
|
+
wordBreak: 'break-word',
|
|
235
|
+
maxHeight: 180,
|
|
236
|
+
overflow: 'auto',
|
|
237
|
+
fontFamily: 'var(--mol-font-mono, monospace)',
|
|
238
|
+
}, children: run.output.join('\n') }))] }))] }));
|
|
239
|
+
}
|
|
240
|
+
TestsBar.displayName = 'TestsBar';
|
|
241
|
+
/**
|
|
242
|
+
* One group of rows — a heading ("End-to-end · App"), a Run for the whole
|
|
243
|
+
* group, and a row per test file.
|
|
244
|
+
*
|
|
245
|
+
* @param props - See {@link TestsBarGroupProps}.
|
|
246
|
+
* @returns The rendered group.
|
|
247
|
+
*/
|
|
248
|
+
function TestsBarGroup({ group, run, runnable, disabledReason, rowMinHeight, actionStyle, onRun, }) {
|
|
249
|
+
const cm = getClassMap();
|
|
250
|
+
const groupId = `${group.kind}-${group.workspace}`;
|
|
251
|
+
return (_jsxs("div", { "data-mol-id": `tests-bar-group-${groupId}`, style: { marginBottom: 6 }, children: [_jsxs("div", { style: {
|
|
252
|
+
display: 'flex',
|
|
253
|
+
alignItems: 'center',
|
|
254
|
+
justifyContent: 'space-between',
|
|
255
|
+
gap: 8,
|
|
256
|
+
flexWrap: 'wrap',
|
|
257
|
+
}, children: [_jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs'), cm.fontWeight('medium')), children: `${kindLabel(group.kind)} · ${workspaceLabel(group.label)}` }), _jsx("button", { type: "button", "data-mol-id": `tests-bar-run-group-${groupId}`, onClick: () => onRun({ ids: group.items.map((item) => item.id) }), disabled: !runnable, title: disabledReason ?? undefined, className: cm.cn(cm.button({ variant: 'ghost', size: 'xs' })), style: actionStyle, children: t('ide.tests.runGroup', undefined, { defaultValue: 'Run group' }) })] }), group.kind === 'e2e' && (_jsx("div", { className: cm.cn(cm.textMuted, cm.textSize('xs')), "data-mol-id": "tests-bar-e2e-hint", style: { lineHeight: 1.4, marginBottom: 2 }, children: t('ide.tests.e2eHint', undefined, {
|
|
258
|
+
defaultValue: 'These run against the live preview, so keep the preview open.',
|
|
259
|
+
}) })), group.items.map((item) => (_jsx(TestsBarRow, { item: item, result: run.results[item.id], running: isRowRunning(run, item.id), runnable: runnable, disabledReason: disabledReason, rowMinHeight: rowMinHeight, actionStyle: actionStyle, onRun: onRun }, item.id)))] }));
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* One test file: its label, its last status pill, a Run button, and — when it
|
|
263
|
+
* FAILED — the runner's output kept underneath so the failure is readable after
|
|
264
|
+
* the run has moved on.
|
|
265
|
+
*
|
|
266
|
+
* @param props - See {@link TestsBarRowProps}.
|
|
267
|
+
* @returns The rendered row.
|
|
268
|
+
*/
|
|
269
|
+
function TestsBarRow({ item, result, running, runnable, disabledReason, rowMinHeight, actionStyle, onRun, }) {
|
|
270
|
+
const cm = getClassMap();
|
|
271
|
+
return (_jsxs("div", { "data-mol-id": `tests-bar-row-${item.id}`, style: { padding: '1px 0' }, children: [_jsxs("div", { style: {
|
|
272
|
+
display: 'flex',
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
gap: 6,
|
|
275
|
+
flexWrap: 'wrap',
|
|
276
|
+
...rowMinHeight,
|
|
277
|
+
}, children: [_jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), title: item.file, style: {
|
|
278
|
+
fontFamily: 'var(--mol-font-mono, monospace)',
|
|
279
|
+
flex: '1 1 140px',
|
|
280
|
+
minWidth: 0,
|
|
281
|
+
overflow: 'hidden',
|
|
282
|
+
textOverflow: 'ellipsis',
|
|
283
|
+
whiteSpace: 'nowrap',
|
|
284
|
+
}, children: testRowLabel(item) }), running ? (_jsxs("span", { "data-mol-id": `tests-bar-status-${item.id}`, className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { display: 'inline-flex', alignItems: 'center', gap: 4, flexShrink: 0 }, children: [_jsx("span", { className: cm.spinner({ size: 'xs' }), "aria-hidden": "true" }), t('ide.tests.running', undefined, { defaultValue: 'Running…' })] })) : (result && (_jsx("span", { "data-mol-id": `tests-bar-status-${item.id}`, className: cm.textSize('xs'), style: { color: statusColor(result.status), flexShrink: 0 }, children: statusLabel(result.status) }))), _jsx("button", { type: "button", "data-mol-id": `tests-bar-run-${item.id}`, onClick: () => onRun({ ids: [item.id] }), disabled: !runnable, title: disabledReason ?? undefined, className: cm.cn(cm.button({ variant: 'ghost', size: 'xs' })), style: actionStyle, children: t('ide.tests.run', undefined, { defaultValue: 'Run' }) })] }), result?.status === 'failed' && result.output && (_jsx("pre", { "data-mol-id": `tests-bar-failure-${item.id}`, className: cm.textSize('xs'), style: {
|
|
285
|
+
margin: '2px 0 4px',
|
|
286
|
+
padding: '6px 8px',
|
|
287
|
+
borderRadius: 4,
|
|
288
|
+
border: `1px solid ${FAIL_COLOR}`,
|
|
289
|
+
whiteSpace: 'pre-wrap',
|
|
290
|
+
wordBreak: 'break-word',
|
|
291
|
+
maxHeight: 160,
|
|
292
|
+
overflow: 'auto',
|
|
293
|
+
fontFamily: 'var(--mol-font-mono, monospace)',
|
|
294
|
+
}, children: result.output }))] }));
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=TestsBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestsBar.js","sourceRoot":"","sources":["../../src/components/TestsBar.tsx"],"names":[],"mappings":";AA2BA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAY9C,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,OAAO,EACP,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,GACb,MAAM,0BAA0B,CAAA;AAkBjC,4FAA4F;AAC5F,MAAM,UAAU,GAAG,mCAAmC,CAAA;AACtD,uFAAuF;AACvF,MAAM,UAAU,GAAG,iCAAiC,CAAA;AAEpD;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,KAAoB;IAC1C,OAAO,KAAK,IAAI,CAAC,CAAC,0BAA0B,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAA;AACvF,CAAC;AAED;;;;;GAKG;AACH,SAAS,SAAS,CAAC,IAAc;IAC/B,OAAO,IAAI,KAAK,KAAK;QACnB,CAAC,CAAC,CAAC,CAAC,oBAAoB,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;QACpE,CAAC,CAAC,CAAC,CAAC,qBAAqB,EAAE,SAAS,EAAE,EAAE,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built as a sibling of {@link ScriptsCard}, because it is the same shape of
|
|
5
|
+
* thing: a searchable list whose rows each carry a Run action and show their
|
|
6
|
+
* captured output inline. Same container chrome, same header (title left,
|
|
7
|
+
* primary action right), same search field, same `cm.borderT` row rhythm, same
|
|
8
|
+
* `<pre>` output block, same `embedded` behaviour in the command overlay.
|
|
9
|
+
*
|
|
10
|
+
* Rows are grouped **End-to-end** then **Unit**, and within a kind by the
|
|
11
|
+
* project directory that owns them (`app`, `my-app/app`, the workspace root
|
|
12
|
+
* last), because a run is invoked from that directory and a person reading two
|
|
13
|
+
* `home.spec.ts` rows needs to know which app each belongs to.
|
|
14
|
+
*
|
|
15
|
+
* The end-to-end specs are the point: the host runs them through the
|
|
16
|
+
* `@molecule/app-e2e-preview` bond chain every scaffolded app carries, so each
|
|
17
|
+
* spec drives the LIVE PREVIEW the person is looking at — no browser binary in
|
|
18
|
+
* the sandbox. That also means **the preview has to be open**: with no page
|
|
19
|
+
* connected the driver waits and then fails saying so, which the card states
|
|
20
|
+
* next to the end-to-end group rather than leaving it a mystery.
|
|
21
|
+
*
|
|
22
|
+
* This component is PRESENTATIONAL — the list and the in-flight run live in
|
|
23
|
+
* `ChatPanel`, so a run keeps streaming while the overlay is closed and
|
|
24
|
+
* re-opened, and re-running `/test` re-lists without losing it.
|
|
25
|
+
*
|
|
26
|
+
* Styling uses `getClassMap()` (`cm.*`); the only inline styles are layout the
|
|
27
|
+
* ClassMap can't express. All user-facing text goes through `t()`.
|
|
28
|
+
*
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
import type { JSX } from 'react';
|
|
32
|
+
import type { TestItem, TestSelection } from '../types.js';
|
|
33
|
+
import type { TestFailure, TestsRunState } from './tests-card-utilities.js';
|
|
34
|
+
/** Discovery status for the tests list — mirrors {@link ScriptsCard}'s. */
|
|
35
|
+
export type TestsStatus = 'loading' | 'ready' | 'error' | 'unavailable';
|
|
36
|
+
/** Props for {@link TestsCard}. */
|
|
37
|
+
export interface TestsCardProps {
|
|
38
|
+
/** Every discovered test (unfiltered). */
|
|
39
|
+
tests: TestItem[];
|
|
40
|
+
/** How the listing went. */
|
|
41
|
+
status: TestsStatus;
|
|
42
|
+
/** The run this card is showing — owned by the panel, so it survives a close. */
|
|
43
|
+
run: TestsRunState;
|
|
44
|
+
/** Seeds the search box from `/test <query>`. */
|
|
45
|
+
initialQuery: string;
|
|
46
|
+
/** Whether this viewer may run tests at all (a viewer may not). */
|
|
47
|
+
canRun: boolean;
|
|
48
|
+
/** Runs a selection. */
|
|
49
|
+
onRun: (selection: TestSelection) => void;
|
|
50
|
+
/** Stops the run in flight. */
|
|
51
|
+
onCancel: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Hands the failing tests to the agent as ONE chat message — a real turn it
|
|
54
|
+
* answers, exactly like the editor’s “Fix with AI”.
|
|
55
|
+
*/
|
|
56
|
+
onFix: (failures: TestFailure[]) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Why fixing is unavailable (a viewer, a turn already streaming), already
|
|
59
|
+
* translated by the host — `null` when it is available. The card states the
|
|
60
|
+
* reason on the disabled button rather than letting a click do nothing.
|
|
61
|
+
*/
|
|
62
|
+
fixDisabledReason: string | null;
|
|
63
|
+
/** Light theme (drives the same row border + field inset the sibling cards use). */
|
|
64
|
+
isLight: boolean;
|
|
65
|
+
/** Chrome-less inside the command overlay; full card chrome in the timeline. */
|
|
66
|
+
embedded?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The tests browser shown by `/test`.
|
|
70
|
+
*
|
|
71
|
+
* @param props - See {@link TestsCardProps}.
|
|
72
|
+
* @returns The rendered tests card.
|
|
73
|
+
*/
|
|
74
|
+
export declare function TestsCard({ tests, status, run, initialQuery, canRun, onRun, onCancel, onFix, fixDisabledReason, isLight, embedded, }: TestsCardProps): JSX.Element;
|
|
75
|
+
export declare namespace TestsCard {
|
|
76
|
+
var displayName: string;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=TestsC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