: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(error-tracking): remove create survey button from issue sidebar (#119758)
Hugues Pouillotce93b007a8a0
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex ac91f22b915b..2950d71b4495 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -533,7 +533,6 @@ export const FEATURE_FLAGS = {SUBSCRIPTION_SOURCE_SUMMARIES: 'subscription-source-summaries', // owner: #team-analytics-platform, shows subscription AI summaries on their dashboard or insightSUBSCRIPTION_SUMMARY_COPY_EXPERIMENT: 'subscription-summary-copy-experiment',SURVEY_HEADLINE_SUMMARY: 'survey-headline-summary', // owner: @adboio #team-surveys- SURVEYS_ERROR_TRACKING_CROSS_SELL: 'surveys-in-error-tracking', // owner: @adboio #team-surveysSURVEYS_FORM_BUILDER: 'surveys-form-builder', // owner: @adboio #team-surveysSURVEYS_INSIGHT_BUTTON_EXPERIMENT: 'ask-users-why-ai-vs-quickcreate', // owner: @adboio #team-surveys multivariate=trueSURVEYS_WEB_ANALYTICS_CROSS_SELL: 'surveys-in-web-analytics', // owner: @adboio #team-surveysdiff --git a/frontend/src/scenes/surveys/QuickSurveyModal.tsx b/frontend/src/scenes/surveys/QuickSurveyModal.tsxindex aee921c8c8b9..6a2ecd58c093 100644--- a/frontend/src/scenes/surveys/QuickSurveyModal.tsx+++ b/frontend/src/scenes/surveys/QuickSurveyModal.tsx@@ -24,7 +24,6 @@ import { teamLogic } from 'scenes/teamLogic'import { Survey } from '~/types'import { EventSelector } from './quick-create/components/EventSelector'-import { ExceptionFilters } from './quick-create/components/ExceptionFilters'import { FunnelSequence } from './quick-create/components/FunnelSequence'import { URLInput } from './quick-create/components/URLInput'import { VariantSelector } from './quick-create/components/VariantSelector'@@ -208,8 +207,6 @@ export function QuickSurveyForm({ context, info, onCancel, showFollowupToggle }:<URLInput /></>)}-- {context.type === QuickSurveyType.ERROR_TRACKING && <URLInput />}</div><div>@@ -219,8 +216,6 @@ export function QuickSurveyForm({ context, info, onCancel, showFollowupToggle }:</div></div>- {context.type === QuickSurveyType.ERROR_TRACKING && <ExceptionFilters />}-<div className="flex flex-col gap-3 mt-4"><SdkVersionWarnings warnings={warnings} />diff --git a/frontend/src/scenes/surveys/constants.tsx b/frontend/src/scenes/surveys/constants.tsxindex fe95631b87d6..884c59a3a2a3 100644--- a/frontend/src/scenes/surveys/constants.tsx+++ b/frontend/src/scenes/surveys/constants.tsx@@ -822,7 +822,6 @@ export enum SURVEY_CREATED_SOURCE {EXPERIMENTS = 'experiments',INSIGHT_CROSS_SELL = 'insight_cross_sell',CUSTOMER_ANALYTICS_INSIGHT = 'customer_analytics_insight',- ERROR_TRACKING = 'error_tracking',WEB_ANALYTICS = 'web_analytics',LLM_ANALYTICS = 'llm_analytics',}diff --git a/frontend/src/scenes/surveys/quick-create/components/ExceptionFilters.tsx b/frontend/src/scenes/surveys/quick-create/components/ExceptionFilters.tsxdeleted file mode 100644index 0ff62320940a..000000000000--- a/frontend/src/scenes/surveys/quick-create/components/ExceptionFilters.tsx+++ /dev/null@@ -1,60 +0,0 @@-import { useActions, useValues } from 'kea'--import { LemonLabel } from '@posthog/lemon-ui'--import { PropertyFilters } from 'lib/components/PropertyFilters/PropertyFilters'-import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'--import { AnyPropertyFilter, SurveyEventsWithProperties } from '~/types'--import {- SUPPORTED_OPERATORS,- convertArrayToPropertyFilters,- convertPropertyFiltersToArray,-} from '../../SurveyEventTrigger'-import { quickSurveyFormLogic } from '../quickSurveyFormLogic'--const EXCEPTION_PROPERTY_ALLOW_LIST = ['$exception_types', '$exception_values', '$exception_handled']--export function ExceptionFilters(): JSX.Element {- const { surveyForm } = useValues(quickSurveyFormLogic)- const { updateConditions } = useActions(quickSurveyFormLogic)-- const exceptionEvent = surveyForm.conditions?.events?.values?.[0]- const propertyFilters = exceptionEvent?.propertyFilters as SurveyEventsWithProperties['propertyFilters']-- const handleFiltersChange = (filters: AnyPropertyFilter[]): void => {- updateConditions({- events: {- values: [- {- name: '$exception',- propertyFilters: convertArrayToPropertyFilters(filters),- },- ],- },- })- }-- return (- <div className="mt-2">- <LemonLabel className="mb-2">Exception filters</LemonLabel>- <div className="border rounded p-3 bg-bg-light">- <div className="text-xs font-medium text-muted-alt mb-2">- Survey will trigger when an exception matches these filters:- </div>- <PropertyFilters- propertyFilters={convertPropertyFiltersToArray(propertyFilters)}- onChange={handleFiltersChange}- pageKey="quick-survey-exception-filters"- taxonomicGroupTypes={[TaxonomicFilterGroupType.EventProperties]}- eventNames={['$exception']}- buttonText="Add filter"- buttonSize="small"- operatorAllowlist={SUPPORTED_OPERATORS}- propertyAllowList={{ [TaxonomicFilterGroupType.EventProperties]: EXCEPTION_PROPERTY_ALLOW_LIST }}- />- </div>- </div>- )-}diff --git a/frontend/src/scenes/surveys/quick-create/types.ts b/frontend/src/scenes/surveys/quick-create/types.tsindex c098e3065202..1d349a69b997 100644--- a/frontend/src/scenes/surveys/quick-create/types.ts+++ b/frontend/src/scenes/surveys/quick-create/types.ts@@ -7,7 +7,6 @@ export type QuickSurveyContext =| { type: QuickSurveyType.FUNNEL; funnel: FunnelContext }| { type: QuickSurveyType.EXPERIMENT; experiment: Experiment }| { type: QuickSurveyType.ANNOUNCEMENT }- | { type: QuickSurveyType.ERROR_TRACKING; exceptionType: string; exceptionMessage?: string | null }| { type: QuickSurveyType.WEB_PATH; path: string }export interface QuickSurveyFormProps {@@ -22,6 +21,5 @@ export enum QuickSurveyType {FUNNEL = 'funnel',EXPERIMENT = 'experiment',ANNOUNCEMENT = 'announcement',- ERROR_TRACKING = 'error_tracking',WEB_PATH = 'web_path',}diff --git a/frontend/src/scenes/surveys/quick-create/utils.ts b/frontend/src/scenes/surveys/quick-create/utils.tsindex 86599ad3526a..c2005aeb0d1d 100644--- a/frontend/src/scenes/surveys/quick-create/utils.ts+++ b/frontend/src/scenes/surveys/quick-create/utils.ts@@ -84,44 +84,6 @@ export const buildLogicProps = (context: QuickSurveyContext): Omit<QuickSurveyFo},}- case QuickSurveyType.ERROR_TRACKING:- return {- key: `error-tracking-${context.exceptionType}-${randomId}`,- contextType: context.type,- source: SURVEY_CREATED_SOURCE.ERROR_TRACKING,- defaults: {- name: `${context.exceptionType} feedback (${randomId})`,- question: 'Looks like we hit a snag - how disruptive was this?',- questionType: SurveyQuestionType.Rating,- scaleType: 'number',- ratingLowerBound: 'Minor glitch',- ratingUpperBound: "Can't continue",- followUpEnabled: true,- followUpQuestion: 'What were you trying to do?',- conditions: {- actions: null,- events: {- values: [- {- name: '$exception',- propertyFilters: {- $exception_types: { values: [context.exceptionType], operator: 'exact' },- ...(context.exceptionMessage- ? {- $exception_values: {- values: [context.exceptionMessage],- operator: 'icontains',- },- }- : {}),- },- },- ],- },- },- },- }-case QuickSurveyType.WEB_PATH:return {key: `web-path-${context.path}-${randomId}`,diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/ErrorTrackingIssueScenePanel.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/ErrorTrackingIssueScenePanel.tsxindex ec6f7a4b89be..3d31fdd9276c 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/ErrorTrackingIssueScenePanel.tsx+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ScenePanel/ErrorTrackingIssueScenePanel.tsx@@ -1,26 +1,18 @@import { useActions, useValues } from 'kea'-import { useState } from 'react'--import { IconMessage } from '@posthog/icons'import { SceneComment } from 'lib/components/Scenes/SceneComment'import { SceneShareButton } from 'lib/components/Scenes/SceneShareButton'import { SceneActivityIndicator } from 'lib/components/Scenes/SceneUpdateActivityInfo'-import { FEATURE_FLAGS } from 'lib/constants'import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { IconFingerprint } from 'lib/lemon-ui/icons'-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'import { copyToClipboard } from 'lib/utils/copyToClipboard'-import { addProductIntentForCrossSell } from 'lib/utils/product-intents'import { pluralize } from 'lib/utils/strings'-import { QuickSurveyType } from 'scenes/surveys/quick-create/types'-import { QuickSurveyModal } from 'scenes/surveys/QuickSurveyModal'import { urls } from 'scenes/urls'import { ScenePanel, ScenePanelDivider, ScenePanelInfoSection, ScenePanelLabel } from '~/layout/scenes/SceneLayout'import { ScenePanelActionsSection } from '~/layout/scenes/SceneLayout'-import { ErrorTrackingRelationalIssue, ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'+import { ErrorTrackingRelationalIssue } from '~/queries/schema/schema-general'import { ExternalReferences } from '../../../components/ExternalReferences'import { manageFingerprintsLogic } from '../../../components/FingerprintPreview/manageFingerprintsLogic'@@ -41,7 +33,6 @@ export const ErrorTrackingIssueScenePanel = ({</ScenePanelInfoSection><ScenePanelDivider /><ScenePanelActionsSection>- <CreateSurveyButton /><SceneComment dataAttrKey="issue" /><SceneShareButtondataAttrKey="issue"@@ -76,47 +67,3 @@ const IssueFingerprints = (): JSX.Element => {</ButtonPrimitive>)}--const CreateSurveyButton = (): JSX.Element | null => {- const { issue } = useValues(errorTrackingIssueSceneLogic)- const { featureFlags } = useValues(featureFlagLogic)- const [showSurveyModal, setShowSurveyModal] = useState(false)-- const exceptionType = issue?.name- const exceptionMessage = issue?.description-- const showSurveyButton = featureFlags[FEATURE_FLAGS.SURVEYS_ERROR_TRACKING_CROSS_SELL] && exceptionType-- if (!showSurveyButton) {- return null- }- return (- <>- <ButtonPrimitive- fullWidth- onClick={() => {- setShowSurveyModal(true)- void addProductIntentForCrossSell({- from: ProductKey.ERROR_TRACKING,- to: ProductKey.SURVEYS,- intent_context: ProductIntentContext.QUICK_SURVEY_STARTED,- })- }}- >- <IconMessage />- Create survey- </ButtonPrimitive>- <QuickSurveyModal- context={{- type: QuickSurveyType.ERROR_TRACKING,- exceptionType: exceptionType,- exceptionMessage: exceptionMessage,- }}- info="This survey will trigger when users encounter matching exceptions. Adjust the filters below to target specific errors."- isOpen={showSurveyModal}- onCancel={() => setShowSurveyModal(false)}- showFollowupToggle={true}- />- </>- )-}