diff --git a/web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx b/web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx index 90e2bf80ee..0d943a1480 100644 --- a/web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx +++ b/web/oss/src/components/Playground/Components/PlaygroundVariantConfig/index.tsx @@ -217,6 +217,10 @@ const PlaygroundVariantConfig: React.FC< revisionId={variantId} onRefinePrompt={handleRefinePrompt} viewMode={viewMode} + // Embedded (drawer) renders the variant config + // header non-sticky, so the section headers have + // nothing to clear — pin them at the scroll top. + stickyHeaderTop={embedded ? 0 : 48} /> diff --git a/web/packages/agenta-entity-ui/src/DrillInView/components/PlaygroundConfigSection.tsx b/web/packages/agenta-entity-ui/src/DrillInView/components/PlaygroundConfigSection.tsx index 0618b14bd8..a77bcad86e 100644 --- a/web/packages/agenta-entity-ui/src/DrillInView/components/PlaygroundConfigSection.tsx +++ b/web/packages/agenta-entity-ui/src/DrillInView/components/PlaygroundConfigSection.tsx @@ -451,6 +451,15 @@ export interface PlaygroundConfigSectionProps { onRefinePrompt?: (promptKey: string) => void /** View mode controlled from parent (form/json/yaml) */ viewMode?: ConfigViewMode + /** + * Top offset (px) for the sticky section headers. Defaults to 48 to clear + * the sticky `PlaygroundVariantConfigHeader` (h-[48px], `sticky top-0`) that + * sits above the config in the full playground. In the embedded drawer that + * header is rendered non-sticky (`grow`), so there is nothing to clear — + * pass 0 there to keep the section headers flush with the scroll top instead + * of floating 48px down into the editor content. + */ + stickyHeaderTop?: number } function PlaygroundConfigSection({ @@ -461,6 +470,7 @@ function PlaygroundConfigSection({ moleculeAdapter, onRefinePrompt, viewMode: externalViewMode, + stickyHeaderTop = 48, }: PlaygroundConfigSectionProps) { const {llmProviderConfig} = useDrillInUI() @@ -1362,7 +1372,8 @@ function PlaygroundConfigSection({ return (