Skip to content

: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.

feat(prompts): add feedback button to the prompts page (#110244)

ruby childsa424d9f4de78
diff --git a/products/ai_observability/frontend/prompts/LLMPromptsScene.tsx b/products/ai_observability/frontend/prompts/LLMPromptsScene.tsx
index 68f616992700..763f944b15e3 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 { Button } from '@posthog/quill'
import { AccessControlAction } from 'lib/components/AccessControlAction'
+import { FeedbackSurveyButton } from 'lib/components/FeedbackSurveyButton/FeedbackSurveyButton'
import { MemberSelect } from 'lib/components/MemberSelect'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
@@ -30,6 +31,9 @@ import { PromptLabelChip } from './PromptLabelChip'
import { LLMPrompt } from './types'
import { openArchivePromptDialog, openDuplicatePromptDialog, stripPromptSceneSearchParams } from './utils'
+// "Prompts open feedback" survey, opened only via the feedback button (its URL targeting never matches).
+const PROMPTS_FEEDBACK_SURVEY_ID = '01a0f8a7-bea2-0000-5f58-c8c69e4b7a3b'
+
export const scene: SceneExport = {
component: LLMPromptsScene,
logic: llmPromptsLogic,
@@ -205,30 +209,36 @@ export function LLMPromptsScene(): JSX.Element {
description="Track and manage your LLM prompts."
resourceType={{ type: 'llm_prompts' }}
actions={
- <AccessControlAction
- resourceType={AccessControlResourceType.LlmAnalytics}
- minAccessLevel={AccessControlLevel.Editor}
- >
- {todayRailNav ? (
- <Button
- variant="primary"
- render={<LinkPrimitive to={promptUrl('new')} />}
- data-attr="new-prompt-button"
- >
- <IconPlus />
- New prompt
- </Button>
- ) : (
- <LemonButton
- type="primary"
- to={promptUrl('new')}
- icon={<IconPlusSmall />}
- data-attr="new-prompt-button"
- >
- New prompt
- </LemonButton>
- )}
- </AccessControlAction>
+ <>
+ <FeedbackSurveyButton
+ surveyId={PROMPTS_FEEDBACK_SURVEY_ID}
+ data-attr="prompts-feedback-button"
+ />
+ <AccessControlAction
+ resourceType={AccessControlResourceType.LlmAnalytics}
+ minAccessLevel={AccessControlLevel.Editor}
+ >
+ {todayRailNav ? (
+ <Button
+ variant="primary"
+ render={<LinkPrimitive to={promptUrl('new')} />}
+ data-attr="new-prompt-button"
+ >
+ <IconPlus />
+ New prompt
+ </Button>
+ ) : (
+ <LemonButton
+ type="primary"
+ to={promptUrl('new')}
+ icon={<IconPlusSmall />}
+ data-attr="new-prompt-button"
+ >
+ New prompt
+ </LemonButton>
+ )}
+ </AccessControlAction>
+ </>
}
/>