From 23a9a7c3866fd3134af3d0538df5d0a21a4d9fc3 Mon Sep 17 00:00:00 2001 From: Arda Erzin Date: Tue, 26 May 2026 21:16:26 +0200 Subject: [PATCH] fix(frontend): wire testset connection into workflow drawer playground MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow entity create/edit drawer playground had no affordance to connect an existing testset — only local testcases could be edited. ExecutionHeader already exposes a renderTestsetActions slot, but OSS MainLayout never forwarded it, so the drawer (which mounts MainLayout directly with no surrounding header) had no place to surface it. Forward renderTestsetActions through MainLayout → ExecutionItems → ExecutionHeader, and fill the slot in DrawerAppPlayground with the existing TestsetDropdown. Full-page playground is unchanged — its TestsetDropdown still lives in PlaygroundHeader, so there is no duplication. --- .../Playground/Components/MainLayout/index.tsx | 13 +++++++++++-- .../WorkflowRevisionDrawerWrapper/index.tsx | 8 ++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/web/oss/src/components/Playground/Components/MainLayout/index.tsx b/web/oss/src/components/Playground/Components/MainLayout/index.tsx index 4bcd0e26cc..771c2dd9e6 100644 --- a/web/oss/src/components/Playground/Components/MainLayout/index.tsx +++ b/web/oss/src/components/Playground/Components/MainLayout/index.tsx @@ -12,7 +12,9 @@ import { GenerationComparisonOutputHeader, GenerationComparisonInputHeader as PlaygroundComparisonGenerationInputHeader, } from "@agenta/playground-ui/execution-item-comparison-view" -import ExecutionItems from "@agenta/playground-ui/execution-items" +import ExecutionItems, { + type PlaygroundGenerationsProps, +} from "@agenta/playground-ui/execution-items" import {Button, Splitter, Typography} from "antd" import clsx from "clsx" import {useAtomValue} from "jotai" @@ -46,6 +48,8 @@ type MainLayoutProps = BaseContainerProps & { configViewMode?: ConfigViewMode /** Callback when config view mode changes. */ onConfigViewModeChange?: (mode: ConfigViewMode) => void + /** Render slot for testset menu in the per-entity Generations header (single view). */ + renderTestsetActions?: PlaygroundGenerationsProps["renderTestsetActions"] } const SplitterPanel = Splitter.Panel @@ -97,6 +101,7 @@ const PlaygroundMainView = ({ embedded = false, configViewMode, onConfigViewModeChange, + renderTestsetActions, ...divProps }: MainLayoutProps) => { const selectedEntityIds = useAtomValue(playgroundController.selectors.entityIds()) @@ -313,7 +318,11 @@ const PlaygroundMainView = ({ ) : ( layoutEntityIds.map((variantId) => displayedEntities.includes(variantId) || isEvaluatorMode ? ( - + ) : ( import("@/oss/components/Playground/Components/TestsetDropdown"), + {ssr: false}, +) + const HumanEvaluatorDrawer = dynamic( () => import("@/oss/components/Evaluators/Drawers/HumanEvaluatorDrawer"), {ssr: false}, @@ -159,6 +164,8 @@ const DrawerAppPlayground = memo(({entityId}: {entityId: string}) => { [], ) + const renderTestsetActions = useCallback(() => , []) + return ( { embedded configViewMode={configViewMode} onConfigViewModeChange={setConfigViewMode} + renderTestsetActions={renderTestsetActions} /> )