add icon for scripted actions (#3274)

This commit is contained in:
Jonathan Dobson
2025-08-22 10:30:49 -04:00
committed by GitHub
parent f57d17f11e
commit 2903291dc4
4 changed files with 21 additions and 1 deletions

View File

@@ -252,6 +252,7 @@ export type ActionApiResponse = {
text: string | null; text: string | null;
option: Option | null; option: Option | null;
file_url: string | null; file_url: string | null;
created_by: string | null;
}; };
export type Action = { export type Action = {
@@ -262,6 +263,7 @@ export type Action = {
success: boolean; success: boolean;
stepId: string; stepId: string;
index: number; index: number;
created_by: string | null;
}; };
export type EvalKind = "workflow" | "task"; export type EvalKind = "workflow" | "task";
@@ -357,6 +359,7 @@ export type ActionsApiResponse = {
reasoning: string | null; reasoning: string | null;
intention: string | null; intention: string | null;
response: string | null; response: string | null;
created_by: string | null;
}; };
export type TaskV2 = { export type TaskV2 = {

View File

@@ -8,6 +8,7 @@ import {
CheckCircledIcon, CheckCircledIcon,
CrossCircledIcon, CrossCircledIcon,
DotFilledIcon, DotFilledIcon,
LightningBoltIcon,
} from "@radix-ui/react-icons"; } from "@radix-ui/react-icons";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { ReactNode, useRef } from "react"; import { ReactNode, useRef } from "react";
@@ -80,6 +81,11 @@ function ScrollableActionList({
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<ActionTypePill actionType={action.type} /> <ActionTypePill actionType={action.type} />
{action.created_by === "script" && (
<div className="flex gap-1 rounded-sm bg-slate-elevation5 px-2 py-1">
<LightningBoltIcon className="h-4 w-4 text-[gold]" />
</div>
)}
{action.success ? ( {action.success ? (
<div className="flex gap-1 rounded-sm bg-slate-elevation5 px-2 py-1"> <div className="flex gap-1 rounded-sm bg-slate-elevation5 px-2 py-1">
<CheckCircledIcon className="h-4 w-4 text-success" /> <CheckCircledIcon className="h-4 w-4 text-success" />

View File

@@ -107,6 +107,7 @@ function useActions({ id }: Props): {
success: actionResult?.[0]?.success ?? false, success: actionResult?.[0]?.success ?? false,
stepId: step.step_id, stepId: step.step_id,
index, index,
created_by: action.created_by,
}; };
}); });
return actions; return actions;
@@ -123,6 +124,7 @@ function useActions({ id }: Props): {
action.status === Status.Skipped, action.status === Status.Skipped,
stepId: action.step_id ?? "", stepId: action.step_id ?? "",
index: action.action_order ?? 0, index: action.action_order ?? 0,
created_by: action.created_by,
}; };
}); });

View File

@@ -2,7 +2,11 @@ import { ActionsApiResponse, ActionTypes, Status } from "@/api/types";
import { Separator } from "@/components/ui/separator"; import { Separator } from "@/components/ui/separator";
import { ActionTypePill } from "@/routes/tasks/detail/ActionTypePill"; import { ActionTypePill } from "@/routes/tasks/detail/ActionTypePill";
import { cn } from "@/util/utils"; import { cn } from "@/util/utils";
import { CheckCircledIcon, CrossCircledIcon } from "@radix-ui/react-icons"; import {
CheckCircledIcon,
CrossCircledIcon,
LightningBoltIcon,
} from "@radix-ui/react-icons";
import { useCallback } from "react"; import { useCallback } from "react";
type Props = { type Props = {
@@ -47,6 +51,11 @@ function ActionCard({ action, onClick, active, index }: Props) {
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<ActionTypePill actionType={action.action_type} /> <ActionTypePill actionType={action.action_type} />
{action.created_by === "script" && (
<div className="flex gap-1 rounded-sm bg-slate-elevation5 px-2 py-1">
<LightningBoltIcon className="h-4 w-4 text-[gold]" />
</div>
)}
{success ? ( {success ? (
<div className="flex gap-1 rounded-sm bg-slate-elevation5 px-2 py-1"> <div className="flex gap-1 rounded-sm bg-slate-elevation5 px-2 py-1">
<CheckCircledIcon className="h-4 w-4 text-success" /> <CheckCircledIcon className="h-4 w-4 text-success" />