: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(flags): improve condition analysis layout in flag testing tab (#63315)
Gustavo H. Strassburger205ba369c6e7
diff --git a/frontend/src/scenes/feature-flags/FeatureFlagTestingTab.tsx b/frontend/src/scenes/feature-flags/FeatureFlagTestingTab.tsxindex ec8ed2e3b5b3..89299c98b4c2 100644--- a/frontend/src/scenes/feature-flags/FeatureFlagTestingTab.tsx+++ b/frontend/src/scenes/feature-flags/FeatureFlagTestingTab.tsx@@ -67,6 +67,8 @@ export function FeatureFlagTestingTab({ featureFlag }: { featureFlag: FeatureFlatestFlagEvaluation({ flagId: featureFlag.id!, formData })}+ const hasConditions = !!result?.conditions?.length+return (<div className="space-y-6"><div>@@ -258,9 +260,11 @@ export function FeatureFlagTestingTab({ featureFlag }: { featureFlag: FeatureFla</div>{/* Right Panel - Analysis and Properties */}- <div className={`flex-1 bg-bg-light p-6 rounded-lg border ${!result ? 'content-center' : ''}`}>+ <div+ className={`flex-1 bg-bg-light p-6 rounded-lg border ${result ? 'flex flex-col' : 'content-center'}`}+ >{result ? (- <div className="space-y-6">+ <div className="space-y-6 flex-1 flex flex-col min-h-0">{/* Evaluation Result */}<div className="space-y-3"><h5 className="font-semibold">Evaluation result</h5>@@ -314,20 +318,20 @@ export function FeatureFlagTestingTab({ featureFlag }: { featureFlag: FeatureFla</div>{/* Two Column Layout: Conditions and Properties */}- <div className="grid grid-cols-1 xl:grid-cols-5 gap-6">+ <div className="grid grid-cols-1 xl:grid-cols-5 gap-6 flex-1 min-h-0">{/* Left Column - Condition Analysis */}- {result.conditions && result.conditions.length > 0 && (- <div className="space-y-3 xl:col-span-2">+ {hasConditions && (+ <div className="space-y-3 xl:col-span-2 flex flex-col min-h-0"><LemonLabel>Condition analysis</LemonLabel>- <div className="space-y-3 max-h-96 overflow-auto">+ <div className="flex-1 space-y-3 overflow-auto">{enrichedConditions.map((condition) => {const styles = CONDITION_DISPLAY_STYLES[condition.display.tone]return (<divkey={condition.index}- className={`border rounded-lg p-3 ${styles.card}`}+ className={`border rounded-lg p-3 break-words ${styles.card}`}><div className="flex items-center gap-2 mb-2"><h6 className="font-medium text-sm">@@ -376,14 +380,18 @@ export function FeatureFlagTestingTab({ featureFlag }: { featureFlag: FeatureFla)}{/* Right Column - Person Properties */}- <div className="space-y-3 xl:col-span-3">+ <div+ className={`space-y-3 ${+ hasConditions ? 'xl:col-span-3' : 'xl:col-span-5'+ } flex flex-col min-h-0`}+ ><div><LemonLabel>Person properties {formData.timestamp ? 'at evaluation time' : '(current)'}</LemonLabel></div>- <div className="max-h-96 overflow-auto">+ <div className="flex-1 overflow-auto"><PropertiesTableproperties={result.person_properties}type={PropertyDefinitionType.Person}