diff --git a/agenta-web/src/components/Playground/Views/TestView.tsx b/agenta-web/src/components/Playground/Views/TestView.tsx index ba34c49c78..3244a70240 100644 --- a/agenta-web/src/components/Playground/Views/TestView.tsx +++ b/agenta-web/src/components/Playground/Views/TestView.tsx @@ -1,9 +1,9 @@ -import React, {useState} from "react" +import React, {useEffect, useState} from "react" import {Button, Input, Card, Row, Col, Space} from "antd" import {CaretRightOutlined, PlusOutlined} from "@ant-design/icons" import {callVariant} from "@/lib/services/api" import {ChatMessage, ChatRole, GenericObject, Parameter, Variant} from "@/lib/Types" -import {randString, removeKeys, renameVariables, safeParse} from "@/lib/helpers/utils" +import {randString, removeKeys, renameVariables} from "@/lib/helpers/utils" import LoadTestsModal from "../LoadTestsModal" import AddToTestSetDrawer from "../AddToTestSetDrawer/AddToTestSetDrawer" import {DeleteOutlined} from "@ant-design/icons" @@ -210,6 +210,15 @@ const App: React.FC = ({inputParams, optParams, variant, isChatVa const [params, setParams] = useState | null>(null) const classes = useStylesApp() + useEffect(() => { + setResultsList((prevResultsList) => { + const newResultsList = testList.map((_, index) => { + return index < prevResultsList.length ? prevResultsList[index] : "" + }) + return newResultsList + }) + }, [testList]) + const setResultForIndex = (value: string, index: number) => { if (isChatVariant) { setTestList((prevState) =>