: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
chore(dashboards): remove prompt composer flag (#94214)
Matt Pua3390f1119b79
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 15f325929984..c751d5062adf 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -296,7 +296,6 @@ export const FEATURE_FLAGS = {CUSTOMER_ANALYTICS_JOURNEYS: 'customer-analytics-journeys', // owner: @arthurdedeus #team-customer-analyticsCUSTOMER_ANALYTICS_TRACK_RULES: 'customer-analytics-track-rules', // owner: @arthurdedeus #team-customer-analyticsCUSTOMER_PROFILE_CONFIG_BUTTON: 'customer-profile-config-button', // owner: @arthurdedeus #team-customer-analytics- DASHBOARD_AI_PROMPT_COMPOSER: 'dashboard-ai-prompt-composer', // owner: @mattp #team-analytics-platform multivariate=control,copy,composerDASHBOARD_AUTO_PREVIEW_LIMIT: 'dashboard-auto-preview-limit', // owner: @pauldambra #team-product-analyticsDASHBOARD_CUSTOMIZATION: 'dashboard-customization', // owner: @MattPua #team-analytics-platformDASHBOARD_EXPORT_NUDGE: 'dashboard-export-nudge', // owner: #team-analytics-platform multivariate=control,test, nudges people who just exported a dashboard toward a recurring subscriptiondiff --git a/frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsx b/frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsxindex c608f862d6e6..82ca319e3472 100644--- a/frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsx+++ b/frontend/src/scenes/dashboard/EmptyDashboardComponent.test.tsx@@ -18,10 +18,6 @@ import { addInsightToDashboardLogic } from './addInsightToDashboardModalLogic'import { dashboardLogic } from './dashboardLogic'import { EmptyDashboardComponent } from './EmptyDashboardComponent'-jest.mock('./emptyDashboardAiStarterPrompts', () => ({- EmptyDashboardAiStarterPrompts: () => <div>Create a chart from a question</div>,-}))-const MOCK_DASHBOARD: DashboardType<QueryBasedInsightModel> = {id: 5,name: 'Test Dashboard',@@ -107,7 +103,7 @@ describe('EmptyDashboardComponent', () => {).toBeInTheDocument()expect(screen.getByText('Add an existing chart')).toBeInTheDocument()expect(screen.getByText('or View Web Analytics')).toBeInTheDocument()- expect(screen.getByText('Create a chart from a question')).toBeInTheDocument()+ expect(screen.getByText('What do you want to learn?')).toBeInTheDocument()logic.unmount()})diff --git a/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx b/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsxindex 706916d98853..9220c671b531 100644--- a/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx+++ b/frontend/src/scenes/dashboard/EmptyDashboardComponent.tsx@@ -8,10 +8,8 @@ import { DashboardLoadingState } from '@posthog/products-dashboards/frontend/comimport { pngHoggie } from 'lib/brand/hoggies'import { AccessControlAction } from 'lib/components/AccessControlAction'import { ProductIntroduction } from 'lib/components/ProductIntroduction/ProductIntroduction'-import { FEATURE_FLAGS } from 'lib/constants'import { LemonButton } from 'lib/lemon-ui/LemonButton'import { LemonMenuOverlay } from 'lib/lemon-ui/LemonMenu'-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { eventUsageLogic } from 'lib/utils/eventUsageLogic'import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'import { urls } from 'scenes/urls'@@ -30,7 +28,6 @@ import { DashboardAiPromptComposer } from './DashboardAiPromptComposer'import { DASHBOARD_CANNOT_EDIT_MESSAGE } from './DashboardHeader'import { getAddTileMenuItems } from './DashboardHeaderActions'import { dashboardLogic } from './dashboardLogic'-import { EmptyDashboardAiStarterPrompts } from './emptyDashboardAiStarterPrompts'const HedgehogChart = pngHoggie(chartPng)@@ -48,7 +45,6 @@ function DashboardEmptyActions({onAddWidget,push,onOpenAiWithPrompt,- promptExperience,}: {canEdit: booleandashboard: DashboardType<QueryBasedInsightModel> | null | undefined@@ -61,7 +57,6 @@ function DashboardEmptyActions({onAddWidget: () => voidpush: (path: string) => voidonOpenAiWithPrompt: (prompt: string) => void- promptExperience: string | boolean | undefined}): JSX.Element {const { reportDashboardEmptyAddChartClicked, reportDashboardEmptyWebAnalyticsClicked } = useActions(eventUsageLogic)const chipDisabledReason = !canEdit ? DASHBOARD_CANNOT_EDIT_MESSAGE : aiDisabledReason || undefined@@ -72,20 +67,13 @@ function DashboardEmptyActions({return (<div className="flex flex-col gap-4 w-full max-w-full">- {promptExperience === 'composer' ? (+ {!aiDisabledReason && (<DashboardAiPromptComposerdashboardId={dashboard?.id}disabledReason={chipDisabledReason}onOpenAiWithPrompt={onOpenAiWithPrompt}/>- ) : !aiDisabledReason ? (- <EmptyDashboardAiStarterPrompts- dashboardId={dashboard?.id}- chipDisabledReason={chipDisabledReason}- onOpenAiWithPrompt={onOpenAiWithPrompt}- variant={promptExperience === 'copy' ? 'copy' : 'control'}- />- ) : null}+ )}<div className="flex flex-wrap items-center justify-center gap-x-4 gap-y-2 @min-[48rem]/main-content:justify-start">{dashboard && (<AccessControlAction@@ -145,11 +133,6 @@ function EmptyDashboardContent({ canEdit }: { canEdit: boolean }): JSX.Element {const { push } = useActions(router)const { openSidePanel } = useActions(sidePanelStateLogic)const { dataProcessingAccepted, dataProcessingApprovalDisabledReason } = useValues(maxGlobalLogic)- const { featureFlags } = useValues(featureFlagLogic)- const promptExperience = dataProcessingAccepted- ? featureFlags[FEATURE_FLAGS.DASHBOARD_AI_PROMPT_COMPOSER]- : undefined-const aiDisabledReason =!dataProcessingAccepted &&(dataProcessingApprovalDisabledReason ?? 'Approve AI data processing to use PostHog AI')@@ -189,7 +172,6 @@ function EmptyDashboardContent({ canEdit }: { canEdit: boolean }): JSX.Element {onAddWidget={() => setAddWidgetModalOpen(true)}push={push}onOpenAiWithPrompt={onOpenAiWithPrompt}- promptExperience={promptExperience}/>}/>diff --git a/frontend/src/scenes/dashboard/dashboardAiPromptChips.tsx b/frontend/src/scenes/dashboard/dashboardAiPromptChips.tsxdeleted file mode 100644index 60826adbc350..000000000000--- a/frontend/src/scenes/dashboard/dashboardAiPromptChips.tsx+++ /dev/null@@ -1,77 +0,0 @@-import { useActions } from 'kea'--import { IconSparkles } from '@posthog/icons'--import { LemonButton } from 'lib/lemon-ui/LemonButton'-import { Tooltip } from 'lib/lemon-ui/Tooltip'-import { eventUsageLogic } from 'lib/utils/eventUsageLogic'--export type DashboardAiPromptChip = {- id: string- label: string- prompt: string-}--export type DashboardAiPromptChipsProps = {- chips: readonly DashboardAiPromptChip[]- dashboardId?: number- chipDisabledReason?: string | null- onOpenAiWithPrompt: (prompt: string) => void- dataAttrPrefix: string- className?: string- maxChips?: number- title?: string- description?: string-}--export function DashboardAiPromptChips({- chips: chipsProp,- dashboardId,- chipDisabledReason,- onOpenAiWithPrompt,- dataAttrPrefix,- className,- maxChips,- title = 'Try PostHog AI',- description = 'Pick a topic below. PostHog AI does the work so you can look at the data you care about quickly.',-}: DashboardAiPromptChipsProps): JSX.Element {- const { reportDashboardEmptyAiPromptClicked } = useActions(eventUsageLogic)-- const chips = typeof maxChips === 'number' && maxChips >= 0 ? chipsProp.slice(0, maxChips) : chipsProp-- return (- <div className={className}>- <div className="rounded-xl border-2 border-[var(--color-ai)] bg-bg-surface-primary p-4">- <div className="flex items-center gap-2 mb-1">- <IconSparkles className="text-ai size-4 shrink-0" />- <span className="text-sm font-semibold">{title}</span>- </div>- <p className="text-sm text-secondary m-0 mb-3">{description}</p>- <div className="flex flex-wrap gap-2">- {chips.map((chip) => {- const button = (- <LemonButton- type="secondary"- size="small"- className="max-w-full whitespace-normal text-left [&_.LemonButton__chrome]:h-auto [&_.LemonButton__chrome]:py-1.5"- disabledReason={chipDisabledReason || undefined}- data-attr={`${dataAttrPrefix}-${chip.id}`}- onClick={() => {- reportDashboardEmptyAiPromptClicked(chip.label, dashboardId, 'starter_question')- onOpenAiWithPrompt(chip.prompt)- }}- >- {chip.label}- </LemonButton>- )- return (- <Tooltip key={chip.id} title={chipDisabledReason ? chipDisabledReason : chip.prompt}>- {button}- </Tooltip>- )- })}- </div>- </div>- </div>- )-}diff --git a/frontend/src/scenes/dashboard/emptyDashboardAiStarterPrompts.tsx b/frontend/src/scenes/dashboard/emptyDashboardAiStarterPrompts.tsxdeleted file mode 100644index 9860053bf46b..000000000000--- a/frontend/src/scenes/dashboard/emptyDashboardAiStarterPrompts.tsx+++ /dev/null@@ -1,70 +0,0 @@-import { DashboardAiPromptChip, DashboardAiPromptChips } from './dashboardAiPromptChips'--export const EMPTY_DASHBOARD_AI_PROMPT_CHIPS: readonly DashboardAiPromptChip[] = [- {- id: 'landing_performance',- label: 'See which campaigns and landing pages actually convert',- prompt: 'Build a dashboard for landing page performance over the last 30 days: pageview or $pageview by path / UTM campaign, bounce proxy (single-page sessions), conversion to a primary goal event (e.g. signed up or book a demo), and session replay links for top paths with drop-off. Add insights I can save to this dashboard.',- },- {- id: 'core_web_metrics',- label: 'Know who visits, which pages matter, and where the site struggles',- prompt: 'Give me a core web metrics dashboard: traffic (DAU/visitors), top pages, referrers, device breakdown, web vitals (LCP, INP, CLS) if available, and error rate (exceptions or client errors). Help me pin the right insights here.',- },- {- id: 'weekly_marketing_health',- label: 'Check whether this week is doing better than last week',- prompt: 'I want a weekly health view for our marketing site: week-over-week visitors, conversion funnel to signup, geo split, and flag for any anomaly vs prior week. Help me build it on this dashboard.',- },- {- id: 'mixed_full_funnel',- label: 'Follow the journey from traffic to signup to retention and feedback',- prompt: 'Combine landing page + website metrics into one dashboard covering Acquisition (UTMs, landing pages), Activation (signup funnel), Retention (returning visitors), Research (survey + feedback volume). Using this dashboard, help me build that.',- },- {- id: 'user_research_ops',- label: 'Hear what people say in surveys and dig into the right sessions',- prompt: 'Build a user research ops dashboard: survey response volume and completion rate, NPS/CSAT if we use surveys, feature request tags from feedback events, and session replay sampled from users who rated low. Add insights to this dashboard.',- },-]--const OUTCOME_FOCUSED_DASHBOARD_AI_PROMPT_CHIPS: readonly DashboardAiPromptChip[] = [- ...EMPTY_DASHBOARD_AI_PROMPT_CHIPS.slice(0, 2),- {- id: 'activation_retention',- label: 'See what brings users back after they sign up',- prompt: 'Build an activation and retention dashboard. Show new signups, users who complete a key activation event, weekly retention cohorts, and the top paths to activation. Add insights I can save to this dashboard.',- },-]--export type EmptyDashboardAiStarterPromptsProps = {- dashboardId?: number- chipDisabledReason?: string | null- onOpenAiWithPrompt: (prompt: string) => void- className?: string- variant?: 'control' | 'copy'-}--export function EmptyDashboardAiStarterPrompts({- dashboardId,- chipDisabledReason,- onOpenAiWithPrompt,- className,- variant = 'control',-}: EmptyDashboardAiStarterPromptsProps): JSX.Element {- const isCopyVariant = variant === 'copy'-- return (- <DashboardAiPromptChips- chips={isCopyVariant ? OUTCOME_FOCUSED_DASHBOARD_AI_PROMPT_CHIPS : EMPTY_DASHBOARD_AI_PROMPT_CHIPS}- dashboardId={dashboardId}- chipDisabledReason={chipDisabledReason}- onOpenAiWithPrompt={onOpenAiWithPrompt}- dataAttrPrefix="dashboard-empty-ai-prompt"- className={className}- maxChips={3}- title={isCopyVariant ? 'What matters most to you?' : undefined}- description={isCopyVariant ? "Choose a topic, and we'll build a dashboard around it." : undefined}- />- )-}