Skip to content

Commit b4df554

Browse files
committed
Cleanup RunDetails
1 parent c9f9463 commit b4df554

File tree

8 files changed

+213
-328
lines changed

8 files changed

+213
-328
lines changed

src/components/Editor/Context/PipelineDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useComponentSpec } from "@/providers/ComponentSpecProvider";
1111
import { getComponentFileFromList } from "@/utils/componentStore";
1212
import { USER_PIPELINES_LIST_NAME } from "@/utils/constants";
1313

14-
import PipelineIO from "../../shared/ArtifactsList/PipelineIO";
14+
import PipelineIO from "../../shared/Execution/PipelineIO";
1515
import { PipelineValidationList } from "./PipelineValidationList";
1616
import RenamePipeline from "./RenamePipeline";
1717

Lines changed: 45 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { Frown } from "lucide-react";
2-
3-
import { ArtifactsList } from "@/components/shared/ArtifactsList/ArtifactsList";
41
import { CopyText } from "@/components/shared/CopyText/CopyText";
52
import { BlockStack, InlineStack } from "@/components/ui/layout";
63
import { Spinner } from "@/components/ui/spinner";
7-
import { Text } from "@/components/ui/typography";
4+
import { Paragraph, Text } from "@/components/ui/typography";
85
import { useCheckComponentSpecFromPath } from "@/hooks/useCheckComponentSpecFromPath";
96
import { useUserDetails } from "@/hooks/useUserDetails";
107
import { useBackend } from "@/providers/BackendProvider";
@@ -17,6 +14,10 @@ import {
1714
isStatusInProgress,
1815
} from "@/services/executionService";
1916

