Display wait action status as success in UI (#SKY-5901) (#4806)

This commit is contained in:
Celal Zamanoğlu
2026-02-19 18:21:29 +03:00
committed by GitHub
parent 68c4eb8069
commit e051f2ce01
3 changed files with 18 additions and 4 deletions

View File

@@ -106,7 +106,11 @@ function useActions({ id }: Props): {
confidence: action.confidence_float, confidence: action.confidence_float,
input: getActionInput(action), input: getActionInput(action),
type: action.action_type, type: action.action_type,
success: actionResult?.[0]?.success ?? false, // Wait actions always succeed — they intentionally return ActionFailure
// from the backend but completing a wait is expected, not a failure.
success:
action.action_type === ActionTypes.wait ||
(actionResult?.[0]?.success ?? false),
stepId: step.step_id, stepId: step.step_id,
index, index,
created_by: action.created_by, created_by: action.created_by,
@@ -121,7 +125,9 @@ function useActions({ id }: Props): {
confidence: action.confidence_float ?? undefined, confidence: action.confidence_float ?? undefined,
input: action.response ?? "", input: action.response ?? "",
type: action.action_type, type: action.action_type,
// Wait actions always succeed — see comment in legacy path above.
success: success:
action.action_type === ActionTypes.wait ||
action.status === Status.Completed || action.status === Status.Completed ||
action.status === Status.Skipped, action.status === Status.Skipped,
stepId: action.step_id ?? "", stepId: action.step_id ?? "",

View File

@@ -23,8 +23,12 @@ type Props = {
}; };
function ActionCard({ action, onClick, active, index }: Props) { function ActionCard({ action, onClick, active, index }: Props) {
// Wait actions always succeed — they intentionally return ActionFailure
// from the backend but completing a wait is expected, not a failure.
const success = const success =
action.status === Status.Completed || action.status === Status.Skipped; action.action_type === ActionTypes.wait ||
action.status === Status.Completed ||
action.status === Status.Skipped;
const refCallback = useCallback((element: HTMLDivElement | null) => { const refCallback = useCallback((element: HTMLDivElement | null) => {
if (element && active) { if (element && active) {

View File

@@ -1,5 +1,5 @@
import { LightningBoltIcon } from "@radix-ui/react-icons"; import { LightningBoltIcon } from "@radix-ui/react-icons";
import { ActionsApiResponse, Status } from "@/api/types"; import { ActionsApiResponse, ActionTypes, Status } from "@/api/types";
import { import {
Tooltip, Tooltip,
TooltipContent, TooltipContent,
@@ -14,8 +14,12 @@ type Props = {
}; };
function ActionCardMinimal({ action }: Props) { function ActionCardMinimal({ action }: Props) {
// Wait actions always succeed — they intentionally return ActionFailure
// from the backend but completing a wait is expected, not a failure.
const success = const success =
action.status === Status.Completed || action.status === Status.Skipped; action.action_type === ActionTypes.wait ||
action.status === Status.Completed ||
action.status === Status.Skipped;
return ( return (
<ItemStatusIndicator failure={!success} success={success} offset="-0.7rem"> <ItemStatusIndicator failure={!success} success={success} offset="-0.7rem">