@shipfox/client-workflows 14.0.0 → 15.0.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/.storybook/preview.tsx +7 -2
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +35 -0
- package/dist/components/job-detail/agent-config-failure-callout.d.ts.map +1 -0
- package/dist/components/{workflow-run-view → job-detail}/agent-config-failure-callout.js +2 -2
- package/dist/components/job-detail/agent-config-failure-callout.js.map +1 -0
- package/dist/components/job-detail/job-detail-header.d.ts +8 -0
- package/dist/components/job-detail/job-detail-header.d.ts.map +1 -0
- package/dist/components/job-detail/job-detail-header.js +111 -0
- package/dist/components/job-detail/job-detail-header.js.map +1 -0
- package/dist/components/job-detail/job-detail-view.d.ts +16 -0
- package/dist/components/job-detail/job-detail-view.d.ts.map +1 -0
- package/dist/components/job-detail/job-detail-view.js +405 -0
- package/dist/components/job-detail/job-detail-view.js.map +1 -0
- package/dist/components/job-detail/job-empty-states.d.ts +10 -0
- package/dist/components/job-detail/job-empty-states.d.ts.map +1 -0
- package/dist/components/job-detail/job-empty-states.js +195 -0
- package/dist/components/job-detail/job-empty-states.js.map +1 -0
- package/dist/components/job-detail/job-execution-switcher.d.ts.map +1 -0
- package/dist/components/job-detail/job-execution-switcher.js.map +1 -0
- package/dist/components/job-detail/job-execution-time-text.d.ts.map +1 -0
- package/dist/components/job-detail/job-execution-time-text.js.map +1 -0
- package/dist/components/job-detail/job-selection.d.ts +24 -0
- package/dist/components/job-detail/job-selection.d.ts.map +1 -0
- package/dist/components/job-detail/job-selection.js +66 -0
- package/dist/components/job-detail/job-selection.js.map +1 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts +15 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts.map +1 -0
- package/dist/components/{workflow-run-view → job-detail}/step-attempt-log-panel.js +61 -16
- package/dist/components/job-detail/step-attempt-log-panel.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.js +1 -1
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/step-list/step-list-model.js +2 -2
- package/dist/components/step-list/step-list-model.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +1 -0
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js +29 -4
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.d.ts +9 -4
- package/dist/components/workflow-run-duration-label.d.ts.map +1 -1
- package/dist/components/workflow-run-duration-label.js +27 -7
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +6 -5
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +68 -64
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +0 -3
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/index.js +0 -3
- package/dist/components/workflow-run-tabs/index.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts +3 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.js +2 -2
- package/dist/components/workflow-run-tabs/run-annotations-empty.js.map +1 -1
- package/dist/components/workflow-run-view/index.d.ts +0 -1
- package/dist/components/workflow-run-view/index.d.ts.map +1 -1
- package/dist/components/workflow-run-view/index.js +0 -1
- package/dist/components/workflow-run-view/index.js.map +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts +20 -0
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts.map +1 -0
- package/dist/components/workflow-run-view/run-workspace-nav.js +271 -0
- package/dist/components/workflow-run-view/run-workspace-nav.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-selection.js +1 -14
- package/dist/components/workflow-run-view/workflow-run-selection.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +10 -8
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +250 -236
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -1
- package/dist/components/workflow-status/status-visuals.js +10 -2
- package/dist/components/workflow-status/status-visuals.js.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts +3 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.js +13 -2
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +9 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js +13 -3
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/step-attempt.d.ts.map +1 -1
- package/dist/core/entities/step.d.ts +2 -0
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js +13 -0
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +56 -1
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js +98 -0
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/workflow-run.d.ts +4 -4
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js +3 -3
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/feature.d.ts +20 -16
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +5 -0
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/workflow-runs.d.ts +5 -3
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -1
- package/dist/hooks/api/workflow-runs.js +5 -4
- package/dist/hooks/api/workflow-runs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/workflow-job-detail-page.d.ts +11 -0
- package/dist/pages/workflow-job-detail-page.d.ts.map +1 -0
- package/dist/pages/workflow-job-detail-page.js +66 -0
- package/dist/pages/workflow-job-detail-page.js.map +1 -0
- package/dist/pages/workflow-run-detail-page.d.ts.map +1 -1
- package/dist/pages/workflow-run-detail-page.js +4 -37
- package/dist/pages/workflow-run-detail-page.js.map +1 -1
- package/dist/routes/inputs.d.ts +47 -34
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +69 -37
- package/dist/routes/inputs.js.map +1 -1
- package/dist/routes/job-detail.d.ts +10 -0
- package/dist/routes/job-detail.d.ts.map +1 -0
- package/dist/routes/job-detail.js +27 -0
- package/dist/routes/job-detail.js.map +1 -0
- package/dist/routes/project-route.d.ts +1 -1
- package/dist/routes/run-detail.d.ts.map +1 -1
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/components/{workflow-run-view → job-detail}/agent-config-failure-callout.stories.tsx +1 -1
- package/src/components/{workflow-run-view → job-detail}/agent-config-failure-callout.tsx +2 -2
- package/src/components/job-detail/job-detail-header.test.tsx +31 -0
- package/src/components/job-detail/job-detail-header.tsx +111 -0
- package/src/components/job-detail/job-detail-view.stories.tsx +526 -0
- package/src/components/job-detail/job-detail-view.tsx +450 -0
- package/src/components/job-detail/job-empty-states.test.ts +27 -0
- package/src/components/job-detail/job-empty-states.tsx +248 -0
- package/src/components/job-detail/job-selection.test.ts +188 -0
- package/src/components/job-detail/job-selection.ts +96 -0
- package/src/components/{workflow-run-view → job-detail}/step-attempt-log-panel.test.tsx +32 -9
- package/src/components/{workflow-run-view → job-detail}/step-attempt-log-panel.tsx +52 -18
- package/src/components/job-graph/job-graph-content.tsx +1 -1
- package/src/components/step-list/step-list-model.test.ts +1 -1
- package/src/components/step-list/step-list-model.ts +2 -2
- package/src/components/step-list/step-list.stories.tsx +1 -1
- package/src/components/step-list/step-list.test.tsx +33 -0
- package/src/components/step-list/step-list.tsx +40 -9
- package/src/components/workflow-run-duration-label.tsx +50 -12
- package/src/components/workflow-run-list/workflow-run-row.tsx +6 -4
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +38 -0
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +79 -5
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +56 -60
- package/src/components/workflow-run-tabs/index.ts +0 -3
- package/src/components/workflow-run-tabs/run-annotations-empty.tsx +6 -2
- package/src/components/workflow-run-view/index.ts +0 -1
- package/src/components/workflow-run-view/run-workspace-nav.test.tsx +242 -0
- package/src/components/workflow-run-view/run-workspace-nav.tsx +301 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +1 -23
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +62 -1136
- package/src/components/workflow-run-view/workflow-run-view.tsx +330 -321
- package/src/components/workflow-status/status-visuals.ts +5 -2
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +1 -0
- package/src/components/workflow-status/workflow-status-icon.tsx +26 -1
- package/src/core/entities/job-execution.ts +17 -2
- package/src/core/entities/step.ts +26 -0
- package/src/core/entities/workflow-run-display.test.ts +159 -0
- package/src/core/entities/workflow-run.ts +139 -1
- package/src/core/workflow-run.ts +16 -1
- package/src/feature.ts +5 -0
- package/src/hooks/api/workflow-runs.ts +6 -2
- package/src/index.ts +1 -0
- package/src/page-harness-budget.test.ts +1 -0
- package/src/pages/workflow-job-detail-page.test.tsx +539 -0
- package/src/pages/workflow-job-detail-page.tsx +84 -0
- package/src/pages/workflow-run-detail-page.tsx +3 -43
- package/src/pages/workflow-run-pages.test.tsx +77 -332
- package/src/routes/inputs.test.ts +56 -6
- package/src/routes/inputs.ts +64 -17
- package/src/routes/job-detail.tsx +29 -0
- package/test/pages.tsx +25 -3
- package/test/render.tsx +6 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts +0 -18
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-jobs-list.js +0 -107
- package/dist/components/workflow-run-tabs/run-jobs-list.js.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts +0 -6
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-count.js +0 -27
- package/dist/components/workflow-run-tabs/run-tab-count.js.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts +0 -8
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-strip.js +0 -82
- package/dist/components/workflow-run-tabs/run-tab-strip.js.map +0 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts.map +0 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.js.map +0 -1
- package/dist/components/workflow-run-view/job-card.d.ts +0 -17
- package/dist/components/workflow-run-view/job-card.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-card.js +0 -496
- package/dist/components/workflow-run-view/job-card.js.map +0 -1
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-execution-switcher.js.map +0 -1
- package/dist/components/workflow-run-view/job-execution-time-text.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-execution-time-text.js.map +0 -1
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts +0 -9
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts.map +0 -1
- package/dist/components/workflow-run-view/step-attempt-log-panel.js.map +0 -1
- package/src/components/workflow-run-tabs/run-jobs-list.tsx +0 -151
- package/src/components/workflow-run-tabs/run-tab-count.tsx +0 -28
- package/src/components/workflow-run-tabs/run-tab-strip.stories.tsx +0 -52
- package/src/components/workflow-run-tabs/run-tab-strip.test.tsx +0 -117
- package/src/components/workflow-run-tabs/run-tab-strip.tsx +0 -97
- package/src/components/workflow-run-view/job-card.stories.tsx +0 -789
- package/src/components/workflow-run-view/job-card.test.tsx +0 -115
- package/src/components/workflow-run-view/job-card.tsx +0 -614
- /package/dist/components/{workflow-run-view → job-detail}/agent-config-failure-callout.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-switcher.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-switcher.js +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-time-text.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-time-text.js +0 -0
- /package/src/components/{workflow-run-view → job-detail}/job-execution-switcher.tsx +0 -0
- /package/src/components/{workflow-run-view → job-detail}/job-execution-time-text.tsx +0 -0
|
@@ -1,496 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { TriggerSourceIcon } from '@shipfox/client-triggers';
|
|
3
|
-
import { Badge } from '@shipfox/react-ui/badge';
|
|
4
|
-
import { Button } from '@shipfox/react-ui/button';
|
|
5
|
-
import { EmptyState } from '@shipfox/react-ui/empty-state';
|
|
6
|
-
import { Icon } from '@shipfox/react-ui/icon';
|
|
7
|
-
import { RelativeTime } from '@shipfox/react-ui/relative-time';
|
|
8
|
-
import { useTimeTick } from '@shipfox/react-ui/time-ticker';
|
|
9
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '@shipfox/react-ui/tooltip';
|
|
10
|
-
import { Text } from '@shipfox/react-ui/typography';
|
|
11
|
-
import { Fragment, useId, useRef, useState } from 'react';
|
|
12
|
-
import { getWorkflowStatusVisual } from '#components/workflow-status/status-visuals.js';
|
|
13
|
-
import { AGENT_CONFIG_ISSUES, defaultJobExecution, deriveJobDisplayStatus, deriveJobExecutionDisplayStatus, STEP_ERROR_REASONS, WORKFLOW_JOB_STATUSES, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel } from '#core/workflow-run.js';
|
|
14
|
-
import { StepList } from '../step-list/index.js';
|
|
15
|
-
import { AgentConfigFailureCallout } from './agent-config-failure-callout.js';
|
|
16
|
-
import { JobExecutionSwitcher } from './job-execution-switcher.js';
|
|
17
|
-
import { formatJobExecutionTime, JobExecutionTimeText } from './job-execution-time-text.js';
|
|
18
|
-
import { StepAttemptLogPanel } from './step-attempt-log-panel.js';
|
|
19
|
-
const STATUS_BADGE_LABEL_WIDTH_CH = Math.max(...[
|
|
20
|
-
...WORKFLOW_JOB_STATUSES,
|
|
21
|
-
'listening'
|
|
22
|
-
].map((status)=>getWorkflowStatusVisual(status).label.length));
|
|
23
|
-
export function JobCard({ workspaceSlug, job, selectedJobExecution, selectedAttemptId, onSelectedJobExecutionChange, onSelectedAttemptChange, renderExpandedStep, sourcePanelId, sourceAvailable, focusedSourceStepId, onOpenStepSource }) {
|
|
24
|
-
const titleId = useId();
|
|
25
|
-
const sourceButtonRef = useRef(null);
|
|
26
|
-
const [localSelectedAttempt, setLocalSelectedAttempt] = useState({
|
|
27
|
-
jobExecutionId: undefined,
|
|
28
|
-
attemptId: null
|
|
29
|
-
});
|
|
30
|
-
const title = selectedJobExecution?.displayName ?? job.displayName;
|
|
31
|
-
const isNonDefaultExecutionSelected = selectedJobExecution !== undefined && selectedJobExecution.id !== defaultJobExecution(job)?.id;
|
|
32
|
-
const selectedExecutionStatus = isNonDefaultExecutionSelected ? deriveJobExecutionDisplayStatus(selectedJobExecution) : deriveJobDisplayStatus(job);
|
|
33
|
-
const effectiveSelectedAttemptId = selectedAttemptId === undefined && localSelectedAttempt.jobExecutionId === selectedJobExecution?.id ? localSelectedAttempt.attemptId : selectedAttemptId;
|
|
34
|
-
const selectedSourceAction = selectedStepSourceAction(selectedJobExecution, effectiveSelectedAttemptId);
|
|
35
|
-
const defaultRenderExpandedStep = ({ step, stepId, attempt, attemptError, attemptStatus, carriedOver })=>carriedOver ? /*#__PURE__*/ _jsx(CarriedOverStepPanel, {}) : /*#__PURE__*/ _jsx(StepAttemptDetailPanel, {
|
|
36
|
-
workspaceSlug: workspaceSlug,
|
|
37
|
-
step: step,
|
|
38
|
-
stepId: stepId,
|
|
39
|
-
attempt: attempt,
|
|
40
|
-
attemptError: attemptError,
|
|
41
|
-
attemptStatus: attemptStatus
|
|
42
|
-
});
|
|
43
|
-
function selectAttempt(attemptId) {
|
|
44
|
-
if (selectedAttemptId === undefined) {
|
|
45
|
-
setLocalSelectedAttempt({
|
|
46
|
-
jobExecutionId: selectedJobExecution?.id,
|
|
47
|
-
attemptId: attemptId ?? null
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
onSelectedAttemptChange?.(attemptId);
|
|
51
|
-
}
|
|
52
|
-
return /*#__PURE__*/ _jsxs("section", {
|
|
53
|
-
"aria-labelledby": titleId,
|
|
54
|
-
className: "flex min-h-0 flex-col rounded-8 border border-border-neutral-base bg-background-components-base",
|
|
55
|
-
children: [
|
|
56
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
57
|
-
className: "grid min-h-52 min-w-0 grid-cols-1 gap-y-4 px-16 py-12",
|
|
58
|
-
children: [
|
|
59
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
60
|
-
className: "flex min-w-0 flex-wrap items-center justify-between gap-10",
|
|
61
|
-
children: [
|
|
62
|
-
job.mode === 'listening' && job.jobExecutions.length > 0 && onSelectedJobExecutionChange ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
63
|
-
children: [
|
|
64
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
65
|
-
as: "h2",
|
|
66
|
-
id: titleId,
|
|
67
|
-
size: "sm",
|
|
68
|
-
bold: true,
|
|
69
|
-
className: "sr-only",
|
|
70
|
-
children: title
|
|
71
|
-
}),
|
|
72
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
73
|
-
className: "flex min-w-0 items-center gap-8",
|
|
74
|
-
children: [
|
|
75
|
-
/*#__PURE__*/ _jsx(JobStatusBadge, {
|
|
76
|
-
status: selectedExecutionStatus
|
|
77
|
-
}),
|
|
78
|
-
/*#__PURE__*/ _jsx(JobExecutionSwitcher, {
|
|
79
|
-
job: job,
|
|
80
|
-
selectedJobExecution: selectedJobExecution?.id ?? null,
|
|
81
|
-
onSelectedJobExecutionChange: onSelectedJobExecutionChange,
|
|
82
|
-
variant: "title"
|
|
83
|
-
})
|
|
84
|
-
]
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
}) : /*#__PURE__*/ _jsxs("div", {
|
|
88
|
-
className: "flex min-w-0 items-center gap-8",
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ _jsx(JobStatusBadge, {
|
|
91
|
-
status: selectedExecutionStatus
|
|
92
|
-
}),
|
|
93
|
-
/*#__PURE__*/ _jsx("div", {
|
|
94
|
-
className: "flex min-w-0 items-center gap-8",
|
|
95
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
96
|
-
as: "h2",
|
|
97
|
-
id: titleId,
|
|
98
|
-
size: "sm",
|
|
99
|
-
bold: true,
|
|
100
|
-
className: "min-w-0 truncate text-foreground-neutral-base",
|
|
101
|
-
children: title
|
|
102
|
-
})
|
|
103
|
-
})
|
|
104
|
-
]
|
|
105
|
-
}),
|
|
106
|
-
sourceAvailable && selectedSourceAction && sourcePanelId && onOpenStepSource ? /*#__PURE__*/ _jsx("div", {
|
|
107
|
-
className: "flex min-w-max items-center gap-6",
|
|
108
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
109
|
-
ref: sourceButtonRef,
|
|
110
|
-
type: "button",
|
|
111
|
-
variant: "secondary",
|
|
112
|
-
size: "xs",
|
|
113
|
-
"aria-controls": sourcePanelId,
|
|
114
|
-
"aria-expanded": focusedSourceStepId === selectedSourceAction.stepId,
|
|
115
|
-
onClick: ()=>onOpenStepSource(selectedSourceAction.stepId, selectedSourceAction.location, sourceButtonRef.current),
|
|
116
|
-
children: "View source"
|
|
117
|
-
})
|
|
118
|
-
}) : null
|
|
119
|
-
]
|
|
120
|
-
}),
|
|
121
|
-
/*#__PURE__*/ _jsx(JobExecutionMetadata, {
|
|
122
|
-
execution: selectedJobExecution
|
|
123
|
-
})
|
|
124
|
-
]
|
|
125
|
-
}),
|
|
126
|
-
/*#__PURE__*/ _jsx("div", {
|
|
127
|
-
className: "min-h-0 border-t border-border-neutral-strong",
|
|
128
|
-
children: selectedJobExecution ? /*#__PURE__*/ _jsx(StepList, {
|
|
129
|
-
job: job,
|
|
130
|
-
jobExecution: selectedJobExecution,
|
|
131
|
-
selectedAttemptId: selectedAttemptId,
|
|
132
|
-
onSelectedAttemptChange: selectAttempt,
|
|
133
|
-
autoSelectActiveAttempt: true,
|
|
134
|
-
emptyState: emptyStateForJob(job, selectedJobExecution),
|
|
135
|
-
showHeader: false,
|
|
136
|
-
className: "rounded-none border-0 bg-transparent",
|
|
137
|
-
renderExpandedStep: renderExpandedStep ?? defaultRenderExpandedStep
|
|
138
|
-
}) : /*#__PURE__*/ _jsx(JobExecutionEmptyState, {
|
|
139
|
-
job: job
|
|
140
|
-
})
|
|
141
|
-
})
|
|
142
|
-
]
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
function JobStatusBadge({ status }) {
|
|
146
|
-
const visual = getWorkflowStatusVisual(status);
|
|
147
|
-
return /*#__PURE__*/ _jsx(Badge, {
|
|
148
|
-
variant: visual.badge,
|
|
149
|
-
size: "xs",
|
|
150
|
-
children: /*#__PURE__*/ _jsx("span", {
|
|
151
|
-
className: "text-center",
|
|
152
|
-
style: {
|
|
153
|
-
width: `${STATUS_BADGE_LABEL_WIDTH_CH}ch`
|
|
154
|
-
},
|
|
155
|
-
children: visual.label
|
|
156
|
-
})
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function JobExecutionEmptyState({ job }) {
|
|
160
|
-
const emptyState = emptyStateForMissingExecution(job);
|
|
161
|
-
return /*#__PURE__*/ _jsx(EmptyState, {
|
|
162
|
-
className: "min-h-120 px-16 py-20",
|
|
163
|
-
icon: "componentLine",
|
|
164
|
-
title: emptyState.title,
|
|
165
|
-
description: emptyState.description,
|
|
166
|
-
variant: "compact"
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
function JobExecutionMetadata({ execution }) {
|
|
170
|
-
if (!execution) return null;
|
|
171
|
-
const queueTime = execution.queueTime;
|
|
172
|
-
const runTime = execution.runTime;
|
|
173
|
-
const executionStartedAt = execution.startedAt ?? execution.queuedAt ?? execution.createdAt;
|
|
174
|
-
const items = [
|
|
175
|
-
execution.triggerEvents.length > 0 ? {
|
|
176
|
-
key: 'trigger',
|
|
177
|
-
kind: 'trigger'
|
|
178
|
-
} : null,
|
|
179
|
-
{
|
|
180
|
-
key: 'started',
|
|
181
|
-
kind: 'started',
|
|
182
|
-
value: executionStartedAt
|
|
183
|
-
},
|
|
184
|
-
queueTime ? {
|
|
185
|
-
key: 'queue',
|
|
186
|
-
icon: 'hourglassLine',
|
|
187
|
-
kind: 'queue',
|
|
188
|
-
time: queueTime
|
|
189
|
-
} : null,
|
|
190
|
-
runTime ? {
|
|
191
|
-
key: 'run',
|
|
192
|
-
icon: 'timerLine',
|
|
193
|
-
kind: 'run',
|
|
194
|
-
time: runTime
|
|
195
|
-
} : null
|
|
196
|
-
].filter((item)=>item !== null);
|
|
197
|
-
if (items.length === 0) return null;
|
|
198
|
-
return /*#__PURE__*/ _jsx("div", {
|
|
199
|
-
className: "flex min-w-0 items-center gap-12 overflow-hidden text-foreground-neutral-muted",
|
|
200
|
-
children: items.map((item, index)=>/*#__PURE__*/ _jsxs(Fragment, {
|
|
201
|
-
children: [
|
|
202
|
-
index > 0 ? /*#__PURE__*/ _jsx(MetadataSeparator, {}) : null,
|
|
203
|
-
item.kind === 'started' ? /*#__PURE__*/ _jsx(RelativeTime, {
|
|
204
|
-
value: item.value,
|
|
205
|
-
className: "shrink-0 whitespace-nowrap text-xs leading-20 text-foreground-neutral-muted"
|
|
206
|
-
}) : item.kind === 'trigger' ? /*#__PURE__*/ _jsx(JobExecutionTriggerMetadata, {
|
|
207
|
-
execution: execution
|
|
208
|
-
}) : /*#__PURE__*/ _jsx(JobExecutionMetadataItem, {
|
|
209
|
-
icon: item.icon,
|
|
210
|
-
kind: item.kind,
|
|
211
|
-
time: item.time,
|
|
212
|
-
displayStatus: deriveJobExecutionDisplayStatus(execution)
|
|
213
|
-
})
|
|
214
|
-
]
|
|
215
|
-
}, item.key))
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
function JobExecutionTriggerMetadata({ execution }) {
|
|
219
|
-
const triggerEvent = execution.triggerEvents[0];
|
|
220
|
-
if (!triggerEvent) return null;
|
|
221
|
-
const triggerLabel = workflowRunTriggerLabel({
|
|
222
|
-
triggerSource: triggerEvent.source,
|
|
223
|
-
triggerEvent: triggerEvent.event
|
|
224
|
-
});
|
|
225
|
-
const triggerDisplayLabel = workflowRunTriggerDisplayLabel({
|
|
226
|
-
triggerSource: triggerEvent.source,
|
|
227
|
-
triggerEvent: triggerEvent.event
|
|
228
|
-
});
|
|
229
|
-
const triggerCount = execution.triggerEvents.length;
|
|
230
|
-
const countLabel = triggerCount > 1 ? ` (${triggerCount})` : '';
|
|
231
|
-
const tooltip = triggerCount > 1 ? `${triggerLabel} (${triggerCount} events)` : triggerLabel;
|
|
232
|
-
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
233
|
-
children: [
|
|
234
|
-
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
235
|
-
asChild: true,
|
|
236
|
-
children: /*#__PURE__*/ _jsxs("button", {
|
|
237
|
-
type: "button",
|
|
238
|
-
"aria-label": tooltip,
|
|
239
|
-
className: "inline-flex min-w-0 max-w-full cursor-default items-center gap-4 rounded-4 border-0 bg-transparent p-0 text-left text-foreground-neutral-muted outline-none focus-visible:shadow-border-interactive-with-active",
|
|
240
|
-
children: [
|
|
241
|
-
/*#__PURE__*/ _jsx(TriggerSourceIcon, {
|
|
242
|
-
provider: triggerEvent.source,
|
|
243
|
-
source: triggerEvent.source,
|
|
244
|
-
"aria-hidden": "true",
|
|
245
|
-
className: "size-12 shrink-0"
|
|
246
|
-
}),
|
|
247
|
-
/*#__PURE__*/ _jsxs(Text, {
|
|
248
|
-
as: "span",
|
|
249
|
-
size: "xs",
|
|
250
|
-
className: "min-w-0 truncate",
|
|
251
|
-
children: [
|
|
252
|
-
triggerDisplayLabel,
|
|
253
|
-
countLabel
|
|
254
|
-
]
|
|
255
|
-
})
|
|
256
|
-
]
|
|
257
|
-
})
|
|
258
|
-
}),
|
|
259
|
-
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
260
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
261
|
-
as: "span",
|
|
262
|
-
size: "xs",
|
|
263
|
-
className: "block max-w-[360px] break-words",
|
|
264
|
-
children: tooltip
|
|
265
|
-
})
|
|
266
|
-
})
|
|
267
|
-
]
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
function JobExecutionMetadataItem({ icon, kind, time, displayStatus }) {
|
|
271
|
-
useTimeTick();
|
|
272
|
-
const tooltip = `${jobExecutionTimeVerb(kind, time, displayStatus)} for ${formatJobExecutionTime(time)}`;
|
|
273
|
-
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
274
|
-
children: [
|
|
275
|
-
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
276
|
-
asChild: true,
|
|
277
|
-
children: /*#__PURE__*/ _jsxs("button", {
|
|
278
|
-
type: "button",
|
|
279
|
-
"aria-label": tooltip,
|
|
280
|
-
className: "inline-flex min-w-0 cursor-default items-center gap-4 rounded-4 border-0 bg-transparent p-0 text-foreground-neutral-muted outline-none focus-visible:shadow-border-interactive-with-active",
|
|
281
|
-
children: [
|
|
282
|
-
/*#__PURE__*/ _jsx(Icon, {
|
|
283
|
-
name: icon,
|
|
284
|
-
className: "size-12 shrink-0",
|
|
285
|
-
"aria-hidden": "true"
|
|
286
|
-
}),
|
|
287
|
-
/*#__PURE__*/ _jsx("span", {
|
|
288
|
-
className: "shrink-0 text-xs leading-20 text-foreground-neutral-muted tabular-nums",
|
|
289
|
-
children: /*#__PURE__*/ _jsx(JobExecutionTimeText, {
|
|
290
|
-
time: time
|
|
291
|
-
})
|
|
292
|
-
})
|
|
293
|
-
]
|
|
294
|
-
})
|
|
295
|
-
}),
|
|
296
|
-
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
297
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
298
|
-
as: "span",
|
|
299
|
-
size: "xs",
|
|
300
|
-
children: tooltip
|
|
301
|
-
})
|
|
302
|
-
})
|
|
303
|
-
]
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
function jobExecutionTimeVerb(kind, time, displayStatus) {
|
|
307
|
-
if (kind === 'queue') return time.state === 'live' ? 'Queueing' : 'Queued';
|
|
308
|
-
if (time.state !== 'live') return 'Ran';
|
|
309
|
-
if (displayStatus === 'running') return 'Running';
|
|
310
|
-
return displayStatus === 'pending' ? 'Runner assigned' : 'Execution elapsed';
|
|
311
|
-
}
|
|
312
|
-
function MetadataSeparator() {
|
|
313
|
-
return /*#__PURE__*/ _jsx("span", {
|
|
314
|
-
"aria-hidden": "true",
|
|
315
|
-
className: "h-12 w-px shrink-0 bg-border-neutral-strong"
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
function selectedStepSourceAction(jobExecution, selectedAttemptId) {
|
|
319
|
-
if (!jobExecution || !selectedAttemptId) return null;
|
|
320
|
-
for (const step of jobExecution.steps){
|
|
321
|
-
const selected = selectedAttemptId === `carried-over:${step.id}` || step.attempts.some((attempt)=>attempt.id === selectedAttemptId);
|
|
322
|
-
if (selected && step.sourceLocation) {
|
|
323
|
-
return {
|
|
324
|
-
stepId: step.id,
|
|
325
|
-
location: step.sourceLocation
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
|
-
function StepAttemptDetailPanel({ workspaceSlug, step, stepId, attempt, attemptError, attemptStatus }) {
|
|
332
|
-
const selectedAttemptError = toSelectedAttemptError(step, attemptError) ?? step.error;
|
|
333
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
334
|
-
className: "flex min-w-0 flex-col gap-10",
|
|
335
|
-
children: [
|
|
336
|
-
isAgentConfigFailure(step, selectedAttemptError) ? /*#__PURE__*/ _jsx(AgentConfigFailureCallout, {
|
|
337
|
-
workspaceSlug: workspaceSlug,
|
|
338
|
-
config: step.agentConfig,
|
|
339
|
-
error: selectedAttemptError
|
|
340
|
-
}) : null,
|
|
341
|
-
/*#__PURE__*/ _jsx(StepAttemptLogPanel, {
|
|
342
|
-
stepId: stepId,
|
|
343
|
-
attempt: attempt,
|
|
344
|
-
attemptStatus: attemptStatus
|
|
345
|
-
})
|
|
346
|
-
]
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
function toSelectedAttemptError(step, error) {
|
|
350
|
-
if (error === null) return null;
|
|
351
|
-
const rawReason = error.reason;
|
|
352
|
-
const parsedReason = typeof rawReason === 'string' && STEP_ERROR_REASONS.has(rawReason) ? rawReason : undefined;
|
|
353
|
-
const rawAgentConfigIssue = error.agentConfigIssue ?? error.agent_config_issue;
|
|
354
|
-
const agentConfigIssue = typeof rawAgentConfigIssue === 'string' && AGENT_CONFIG_ISSUES.has(rawAgentConfigIssue) ? rawAgentConfigIssue : undefined;
|
|
355
|
-
const exitCode = error.exitCode ?? error.exit_code;
|
|
356
|
-
const resolvedReason = parsedReason ? parsedReason : agentConfigIssue ? 'agent_config_invalid' : undefined;
|
|
357
|
-
if (resolvedReason === undefined) return null;
|
|
358
|
-
return {
|
|
359
|
-
message: typeof error.message === 'string' ? error.message : '',
|
|
360
|
-
exitCode: exitCode === null || typeof exitCode === 'number' ? exitCode : null,
|
|
361
|
-
signal: typeof error.signal === 'string' ? error.signal : undefined,
|
|
362
|
-
reason: resolvedReason,
|
|
363
|
-
agentConfigIssue,
|
|
364
|
-
category: step.type === 'setup' || step.type === 'checkout' ? 'setup' : 'user'
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
function isAgentConfigFailure(step, error) {
|
|
368
|
-
return step.type === 'agent' && error?.reason === 'agent_config_invalid';
|
|
369
|
-
}
|
|
370
|
-
function emptyStateForJob(job, jobExecution) {
|
|
371
|
-
if (job.carriedOver) {
|
|
372
|
-
return {
|
|
373
|
-
title: 'Carried over from a previous attempt',
|
|
374
|
-
description: 'This job did not execute in this run.',
|
|
375
|
-
status: 'succeeded'
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
const displayStatus = job.mode === 'listening' ? deriveJobExecutionDisplayStatus(jobExecution) : deriveJobDisplayStatus(job);
|
|
379
|
-
if (jobExecution.status === 'running' && displayStatus === 'pending') {
|
|
380
|
-
return {
|
|
381
|
-
title: 'Runner preparing job',
|
|
382
|
-
description: 'A runner is assigned. Steps will appear here when work begins.',
|
|
383
|
-
status: displayStatus
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
if (displayStatus === 'pending') {
|
|
387
|
-
return {
|
|
388
|
-
title: 'Waiting for this job to start',
|
|
389
|
-
description: 'Steps will appear here once the job starts.',
|
|
390
|
-
status: displayStatus
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
if (displayStatus === 'running') {
|
|
394
|
-
return {
|
|
395
|
-
title: 'Waiting for the first step',
|
|
396
|
-
description: 'The first running step will appear here shortly.',
|
|
397
|
-
status: displayStatus
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
if (displayStatus === 'cancelled') {
|
|
401
|
-
return {
|
|
402
|
-
title: 'Cancelled before start',
|
|
403
|
-
description: 'This job was cancelled before any step started.',
|
|
404
|
-
status: displayStatus
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
if (displayStatus === 'succeeded' || displayStatus === 'failed') {
|
|
408
|
-
return {
|
|
409
|
-
title: 'No steps recorded',
|
|
410
|
-
description: `Execution #${jobExecution.sequence} finished without recorded steps.`,
|
|
411
|
-
status: displayStatus
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
return undefined;
|
|
415
|
-
}
|
|
416
|
-
function emptyStateForMissingExecution(job) {
|
|
417
|
-
if (job.carriedOver) {
|
|
418
|
-
return {
|
|
419
|
-
title: 'Carried over from a previous attempt',
|
|
420
|
-
description: 'This job did not execute in this run.',
|
|
421
|
-
status: 'succeeded'
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
if (job.mode === 'listening' && job.listenerStatus === 'listening') {
|
|
425
|
-
return {
|
|
426
|
-
title: 'Waiting for trigger events',
|
|
427
|
-
description: 'Matching trigger events will create job executions here.',
|
|
428
|
-
status: deriveJobDisplayStatus(job)
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
if (job.mode === 'listening' && job.listenerStatus === 'resolved') {
|
|
432
|
-
return {
|
|
433
|
-
title: 'Listener resolved without executions',
|
|
434
|
-
description: 'No matching trigger event created a job execution before the listener stopped.',
|
|
435
|
-
status: job.status
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
if (job.status === 'pending') {
|
|
439
|
-
return {
|
|
440
|
-
title: 'Waiting for this job to start',
|
|
441
|
-
description: 'No execution has been created for this job yet.',
|
|
442
|
-
status: 'pending'
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
if (job.status === 'skipped') {
|
|
446
|
-
return {
|
|
447
|
-
title: 'This job was skipped',
|
|
448
|
-
description: skippedJobDescription(job.statusReason),
|
|
449
|
-
status: 'skipped'
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
if (job.status === 'cancelled') {
|
|
453
|
-
return {
|
|
454
|
-
title: 'Cancelled before start',
|
|
455
|
-
description: 'This job was cancelled before an execution was created.',
|
|
456
|
-
status: 'cancelled'
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
return {
|
|
460
|
-
title: 'Execution details unavailable',
|
|
461
|
-
description: 'This job finished, but no job execution record is available.',
|
|
462
|
-
status: job.status
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
function CarriedOverStepPanel() {
|
|
466
|
-
return /*#__PURE__*/ _jsx(EmptyState, {
|
|
467
|
-
className: "min-h-120 rounded-8 border border-border-neutral-base bg-background-components-base px-16 py-20",
|
|
468
|
-
icon: "componentLine",
|
|
469
|
-
title: "Carried over from a previous attempt",
|
|
470
|
-
description: "Not executed in this run.",
|
|
471
|
-
variant: "compact"
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
function skippedJobDescription(reason) {
|
|
475
|
-
switch(reason){
|
|
476
|
-
case 'dependency_not_completed':
|
|
477
|
-
return 'A required job did not complete, so this job was skipped.';
|
|
478
|
-
case 'default_gate_rejected':
|
|
479
|
-
return 'A required job did not succeed, so this job was skipped.';
|
|
480
|
-
case 'condition_false':
|
|
481
|
-
case 'condition_rejected':
|
|
482
|
-
return 'The job condition did not match, so this job was skipped.';
|
|
483
|
-
case 'condition_errored':
|
|
484
|
-
return 'The job condition could not be evaluated, so this job was skipped.';
|
|
485
|
-
case 'user_cancelled':
|
|
486
|
-
case 'run_cancelled':
|
|
487
|
-
case 'timed_out':
|
|
488
|
-
case 'runner_lost':
|
|
489
|
-
case 'step_failed':
|
|
490
|
-
case 'unknown':
|
|
491
|
-
case null:
|
|
492
|
-
return 'This job did not start.';
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
//# sourceMappingURL=job-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/workflow-run-view/job-card.tsx"],"sourcesContent":["import {TriggerSourceIcon} from '@shipfox/client-triggers';\nimport {Badge} from '@shipfox/react-ui/badge';\nimport {Button} from '@shipfox/react-ui/button';\nimport {EmptyState} from '@shipfox/react-ui/empty-state';\nimport {Icon} from '@shipfox/react-ui/icon';\nimport {RelativeTime} from '@shipfox/react-ui/relative-time';\nimport {useTimeTick} from '@shipfox/react-ui/time-ticker';\nimport {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';\nimport {Text} from '@shipfox/react-ui/typography';\nimport type {ReactNode} from 'react';\nimport {Fragment, useId, useRef, useState} from 'react';\nimport {getWorkflowStatusVisual} from '#components/workflow-status/status-visuals.js';\nimport {\n AGENT_CONFIG_ISSUES,\n defaultJobExecution,\n deriveJobDisplayStatus,\n deriveJobExecutionDisplayStatus,\n type Job,\n type JobDisplayStatus,\n type JobExecution,\n type JobExecutionTime,\n STEP_ERROR_REASONS,\n type Step,\n type StepError,\n type StepSourceLocation,\n WORKFLOW_JOB_STATUSES,\n workflowRunTriggerDisplayLabel,\n workflowRunTriggerLabel,\n} from '#core/workflow-run.js';\nimport {type StepExpandedContext, StepList, type StepListEmptyState} from '../step-list/index.js';\nimport {AgentConfigFailureCallout} from './agent-config-failure-callout.js';\nimport {JobExecutionSwitcher} from './job-execution-switcher.js';\nimport {formatJobExecutionTime, JobExecutionTimeText} from './job-execution-time-text.js';\nimport {StepAttemptLogPanel} from './step-attempt-log-panel.js';\n\nconst STATUS_BADGE_LABEL_WIDTH_CH = Math.max(\n ...[...WORKFLOW_JOB_STATUSES, 'listening' as const].map(\n (status) => getWorkflowStatusVisual(status).label.length,\n ),\n);\n\ninterface LocalSelectedAttempt {\n jobExecutionId: string | undefined;\n attemptId: string | null;\n}\n\nexport function JobCard({\n workspaceSlug,\n job,\n selectedJobExecution,\n selectedAttemptId,\n onSelectedJobExecutionChange,\n onSelectedAttemptChange,\n renderExpandedStep,\n sourcePanelId,\n sourceAvailable,\n focusedSourceStepId,\n onOpenStepSource,\n}: {\n workspaceSlug?: string | undefined;\n job: Job;\n selectedJobExecution: JobExecution | undefined;\n selectedAttemptId: string | null | undefined;\n onSelectedJobExecutionChange: ((jobExecutionId: string | undefined) => void) | undefined;\n onSelectedAttemptChange: ((attemptId: string | undefined) => void) | undefined;\n renderExpandedStep?: ((context: StepExpandedContext) => ReactNode) | undefined;\n sourcePanelId?: string | undefined;\n sourceAvailable?: boolean | undefined;\n focusedSourceStepId?: string | null | undefined;\n onOpenStepSource?:\n | ((stepId: string, location: StepSourceLocation, trigger: HTMLButtonElement | null) => void)\n | undefined;\n}) {\n const titleId = useId();\n const sourceButtonRef = useRef<HTMLButtonElement>(null);\n const [localSelectedAttempt, setLocalSelectedAttempt] = useState<LocalSelectedAttempt>({\n jobExecutionId: undefined,\n attemptId: null,\n });\n const title = selectedJobExecution?.displayName ?? job.displayName;\n const isNonDefaultExecutionSelected =\n selectedJobExecution !== undefined && selectedJobExecution.id !== defaultJobExecution(job)?.id;\n const selectedExecutionStatus = isNonDefaultExecutionSelected\n ? deriveJobExecutionDisplayStatus(selectedJobExecution)\n : deriveJobDisplayStatus(job);\n const effectiveSelectedAttemptId =\n selectedAttemptId === undefined &&\n localSelectedAttempt.jobExecutionId === selectedJobExecution?.id\n ? localSelectedAttempt.attemptId\n : selectedAttemptId;\n const selectedSourceAction = selectedStepSourceAction(\n selectedJobExecution,\n effectiveSelectedAttemptId,\n );\n const defaultRenderExpandedStep = ({\n step,\n stepId,\n attempt,\n attemptError,\n attemptStatus,\n carriedOver,\n }: StepExpandedContext) =>\n carriedOver ? (\n <CarriedOverStepPanel />\n ) : (\n <StepAttemptDetailPanel\n workspaceSlug={workspaceSlug}\n step={step}\n stepId={stepId}\n attempt={attempt}\n attemptError={attemptError}\n attemptStatus={attemptStatus}\n />\n );\n\n function selectAttempt(attemptId: string | undefined) {\n if (selectedAttemptId === undefined) {\n setLocalSelectedAttempt({\n jobExecutionId: selectedJobExecution?.id,\n attemptId: attemptId ?? null,\n });\n }\n\n onSelectedAttemptChange?.(attemptId);\n }\n\n return (\n <section\n aria-labelledby={titleId}\n className=\"flex min-h-0 flex-col rounded-8 border border-border-neutral-base bg-background-components-base\"\n >\n <div className=\"grid min-h-52 min-w-0 grid-cols-1 gap-y-4 px-16 py-12\">\n <div className=\"flex min-w-0 flex-wrap items-center justify-between gap-10\">\n {job.mode === 'listening' &&\n job.jobExecutions.length > 0 &&\n onSelectedJobExecutionChange ? (\n <>\n <Text as=\"h2\" id={titleId} size=\"sm\" bold className=\"sr-only\">\n {title}\n </Text>\n <div className=\"flex min-w-0 items-center gap-8\">\n <JobStatusBadge status={selectedExecutionStatus} />\n <JobExecutionSwitcher\n job={job}\n selectedJobExecution={selectedJobExecution?.id ?? null}\n onSelectedJobExecutionChange={onSelectedJobExecutionChange}\n variant=\"title\"\n />\n </div>\n </>\n ) : (\n <div className=\"flex min-w-0 items-center gap-8\">\n <JobStatusBadge status={selectedExecutionStatus} />\n <div className=\"flex min-w-0 items-center gap-8\">\n <Text\n as=\"h2\"\n id={titleId}\n size=\"sm\"\n bold\n className=\"min-w-0 truncate text-foreground-neutral-base\"\n >\n {title}\n </Text>\n </div>\n </div>\n )}\n {sourceAvailable && selectedSourceAction && sourcePanelId && onOpenStepSource ? (\n <div className=\"flex min-w-max items-center gap-6\">\n <Button\n ref={sourceButtonRef}\n type=\"button\"\n variant=\"secondary\"\n size=\"xs\"\n aria-controls={sourcePanelId}\n aria-expanded={focusedSourceStepId === selectedSourceAction.stepId}\n onClick={() =>\n onOpenStepSource(\n selectedSourceAction.stepId,\n selectedSourceAction.location,\n sourceButtonRef.current,\n )\n }\n >\n View source\n </Button>\n </div>\n ) : null}\n </div>\n <JobExecutionMetadata execution={selectedJobExecution} />\n </div>\n <div className=\"min-h-0 border-t border-border-neutral-strong\">\n {selectedJobExecution ? (\n <StepList\n job={job}\n jobExecution={selectedJobExecution}\n selectedAttemptId={selectedAttemptId}\n onSelectedAttemptChange={selectAttempt}\n autoSelectActiveAttempt\n emptyState={emptyStateForJob(job, selectedJobExecution)}\n showHeader={false}\n className=\"rounded-none border-0 bg-transparent\"\n renderExpandedStep={renderExpandedStep ?? defaultRenderExpandedStep}\n />\n ) : (\n <JobExecutionEmptyState job={job} />\n )}\n </div>\n </section>\n );\n}\n\nfunction JobStatusBadge({status}: {status: JobDisplayStatus}) {\n const visual = getWorkflowStatusVisual(status);\n\n return (\n <Badge variant={visual.badge} size=\"xs\">\n <span className=\"text-center\" style={{width: `${STATUS_BADGE_LABEL_WIDTH_CH}ch`}}>\n {visual.label}\n </span>\n </Badge>\n );\n}\n\nfunction JobExecutionEmptyState({job}: {job: Job}) {\n const emptyState = emptyStateForMissingExecution(job);\n\n return (\n <EmptyState\n className=\"min-h-120 px-16 py-20\"\n icon=\"componentLine\"\n title={emptyState.title}\n description={emptyState.description}\n variant=\"compact\"\n />\n );\n}\n\nfunction JobExecutionMetadata({execution}: {execution: JobExecution | undefined}) {\n if (!execution) return null;\n\n const queueTime = execution.queueTime;\n const runTime = execution.runTime;\n const executionStartedAt = execution.startedAt ?? execution.queuedAt ?? execution.createdAt;\n const items = [\n execution.triggerEvents.length > 0 ? {key: 'trigger', kind: 'trigger' as const} : null,\n {key: 'started', kind: 'started' as const, value: executionStartedAt},\n queueTime\n ? {key: 'queue', icon: 'hourglassLine' as const, kind: 'queue' as const, time: queueTime}\n : null,\n runTime ? {key: 'run', icon: 'timerLine' as const, kind: 'run' as const, time: runTime} : null,\n ].filter((item) => item !== null);\n\n if (items.length === 0) return null;\n\n return (\n <div className=\"flex min-w-0 items-center gap-12 overflow-hidden text-foreground-neutral-muted\">\n {items.map((item, index) => (\n <Fragment key={item.key}>\n {index > 0 ? <MetadataSeparator /> : null}\n {item.kind === 'started' ? (\n <RelativeTime\n value={item.value}\n className=\"shrink-0 whitespace-nowrap text-xs leading-20 text-foreground-neutral-muted\"\n />\n ) : item.kind === 'trigger' ? (\n <JobExecutionTriggerMetadata execution={execution} />\n ) : (\n <JobExecutionMetadataItem\n icon={item.icon}\n kind={item.kind}\n time={item.time}\n displayStatus={deriveJobExecutionDisplayStatus(execution)}\n />\n )}\n </Fragment>\n ))}\n </div>\n );\n}\n\nfunction JobExecutionTriggerMetadata({execution}: {execution: JobExecution}) {\n const triggerEvent = execution.triggerEvents[0];\n if (!triggerEvent) return null;\n\n const triggerLabel = workflowRunTriggerLabel({\n triggerSource: triggerEvent.source,\n triggerEvent: triggerEvent.event,\n });\n const triggerDisplayLabel = workflowRunTriggerDisplayLabel({\n triggerSource: triggerEvent.source,\n triggerEvent: triggerEvent.event,\n });\n const triggerCount = execution.triggerEvents.length;\n const countLabel = triggerCount > 1 ? ` (${triggerCount})` : '';\n const tooltip = triggerCount > 1 ? `${triggerLabel} (${triggerCount} events)` : triggerLabel;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={tooltip}\n className=\"inline-flex min-w-0 max-w-full cursor-default items-center gap-4 rounded-4 border-0 bg-transparent p-0 text-left text-foreground-neutral-muted outline-none focus-visible:shadow-border-interactive-with-active\"\n >\n <TriggerSourceIcon\n provider={triggerEvent.source}\n source={triggerEvent.source}\n aria-hidden=\"true\"\n className=\"size-12 shrink-0\"\n />\n <Text as=\"span\" size=\"xs\" className=\"min-w-0 truncate\">\n {triggerDisplayLabel}\n {countLabel}\n </Text>\n </button>\n </TooltipTrigger>\n <TooltipContent>\n <Text as=\"span\" size=\"xs\" className=\"block max-w-[360px] break-words\">\n {tooltip}\n </Text>\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction JobExecutionMetadataItem({\n icon,\n kind,\n time,\n displayStatus,\n}: {\n icon: 'hourglassLine' | 'timerLine';\n kind: 'queue' | 'run';\n time: JobExecutionTime;\n displayStatus: JobExecution['status'];\n}) {\n useTimeTick();\n\n const tooltip = `${jobExecutionTimeVerb(kind, time, displayStatus)} for ${formatJobExecutionTime(time)}`;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={tooltip}\n className=\"inline-flex min-w-0 cursor-default items-center gap-4 rounded-4 border-0 bg-transparent p-0 text-foreground-neutral-muted outline-none focus-visible:shadow-border-interactive-with-active\"\n >\n <Icon name={icon} className=\"size-12 shrink-0\" aria-hidden=\"true\" />\n <span className=\"shrink-0 text-xs leading-20 text-foreground-neutral-muted tabular-nums\">\n <JobExecutionTimeText time={time} />\n </span>\n </button>\n </TooltipTrigger>\n <TooltipContent>\n <Text as=\"span\" size=\"xs\">\n {tooltip}\n </Text>\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction jobExecutionTimeVerb(\n kind: 'queue' | 'run',\n time: JobExecutionTime,\n displayStatus: JobExecution['status'],\n): string {\n if (kind === 'queue') return time.state === 'live' ? 'Queueing' : 'Queued';\n if (time.state !== 'live') return 'Ran';\n if (displayStatus === 'running') return 'Running';\n return displayStatus === 'pending' ? 'Runner assigned' : 'Execution elapsed';\n}\n\nfunction MetadataSeparator() {\n return <span aria-hidden=\"true\" className=\"h-12 w-px shrink-0 bg-border-neutral-strong\" />;\n}\n\nfunction selectedStepSourceAction(\n jobExecution: JobExecution | undefined,\n selectedAttemptId: string | null | undefined,\n): {stepId: string; location: StepSourceLocation} | null {\n if (!jobExecution || !selectedAttemptId) return null;\n\n for (const step of jobExecution.steps) {\n const selected =\n selectedAttemptId === `carried-over:${step.id}` ||\n step.attempts.some((attempt) => attempt.id === selectedAttemptId);\n if (selected && step.sourceLocation) {\n return {stepId: step.id, location: step.sourceLocation};\n }\n }\n\n return null;\n}\n\nfunction StepAttemptDetailPanel({\n workspaceSlug,\n step,\n stepId,\n attempt,\n attemptError,\n attemptStatus,\n}: {\n workspaceSlug?: string | undefined;\n step: Step;\n stepId: string;\n attempt: number;\n attemptError: Record<string, unknown> | null;\n attemptStatus: string;\n}) {\n const selectedAttemptError = toSelectedAttemptError(step, attemptError) ?? step.error;\n\n return (\n <div className=\"flex min-w-0 flex-col gap-10\">\n {isAgentConfigFailure(step, selectedAttemptError) ? (\n <AgentConfigFailureCallout\n workspaceSlug={workspaceSlug}\n config={step.agentConfig}\n error={selectedAttemptError}\n />\n ) : null}\n <StepAttemptLogPanel stepId={stepId} attempt={attempt} attemptStatus={attemptStatus} />\n </div>\n );\n}\n\nfunction toSelectedAttemptError(\n step: Step,\n error: Record<string, unknown> | null,\n): StepError | null {\n if (error === null) return null;\n\n const rawReason = error.reason;\n const parsedReason =\n typeof rawReason === 'string' &&\n STEP_ERROR_REASONS.has(rawReason as StepError['reason'] & string)\n ? (rawReason as NonNullable<StepError['reason']>)\n : undefined;\n const rawAgentConfigIssue = error.agentConfigIssue ?? error.agent_config_issue;\n const agentConfigIssue =\n typeof rawAgentConfigIssue === 'string' &&\n AGENT_CONFIG_ISSUES.has(rawAgentConfigIssue as NonNullable<StepError['agentConfigIssue']>)\n ? (rawAgentConfigIssue as NonNullable<StepError['agentConfigIssue']>)\n : undefined;\n const exitCode = error.exitCode ?? error.exit_code;\n const resolvedReason = parsedReason\n ? parsedReason\n : agentConfigIssue\n ? 'agent_config_invalid'\n : undefined;\n\n if (resolvedReason === undefined) return null;\n\n return {\n message: typeof error.message === 'string' ? error.message : '',\n exitCode: exitCode === null || typeof exitCode === 'number' ? exitCode : null,\n signal: typeof error.signal === 'string' ? error.signal : undefined,\n reason: resolvedReason,\n agentConfigIssue,\n category: step.type === 'setup' || step.type === 'checkout' ? 'setup' : 'user',\n };\n}\n\nfunction isAgentConfigFailure(step: Step, error: StepError | null): boolean {\n return step.type === 'agent' && error?.reason === 'agent_config_invalid';\n}\n\nfunction emptyStateForJob(job: Job, jobExecution: JobExecution): StepListEmptyState | undefined {\n if (job.carriedOver) {\n return {\n title: 'Carried over from a previous attempt',\n description: 'This job did not execute in this run.',\n status: 'succeeded',\n };\n }\n\n const displayStatus =\n job.mode === 'listening'\n ? deriveJobExecutionDisplayStatus(jobExecution)\n : deriveJobDisplayStatus(job);\n\n if (jobExecution.status === 'running' && displayStatus === 'pending') {\n return {\n title: 'Runner preparing job',\n description: 'A runner is assigned. Steps will appear here when work begins.',\n status: displayStatus,\n };\n }\n\n if (displayStatus === 'pending') {\n return {\n title: 'Waiting for this job to start',\n description: 'Steps will appear here once the job starts.',\n status: displayStatus,\n };\n }\n\n if (displayStatus === 'running') {\n return {\n title: 'Waiting for the first step',\n description: 'The first running step will appear here shortly.',\n status: displayStatus,\n };\n }\n\n if (displayStatus === 'cancelled') {\n return {\n title: 'Cancelled before start',\n description: 'This job was cancelled before any step started.',\n status: displayStatus,\n };\n }\n\n if (displayStatus === 'succeeded' || displayStatus === 'failed') {\n return {\n title: 'No steps recorded',\n description: `Execution #${jobExecution.sequence} finished without recorded steps.`,\n status: displayStatus,\n };\n }\n\n return undefined;\n}\n\nfunction emptyStateForMissingExecution(job: Job): StepListEmptyState {\n if (job.carriedOver) {\n return {\n title: 'Carried over from a previous attempt',\n description: 'This job did not execute in this run.',\n status: 'succeeded',\n };\n }\n\n if (job.mode === 'listening' && job.listenerStatus === 'listening') {\n return {\n title: 'Waiting for trigger events',\n description: 'Matching trigger events will create job executions here.',\n status: deriveJobDisplayStatus(job),\n };\n }\n\n if (job.mode === 'listening' && job.listenerStatus === 'resolved') {\n return {\n title: 'Listener resolved without executions',\n description: 'No matching trigger event created a job execution before the listener stopped.',\n status: job.status,\n };\n }\n\n if (job.status === 'pending') {\n return {\n title: 'Waiting for this job to start',\n description: 'No execution has been created for this job yet.',\n status: 'pending',\n };\n }\n\n if (job.status === 'skipped') {\n return {\n title: 'This job was skipped',\n description: skippedJobDescription(job.statusReason),\n status: 'skipped',\n };\n }\n\n if (job.status === 'cancelled') {\n return {\n title: 'Cancelled before start',\n description: 'This job was cancelled before an execution was created.',\n status: 'cancelled',\n };\n }\n\n return {\n title: 'Execution details unavailable',\n description: 'This job finished, but no job execution record is available.',\n status: job.status,\n };\n}\n\nfunction CarriedOverStepPanel() {\n return (\n <EmptyState\n className=\"min-h-120 rounded-8 border border-border-neutral-base bg-background-components-base px-16 py-20\"\n icon=\"componentLine\"\n title=\"Carried over from a previous attempt\"\n description=\"Not executed in this run.\"\n variant=\"compact\"\n />\n );\n}\n\nfunction skippedJobDescription(reason: Job['statusReason']): string {\n switch (reason) {\n case 'dependency_not_completed':\n return 'A required job did not complete, so this job was skipped.';\n case 'default_gate_rejected':\n return 'A required job did not succeed, so this job was skipped.';\n case 'condition_false':\n case 'condition_rejected':\n return 'The job condition did not match, so this job was skipped.';\n case 'condition_errored':\n return 'The job condition could not be evaluated, so this job was skipped.';\n case 'user_cancelled':\n case 'run_cancelled':\n case 'timed_out':\n case 'runner_lost':\n case 'step_failed':\n case 'unknown':\n case null:\n return 'This job did not start.';\n }\n}\n"],"names":["TriggerSourceIcon","Badge","Button","EmptyState","Icon","RelativeTime","useTimeTick","Tooltip","TooltipContent","TooltipTrigger","Text","Fragment","useId","useRef","useState","getWorkflowStatusVisual","AGENT_CONFIG_ISSUES","defaultJobExecution","deriveJobDisplayStatus","deriveJobExecutionDisplayStatus","STEP_ERROR_REASONS","WORKFLOW_JOB_STATUSES","workflowRunTriggerDisplayLabel","workflowRunTriggerLabel","StepList","AgentConfigFailureCallout","JobExecutionSwitcher","formatJobExecutionTime","JobExecutionTimeText","StepAttemptLogPanel","STATUS_BADGE_LABEL_WIDTH_CH","Math","max","map","status","label","length","JobCard","workspaceSlug","job","selectedJobExecution","selectedAttemptId","onSelectedJobExecutionChange","onSelectedAttemptChange","renderExpandedStep","sourcePanelId","sourceAvailable","focusedSourceStepId","onOpenStepSource","titleId","sourceButtonRef","localSelectedAttempt","setLocalSelectedAttempt","jobExecutionId","undefined","attemptId","title","displayName","isNonDefaultExecutionSelected","id","selectedExecutionStatus","effectiveSelectedAttemptId","selectedSourceAction","selectedStepSourceAction","defaultRenderExpandedStep","step","stepId","attempt","attemptError","attemptStatus","carriedOver","CarriedOverStepPanel","StepAttemptDetailPanel","selectAttempt","section","aria-labelledby","className","div","mode","jobExecutions","as","size","bold","JobStatusBadge","variant","ref","type","aria-controls","aria-expanded","onClick","location","current","JobExecutionMetadata","execution","jobExecution","autoSelectActiveAttempt","emptyState","emptyStateForJob","showHeader","JobExecutionEmptyState","visual","badge","span","style","width","emptyStateForMissingExecution","icon","description","queueTime","runTime","executionStartedAt","startedAt","queuedAt","createdAt","items","triggerEvents","key","kind","value","time","filter","item","index","MetadataSeparator","JobExecutionTriggerMetadata","JobExecutionMetadataItem","displayStatus","triggerEvent","triggerLabel","triggerSource","source","event","triggerDisplayLabel","triggerCount","countLabel","tooltip","asChild","button","aria-label","provider","aria-hidden","jobExecutionTimeVerb","name","state","steps","selected","attempts","some","sourceLocation","selectedAttemptError","toSelectedAttemptError","error","isAgentConfigFailure","config","agentConfig","rawReason","reason","parsedReason","has","rawAgentConfigIssue","agentConfigIssue","agent_config_issue","exitCode","exit_code","resolvedReason","message","signal","category","sequence","listenerStatus","skippedJobDescription","statusReason"],"mappings":";AAAA,SAAQA,iBAAiB,QAAO,2BAA2B;AAC3D,SAAQC,KAAK,QAAO,0BAA0B;AAC9C,SAAQC,MAAM,QAAO,2BAA2B;AAChD,SAAQC,UAAU,QAAO,gCAAgC;AACzD,SAAQC,IAAI,QAAO,yBAAyB;AAC5C,SAAQC,YAAY,QAAO,kCAAkC;AAC7D,SAAQC,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAO,4BAA4B;AAClF,SAAQC,IAAI,QAAO,+BAA+B;AAElD,SAAQC,QAAQ,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,QAAO,QAAQ;AACxD,SAAQC,uBAAuB,QAAO,gDAAgD;AACtF,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,sBAAsB,EACtBC,+BAA+B,EAK/BC,kBAAkB,EAIlBC,qBAAqB,EACrBC,8BAA8B,EAC9BC,uBAAuB,QAClB,wBAAwB;AAC/B,SAAkCC,QAAQ,QAAgC,wBAAwB;AAClG,SAAQC,yBAAyB,QAAO,oCAAoC;AAC5E,SAAQC,oBAAoB,QAAO,8BAA8B;AACjE,SAAQC,sBAAsB,EAAEC,oBAAoB,QAAO,+BAA+B;AAC1F,SAAQC,mBAAmB,QAAO,8BAA8B;AAEhE,MAAMC,8BAA8BC,KAAKC,GAAG,IACvC;OAAIX;IAAuB;CAAqB,C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ACLjH,OAAO;YACPmD,aAAa;YACbzE,QAAQK,IAAIL,MAAM;QACpB;IACF;IAEA,IAAIK,IAAIL,MAAM,KAAK,WAAW;QAC5B,OAAO;YACLsB,OAAO;YACPmD,aAAa;YACbzE,QAAQ;QACV;IACF;IAEA,IAAIK,IAAIL,MAAM,KAAK,WAAW;QAC5B,OAAO;YACLsB,OAAO;YACPmD,aAAa+D,sBAAsBnI,IAAIoI,YAAY;YACnDzI,QAAQ;QACV;IACF;IAEA,IAAIK,IAAIL,MAAM,KAAK,aAAa;QAC9B,OAAO;YACLsB,OAAO;YACPmD,aAAa;YACbzE,QAAQ;QACV;IACF;IAEA,OAAO;QACLsB,OAAO;QACPmD,aAAa;QACbzE,QAAQK,IAAIL,MAAM;IACpB;AACF;AAEA,SAASqC;IACP,qBACE,KAACpE;QACCyE,WAAU;QACV8B,MAAK;QACLlD,OAAM;QACNmD,aAAY;QACZvB,SAAQ;;AAGd;AAEA,SAASsF,sBAAsBd,MAA2B;IACxD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;IACX;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-execution-switcher.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-run-view/job-execution-switcher.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkC,KAAK,GAAG,EAAoB,MAAM,uBAAuB,CAAC;AAGnG,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,GAAG,CAAC;IACT,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,4BAA4B,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,GAAG,EACH,oBAAoB,EACpB,4BAA4B,EAC5B,OAAmB,EACnB,SAAS,GACV,EAAE,yBAAyB,sCA+F3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/workflow-run-view/job-execution-switcher.tsx"],"sourcesContent":["import {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuTrigger,\n} from '@shipfox/react-ui/dropdown-menu';\nimport {Icon} from '@shipfox/react-ui/icon';\nimport {Text} from '@shipfox/react-ui/typography';\nimport {cn} from '@shipfox/react-ui/utils';\nimport {useMemo} from 'react';\nimport {getWorkflowStatusVisual} from '#components/workflow-status/status-visuals.js';\nimport {WorkflowStatusIcon} from '#components/workflow-status/workflow-status-icon.js';\nimport {deriveJobExecutionDisplayStatus, type Job, type JobExecution} from '#core/workflow-run.js';\nimport {formatJobExecutionTime, JobExecutionTimeText} from './job-execution-time-text.js';\n\nexport interface JobExecutionSwitcherProps {\n job: Job;\n selectedJobExecution: string | null;\n onSelectedJobExecutionChange: (jobExecutionId: string) => void;\n variant?: 'compact' | 'title' | undefined;\n className?: string | undefined;\n}\n\nexport function JobExecutionSwitcher({\n job,\n selectedJobExecution,\n onSelectedJobExecutionChange,\n variant = 'compact',\n className,\n}: JobExecutionSwitcherProps) {\n const executions = useMemo(\n () => [...job.jobExecutions].sort((left, right) => right.sequence - left.sequence),\n [job.jobExecutions],\n );\n const selected =\n executions.find((jobExecution) => jobExecution.id === selectedJobExecution) ??\n executions[0] ??\n null;\n\n if (selected === null) return null;\n\n if (!job.executionCountVisible) {\n return (\n <div\n className={cn(\n 'flex min-w-0 items-center gap-6 text-sm leading-20 text-foreground-neutral-subtle',\n className,\n )}\n >\n <ExecutionSummary execution={selected} />\n </div>\n );\n }\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n className={cn(\n 'inline-flex min-w-0 max-w-full items-center rounded-6 text-left transition-colors focus-visible:shadow-border-interactive-with-active focus-visible:outline-none',\n variant === 'title'\n ? '-mx-6 -my-4 gap-8 px-6 py-4 hover:bg-background-components-hover'\n : 'min-h-28 gap-6 px-8 py-4 text-sm leading-20 text-foreground-neutral-subtle hover:bg-background-components-hover',\n className,\n )}\n aria-label={`Switch job execution, currently execution ${selected.sequence}: ${selected.displayName}`}\n >\n {variant === 'title' ? (\n <TitleExecutionSummary execution={selected} />\n ) : (\n <ExecutionSummary execution={selected} />\n )}\n <Icon name=\"arrowDownSLine\" className=\"size-14 shrink-0 text-foreground-neutral-muted\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" size=\"lg\" className=\"max-h-[320px] overflow-y-auto\">\n <DropdownMenuLabel>\n {executions.length} execution{executions.length === 1 ? '' : 's'}\n </DropdownMenuLabel>\n {executions.map((jobExecution) => {\n const isSelected = jobExecution.id === selected.id;\n\n return (\n <DropdownMenuItem\n key={jobExecution.id}\n asChild\n onSelect={() => onSelectedJobExecutionChange(jobExecution.id)}\n >\n <button\n type=\"button\"\n aria-current={isSelected ? 'true' : undefined}\n aria-label={executionAccessibleLabel(jobExecution)}\n className=\"w-full text-left\"\n >\n <WorkflowStatusIcon\n status={deriveJobExecutionDisplayStatus(jobExecution)}\n size={14}\n tooltip={false}\n />\n <span className=\"font-code text-xs leading-20 text-foreground-neutral-base tabular-nums\">\n #{jobExecution.sequence}\n </span>\n <span className=\"min-w-0 truncate text-xs leading-20 text-foreground-neutral-base\">\n {jobExecution.displayName}\n </span>\n {!isSelected && jobExecution.statusReason ? (\n <span className=\"min-w-0 flex-1 truncate text-xs leading-20 text-foreground-neutral-muted\">\n {jobExecution.statusReason}\n </span>\n ) : (\n <span className=\"min-w-0 flex-1\" />\n )}\n {isSelected ? (\n <Icon name=\"check\" className=\"size-14 shrink-0 text-foreground-neutral-base\" />\n ) : null}\n <JobExecutionDuration\n execution={jobExecution}\n className=\"ml-auto shrink-0 font-code text-xs leading-20 text-foreground-neutral-muted tabular-nums\"\n />\n </button>\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction executionAccessibleLabel(execution: JobExecution): string {\n const status = getWorkflowStatusVisual(deriveJobExecutionDisplayStatus(execution));\n return [\n `Execution #${execution.sequence}: ${execution.displayName}`,\n status.label,\n execution.statusReason ?? undefined,\n execution.displayDuration\n ? `duration ${formatJobExecutionTime(execution.displayDuration)}`\n : undefined,\n ]\n .filter((part): part is string => Boolean(part))\n .join(', ');\n}\n\nfunction TitleExecutionSummary({execution}: {execution: JobExecution}) {\n return (\n <span className=\"flex min-w-0 items-center gap-8\">\n <Text as=\"span\" size=\"sm\" bold className=\"shrink-0 text-foreground-neutral-base\">\n #{execution.sequence}\n </Text>\n <Text as=\"span\" size=\"sm\" bold className=\"min-w-0 truncate text-foreground-neutral-base\">\n {execution.displayName}\n </Text>\n </span>\n );\n}\n\nfunction ExecutionSummary({execution}: {execution: JobExecution}) {\n const displayStatus = deriveJobExecutionDisplayStatus(execution);\n\n return (\n <span className=\"flex min-w-0 items-center gap-6\">\n <WorkflowStatusIcon status={displayStatus} size={14} tooltip={false} />\n <span className=\"shrink-0 font-code text-xs leading-20 text-foreground-neutral-base tabular-nums\">\n Execution #{execution.sequence}\n </span>\n {execution.statusReason ? (\n <Text as=\"span\" size=\"xs\" className=\"min-w-0 truncate text-foreground-neutral-muted\">\n · {execution.statusReason}\n </Text>\n ) : null}\n <JobExecutionDuration\n execution={execution}\n className=\"shrink-0 font-code text-xs leading-20 text-foreground-neutral-muted tabular-nums\"\n />\n </span>\n );\n}\n\nfunction JobExecutionDuration({\n execution,\n className,\n}: {\n execution: JobExecution;\n className?: string | undefined;\n}) {\n const duration = execution.displayDuration;\n if (!duration) return null;\n\n return (\n <span className={className}>\n <JobExecutionTimeText time={duration} />\n </span>\n );\n}\n"],"names":["DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuLabel","DropdownMenuTrigger","Icon","Text","cn","useMemo","getWorkflowStatusVisual","WorkflowStatusIcon","deriveJobExecutionDisplayStatus","formatJobExecutionTime","JobExecutionTimeText","JobExecutionSwitcher","job","selectedJobExecution","onSelectedJobExecutionChange","variant","className","executions","jobExecutions","sort","left","right","sequence","selected","find","jobExecution","id","executionCountVisible","div","ExecutionSummary","execution","aria-label","displayName","TitleExecutionSummary","name","align","size","length","map","isSelected","asChild","onSelect","button","type","aria-current","undefined","executionAccessibleLabel","status","tooltip","span","statusReason","JobExecutionDuration","label","displayDuration","filter","part","Boolean","join","as","bold","displayStatus","duration","time"],"mappings":";AAAA,SACEA,YAAY,EACZC,mBAAmB,EACnBC,gBAAgB,EAChBC,iBAAiB,EACjBC,mBAAmB,QACd,kCAAkC;AACzC,SAAQC,IAAI,QAAO,yBAAyB;AAC5C,SAAQC,IAAI,QAAO,+BAA+B;AAClD,SAAQC,EAAE,QAAO,0BAA0B;AAC3C,SAAQC,OAAO,QAAO,QAAQ;AAC9B,SAAQC,uBAAuB,QAAO,gDAAgD;AACtF,SAAQC,kBAAkB,QAAO,sDAAsD;AACvF,SAAQC,+BAA+B,QAAoC,wBAAwB;AACnG,SAAQC,sBAAsB,EAAEC,oBAAoB,QAAO,+BAA+B;AAU1F,OAAO,SAASC,qBAAqB,EACnCC,GAAG,EACHC,oBAAoB,EACpBC,4BAA4B,EAC5BC,UAAU,SAAS,EACnBC,SAAS,EACiB;IAC1B,MAAMC,aAAaZ,QACjB,IAAM;eAAIO,IAAIM,aAAa;SAAC,CAACC,IAAI,CAAC,CAACC,MAAMC,QAAUA,MAAMC,QAAQ,GAAGF,KAAKE,QAAQ,GACjF;QAACV,IAAIM,aAAa;KAAC;IAErB,MAAMK,WACJN,WAAWO,IAAI,CAAC,CAACC,eAAiBA,aAAaC,EAAE,KAAKb,yBACtDI,UAAU,CAAC,EAAE,IACb;IAEF,IAAIM,aAAa,MAAM,OAAO;IAE9B,IAA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C,WAAW/B,UAAUuB,eAAe;IAC1C,IAAI,CAACQ,UAAU,OAAO;IAEtB,qBACE,KAACZ;QAAKjC,WAAWA;kBACf,cAAA,KAACN;YAAqBoD,MAAMD;;;AAGlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-execution-time-text.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-run-view/job-execution-time-text.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAE5D,wBAAgB,oBAAoB,CAAC,EAAC,IAAI,EAAC,EAAE;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAC,UAIpE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAMrE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/workflow-run-view/job-execution-time-text.tsx"],"sourcesContent":["import {useTimeTick} from '@shipfox/react-ui/time-ticker';\nimport {formatDuration} from '@shipfox/react-ui/utils';\nimport type {JobExecutionTime} from '#core/workflow-run.js';\n\nexport function JobExecutionTimeText({time}: {time: JobExecutionTime}) {\n useTimeTick();\n\n return formatJobExecutionTime(time);\n}\n\nexport function formatJobExecutionTime(time: JobExecutionTime): string {\n if (time.state === 'live') {\n return formatDuration(Date.now() - Date.parse(time.fromIso));\n }\n\n return formatElapsedDuration(time.elapsed);\n}\n\nfunction formatElapsedDuration(duration: {\n days?: number | undefined;\n hours?: number | undefined;\n minutes?: number | undefined;\n seconds?: number | undefined;\n}): string {\n const days = duration.days ?? 0;\n const hours = duration.hours ?? 0;\n const minutes = duration.minutes ?? 0;\n const seconds = duration.seconds ?? 0;\n\n if (days > 0) return hours > 0 ? `${days}d ${hours}h` : `${days}d`;\n if (hours > 0) return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;\n if (minutes > 0) return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`;\n return `${seconds}s`;\n}\n"],"names":["useTimeTick","formatDuration","JobExecutionTimeText","time","formatJobExecutionTime","state","Date","now","parse","fromIso","formatElapsedDuration","elapsed","duration","days","hours","minutes","seconds"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,cAAc,QAAO,0BAA0B;AAGvD,OAAO,SAASC,qBAAqB,EAACC,IAAI,EAA2B;IACnEH;IAEA,OAAOI,uBAAuBD;AAChC;AAEA,OAAO,SAASC,uBAAuBD,IAAsB;IAC3D,IAAIA,KAAKE,KAAK,KAAK,QAAQ;QACzB,OAAOJ,eAAeK,KAAKC,GAAG,KAAKD,KAAKE,KAAK,CAACL,KAAKM,OAAO;IAC5D;IAEA,OAAOC,sBAAsBP,KAAKQ,OAAO;AAC3C;AAEA,SAASD,sBAAsBE,QAK9B;IACC,MAAMC,OAAOD,SAASC,IAAI,IAAI;IAC9B,MAAMC,QAAQF,SAASE,KAAK,IAAI;IAChC,MAAMC,UAAUH,SAASG,OAAO,IAAI;IACpC,MAAMC,UAAUJ,SAASI,OAAO,IAAI;IAEpC,IAAIH,OAAO,GAAG,OAAOC,QAAQ,IAAI,GAAGD,KAAK,EAAE,EAAEC,MAAM,CAAC,CAAC,GAAG,GAAGD,KAAK,CAAC,CAAC;IAClE,IAAIC,QAAQ,GAAG,OAAOC,UAAU,IAAI,GAAGD,MAAM,EAAE,EAAEC,QAAQ,CAAC,CAAC,GAAG,GAAGD,MAAM,CAAC,CAAC;IACzE,IAAIC,UAAU,GAAG,OAAOC,UAAU,IAAI,GAAGD,QAAQ,EAAE,EAAEC,QAAQ,CAAC,CAAC,GAAG,GAAGD,QAAQ,CAAC,CAAC;IAC/E,OAAO,GAAGC,QAAQ,CAAC,CAAC;AACtB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface StepAttemptLogPanelProps {
|
|
2
|
-
stepId: string;
|
|
3
|
-
attempt: number;
|
|
4
|
-
attemptStatus: string;
|
|
5
|
-
initialErrorRetryCount?: number | undefined;
|
|
6
|
-
initialErrorRetryDelayMs?: number | undefined;
|
|
7
|
-
}
|
|
8
|
-
export declare function StepAttemptLogPanel({ stepId, attempt, attemptStatus, initialErrorRetryCount, initialErrorRetryDelayMs, }: StepAttemptLogPanelProps): import("react").JSX.Element;
|
|
9
|
-
//# sourceMappingURL=step-attempt-log-panel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"step-attempt-log-panel.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-run-view/step-attempt-log-panel.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,OAAO,EACP,aAAa,EACb,sBAAsD,EACtD,wBAA2D,GAC5D,EAAE,wBAAwB,+BAiF1B"}
|