: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
feat(llma): add empty-state onboarding to prompts list (#69646)
Juraj Majerik5bd4c3331a52
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex e59fbc45779f..1a3cb2466419 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -4899,9 +4899,9 @@ snapshots:scenes-app-ai-observability-conversation-display--tools--light:hash: v1.k794b7964.8cef3e2b4016ddd7acd4573fc58711be40ebe7d669371df7b7d4a35324dfce8a.exvwcwzA0A82p-3LqqXM3F04g3shIirvtOlCd3H7Z8cscenes-app-ai-observability-prompts--empty-state--dark:- hash: v1.k794b7964.1f2503ad0152203e984367634002c47a551389565abab706312f07e07c81855c.eYgqyAER3vhnb5ppvZR_T_qqS8QdQfAKpfpX7_RVPTY+ hash: v1.k794b7964.c8d83f25e82f659e199c0514b7eab4a0b1dab1e7a6a1c4e1de97a162a007b9f0.iR50GK7W2Ghw5_0tV7K5HMTfGuVyUSWQfYO-waZI_SAscenes-app-ai-observability-prompts--empty-state--light:- hash: v1.k794b7964.fcb49d1187406a0406d4fe642c27f72c7e8e1ed834cec879fca4a691b1887e5a.CK-BAy4rVR4uqiERyNzhF5-aLCWKblFSELggQJXftOg+ hash: v1.k794b7964.83bb6355d1386b5957fb43acb45e48d351e3adea9c71f47a67eeedb0ce1949a1.T0OWcSem5zhD85QUMGVmdYHwJPtpYOZV3Epg8teUqlcscenes-app-ai-observability-prompts--prompts-list--dark:hash: v1.k794b7964.d04f5f25d543c7427fbfc2678fd8ef2828cec6d8c0107162204bbae9ec6e1c14.N6Zj2RLZ108T1ZC1w2KCCoMD7oaqaWSYBi_tChhGISMscenes-app-ai-observability-prompts--prompts-list--light:diff --git a/products/ai_observability/frontend/prompts/LLMPromptsScene.tsx b/products/ai_observability/frontend/prompts/LLMPromptsScene.tsxindex e215086313d9..def8e12535c3 100644--- a/products/ai_observability/frontend/prompts/LLMPromptsScene.tsx+++ b/products/ai_observability/frontend/prompts/LLMPromptsScene.tsx@@ -6,6 +6,7 @@ import { Link } from '@posthog/lemon-ui'import { AccessControlAction } from 'lib/components/AccessControlAction'import { MemberSelect } from 'lib/components/MemberSelect'+import { ProductIntroduction } from 'lib/components/ProductIntroduction/ProductIntroduction'import { LemonButton } from 'lib/lemon-ui/LemonButton'import { More } from 'lib/lemon-ui/LemonButton/More'import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'@@ -33,7 +34,8 @@ export const scene: SceneExport = {export function LLMPromptsScene(): JSX.Element {const { setFilters, deletePrompt, duplicatePrompt } = useActions(llmPromptsLogic)- const { prompts, promptsLoading, sorting, pagination, filters, promptCountLabel } = useValues(llmPromptsLogic)+ const { prompts, promptsLoading, sorting, pagination, filters, promptCountLabel, shouldShowEmptyState } =+ useValues(llmPromptsLogic)const { searchParams } = useValues(router)const promptUrl = (name: string): string => combineUrl(urls.aiObservabilityPrompt(name), searchParams).url@@ -181,48 +183,74 @@ export function LLMPromptsScene(): JSX.Element {}/>- <div className="space-y-4">- <div className="flex gap-x-4 gap-y-2 items-center flex-wrap">- <LemonInput- type="search"- placeholder="Search prompts..."- value={filters.search}- data-attr="prompts-search-input"- onChange={(value) => setFilters({ search: value })}- className="max-w-md"- />- <div className="text-muted-alt">{promptCountLabel}</div>- <div className="flex-1" />- <span>- <b>Created by</b>- </span>- <MemberSelect- defaultLabel="Any user"- value={filters.created_by_id ?? null}- size="xsmall"- onChange={(user) => setFilters({ created_by_id: user?.id, page: 1 })}- />- </div>-- <LemonTable- loading={promptsLoading}- columns={columns}- dataSource={prompts.results}- pagination={pagination}- noSortingCancellation- sorting={sorting}- onSort={(newSorting) =>- setFilters({- order_by: newSorting- ? `${newSorting.order === -1 ? '-' : ''}${newSorting.columnKey}`- : undefined,- })+ {shouldShowEmptyState ? (+ <ProductIntroduction+ productName="Prompt management"+ productKey={ProductKey.LLM_PROMPTS}+ thingName="prompt"+ description="Create and version LLM prompts in PostHog, then fetch them from your code at runtime — update prompts without deploying. Every change is an immutable version you can compare, restore, and A/B test."+ docsURL="https://posthog.com/docs/prompt-management"+ isEmpty+ actionElementOverride={+ <AccessControlAction+ resourceType={AccessControlResourceType.LlmAnalytics}+ minAccessLevel={AccessControlLevel.Editor}+ >+ <LemonButton+ type="primary"+ to={promptUrl('new')}+ icon={<IconPlusSmall />}+ data-attr="llma-prompts-empty-state-new-prompt"+ >+ New prompt+ </LemonButton>+ </AccessControlAction>}- rowKey="id"- loadingSkeletonRows={PROMPTS_PER_PAGE}- nouns={['prompt', 'prompts']}/>- </div>+ ) : (+ <div className="space-y-4">+ <div className="flex gap-x-4 gap-y-2 items-center flex-wrap">+ <LemonInput+ type="search"+ placeholder="Search prompts..."+ value={filters.search}+ data-attr="prompts-search-input"+ onChange={(value) => setFilters({ search: value })}+ className="max-w-md"+ />+ <div className="text-muted-alt">{promptCountLabel}</div>+ <div className="flex-1" />+ <span>+ <b>Created by</b>+ </span>+ <MemberSelect+ defaultLabel="Any user"+ value={filters.created_by_id ?? null}+ size="xsmall"+ onChange={(user) => setFilters({ created_by_id: user?.id, page: 1 })}+ />+ </div>++ <LemonTable+ loading={promptsLoading}+ columns={columns}+ dataSource={prompts.results}+ pagination={pagination}+ noSortingCancellation+ sorting={sorting}+ onSort={(newSorting) =>+ setFilters({+ order_by: newSorting+ ? `${newSorting.order === -1 ? '-' : ''}${newSorting.columnKey}`+ : undefined,+ })+ }+ rowKey="id"+ loadingSkeletonRows={PROMPTS_PER_PAGE}+ nouns={['prompt', 'prompts']}+ />+ </div>+ )}</SceneContent>)}diff --git a/products/ai_observability/frontend/prompts/llmPromptsLogic.ts b/products/ai_observability/frontend/prompts/llmPromptsLogic.tsindex cd0cc6b3cd2a..8f9a8cffe266 100644--- a/products/ai_observability/frontend/prompts/llmPromptsLogic.ts+++ b/products/ai_observability/frontend/prompts/llmPromptsLogic.ts@@ -65,6 +65,12 @@ export const llmPromptsLogic = kea<llmPromptsLogicType>([}),},],+ promptsLoaded: [+ false as boolean,+ {+ loadPromptsSuccess: () => true,+ },+ ],}),loaders(({ values }) => ({@@ -141,6 +147,12 @@ export const llmPromptsLogic = kea<llmPromptsLogicType>([return count === 0 ? '0 prompts' : `${start}-${end} of ${count} prompt${count === 1 ? '' : 's'}`},],++ shouldShowEmptyState: [+ (s) => [s.count, s.promptsLoaded, s.promptsLoading, s.filters],+ (count, promptsLoaded, promptsLoading, filters): boolean =>+ promptsLoaded && !promptsLoading && count === 0 && !filters.search && !filters.created_by_id,+ ],}),listeners(({ asyncActions, values, selectors }) => ({diff --git a/products/ai_observability/frontend/prompts/llmPromptsLogicType.ts b/products/ai_observability/frontend/prompts/llmPromptsLogicType.tsindex 49df76e04240..4cacc207da6b 100644--- a/products/ai_observability/frontend/prompts/llmPromptsLogicType.ts+++ b/products/ai_observability/frontend/prompts/llmPromptsLogicType.ts@@ -1,4 +1,4 @@-// Generated by kea-typegen on Sun, 07 Jun 2026 14:42:30 GMT. DO NOT EDIT THIS FILE MANUALLY.+// Generated by kea-typegen on Thu, 09 Jul 2026 12:21:22 GMT. DO NOT EDIT THIS FILE MANUALLY.import type { Logic } from 'kea'@@ -94,6 +94,7 @@ export interface llmPromptsLogicType extends Logic {};defaults: {rawFilters: Partial<PromptFilters> | null;+ promptsLoaded: boolean;prompts: CountedPaginatedResponse<LLMPrompt>;promptsLoading: boolean;};@@ -131,21 +132,25 @@ export interface llmPromptsLogicType extends Logic {props: LLMPromptsLogicProps;reducer: (state: any, action: any, fullState: any) => {rawFilters: Partial<PromptFilters> | null;+ promptsLoaded: boolean;prompts: CountedPaginatedResponse<LLMPrompt>;promptsLoading: boolean;};reducers: {rawFilters: (state: Partial<PromptFilters> | null, action: any, fullState: any) => Partial<PromptFilters> | null;+ promptsLoaded: (state: boolean, action: any, fullState: any) => boolean;prompts: (state: CountedPaginatedResponse<LLMPrompt>, action: any, fullState: any) => CountedPaginatedResponse<LLMPrompt>;promptsLoading: (state: boolean, action: any, fullState: any) => boolean;};selector: (state: any) => {rawFilters: Partial<PromptFilters> | null;+ promptsLoaded: boolean;prompts: CountedPaginatedResponse<LLMPrompt>;promptsLoading: boolean;};selectors: {rawFilters: (state: any, props?: any) => Partial<PromptFilters> | null;+ promptsLoaded: (state: any, props?: any) => boolean;prompts: (state: any, props?: any) => CountedPaginatedResponse<LLMPrompt>;promptsLoading: (state: any, props?: any) => boolean;filters: (state: any, props?: any) => PromptFilters;@@ -153,10 +158,12 @@ export interface llmPromptsLogicType extends Logic {sorting: (state: any, props?: any) => Sorting | null;pagination: (state: any, props?: any) => PaginationManual;promptCountLabel: (state: any, props?: any) => string;+ shouldShowEmptyState: (state: any, props?: any) => boolean;};sharedListeners: {};values: {rawFilters: Partial<PromptFilters> | null;+ promptsLoaded: boolean;prompts: CountedPaginatedResponse<LLMPrompt>;promptsLoading: boolean;filters: PromptFilters;@@ -164,6 +171,7 @@ export interface llmPromptsLogicType extends Logic {sorting: Sorting | null;pagination: PaginationManual;promptCountLabel: string;+ shouldShowEmptyState: boolean;};_isKea: true;_isKeaWithKey: false;@@ -173,5 +181,6 @@ export interface llmPromptsLogicType extends Logic {sorting: (filters: PromptFilters) => Sorting | null;pagination: (filters: PromptFilters, count: number) => PaginationManual;promptCountLabel: (filters: PromptFilters, count: number) => string;+ shouldShowEmptyState: (count: number, promptsLoaded: boolean, promptsLoading: boolean, filters: PromptFilters) => boolean;};}\ No newline at end of file