@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,83 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useNavigate, useSearch } from '@tanstack/react-router';
|
|
3
|
+
import { useCallback, useEffect } from 'react';
|
|
4
|
+
import { WorkflowRunList } from '#components/workflow-run-list/workflow-run-list.js';
|
|
5
|
+
import { WorkflowRunView } from '#components/workflow-run-view/index.js';
|
|
6
|
+
import { withoutWorkflowRunSelectionSearch, withWorkflowRunSelectionSearch, workflowRunSelectionFromSearch } from '#core/workflow-run-url-state.js';
|
|
7
|
+
import { useWorkflowRunsInfiniteQuery } from '#hooks/api/workflow-runs.js';
|
|
8
|
+
import { WorkflowRunFirstTimeUse } from './workflow-run-first-time-use.js';
|
|
9
|
+
/**
|
|
10
|
+
* Resolve which surface the runs path should show from a single read of the runs list:
|
|
11
|
+
* - when opened without a workflow run id, point the URL at the most recent run so the detail pane is
|
|
12
|
+
* never empty (navigation happens in an effect since it mutates history);
|
|
13
|
+
* - report `hasNoRuns` once the list has loaded with zero runs, so a brand-new project lands
|
|
14
|
+
* on the first-time-use surface instead of an empty rail and a perpetual detail skeleton.
|
|
15
|
+
*/ function useWorkflowRunPageTarget(workspaceId, projectId, workflowRunId) {
|
|
16
|
+
const navigate = useNavigate();
|
|
17
|
+
const { data, isPending } = useWorkflowRunsInfiniteQuery(projectId, {});
|
|
18
|
+
const firstWorkflowRunId = data?.pages[0]?.runs[0]?.id;
|
|
19
|
+
// Gate on data presence, not `!isError`: a transient refetch error after a prior success
|
|
20
|
+
// keeps `data`, so the redirect (and the no-runs surface) still resolve from it instead of
|
|
21
|
+
// stalling on the rail while active-run polling hits a blip.
|
|
22
|
+
const isLoaded = !isPending && data !== undefined;
|
|
23
|
+
useEffect(()=>{
|
|
24
|
+
if (workflowRunId || !isLoaded || !firstWorkflowRunId) return;
|
|
25
|
+
navigate({
|
|
26
|
+
to: '/workspaces/$wid/projects/$pid/runs/$workflowRunId',
|
|
27
|
+
params: {
|
|
28
|
+
wid: workspaceId,
|
|
29
|
+
pid: projectId,
|
|
30
|
+
workflowRunId: firstWorkflowRunId
|
|
31
|
+
},
|
|
32
|
+
search: (previous)=>withoutWorkflowRunSelectionSearch(previous),
|
|
33
|
+
replace: true
|
|
34
|
+
});
|
|
35
|
+
}, [
|
|
36
|
+
navigate,
|
|
37
|
+
workspaceId,
|
|
38
|
+
projectId,
|
|
39
|
+
workflowRunId,
|
|
40
|
+
isLoaded,
|
|
41
|
+
firstWorkflowRunId
|
|
42
|
+
]);
|
|
43
|
+
return {
|
|
44
|
+
hasNoRuns: isLoaded && firstWorkflowRunId === undefined
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function WorkflowRunPage({ workspaceId, projectId, workflowRunId }) {
|
|
48
|
+
const { hasNoRuns } = useWorkflowRunPageTarget(workspaceId, projectId, workflowRunId);
|
|
49
|
+
const navigate = useNavigate();
|
|
50
|
+
const search = useSearch({
|
|
51
|
+
strict: false
|
|
52
|
+
});
|
|
53
|
+
const selection = workflowRunSelectionFromSearch(search);
|
|
54
|
+
const onSelectionChange = useCallback((nextSelection)=>{
|
|
55
|
+
navigate({
|
|
56
|
+
search: (previous)=>withWorkflowRunSelectionSearch(previous, nextSelection)
|
|
57
|
+
});
|
|
58
|
+
}, [
|
|
59
|
+
navigate
|
|
60
|
+
]);
|
|
61
|
+
if (!workflowRunId && hasNoRuns) {
|
|
62
|
+
return /*#__PURE__*/ _jsx(WorkflowRunFirstTimeUse, {});
|
|
63
|
+
}
|
|
64
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
65
|
+
className: "flex min-h-0 flex-1 overflow-hidden",
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ _jsx(WorkflowRunList, {
|
|
68
|
+
workspaceId: workspaceId,
|
|
69
|
+
projectId: projectId,
|
|
70
|
+
selectedWorkflowRunId: workflowRunId
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ _jsx(WorkflowRunView, {
|
|
73
|
+
workspaceId: workspaceId,
|
|
74
|
+
projectId: projectId,
|
|
75
|
+
workflowRunId: workflowRunId,
|
|
76
|
+
selection: selection,
|
|
77
|
+
onSelectionChange: onSelectionChange
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=workflow-run-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/pages/workflow-run-page.tsx"],"sourcesContent":["import {useNavigate, useSearch} from '@tanstack/react-router';\nimport {useCallback, useEffect} from 'react';\nimport {WorkflowRunList} from '#components/workflow-run-list/workflow-run-list.js';\nimport {WorkflowRunView} from '#components/workflow-run-view/index.js';\nimport {\n type WorkflowRunSelectionInput,\n withoutWorkflowRunSelectionSearch,\n withWorkflowRunSelectionSearch,\n workflowRunSelectionFromSearch,\n} from '#core/workflow-run-url-state.js';\nimport {useWorkflowRunsInfiniteQuery} from '#hooks/api/workflow-runs.js';\nimport {WorkflowRunFirstTimeUse} from './workflow-run-first-time-use.js';\n\ninterface WorkflowRunPageProps {\n workspaceId: string;\n projectId: string;\n workflowRunId?: string | undefined;\n}\n\n/**\n * Resolve which surface the runs path should show from a single read of the runs list:\n * - when opened without a workflow run id, point the URL at the most recent run so the detail pane is\n * never empty (navigation happens in an effect since it mutates history);\n * - report `hasNoRuns` once the list has loaded with zero runs, so a brand-new project lands\n * on the first-time-use surface instead of an empty rail and a perpetual detail skeleton.\n */\nfunction useWorkflowRunPageTarget(\n workspaceId: string,\n projectId: string,\n workflowRunId: string | undefined,\n) {\n const navigate = useNavigate();\n const {data, isPending} = useWorkflowRunsInfiniteQuery(projectId, {});\n const firstWorkflowRunId = data?.pages[0]?.runs[0]?.id;\n // Gate on data presence, not `!isError`: a transient refetch error after a prior success\n // keeps `data`, so the redirect (and the no-runs surface) still resolve from it instead of\n // stalling on the rail while active-run polling hits a blip.\n const isLoaded = !isPending && data !== undefined;\n\n useEffect(() => {\n if (workflowRunId || !isLoaded || !firstWorkflowRunId) return;\n navigate({\n to: '/workspaces/$wid/projects/$pid/runs/$workflowRunId',\n params: {wid: workspaceId, pid: projectId, workflowRunId: firstWorkflowRunId},\n search: ((previous: Record<string, unknown>) =>\n withoutWorkflowRunSelectionSearch(previous)) as never,\n replace: true,\n });\n }, [navigate, workspaceId, projectId, workflowRunId, isLoaded, firstWorkflowRunId]);\n\n return {hasNoRuns: isLoaded && firstWorkflowRunId === undefined};\n}\n\nexport function WorkflowRunPage({workspaceId, projectId, workflowRunId}: WorkflowRunPageProps) {\n const {hasNoRuns} = useWorkflowRunPageTarget(workspaceId, projectId, workflowRunId);\n const navigate = useNavigate();\n const search = useSearch({strict: false}) as Record<string, unknown>;\n const selection = workflowRunSelectionFromSearch(search);\n const onSelectionChange = useCallback(\n (nextSelection: WorkflowRunSelectionInput) => {\n navigate({\n search: ((previous: Record<string, unknown>) =>\n withWorkflowRunSelectionSearch(previous, nextSelection)) as never,\n });\n },\n [navigate],\n );\n\n if (!workflowRunId && hasNoRuns) {\n return <WorkflowRunFirstTimeUse />;\n }\n\n return (\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <WorkflowRunList\n workspaceId={workspaceId}\n projectId={projectId}\n selectedWorkflowRunId={workflowRunId}\n />\n <WorkflowRunView\n workspaceId={workspaceId}\n projectId={projectId}\n workflowRunId={workflowRunId}\n selection={selection}\n onSelectionChange={onSelectionChange}\n />\n </div>\n );\n}\n"],"names":["useNavigate","useSearch","useCallback","useEffect","WorkflowRunList","WorkflowRunView","withoutWorkflowRunSelectionSearch","withWorkflowRunSelectionSearch","workflowRunSelectionFromSearch","useWorkflowRunsInfiniteQuery","WorkflowRunFirstTimeUse","useWorkflowRunPageTarget","workspaceId","projectId","workflowRunId","navigate","data","isPending","firstWorkflowRunId","pages","runs","id","isLoaded","undefined","to","params","wid","pid","search","previous","replace","hasNoRuns","WorkflowRunPage","strict","selection","onSelectionChange","nextSelection","div","className","selectedWorkflowRunId"],"mappings":";AAAA,SAAQA,WAAW,EAAEC,SAAS,QAAO,yBAAyB;AAC9D,SAAQC,WAAW,EAAEC,SAAS,QAAO,QAAQ;AAC7C,SAAQC,eAAe,QAAO,qDAAqD;AACnF,SAAQC,eAAe,QAAO,yCAAyC;AACvE,SAEEC,iCAAiC,EACjCC,8BAA8B,EAC9BC,8BAA8B,QACzB,kCAAkC;AACzC,SAAQC,4BAA4B,QAAO,8BAA8B;AACzE,SAAQC,uBAAuB,QAAO,mCAAmC;AAQzE;;;;;;CAMC,GACD,SAASC,yBACPC,WAAmB,EACnBC,SAAiB,EACjBC,aAAiC;IAEjC,MAAMC,WAAWf;IACjB,MAAM,EAACgB,IAAI,EAAEC,SAAS,EAAC,GAAGR,6BAA6BI,WAAW,CAAC;IACnE,MAAMK,qBAAqBF,MAAMG,KAAK,CAAC,EAAE,EAAEC,IAAI,CAAC,EAAE,EAAEC;IACpD,yFAAyF;IACzF,2FAA2F;IAC3F,6DAA6D;IAC7D,MAAMC,WAAW,CAACL,aAAaD,SAASO;IAExCpB,UAAU;QACR,IAAIW,iBAAiB,CAACQ,YAAY,CAACJ,oBAAoB;QACvDH,SAAS;YACPS,IAAI;YACJC,QAAQ;gBAACC,KAAKd;gBAAae,KAAKd;gBAAWC,eAAeI;YAAkB;YAC5EU,QAAS,CAACC,WACRvB,kCAAkCuB;YACpCC,SAAS;QACX;IACF,GAAG;QAACf;QAAUH;QAAaC;QAAWC;QAAeQ;QAAUJ;KAAmB;IAElF,OAAO;QAACa,WAAWT,YAAYJ,uBAAuBK;IAAS;AACjE;AAEA,OAAO,SAASS,gBAAgB,EAACpB,WAAW,EAAEC,SAAS,EAAEC,aAAa,EAAuB;IAC3F,MAAM,EAACiB,SAAS,EAAC,GAAGpB,yBAAyBC,aAAaC,WAAWC;IACrE,MAAMC,WAAWf;IACjB,MAAM4B,SAAS3B,UAAU;QAACgC,QAAQ;IAAK;IACvC,MAAMC,YAAY1B,+BAA+BoB;IACjD,MAAMO,oBAAoBjC,YACxB,CAACkC;QACCrB,SAAS;YACPa,QAAS,CAACC,WACRtB,+BAA+BsB,UAAUO;QAC7C;IACF,GACA;QAACrB;KAAS;IAGZ,IAAI,CAACD,iBAAiBiB,WAAW;QAC/B,qBAAO,KAACrB;IACV;IAEA,qBACE,MAAC2B;QAAIC,WAAU;;0BACb,KAAClC;gBACCQ,aAAaA;gBACbC,WAAWA;gBACX0B,uBAAuBzB;;0BAEzB,KAACT;gBACCO,aAAaA;gBACbC,WAAWA;gBACXC,eAAeA;gBACfoB,WAAWA;gBACXC,mBAAmBA;;;;AAI3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: import("@shipfox/client-shell/runtime").RouteImpl<{
|
|
2
|
+
readonly staticData: {
|
|
3
|
+
readonly layout: "full-bleed";
|
|
4
|
+
};
|
|
5
|
+
readonly component: () => import("react").JSX.Element;
|
|
6
|
+
}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=run-detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-detail.d.ts","sourceRoot":"","sources":["../../src/routes/run-detail.tsx"],"names":[],"mappings":";;;;;;AAIA,wBAUG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineRoute } from '@shipfox/client-shell/runtime';
|
|
3
|
+
import { useParams } from '@tanstack/react-router';
|
|
4
|
+
import { WorkflowRunPage } from '#pages/workflow-run-page.js';
|
|
5
|
+
export default defineRoute({
|
|
6
|
+
staticData: {
|
|
7
|
+
layout: 'full-bleed'
|
|
8
|
+
},
|
|
9
|
+
component: ()=>{
|
|
10
|
+
const { wid, pid, workflowRunId } = useParams({
|
|
11
|
+
strict: false
|
|
12
|
+
});
|
|
13
|
+
return /*#__PURE__*/ _jsx(WorkflowRunPage, {
|
|
14
|
+
workspaceId: wid,
|
|
15
|
+
projectId: pid,
|
|
16
|
+
workflowRunId: workflowRunId
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=run-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/routes/run-detail.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {useParams} from '@tanstack/react-router';\nimport {WorkflowRunPage} from '#pages/workflow-run-page.js';\n\nexport default defineRoute({\n staticData: {layout: 'full-bleed'},\n component: () => {\n const {wid, pid, workflowRunId} = useParams({strict: false}) as {\n wid: string;\n pid: string;\n workflowRunId: string;\n };\n return <WorkflowRunPage workspaceId={wid} projectId={pid} workflowRunId={workflowRunId} />;\n },\n});\n"],"names":["defineRoute","useParams","WorkflowRunPage","staticData","layout","component","wid","pid","workflowRunId","strict","workspaceId","projectId"],"mappings":";AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,SAAS,QAAO,yBAAyB;AACjD,SAAQC,eAAe,QAAO,8BAA8B;AAE5D,eAAeF,YAAY;IACzBG,YAAY;QAACC,QAAQ;IAAY;IACjCC,WAAW;QACT,MAAM,EAACC,GAAG,EAAEC,GAAG,EAAEC,aAAa,EAAC,GAAGP,UAAU;YAACQ,QAAQ;QAAK;QAK1D,qBAAO,KAACP;YAAgBQ,aAAaJ;YAAKK,WAAWJ;YAAKC,eAAeA;;IAC3E;AACF,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/routes/runs.tsx"],"names":[],"mappings":";;;;;;AAIA,wBAMG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { defineRoute } from '@shipfox/client-shell/runtime';
|
|
3
|
+
import { useParams } from '@tanstack/react-router';
|
|
4
|
+
import { WorkflowRunPage } from '#pages/workflow-run-page.js';
|
|
5
|
+
export default defineRoute({
|
|
6
|
+
staticData: {
|
|
7
|
+
layout: 'full-bleed'
|
|
8
|
+
},
|
|
9
|
+
component: ()=>{
|
|
10
|
+
const { wid, pid } = useParams({
|
|
11
|
+
strict: false
|
|
12
|
+
});
|
|
13
|
+
return /*#__PURE__*/ _jsx(WorkflowRunPage, {
|
|
14
|
+
workspaceId: wid,
|
|
15
|
+
projectId: pid
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/routes/runs.tsx"],"sourcesContent":["import {defineRoute} from '@shipfox/client-shell/runtime';\nimport {useParams} from '@tanstack/react-router';\nimport {WorkflowRunPage} from '#pages/workflow-run-page.js';\n\nexport default defineRoute({\n staticData: {layout: 'full-bleed'},\n component: () => {\n const {wid, pid} = useParams({strict: false}) as {wid: string; pid: string};\n return <WorkflowRunPage workspaceId={wid} projectId={pid} />;\n },\n});\n"],"names":["defineRoute","useParams","WorkflowRunPage","staticData","layout","component","wid","pid","strict","workspaceId","projectId"],"mappings":";AAAA,SAAQA,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,SAAS,QAAO,yBAAyB;AACjD,SAAQC,eAAe,QAAO,8BAA8B;AAE5D,eAAeF,YAAY;IACzBG,YAAY;QAACC,QAAQ;IAAY;IACjCC,WAAW;QACT,MAAM,EAACC,GAAG,EAAEC,GAAG,EAAC,GAAGN,UAAU;YAACO,QAAQ;QAAK;QAC3C,qBAAO,KAACN;YAAgBO,aAAaH;YAAKI,WAAWH;;IACvD;AACF,GAAG"}
|