Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions web/oss/src/components/Playground/Components/MainLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -97,6 +101,7 @@ const PlaygroundMainView = ({
embedded = false,
configViewMode,
onConfigViewModeChange,
renderTestsetActions,
...divProps
}: MainLayoutProps) => {
const selectedEntityIds = useAtomValue(playgroundController.selectors.entityIds())
Expand Down Expand Up @@ -313,7 +318,11 @@ const PlaygroundMainView = ({
) : (
layoutEntityIds.map((variantId) =>
displayedEntities.includes(variantId) || isEvaluatorMode ? (
<ExecutionItems key={variantId} entityId={variantId} />
<ExecutionItems
key={variantId}
entityId={variantId}
renderTestsetActions={renderTestsetActions}
/>
) : (
<GenerationPanelPlaceholder
key={`generation-placeholder-${variantId}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ const PlaygroundMainView = dynamic(
{ssr: false},
)

const TestsetDropdown = dynamic(
() => import("@/oss/components/Playground/Components/TestsetDropdown"),
{ssr: false},
)

const HumanEvaluatorDrawer = dynamic(
() => import("@/oss/components/Evaluators/Drawers/HumanEvaluatorDrawer"),
{ssr: false},
Expand Down Expand Up @@ -159,6 +164,8 @@ const DrawerAppPlayground = memo(({entityId}: {entityId: string}) => {
[],
)

const renderTestsetActions = useCallback(() => <TestsetDropdown />, [])

return (
<OSSPlaygroundShell providers={providers}>
<PlaygroundMainView
Expand All @@ -167,6 +174,7 @@ const DrawerAppPlayground = memo(({entityId}: {entityId: string}) => {
embedded
configViewMode={configViewMode}
onConfigViewModeChange={setConfigViewMode}
renderTestsetActions={renderTestsetActions}
/>
</OSSPlaygroundShell>
)
Expand Down
Loading