@spunto/design-system 0.53.1 → 0.53.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/package.json
CHANGED
|
@@ -236,19 +236,19 @@ export function TaskMachine({ task, worker, node = null, stats = null, ports = [
|
|
|
236
236
|
// ── The boot panel, centre column ────────────────────────────────────────────────────────────
|
|
237
237
|
|
|
238
238
|
export type TaskBootStep = {
|
|
239
|
-
/** `machine` | `container` | `setup` | `branch` | `
|
|
239
|
+
/** `machine` | `container` | `setup` | `branch` | `session`. */
|
|
240
240
|
key: string
|
|
241
241
|
label: string
|
|
242
242
|
state: StepState
|
|
243
243
|
detail?: string
|
|
244
|
-
/** The platform's commands behind the step (Branch
|
|
244
|
+
/** The platform's commands behind the step (Branch) — what its log is drawn from. */
|
|
245
245
|
commands?: TaskCommand[]
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
249
|
* A log per boot step, keyed by `TaskBootStep.key`, shown in a sheet when its row is clicked.
|
|
250
250
|
*
|
|
251
|
-
* Branch
|
|
251
|
+
* Branch needs nothing here: its output is already in `commands`, so `TaskBoot` draws
|
|
252
252
|
* it itself (`TaskCommandTerminal`). The others live where the package cannot reach — the image
|
|
253
253
|
* build's log, the container's stdout (where every setup phase prints) — so the app passes them
|
|
254
254
|
* in, typically its own socket-backed panels. An element is only a description: nothing is
|
|
@@ -349,22 +349,8 @@ export function bootSteps({
|
|
|
349
349
|
commands: branchCommands.length > 0 ? branchCommands : undefined,
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
// Only a recycled machine runs the project's reset command, so the step exists if and only if
|
|
353
|
-
// that command has a row — the same rule as everything else here: nothing ran, nothing to show.
|
|
354
|
-
const resetCommand = commands.find((c) => (c.label ?? "") === "Reset")
|
|
355
|
-
const reset: TaskBootStep | null = resetCommand
|
|
356
|
-
? {
|
|
357
|
-
key: "reset",
|
|
358
|
-
label: "Reset",
|
|
359
|
-
state:
|
|
360
|
-
resetCommand.status === "running" ? "running" : resetCommand.status === "succeeded" ? "done" : "error",
|
|
361
|
-
detail: "putting the reused machine back in shape",
|
|
362
|
-
commands: [resetCommand],
|
|
363
|
-
}
|
|
364
|
-
: null
|
|
365
|
-
|
|
366
352
|
const queued = task.state === "queued"
|
|
367
|
-
const ready = branchState === "done"
|
|
353
|
+
const ready = branchState === "done"
|
|
368
354
|
const session: TaskBootStep = {
|
|
369
355
|
key: "session",
|
|
370
356
|
label: "Agent session",
|
|
@@ -372,9 +358,7 @@ export function bootSteps({
|
|
|
372
358
|
detail: task.startedAt
|
|
373
359
|
? "started"
|
|
374
360
|
: queued
|
|
375
|
-
?
|
|
376
|
-
? "starts once the machine is back in shape"
|
|
377
|
-
: "starts as soon as the branch is ready"
|
|
361
|
+
? "starts as soon as the branch is ready"
|
|
378
362
|
: "never started",
|
|
379
363
|
}
|
|
380
364
|
|
|
@@ -382,7 +366,7 @@ export function bootSteps({
|
|
|
382
366
|
// machine's state *now* — and a task that is over no longer owns its machine, so those two rows
|
|
383
367
|
// would describe someone else's boot. What is left is recorded: which worker it got, whether
|
|
384
368
|
// its branch commands ran, whether a session ever started.
|
|
385
|
-
const rest =
|
|
369
|
+
const rest = [branch, session]
|
|
386
370
|
return queued ? [machine, container, setupStep, ...rest] : [machine, ...rest]
|
|
387
371
|
}
|
|
388
372
|
|
|
@@ -112,12 +112,11 @@ describe("boot steps", () => {
|
|
|
112
112
|
expect(steps.find((s) => s.key === "session")?.state).toBe("running")
|
|
113
113
|
})
|
|
114
114
|
|
|
115
|
-
it("hangs its own commands on the branch
|
|
116
|
-
const
|
|
117
|
-
const steps = bootSteps({ task: task({ state: "queued" }), worker: null, commands: [branchSetup("succeeded"), reset] })
|
|
115
|
+
it("hangs its own commands on the branch step — its log", () => {
|
|
116
|
+
const steps = bootSteps({ task: task({ state: "queued" }), worker: null, commands: [branchSetup("succeeded")] })
|
|
118
117
|
expect(steps.find((s) => s.key === "branch")?.commands?.map((c) => c.id)).toEqual(["c1"])
|
|
119
|
-
expect(steps.find((s) => s.key === "reset")?.commands?.map((c) => c.id)).toEqual(["c2"])
|
|
120
118
|
expect(steps.find((s) => s.key === "machine")?.commands).toBeUndefined()
|
|
119
|
+
expect(steps.map((s) => s.key)).not.toContain("reset")
|
|
121
120
|
})
|
|
122
121
|
})
|
|
123
122
|
|