Display wait action status as success in UI (#SKY-5901) (#4806)
This commit is contained in:
@@ -106,7 +106,11 @@ function useActions({ id }: Props): {
|
||||
confidence: action.confidence_float,
|
||||
input: getActionInput(action),
|
||||
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,
|
||||
index,
|
||||
created_by: action.created_by,
|
||||
@@ -121,7 +125,9 @@ function useActions({ id }: Props): {
|
||||
confidence: action.confidence_float ?? undefined,
|
||||
input: action.response ?? "",
|
||||
type: action.action_type,
|
||||
// Wait actions always succeed — see comment in legacy path above.
|
||||
success:
|
||||
action.action_type === ActionTypes.wait ||
|
||||
action.status === Status.Completed ||
|
||||
action.status === Status.Skipped,
|
||||
stepId: action.step_id ?? "",
|
||||
|
||||
@@ -23,8 +23,12 @@ type 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 =
|
||||
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) => {
|
||||
if (element && active) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LightningBoltIcon } from "@radix-ui/react-icons";
|
||||
import { ActionsApiResponse, Status } from "@/api/types";
|
||||
import { ActionsApiResponse, ActionTypes, Status } from "@/api/types";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
@@ -14,8 +14,12 @@ type 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 =
|
||||
action.status === Status.Completed || action.status === Status.Skipped;
|
||||
action.action_type === ActionTypes.wait ||
|
||||
action.status === Status.Completed ||
|
||||
action.status === Status.Skipped;
|
||||
|
||||
return (
|
||||
<ItemStatusIndicator failure={!success} success={success} offset="-0.7rem">
|
||||
|
||||
Reference in New Issue
Block a user