:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(aio): make clicks land on the evaluation template picker rows (#81324)
posthog[bot]0336a8c4aed2
diff --git a/products/ai_observability/frontend/evaluations/EvaluationTemplates.tsx b/products/ai_observability/frontend/evaluations/EvaluationTemplates.tsxindex c09b34783caa..a798bb1cd6b2 100644--- a/products/ai_observability/frontend/evaluations/EvaluationTemplates.tsx+++ b/products/ai_observability/frontend/evaluations/EvaluationTemplates.tsx@@ -1,3 +1,4 @@+import clsx from 'clsx'import { useValues } from 'kea'import { router } from 'kea-router'import posthog from 'posthog-js'@@ -5,6 +6,7 @@ import posthog from 'posthog-js'import * as judgePng from '@posthog/brand/hoggies/png/judge'import {IconArrowLeft,+ IconChevronRight,IconCode,IconEmoji,IconEye,@@ -95,7 +97,7 @@ interface PickerRowProps {function PickerRow({ dataAttr, description, icon, onClick, tag, title }: PickerRowProps): JSX.Element {return (<button- className="flex items-center gap-4 w-full text-left px-4 py-3 hover:bg-fill-highlight-50 focus:bg-fill-highlight-50 focus:outline-none transition-colors cursor-pointer"+ className="group flex items-center gap-4 w-full text-left px-4 py-3 hover:bg-fill-highlight-50 focus:bg-fill-highlight-50 focus:outline-none transition-colors cursor-pointer"data-attr={dataAttr}onClick={onClick}>@@ -104,7 +106,7 @@ function PickerRow({ dataAttr, description, icon, onClick, tag, title }: PickerR</div><div className="flex-1 min-w-0"><div className="flex items-center gap-2">- <h3 className="text-base font-semibold text-default mb-0">{title}</h3>+ <h3 className="text-base font-semibold text-default mb-0 group-hover:text-primary-3000">{title}</h3>{tag && (<LemonTag type={tag.type} size="small">{tag.label}@@ -113,6 +115,7 @@ function PickerRow({ dataAttr, description, icon, onClick, tag, title }: PickerR</div><p className="text-sm text-secondary mb-0">{description}</p></div>+ <IconChevronRight className="size-5 flex-shrink-0 text-secondary transition-transform group-hover:translate-x-0.5 group-hover:text-primary-3000" /></button>)}@@ -162,49 +165,54 @@ function TemplatePicker({const showStartWithAi = !!featureFlags[FEATURE_FLAGS.LLM_ANALYTICS_EVALUATIONS_START_WITH_AI]return (- <div className="flex flex-col shrink-0 items-center justify-center py-8" style={{ minHeight }}>- <div className="w-full max-w-5xl px-4">- {showBackButton && (- <div className="mb-6">- <LemonButton- type="secondary"- icon={<IconArrowLeft />}- onClick={() => router.actions.push(getEvaluationBackTarget(false, searchParams).path)}- size="small"- >- Back to Evaluations- </LemonButton>- </div>- )}- <div className="space-y-8">- <div className="text-center space-y-3">- <div className="flex justify-center mb-4">- <HedgehogJudge className="w-32 h-32" />- </div>- <h1 className="text-3xl font-bold">{title}</h1>- <p className="text-base text-secondary max-w-2xl mx-auto">- {description}- {learnMoreUrl && (- <>- {' '}- <Link to={learnMoreUrl} target="_blank">- Learn more- </Link>- </>- )}- </p>+ // Capped on the wrapper rather than on an inner child so the picker collects no clicks in the+ // empty space beside the card on wide viewports.+ <div+ className={clsx(+ 'flex flex-col shrink-0 justify-center w-full max-w-5xl mx-auto px-4 py-8',+ minHeight === '80vh' ? 'min-h-[80vh]' : 'min-h-[60vh]'+ )}+ >+ {showBackButton && (+ <div className="mb-6">+ <LemonButton+ type="secondary"+ icon={<IconArrowLeft />}+ onClick={() => router.actions.push(getEvaluationBackTarget(false, searchParams).path)}+ size="small"+ >+ Back to Evaluations+ </LemonButton>+ </div>+ )}+ <div className="space-y-8">+ <div className="text-center space-y-3">+ <div className="flex justify-center mb-4">+ <HedgehogJudge className="w-32 h-32" /></div>+ <h1 className="text-3xl font-bold">{title}</h1>+ <p className="text-base text-secondary max-w-2xl mx-auto">+ {description}+ {learnMoreUrl && (+ <>+ {' '}+ <Link to={learnMoreUrl} target="_blank">+ Learn more+ </Link>+ </>+ )}+ </p>+ </div>- {showStartWithAi && (- <MCPUseCaseCard surfaceKey="ai_observability_evaluations.create" className="!mt-0" />- )}+ {showStartWithAi && (+ <MCPUseCaseCard surfaceKey="ai_observability_evaluations.create" className="!mt-0" />+ )}- <div className="flex flex-col border border-border rounded-lg divide-y divide-border overflow-hidden bg-bg-light">- <TemplateRow template="blank" />- {defaultEvaluationTemplates.map((template) => (- <TemplateRow key={template.key} template={template} />- ))}- </div>+ <div className="flex flex-col border border-border rounded-lg divide-y divide-border overflow-hidden bg-bg-light">+ <TemplateRow template="blank" />+ {defaultEvaluationTemplates.map((template) => (+ <TemplateRow key={template.key} template={template} />+ ))}</div></div></div>