17+
import { ContentBlock } from "../shared/ContextPanel/Blocks/ContentBlock";
18+
import { ListBlock } from "../shared/ContextPanel/Blocks/ListBlock";
19+
import { TextBlock } from "../shared/ContextPanel/Blocks/TextBlock";
20+
import PipelineIO from "../shared/Execution/PipelineIO";
2021
import { InfoBox } from "../shared/InfoBox";
2122
import { StatusBar, StatusText } from "../shared/Status";
2223
import { TaskImplementation } from "../shared/TaskDetails";
@@ -52,29 +53,30 @@ export const RunDetails = () => {
5253

5354
if (error || !details || !state || !componentSpec) {
5455
return (
55-
<div className="flex flex-col gap-8 items-center justify-center h-full">
56-
<Frown className="w-12 h-12 text-secondary-foreground" />
57-
<div className="text-secondary-foreground">
58-
Error loading run details.
59-
</div>
60-
</div>
56+
<BlockStack align="center" inlineAlign="center" className="h-full">
57+
<InfoBox title="Error" variant="error">
58+
Pipeline Run could not be loaded.
59+
</InfoBox>
60+
</BlockStack>
6161
);
6262
}
6363

6464
if (isLoading) {
6565
return (
66-
<div className="flex items-center justify-center h-full">
66+
<InlineStack align="center" blockAlign="center" className="h-full">
6767
<Spinner className="mr-2" />
68-
<p className="text-secondary-foreground">Loading run details...</p>
69-
</div>
68+
<Paragraph tone="subdued">Loading run details...</Paragraph>
69+
</InlineStack>
7070
);
7171
}
7272

7373
if (!configured) {
7474
return (
75-
<InfoBox title="Backend not configured" variant="warning">
76-
Configure a backend to view execution artifacts.
77-
</InfoBox>
75+
<BlockStack align="center" inlineAlign="center" className="h-full">
76+
<InfoBox title="Backend not configured" variant="warning">
77+
Configure a backend to view execution artifacts.
78+
</InfoBox>
79+
</BlockStack>
7880
);
7981
}
8082

@@ -109,110 +111,49 @@ export const RunDetails = () => {
109111
</InlineStack>
110112

111113
{metadata && (
112-
<BlockStack>
113-
<Text as="h3" size="md" weight="semibold" className="mb-1">
114-
Run Info
115-
</Text>
116-
<dl className="flex flex-col gap-1 text-xs text-secondary-foreground">
117-
{metadata.id && (
118-
<InlineStack as="div" gap="1" blockAlign="center">
119-
<Text as="dt" weight="semibold" className="shrink-0">
120-
Run Id:
121-
</Text>
122-
<dd>
123-
<CopyText className="font-mono truncate max-w-[180px]">
124-
{metadata.id}
125-
</CopyText>
126-
</dd>
127-
</InlineStack>
128-
)}
129-
{metadata.root_execution_id && (
130-
<InlineStack as="div" gap="1" blockAlign="center">
131-
<Text as="dt" weight="semibold" className="shrink-0">
132-
Execution Id:
133-
</Text>
134-
<dd>
135-
<CopyText className="font-mono truncate max-w-[180px]">
136-
{metadata.root_execution_id}
137-
</CopyText>
138-
</dd>
139-
</InlineStack>
140-
)}
141-
{metadata.created_by && (
142-
<InlineStack as="div" gap="1" blockAlign="center">
143-
<Text as="dt" weight="semibold">
144-
Created by:
145-
</Text>
146-
<dd>{metadata.created_by}</dd>
147-
</InlineStack>
148-
)}
149-
{metadata.created_at && (
150-
<InlineStack as="div" gap="1" blockAlign="center">
151-
<Text as="dt" weight="semibold">
152-
Created at:
153-
</Text>
154-
<dd>{new Date(metadata.created_at).toLocaleString()}</dd>
155-
</InlineStack>
156-
)}
157-
</dl>
158-
</BlockStack>
114+
<ListBlock
115+
title="Run Info"
116+
items={[
117+
{ label: "Run Id", value: metadata.id },
118+
{ label: "Execution Id", value: metadata.root_execution_id },
119+
{ label: "Created by", value: metadata.created_by ?? undefined },
120+
{
121+
label: "Created at",
122+
value: metadata.created_at
123+
? new Date(metadata.created_at).toLocaleString()
124+
: undefined,
125+
},
126+
]}
127+
marker="none"
128+
/>
159129
)}
160130

161131
{componentSpec.description && (
162-
<BlockStack>
163-
<Text as="h3" size="md" weight="semibold" className="mb-1">
164-
Description
165-
</Text>
166-
<Text as="p" size="sm" className="whitespace-pre-line">
167-
{componentSpec.description}
168-
</Text>
169-
</BlockStack>
132+
<TextBlock title="Description" text={componentSpec.description} />
170133
)}
171134

172-
<BlockStack>
173-
<Text as="h3" size="md" weight="semibold" className="mb-1">
174-
Status
175-
</Text>
135+
<ContentBlock title="Status">
176136
<InlineStack gap="2" blockAlign="center" className="mb-1">
177137
<Text size="sm" weight="semibold">
178138
{runStatus}
179139
</Text>
180140
<StatusText statusCounts={statusCounts} />
181141
</InlineStack>
182142
<StatusBar statusCounts={statusCounts} />
183-
</BlockStack>
143+
</ContentBlock>
184144

185145
{Object.keys(annotations).length > 0 && (
186-
<BlockStack>
187-
<Text as="h3" size="md" weight="semibold" className="mb-1">
188-
Annotations
189-
</Text>
190-
<ul className="text-xs text-secondary-foreground">
191-
{Object.entries(annotations).map(([key, value]) => (
192-
<li key={key}>
193-
<Text as="span" weight="semibold">
194-
{key}:
195-
</Text>{" "}
196-
<Text as="span" className="break-all">
197-
{String(value)}
198-
</Text>
199-
</li>
200-
))}
201-
</ul>
202-
</BlockStack>
146+
<ListBlock
147+
title="Annotations"
148+
items={Object.entries(annotations).map(([key, value]) => ({
149+
label: key,
150+
value: String(value),
151+
}))}
152+
marker="none"
153+
/>
203154
)}
204155

205-
<ArtifactsList
206-
inputs={(componentSpec.inputs ?? []).map((input) => ({
207-
name: input.name,
208-
type: typeof input.type === "string" ? input.type : "object",
209-
value: input.value ?? input.default,
210-
}))}
211-
outputs={(componentSpec.outputs ?? []).map((output) => ({
212-
name: output.name,
213-
type: typeof output.type === "string" ? output.type : "object",
214-
}))}
215-
/>
156+
<PipelineIO readOnly />
216157
</BlockStack>
217158
);
218159
};

src/components/shared/ArtifactsList/ArtifactsList.tsx

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)