@shipfox/client-workflows 0.2.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/main.ts +1 -0
- package/.storybook/preview.css +10 -0
- package/.storybook/preview.tsx +97 -0
- package/.swcrc +42 -0
- package/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-type$colon$emit.log +1 -0
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +162 -0
- package/LICENSE +21 -0
- package/dist/components/identifier/identifier.d.ts +6 -0
- package/dist/components/identifier/identifier.d.ts.map +1 -0
- package/dist/components/identifier/identifier.js +144 -0
- package/dist/components/identifier/identifier.js.map +1 -0
- package/dist/components/identifier/index.d.ts +2 -0
- package/dist/components/identifier/index.d.ts.map +1 -0
- package/dist/components/identifier/index.js +3 -0
- package/dist/components/identifier/index.js.map +1 -0
- package/dist/components/job-graph/graph-model.d.ts +27 -0
- package/dist/components/job-graph/graph-model.d.ts.map +1 -0
- package/dist/components/job-graph/graph-model.js +107 -0
- package/dist/components/job-graph/graph-model.js.map +1 -0
- package/dist/components/job-graph/index.d.ts +3 -0
- package/dist/components/job-graph/index.d.ts.map +1 -0
- package/dist/components/job-graph/index.js +3 -0
- package/dist/components/job-graph/index.js.map +1 -0
- package/dist/components/job-graph/job-duration-format.d.ts +4 -0
- package/dist/components/job-graph/job-duration-format.d.ts.map +1 -0
- package/dist/components/job-graph/job-duration-format.js +41 -0
- package/dist/components/job-graph/job-duration-format.js.map +1 -0
- package/dist/components/job-graph/job-duration-label.d.ts +5 -0
- package/dist/components/job-graph/job-duration-label.d.ts.map +1 -0
- package/dist/components/job-graph/job-duration-label.js +33 -0
- package/dist/components/job-graph/job-duration-label.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.d.ts +9 -0
- package/dist/components/job-graph/job-graph-content.d.ts.map +1 -0
- package/dist/components/job-graph/job-graph-content.js +181 -0
- package/dist/components/job-graph/job-graph-content.js.map +1 -0
- package/dist/components/job-graph/job-graph-view.d.ts +11 -0
- package/dist/components/job-graph/job-graph-view.d.ts.map +1 -0
- package/dist/components/job-graph/job-graph-view.js +24 -0
- package/dist/components/job-graph/job-graph-view.js.map +1 -0
- package/dist/components/job-graph/job-graph.d.ts +3 -0
- package/dist/components/job-graph/job-graph.d.ts.map +1 -0
- package/dist/components/job-graph/job-graph.js +21 -0
- package/dist/components/job-graph/job-graph.js.map +1 -0
- package/dist/components/job-graph/job-node.d.ts +16 -0
- package/dist/components/job-graph/job-node.d.ts.map +1 -0
- package/dist/components/job-graph/job-node.js +196 -0
- package/dist/components/job-graph/job-node.js.map +1 -0
- package/dist/components/job-graph/types.d.ts +9 -0
- package/dist/components/job-graph/types.d.ts.map +1 -0
- package/dist/components/job-graph/types.js +3 -0
- package/dist/components/job-graph/types.js.map +1 -0
- package/dist/components/step-list/index.d.ts +3 -0
- package/dist/components/step-list/index.d.ts.map +1 -0
- package/dist/components/step-list/index.js +3 -0
- package/dist/components/step-list/index.js.map +1 -0
- package/dist/components/step-list/step-list-model.d.ts +36 -0
- package/dist/components/step-list/step-list-model.d.ts.map +1 -0
- package/dist/components/step-list/step-list-model.js +135 -0
- package/dist/components/step-list/step-list-model.js.map +1 -0
- package/dist/components/step-list/step-list.d.ts +32 -0
- package/dist/components/step-list/step-list.d.ts.map +1 -0
- package/dist/components/step-list/step-list.js +409 -0
- package/dist/components/step-list/step-list.js.map +1 -0
- package/dist/components/workflow-run-duration-label.d.ts +8 -0
- package/dist/components/workflow-run-duration-label.d.ts.map +1 -0
- package/dist/components/workflow-run-duration-label.js +84 -0
- package/dist/components/workflow-run-duration-label.js.map +1 -0
- package/dist/components/workflow-run-list/index.d.ts +2 -0
- package/dist/components/workflow-run-list/index.d.ts.map +1 -0
- package/dist/components/workflow-run-list/index.js +3 -0
- package/dist/components/workflow-run-list/index.js.map +1 -0
- package/dist/components/workflow-run-list/run-display.d.ts +5 -0
- package/dist/components/workflow-run-list/run-display.d.ts.map +1 -0
- package/dist/components/workflow-run-list/run-display.js +19 -0
- package/dist/components/workflow-run-list/run-display.js.map +1 -0
- package/dist/components/workflow-run-list/types.d.ts +21 -0
- package/dist/components/workflow-run-list/types.d.ts.map +1 -0
- package/dist/components/workflow-run-list/types.js +3 -0
- package/dist/components/workflow-run-list/types.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts +14 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.js +37 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts +10 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.js +55 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts +15 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.js +103 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts +3 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.js +46 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list.d.ts +3 -0
- package/dist/components/workflow-run-list/workflow-run-list.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list.js +20 -0
- package/dist/components/workflow-run-list/workflow-run-list.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-row.d.ts +14 -0
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-row.js +172 -0
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -0
- package/dist/components/workflow-run-summary/index.d.ts +2 -0
- package/dist/components/workflow-run-summary/index.d.ts.map +1 -0
- package/dist/components/workflow-run-summary/index.js +3 -0
- package/dist/components/workflow-run-summary/index.js.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts +9 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +138 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +20 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.js +252 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts +7 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts.map +1 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.js +84 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.js.map +1 -0
- package/dist/components/workflow-run-view/index.d.ts +3 -0
- package/dist/components/workflow-run-view/index.d.ts.map +1 -0
- package/dist/components/workflow-run-view/index.js +4 -0
- package/dist/components/workflow-run-view/index.js.map +1 -0
- package/dist/components/workflow-run-view/job-card.d.ts +17 -0
- package/dist/components/workflow-run-view/job-card.d.ts.map +1 -0
- package/dist/components/workflow-run-view/job-card.js +476 -0
- package/dist/components/workflow-run-view/job-card.js.map +1 -0
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts +10 -0
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts.map +1 -0
- package/dist/components/workflow-run-view/job-execution-switcher.js +171 -0
- package/dist/components/workflow-run-view/job-execution-switcher.js.map +1 -0
- package/dist/components/workflow-run-view/job-execution-time-text.d.ts +6 -0
- package/dist/components/workflow-run-view/job-execution-time-text.d.ts.map +1 -0
- package/dist/components/workflow-run-view/job-execution-time-text.js +24 -0
- package/dist/components/workflow-run-view/job-execution-time-text.js.map +1 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts +9 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts.map +1 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.js +152 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts +14 -0
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-selection.js +56 -0
- package/dist/components/workflow-run-view/workflow-run-selection.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-states.d.ts +12 -0
- package/dist/components/workflow-run-view/workflow-run-states.d.ts.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-states.js +91 -0
- package/dist/components/workflow-run-view/workflow-run-states.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +15 -0
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-view.js +285 -0
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -0
- package/dist/components/workflow-source-panel/index.d.ts +2 -0
- package/dist/components/workflow-source-panel/index.d.ts.map +1 -0
- package/dist/components/workflow-source-panel/index.js +3 -0
- package/dist/components/workflow-source-panel/index.js.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts +13 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.js +91 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.js.map +1 -0
- package/dist/components/workflow-status/status-visuals.d.ts +12 -0
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -0
- package/dist/components/workflow-status/status-visuals.js +54 -0
- package/dist/components/workflow-status/status-visuals.js.map +1 -0
- package/dist/components/workflow-status/workflow-status-icon.d.ts +22 -0
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -0
- package/dist/components/workflow-status/workflow-status-icon.js +100 -0
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -0
- package/dist/core/entities/job-execution.d.ts +69 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -0
- package/dist/core/entities/job-execution.js +83 -0
- package/dist/core/entities/job-execution.js.map +1 -0
- package/dist/core/entities/job.d.ts +56 -0
- package/dist/core/entities/job.d.ts.map +1 -0
- package/dist/core/entities/job.js +71 -0
- package/dist/core/entities/job.js.map +1 -0
- package/dist/core/entities/step-attempt.d.ts +49 -0
- package/dist/core/entities/step-attempt.d.ts.map +1 -0
- package/dist/core/entities/step-attempt.js +48 -0
- package/dist/core/entities/step-attempt.js.map +1 -0
- package/dist/core/entities/step.d.ts +41 -0
- package/dist/core/entities/step.d.ts.map +1 -0
- package/dist/core/entities/step.js +51 -0
- package/dist/core/entities/step.js.map +1 -0
- package/dist/core/entities/workflow-run-attempt.d.ts +44 -0
- package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -0
- package/dist/core/entities/workflow-run-attempt.js +51 -0
- package/dist/core/entities/workflow-run-attempt.js.map +1 -0
- package/dist/core/entities/workflow-run.d.ts +61 -0
- package/dist/core/entities/workflow-run.d.ts.map +1 -0
- package/dist/core/entities/workflow-run.js +104 -0
- package/dist/core/entities/workflow-run.js.map +1 -0
- package/dist/core/workflow-run-url-state.d.ts +13 -0
- package/dist/core/workflow-run-url-state.d.ts.map +1 -0
- package/dist/core/workflow-run-url-state.js +43 -0
- package/dist/core/workflow-run-url-state.js.map +1 -0
- package/dist/core/workflow-run.d.ts +13 -0
- package/dist/core/workflow-run.d.ts.map +1 -0
- package/dist/core/workflow-run.js +8 -0
- package/dist/core/workflow-run.js.map +1 -0
- package/dist/env.d.js +2 -0
- package/dist/env.d.js.map +1 -0
- package/dist/feature.d.ts +20 -0
- package/dist/feature.d.ts.map +1 -0
- package/dist/feature.js +27 -0
- package/dist/feature.js.map +1 -0
- package/dist/hooks/api/workflow-runs.d.ts +109 -0
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -0
- package/dist/hooks/api/workflow-runs.js +394 -0
- package/dist/hooks/api/workflow-runs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/workflow-run-first-time-use.d.ts +6 -0
- package/dist/pages/workflow-run-first-time-use.d.ts.map +1 -0
- package/dist/pages/workflow-run-first-time-use.js +17 -0
- package/dist/pages/workflow-run-first-time-use.js.map +1 -0
- package/dist/pages/workflow-run-page.d.ts +8 -0
- package/dist/pages/workflow-run-page.d.ts.map +1 -0
- package/dist/pages/workflow-run-page.js +83 -0
- package/dist/pages/workflow-run-page.js.map +1 -0
- package/dist/routes/run-detail.d.ts +8 -0
- package/dist/routes/run-detail.d.ts.map +1 -0
- package/dist/routes/run-detail.js +21 -0
- package/dist/routes/run-detail.js.map +1 -0
- package/dist/routes/runs.d.ts +8 -0
- package/dist/routes/runs.d.ts.map +1 -0
- package/dist/routes/runs.js +20 -0
- package/dist/routes/runs.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/package.json +114 -0
- package/src/components/identifier/identifier.tsx +178 -0
- package/src/components/identifier/index.ts +1 -0
- package/src/components/job-graph/graph-model.test.ts +189 -0
- package/src/components/job-graph/graph-model.ts +178 -0
- package/src/components/job-graph/index.ts +2 -0
- package/src/components/job-graph/job-duration-format.ts +54 -0
- package/src/components/job-graph/job-duration-label.tsx +29 -0
- package/src/components/job-graph/job-graph-content.tsx +225 -0
- package/src/components/job-graph/job-graph-view.test.tsx +298 -0
- package/src/components/job-graph/job-graph-view.tsx +45 -0
- package/src/components/job-graph/job-graph.stories.tsx +182 -0
- package/src/components/job-graph/job-graph.tsx +24 -0
- package/src/components/job-graph/job-node.stories.tsx +364 -0
- package/src/components/job-graph/job-node.test.tsx +347 -0
- package/src/components/job-graph/job-node.tsx +202 -0
- package/src/components/job-graph/types.ts +9 -0
- package/src/components/step-list/index.ts +6 -0
- package/src/components/step-list/step-list-model.test.ts +369 -0
- package/src/components/step-list/step-list-model.ts +205 -0
- package/src/components/step-list/step-list.stories.tsx +419 -0
- package/src/components/step-list/step-list.test.tsx +566 -0
- package/src/components/step-list/step-list.tsx +494 -0
- package/src/components/workflow-run-duration-label.tsx +118 -0
- package/src/components/workflow-run-list/index.ts +1 -0
- package/src/components/workflow-run-list/run-display.test.ts +53 -0
- package/src/components/workflow-run-list/run-display.ts +22 -0
- package/src/components/workflow-run-list/types.ts +22 -0
- package/src/components/workflow-run-list/workflow-run-list-content.tsx +58 -0
- package/src/components/workflow-run-list/workflow-run-list-header.tsx +53 -0
- package/src/components/workflow-run-list/workflow-run-list-states.tsx +86 -0
- package/src/components/workflow-run-list/workflow-run-list-view.test.tsx +178 -0
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +57 -0
- package/src/components/workflow-run-list/workflow-run-list.stories.tsx +111 -0
- package/src/components/workflow-run-list/workflow-run-list.tsx +29 -0
- package/src/components/workflow-run-list/workflow-run-row.tsx +176 -0
- package/src/components/workflow-run-summary/index.ts +1 -0
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.test.tsx +230 -0
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +146 -0
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +414 -0
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +354 -0
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +295 -0
- package/src/components/workflow-run-view/agent-config-failure-callout.stories.tsx +140 -0
- package/src/components/workflow-run-view/agent-config-failure-callout.tsx +93 -0
- package/src/components/workflow-run-view/index.ts +2 -0
- package/src/components/workflow-run-view/job-card.stories.tsx +788 -0
- package/src/components/workflow-run-view/job-card.tsx +566 -0
- package/src/components/workflow-run-view/job-execution-switcher.tsx +170 -0
- package/src/components/workflow-run-view/job-execution-time-text.tsx +34 -0
- package/src/components/workflow-run-view/step-attempt-log-panel.test.tsx +290 -0
- package/src/components/workflow-run-view/step-attempt-log-panel.tsx +152 -0
- package/src/components/workflow-run-view/workflow-run-selection.test.ts +280 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +89 -0
- package/src/components/workflow-run-view/workflow-run-states.tsx +70 -0
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +1214 -0
- package/src/components/workflow-run-view/workflow-run-view.tsx +341 -0
- package/src/components/workflow-source-panel/index.ts +1 -0
- package/src/components/workflow-source-panel/workflow-source-panel.stories.tsx +110 -0
- package/src/components/workflow-source-panel/workflow-source-panel.test.tsx +96 -0
- package/src/components/workflow-source-panel/workflow-source-panel.tsx +136 -0
- package/src/components/workflow-status/status-visuals.test.ts +38 -0
- package/src/components/workflow-status/status-visuals.ts +36 -0
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +90 -0
- package/src/components/workflow-status/workflow-status-icon.tsx +135 -0
- package/src/core/entities/job-execution.ts +139 -0
- package/src/core/entities/job.ts +149 -0
- package/src/core/entities/step-attempt.ts +89 -0
- package/src/core/entities/step.ts +105 -0
- package/src/core/entities/workflow-run-attempt.ts +87 -0
- package/src/core/entities/workflow-run.ts +183 -0
- package/src/core/workflow-run-url-state.ts +61 -0
- package/src/core/workflow-run.test.ts +640 -0
- package/src/core/workflow-run.ts +66 -0
- package/src/env.d.ts +8 -0
- package/src/feature.ts +26 -0
- package/src/hooks/api/workflow-runs.test.tsx +410 -0
- package/src/hooks/api/workflow-runs.ts +485 -0
- package/src/index.ts +45 -0
- package/src/page-harness-budget.test.ts +33 -0
- package/src/pages/workflow-run-first-time-use.tsx +17 -0
- package/src/pages/workflow-run-page.test.tsx +517 -0
- package/src/pages/workflow-run-page.tsx +89 -0
- package/src/routes/run-detail.tsx +15 -0
- package/src/routes/runs.tsx +11 -0
- package/test/fixtures/logs.ts +13 -0
- package/test/fixtures/workflow-run.ts +311 -0
- package/test/pages.tsx +79 -0
- package/test/render.tsx +40 -0
- package/test/setup.ts +3 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +8 -0
- package/vercel.json +8 -0
- package/vitest.config.ts +70 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import type {StepAttemptDto, WorkflowRunStepDetailDto} from '@shipfox/api-workflows-dto';
|
|
2
|
+
import {LogView, type LogViewProps} from '@shipfox/client-logs';
|
|
3
|
+
import {Text} from '@shipfox/react-ui/typography';
|
|
4
|
+
import type {Decorator, Meta, StoryObj} from '@storybook/react';
|
|
5
|
+
import {
|
|
6
|
+
createMemoryHistory,
|
|
7
|
+
createRootRoute,
|
|
8
|
+
createRoute,
|
|
9
|
+
createRouter,
|
|
10
|
+
Outlet,
|
|
11
|
+
RouterProvider,
|
|
12
|
+
} from '@tanstack/react-router';
|
|
13
|
+
import {within} from 'storybook/test';
|
|
14
|
+
import type {Job} from '#core/workflow-run.js';
|
|
15
|
+
import {
|
|
16
|
+
type JobDtoOverrides,
|
|
17
|
+
workflowJob,
|
|
18
|
+
workflowStepAttemptDto,
|
|
19
|
+
workflowStepDto,
|
|
20
|
+
} from '#test/fixtures/workflow-run.js';
|
|
21
|
+
import {AgentConfigFailureCallout as AgentConfigFailureCalloutView} from '../workflow-run-view/agent-config-failure-callout.js';
|
|
22
|
+
import {StepList} from './step-list.js';
|
|
23
|
+
|
|
24
|
+
const WORKSPACE_ID = '44444444-4444-4444-8444-444444444444';
|
|
25
|
+
const AGENTS_LINK_NAME = 'Configure Agents';
|
|
26
|
+
|
|
27
|
+
const meta = {
|
|
28
|
+
title: 'Workflows/StepList',
|
|
29
|
+
component: StepList,
|
|
30
|
+
parameters: {
|
|
31
|
+
layout: 'centered',
|
|
32
|
+
},
|
|
33
|
+
decorators: [
|
|
34
|
+
(Story) => (
|
|
35
|
+
<div className="h-520 w-720 overflow-auto bg-background-neutral-base p-16">
|
|
36
|
+
<Story />
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
],
|
|
40
|
+
args: {
|
|
41
|
+
job: makeJob({
|
|
42
|
+
steps: [
|
|
43
|
+
makeStep({
|
|
44
|
+
name: 'checkout',
|
|
45
|
+
status: 'succeeded',
|
|
46
|
+
attempts: [makeAttempt({status: 'succeeded'})],
|
|
47
|
+
}),
|
|
48
|
+
makeStep({
|
|
49
|
+
name: 'install',
|
|
50
|
+
position: 1,
|
|
51
|
+
status: 'running',
|
|
52
|
+
attempts: [makeAttempt({status: 'running'})],
|
|
53
|
+
}),
|
|
54
|
+
makeStep({name: 'test', position: 2}),
|
|
55
|
+
],
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
} satisfies Meta<typeof StepList>;
|
|
59
|
+
|
|
60
|
+
export default meta;
|
|
61
|
+
type Story = StoryObj<typeof meta>;
|
|
62
|
+
type StepListStoryContext = Parameters<NonNullable<Story['play']>>[0];
|
|
63
|
+
|
|
64
|
+
const withAgentSettingsRoute: Decorator = (Story) => {
|
|
65
|
+
const rootRoute = createRootRoute({component: Outlet});
|
|
66
|
+
const storyRoute = createRoute({
|
|
67
|
+
getParentRoute: () => rootRoute,
|
|
68
|
+
path: '/',
|
|
69
|
+
component: () => <Story />,
|
|
70
|
+
});
|
|
71
|
+
const agentSettingsRoute = createRoute({
|
|
72
|
+
getParentRoute: () => rootRoute,
|
|
73
|
+
path: '/workspaces/$wid/settings/agents',
|
|
74
|
+
component: () => null,
|
|
75
|
+
});
|
|
76
|
+
const router = createRouter({
|
|
77
|
+
history: createMemoryHistory({initialEntries: ['/']}),
|
|
78
|
+
routeTree: rootRoute.addChildren([storyRoute, agentSettingsRoute]),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return <RouterProvider router={router} />;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
async function assertAgentConfigFailureCallout(ctx: StepListStoryContext) {
|
|
85
|
+
const canvas = within(ctx.canvasElement);
|
|
86
|
+
|
|
87
|
+
await canvas.findByText('Configure credentials for anthropic');
|
|
88
|
+
await canvas.findByRole('link', {name: AGENTS_LINK_NAME});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const Playground: Story = {};
|
|
92
|
+
|
|
93
|
+
export const Statuses: Story = {
|
|
94
|
+
args: {
|
|
95
|
+
job: makeJob({
|
|
96
|
+
name: 'release-production',
|
|
97
|
+
status: 'running',
|
|
98
|
+
steps: [
|
|
99
|
+
makeStep({name: 'pending', status: 'pending'}),
|
|
100
|
+
makeStep({
|
|
101
|
+
name: 'running',
|
|
102
|
+
position: 1,
|
|
103
|
+
status: 'running',
|
|
104
|
+
attempts: [makeAttempt({status: 'running'})],
|
|
105
|
+
}),
|
|
106
|
+
makeStep({
|
|
107
|
+
name: 'succeeded',
|
|
108
|
+
position: 2,
|
|
109
|
+
status: 'succeeded',
|
|
110
|
+
attempts: [makeAttempt({status: 'succeeded'})],
|
|
111
|
+
}),
|
|
112
|
+
makeStep({
|
|
113
|
+
name: 'failed',
|
|
114
|
+
position: 3,
|
|
115
|
+
status: 'failed',
|
|
116
|
+
error: {
|
|
117
|
+
message: 'Tests failed',
|
|
118
|
+
category: 'user',
|
|
119
|
+
reason: 'agent_invocation_failed',
|
|
120
|
+
},
|
|
121
|
+
attempts: [makeAttempt({status: 'failed', exit_code: 1})],
|
|
122
|
+
}),
|
|
123
|
+
makeStep({
|
|
124
|
+
name: 'cancelled',
|
|
125
|
+
position: 4,
|
|
126
|
+
status: 'cancelled',
|
|
127
|
+
attempts: [makeAttempt({status: 'cancelled'})],
|
|
128
|
+
}),
|
|
129
|
+
makeStep({
|
|
130
|
+
name: 'timed-out',
|
|
131
|
+
position: 5,
|
|
132
|
+
status: 'timed_out',
|
|
133
|
+
attempts: [makeAttempt({status: 'timed_out'})],
|
|
134
|
+
}),
|
|
135
|
+
],
|
|
136
|
+
}),
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const activeLogRecords: LogViewProps['records'] = [
|
|
141
|
+
{
|
|
142
|
+
v: 1,
|
|
143
|
+
ts: Date.parse('2026-06-21T12:00:00.000Z'),
|
|
144
|
+
type: 'output',
|
|
145
|
+
stream: 'stdout',
|
|
146
|
+
data: '$ pnpm test --filter=@shipfox/client-workflows\n',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
v: 1,
|
|
150
|
+
ts: Date.parse('2026-06-21T12:00:01.000Z'),
|
|
151
|
+
type: 'output',
|
|
152
|
+
stream: 'stdout',
|
|
153
|
+
data: 'step-list.test.tsx 18 tests passed\n',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
v: 1,
|
|
157
|
+
ts: Date.parse('2026-06-21T12:00:02.000Z'),
|
|
158
|
+
type: 'output',
|
|
159
|
+
stream: 'stdout',
|
|
160
|
+
data: 'step-attempt-log-panel.test.tsx running smart-tail checks\n',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
v: 1,
|
|
164
|
+
ts: Date.parse('2026-06-21T12:00:03.000Z'),
|
|
165
|
+
type: 'output',
|
|
166
|
+
stream: 'stdout',
|
|
167
|
+
data: 'waiting for live log chunks...\n',
|
|
168
|
+
},
|
|
169
|
+
];
|
|
170
|
+
|
|
171
|
+
export const Attempts: Story = {
|
|
172
|
+
args: {
|
|
173
|
+
job: makeJob({
|
|
174
|
+
name: 'release-production',
|
|
175
|
+
status: 'running',
|
|
176
|
+
steps: [
|
|
177
|
+
makeStep({
|
|
178
|
+
name: 'checkout',
|
|
179
|
+
position: 0,
|
|
180
|
+
status: 'succeeded',
|
|
181
|
+
attempts: [makeAttempt({attempt: 1, execution_order: 1, status: 'succeeded'})],
|
|
182
|
+
}),
|
|
183
|
+
makeStep({
|
|
184
|
+
name: 'compile',
|
|
185
|
+
position: 1,
|
|
186
|
+
status: 'succeeded',
|
|
187
|
+
current_attempt: 2,
|
|
188
|
+
attempts: [
|
|
189
|
+
makeAttempt({attempt: 1, execution_order: 2, status: 'failed', exit_code: 1}),
|
|
190
|
+
makeAttempt({attempt: 2, execution_order: 4, status: 'succeeded'}),
|
|
191
|
+
],
|
|
192
|
+
}),
|
|
193
|
+
makeStep({
|
|
194
|
+
name: 'test',
|
|
195
|
+
position: 2,
|
|
196
|
+
status: 'succeeded',
|
|
197
|
+
current_attempt: 2,
|
|
198
|
+
attempts: [
|
|
199
|
+
makeAttempt({attempt: 1, execution_order: 3, status: 'failed', exit_code: 1}),
|
|
200
|
+
makeAttempt({attempt: 2, execution_order: 5, status: 'succeeded'}),
|
|
201
|
+
],
|
|
202
|
+
}),
|
|
203
|
+
makeStep({
|
|
204
|
+
name: 'deploy',
|
|
205
|
+
position: 3,
|
|
206
|
+
status: 'running',
|
|
207
|
+
current_attempt: 2,
|
|
208
|
+
attempts: [
|
|
209
|
+
makeAttempt({attempt: 1, execution_order: 6, status: 'failed', exit_code: 1}),
|
|
210
|
+
makeAttempt({
|
|
211
|
+
attempt: 2,
|
|
212
|
+
execution_order: 7,
|
|
213
|
+
status: 'running',
|
|
214
|
+
restart_feedback: 'manual approval',
|
|
215
|
+
}),
|
|
216
|
+
],
|
|
217
|
+
}),
|
|
218
|
+
],
|
|
219
|
+
}),
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export const ContentVariants: Story = {
|
|
224
|
+
args: {
|
|
225
|
+
job: makeJob({
|
|
226
|
+
name: 'release-production-multi-region-with-canary-validation-and-post-deploy-observability',
|
|
227
|
+
steps: [
|
|
228
|
+
makeStep({
|
|
229
|
+
name: 'Set up job',
|
|
230
|
+
type: 'setup',
|
|
231
|
+
status: 'succeeded',
|
|
232
|
+
attempts: [makeAttempt({status: 'succeeded'})],
|
|
233
|
+
}),
|
|
234
|
+
makeStep({
|
|
235
|
+
key: null,
|
|
236
|
+
name: 'pnpm test --filter=@shipfox/client-workflows',
|
|
237
|
+
position: 1,
|
|
238
|
+
type: 'run',
|
|
239
|
+
config: {run: 'pnpm test --filter=@shipfox/client-workflows'},
|
|
240
|
+
status: 'succeeded',
|
|
241
|
+
attempts: [makeAttempt({status: 'succeeded'})],
|
|
242
|
+
}),
|
|
243
|
+
makeStep({
|
|
244
|
+
key: null,
|
|
245
|
+
name: 'claude-opus-4-8 · Review the failing workflow step tests and propose the smallest fix.',
|
|
246
|
+
position: 2,
|
|
247
|
+
type: 'agent',
|
|
248
|
+
config: {
|
|
249
|
+
model: 'claude-opus-4-8',
|
|
250
|
+
prompt: 'Review the failing workflow step tests and propose the smallest fix.',
|
|
251
|
+
},
|
|
252
|
+
status: 'failed',
|
|
253
|
+
error: {
|
|
254
|
+
message: 'Agent invocation failed',
|
|
255
|
+
category: 'user',
|
|
256
|
+
reason: 'agent_invocation_failed',
|
|
257
|
+
},
|
|
258
|
+
attempts: [makeAttempt({status: 'failed', exit_code: 1})],
|
|
259
|
+
}),
|
|
260
|
+
makeStep({
|
|
261
|
+
name: 'publish-observability-summary-with-alert-links-and-rollout-decision',
|
|
262
|
+
position: 3,
|
|
263
|
+
status: 'pending',
|
|
264
|
+
}),
|
|
265
|
+
],
|
|
266
|
+
}),
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const DataStates: Story = {
|
|
271
|
+
render: () => (
|
|
272
|
+
<div className="grid gap-16">
|
|
273
|
+
<StepList
|
|
274
|
+
job={makeJob({status: 'skipped', status_reason: 'dependency_not_completed', steps: []})}
|
|
275
|
+
emptyState={{
|
|
276
|
+
title: 'This job was skipped',
|
|
277
|
+
description: 'A required job did not complete, so this job was skipped.',
|
|
278
|
+
status: 'skipped',
|
|
279
|
+
}}
|
|
280
|
+
/>
|
|
281
|
+
<StepList
|
|
282
|
+
job={makeJob({status: 'running', steps: []})}
|
|
283
|
+
emptyState={{
|
|
284
|
+
title: 'Waiting for the first step',
|
|
285
|
+
description: 'This job is running, but no steps have started yet.',
|
|
286
|
+
status: 'running',
|
|
287
|
+
}}
|
|
288
|
+
/>
|
|
289
|
+
</div>
|
|
290
|
+
),
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
export const CollapsedAndExpanded: Story = {
|
|
294
|
+
render: renderCollapsedAndExpanded,
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
export const ActiveExpandedLogs: Story = {
|
|
298
|
+
render: renderActiveExpandedLogs,
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export const ExpandedSlot: Story = {
|
|
302
|
+
render: renderExpandedSlot,
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export const TestAgentConfigFailureCallout: Story = {
|
|
306
|
+
decorators: [withAgentSettingsRoute],
|
|
307
|
+
render: renderAgentConfigFailureCallout,
|
|
308
|
+
play: assertAgentConfigFailureCallout,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
function renderCollapsedAndExpanded() {
|
|
312
|
+
const build = makeStep({name: 'build', attempts: [makeAttempt()]});
|
|
313
|
+
const deployAttempt = makeAttempt();
|
|
314
|
+
const deploy = makeStep({name: 'deploy', position: 1, attempts: [deployAttempt]});
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<StepList
|
|
318
|
+
job={makeJob({steps: [build, deploy]})}
|
|
319
|
+
defaultSelectedAttemptId={deployAttempt.id}
|
|
320
|
+
renderExpandedStep={({stepId}) => (
|
|
321
|
+
<Text size="sm" className="text-foreground-neutral-subtle">
|
|
322
|
+
Slot content for {stepId}
|
|
323
|
+
</Text>
|
|
324
|
+
)}
|
|
325
|
+
/>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function renderActiveExpandedLogs() {
|
|
330
|
+
const attempt = makeAttempt({status: 'running'});
|
|
331
|
+
const step = makeStep({
|
|
332
|
+
name: 'pnpm test --filter=@shipfox/client-workflows',
|
|
333
|
+
status: 'running',
|
|
334
|
+
attempts: [attempt],
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
return (
|
|
338
|
+
<StepList
|
|
339
|
+
job={makeJob({steps: [step]})}
|
|
340
|
+
autoSelectActiveAttempt
|
|
341
|
+
renderExpandedStep={() => (
|
|
342
|
+
<LogView records={activeLogRecords} className="max-h-[280px] rounded-8" />
|
|
343
|
+
)}
|
|
344
|
+
/>
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function renderExpandedSlot() {
|
|
349
|
+
const attempt = makeAttempt();
|
|
350
|
+
const step = makeStep({name: 'run integration tests', attempts: [attempt]});
|
|
351
|
+
|
|
352
|
+
return (
|
|
353
|
+
<StepList
|
|
354
|
+
job={makeJob({steps: [step]})}
|
|
355
|
+
defaultSelectedAttemptId={attempt.id}
|
|
356
|
+
renderExpandedStep={({stepId}) => (
|
|
357
|
+
<Text size="sm" className="text-foreground-neutral-subtle">
|
|
358
|
+
Injected detail placeholder for {stepId}
|
|
359
|
+
</Text>
|
|
360
|
+
)}
|
|
361
|
+
/>
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function renderAgentConfigFailureCallout() {
|
|
366
|
+
const attempt = makeAttempt({status: 'failed', exit_code: 1});
|
|
367
|
+
const step = makeStep({
|
|
368
|
+
key: 'implement',
|
|
369
|
+
name: 'Fix the failing tests.',
|
|
370
|
+
type: 'agent',
|
|
371
|
+
status: 'failed',
|
|
372
|
+
config: {
|
|
373
|
+
provider: 'anthropic',
|
|
374
|
+
model: 'claude-opus-4-8',
|
|
375
|
+
thinking: 'high',
|
|
376
|
+
prompt: 'Fix the failing tests.',
|
|
377
|
+
},
|
|
378
|
+
error: {
|
|
379
|
+
message: 'Model provider credentials are not configured',
|
|
380
|
+
category: 'user',
|
|
381
|
+
reason: 'agent_config_invalid',
|
|
382
|
+
agent_config_issue: 'provider_not_configured',
|
|
383
|
+
},
|
|
384
|
+
attempts: [attempt],
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
return (
|
|
388
|
+
<StepList
|
|
389
|
+
job={makeJob({status: 'failed', steps: [step]})}
|
|
390
|
+
defaultSelectedAttemptId={attempt.id}
|
|
391
|
+
renderExpandedStep={() => (
|
|
392
|
+
<AgentConfigFailureCalloutView
|
|
393
|
+
workspaceId={WORKSPACE_ID}
|
|
394
|
+
config={{provider: 'anthropic', model: 'claude-opus-4-8', thinking: 'high'}}
|
|
395
|
+
error={{
|
|
396
|
+
message: 'Model provider credentials are not configured',
|
|
397
|
+
reason: 'agent_config_invalid',
|
|
398
|
+
agentConfigIssue: 'provider_not_configured',
|
|
399
|
+
category: 'user',
|
|
400
|
+
exitCode: null,
|
|
401
|
+
signal: undefined,
|
|
402
|
+
}}
|
|
403
|
+
/>
|
|
404
|
+
)}
|
|
405
|
+
/>
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function makeJob(overrides: JobDtoOverrides = {}): Job {
|
|
410
|
+
return workflowJob(overrides);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function makeStep(overrides: Partial<WorkflowRunStepDetailDto> = {}): WorkflowRunStepDetailDto {
|
|
414
|
+
return workflowStepDto(overrides);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
function makeAttempt(overrides: Partial<StepAttemptDto> = {}): StepAttemptDto {
|
|
418
|
+
return workflowStepAttemptDto(overrides);
|
|
419
|
+
}
|