@impeccable/reviews 0.1.27 → 0.1.29
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 +7 -3
- package/dist/bin.js +3 -1
- package/dist/cloudflare.js +49 -8
- package/dist/fence.js +35 -2
- package/dist/host-questions.js +21 -0
- package/dist/hosted.js +46 -13
- package/dist/log.js +2 -1
- package/dist/main.js +10 -0
- package/dist/playbook/cases/cloudflare-previews.md +3 -3
- package/dist/playbook/cases/live-app-address.md +1 -1
- package/dist/playbook/cases/monorepo.md +1 -1
- package/dist/playbook/cases/pull-requests.md +4 -4
- package/dist/playbook/cases/render-previews.md +21 -0
- package/dist/playbook/cases/server-previews.md +1 -1
- package/dist/playbook.js +4 -4
- package/dist/render.js +105 -0
- package/dist/report.js +3 -1
- package/dist/skill/impeccable-screenshots/SKILL.md +73 -0
- package/dist/skill.js +37 -0
- package/dist/tools.js +284 -52
- package/dist/ui/run-state.js +19 -9
- package/package.json +1 -1
package/dist/ui/run-state.js
CHANGED
|
@@ -3,6 +3,22 @@ import { statusLine } from '../sync.js';
|
|
|
3
3
|
export function statusFromEvent(event) {
|
|
4
4
|
return event.type === 'message_end' ? statusLine(event.message) : null;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* The order a task list reads in, in the terminal and on the web page alike (REN-1119): the tasks that left pending
|
|
8
|
+
* (skipped too), in the order they first did, then those still waiting, each group in the order given. A task that
|
|
9
|
+
* waits under the task in progress (Preview method while Test drive runs) never shows above it unticked (#419).
|
|
10
|
+
*/
|
|
11
|
+
export class TaskOrder {
|
|
12
|
+
moved = new Set();
|
|
13
|
+
sort(tasks) {
|
|
14
|
+
for (const t of tasks)
|
|
15
|
+
if (t.status !== 'pending')
|
|
16
|
+
this.moved.add(t.id);
|
|
17
|
+
const order = [...this.moved];
|
|
18
|
+
const rank = (t) => (this.moved.has(t.id) ? order.indexOf(t.id) : order.length);
|
|
19
|
+
return tasks.map((t, i) => ({ t, i })).sort((a, b) => rank(a.t) - rank(b.t) || a.i - b.i).map(({ t }) => t);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
6
22
|
/** After this long with nothing new on screen, the status band says the run is still working. */
|
|
7
23
|
const SILENCE_MS = 60_000;
|
|
8
24
|
/** How long something has taken, the way the screen says it: "45 s", "2 min", "1 h 5 min". */
|
|
@@ -30,8 +46,8 @@ export class RunState {
|
|
|
30
46
|
waiting;
|
|
31
47
|
/** The tasks that have been in progress, done or failed in this run. */
|
|
32
48
|
started = new Set();
|
|
33
|
-
/** The
|
|
34
|
-
|
|
49
|
+
/** The order the list shows the tasks in. */
|
|
50
|
+
order = new TaskOrder();
|
|
35
51
|
/** When something last changed on screen: a status, the task list, an answered question. */
|
|
36
52
|
changedAt;
|
|
37
53
|
constructor(now = Date.now, first) {
|
|
@@ -68,15 +84,9 @@ export class RunState {
|
|
|
68
84
|
for (const t of tasks)
|
|
69
85
|
if (t.status === 'in_progress' || t.status === 'completed' || t.status === 'failed')
|
|
70
86
|
this.started.add(t.id);
|
|
71
|
-
for (const t of tasks)
|
|
72
|
-
if (t.status !== 'pending')
|
|
73
|
-
this.moved.add(t.id);
|
|
74
87
|
// A task that has started never reads as not started again (#390).
|
|
75
88
|
const shown = tasks.map((t) => ({ ...t, ...(t.status === 'pending' && this.started.has(t.id) ? { started: true } : {}) }));
|
|
76
|
-
|
|
77
|
-
const order = [...this.moved];
|
|
78
|
-
const rank = (t) => (this.moved.has(t.id) ? order.indexOf(t.id) : order.length);
|
|
79
|
-
this.tasks = shown.map((t, i) => ({ t, i })).sort((a, b) => rank(a.t) - rank(b.t) || a.i - b.i).map(({ t }) => t);
|
|
89
|
+
this.tasks = this.order.sort(shown);
|
|
80
90
|
this.touch();
|
|
81
91
|
}
|
|
82
92
|
/** Something happened that the person saw, so the silence starts again. */
|