Add block description (#1502)

This commit is contained in:
Shuchang Zheng
2025-01-06 07:52:20 -08:00
committed by GitHub
parent c0bf6387c3
commit 45cfa58648
2 changed files with 29 additions and 22 deletions

View File

@@ -26,6 +26,7 @@ export type WorkflowRunBlock = {
parent_workflow_run_block_id: string | null; parent_workflow_run_block_id: string | null;
block_type: WorkflowBlockType; block_type: WorkflowBlockType;
label: string | null; label: string | null;
description: string | null;
title: string | null; title: string | null;
status: Status | null; status: Status | null;
failure_reason: string | null; failure_reason: string | null;

View File

@@ -78,30 +78,36 @@ function WorkflowRunTimelineBlockItem({
}} }}
ref={refCallback} ref={refCallback}
> >
<div className="flex justify-between"> <div className="space-y-2">
<div className="flex gap-3"> <div className="flex justify-between">
<WorkflowBlockIcon <div className="flex gap-3">
workflowBlockType={block.block_type} <WorkflowBlockIcon
className="size-6" workflowBlockType={block.block_type}
/> className="size-6"
<span>{workflowBlockTitle[block.block_type]}</span> />
</div> <span>{workflowBlockTitle[block.block_type]}</span>
<div className="flex items-center gap-1 rounded bg-slate-elevation5 px-2 py-1"> </div>
{showDiagnosticLink ? ( <div className="flex items-center gap-1 rounded bg-slate-elevation5 px-2 py-1">
<Link to={`/tasks/${block.task_id}/diagnostics`}> {showDiagnosticLink ? (
<div className="flex gap-1"> <Link to={`/tasks/${block.task_id}/diagnostics`}>
<ExternalLinkIcon className="size-4" /> <div className="flex gap-1">
<span className="text-xs">Diagnostics</span> <ExternalLinkIcon className="size-4" />
</div> <span className="text-xs">Diagnostics</span>
</Link> </div>
) : ( </Link>
<> ) : (
<CubeIcon className="size-4" /> <>
<span className="text-xs">Block</span> <CubeIcon className="size-4" />
</> <span className="text-xs">Block</span>
)} </>
)}
</div>
</div> </div>
{block.description ? (
<div className="text-xs text-slate-400">{block.description}</div>
) : null}
</div> </div>
{actions.map((action, index) => { {actions.map((action, index) => {
return ( return (
<ActionCard <ActionCard