: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 autofix tab from issue scene (#75595)
Hugues Pouillotee5434c83e1a
diff --git a/products/error_tracking/frontend/components/IssueTasks.tsx b/products/error_tracking/frontend/components/IssueTasks.tsxdeleted file mode 100644index b4a1509d9a1c..000000000000--- a/products/error_tracking/frontend/components/IssueTasks.tsx+++ /dev/null@@ -1,210 +0,0 @@-import { useValues } from 'kea'--import { IconPlus } from '@posthog/icons'-import { LemonDialog, LemonInput, LemonTextArea } from '@posthog/lemon-ui'--import api from 'lib/api'-import { ErrorEventType, ErrorTrackingException } from 'lib/components/Errors/types'-import { formatExceptionDisplay, formatResolvedName } from 'lib/components/Errors/utils'-import { GitHubRepositorySelectField } from 'lib/integrations/GitHubIntegrationHelpers'-import { integrationsLogic } from 'lib/integrations/integrationsLogic'-import { LemonField } from 'lib/lemon-ui/LemonField'-import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'--import { ErrorTrackingRelationalIssue } from '~/queries/schema/schema-general'-import { IntegrationType } from '~/types'--import { OriginProduct, TaskUpsertProps } from 'products/posthog_ai/frontend/types/taskTypes'--import { errorTrackingIssueSceneLogic } from '../scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic'--export const IssueTasks = (): JSX.Element => {- const { issue, issueLoading, selectedEvent } = useValues(errorTrackingIssueSceneLogic)- const { getIntegrationsByKind } = useValues(integrationsLogic)-- const onClickCreateTask = (): void => {- if (issue) {- const githubIntegrations = getIntegrationsByKind(['github'])- createTaskForm(issue, selectedEvent, githubIntegrations)- }- }- return (- <ButtonPrimitive fullWidth onClick={onClickCreateTask} disabled={issueLoading}>- <IconPlus />- Create task in PostHog- </ButtonPrimitive>- )-}--const createTaskForm = (- issue: ErrorTrackingRelationalIssue,- selectedEvent: ErrorEventType | null,- githubIntegrations: IntegrationType[]-): void => {- const posthogUrl = window.location.origin + window.location.pathname-- let description = ''-- if (selectedEvent?.properties) {- const props = selectedEvent.properties-- // Extract error details from exception list- if (props.$exception_list && Array.isArray(props.$exception_list) && props.$exception_list.length > 0) {- const exception = props.$exception_list[0] as ErrorTrackingException-- description += `## ${formatExceptionDisplay(exception)}\n\n`-- if (exception.mechanism) {- description += `**Handled:** ${exception.mechanism.handled ? 'Yes' : 'No'}\n\n`- }-- // Add detailed stack trace from frames- if (exception.stacktrace && exception.stacktrace.type === 'resolved') {- description += `## Stack Trace\n\n`-- const frames = exception.stacktrace.frames.slice().reverse() // Reverse to show call order- frames.forEach((frame, index) => {- description += `**${index + 1}.** `- const resolvedName = formatResolvedName(frame)- if (resolvedName) {- description += `\`${resolvedName}\``- } else {- description += 'Anonymous function'- }-- if (frame.source) {- description += ` in \`${frame.source}\``- }-- if (frame.line) {- description += ` at line ${frame.line}`- if (frame.column) {- description += `:${frame.column}`- }- }-- description += '\n'-- // Add resolution failure if present- if (frame.resolve_failure) {- description += ` *Source map resolution failed: ${frame.resolve_failure}*\n`- }- })- description += '\n'- }- } else {- // Fallback to basic error info- description += `## ${issue.name}\n\n`- if (props.$exception_message) {- description += `**Message:** ${props.$exception_message}\n\n`- }- if (props.$exception_type) {- description += `**Type:** ${props.$exception_type}\n\n`- }- }-- // Add browser/environment info- if (props.$browser || props.$os || props.$lib_version) {- description += `## Environment\n\n`- if (props.$browser) {- description += `**Browser:** ${props.$browser}\n`- }- if (props.$os) {- description += `**OS:** ${props.$os}\n`- }- if (props.$lib_version) {- description += `**SDK Version:** ${props.$lib_version}\n`- }- if (props.$viewport_height && props.$viewport_width) {- description += `**Viewport:** ${props.$viewport_width}x${props.$viewport_height}\n`- }- description += '\n'- }-- // Add URL and user info- if (props.$current_url) {- description += `**Page:** ${props.$current_url}\n`- }- if (props.$referrer) {- description += `**Referrer:** ${props.$referrer}\n`- }- if (props.distinct_id) {- description += `**User ID:** ${props.distinct_id}\n`- }- description += '\n'- } else {- description += `## ${issue.name}\n\n`- }-- description += `---\n\n`- description += `**PostHog Error Tracking:** ${posthogUrl}\n`- description += `**First Seen:** ${new Date(issue.first_seen).toLocaleString()}\n`-- const defaultIntegration = githubIntegrations[0]-- LemonDialog.openForm({- title: 'Create PostHog task',- initialValues: {- title: issue.name ?? '',- description: description ?? '',- repositories: [],- },- content: (- <div className="flex flex-col gap-y-4">- {githubIntegrations.length > 0 && <GitHubRepositorySelectField integrationId={defaultIntegration.id} />}- <LemonField name="title" label="Title">- <LemonInput data-attr="task-title" placeholder="Task title" size="small" />- </LemonField>- <LemonField name="description" label="Description">- <LemonTextArea data-attr="task-description" placeholder="Start typing..." rows={8} />- </LemonField>- </div>- ),- errors: {- title: (title) => (!title ? 'You must enter a title' : undefined),- repositories: (repositories) =>- githubIntegrations.length > 0 && (!repositories || repositories.length === 0)- ? 'You must choose a repository'- : undefined,- },- onSubmit: async ({ title, description, repositories }) => {- try {- const taskData: TaskUpsertProps = {- title,- description,- origin_product: OriginProduct.ERROR_TRACKING,- }-- // Add repository config if GitHub integration is available and repository is selected- if (githubIntegrations.length > 0 && repositories && repositories.length > 0) {- const repoName = repositories[0]-- if (repoName && typeof repoName === 'string') {- let organization: string- let repository: string-- if (repoName.includes('/')) {- // Format: "owner/repo"- ;[organization, repository] = repoName.split('/', 2)- } else {- // Just repository name - get organization from integration config- organization =- defaultIntegration.config?.account?.name ||- defaultIntegration.config?.account?.login ||- 'GitHub'- repository = `${organization}/${repoName}`- }-- taskData.github_integration = defaultIntegration.id-- taskData.repository = repository- }- }-- await api.tasks.create(taskData)- } catch (error) {- console.error('Failed to create task:', error)- }- },- })-}diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsxindex c985cabecdac..58786321d1f1 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx@@ -16,7 +16,6 @@ import { TZLabel } from 'lib/components/TZLabel'import ViewRecordingsPlaylistButton from 'lib/components/ViewRecordingButton/ViewRecordingsPlaylistButton'import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { useWindowSize } from 'lib/hooks/useWindowSize'-import { IconRobot } from 'lib/lemon-ui/icons'import { Button, Separator, Tooltip, TooltipContent, TooltipTrigger } from 'lib/ui/quill'import {TabsPrimitive,@@ -49,7 +48,6 @@ import { ErrorFilters } from '../../components/IssueFilters'import { issueFiltersLogic } from '../../components/IssueFilters/issueFiltersLogic'import { Metadata } from '../../components/IssueMetadata'import { IssueStatusButton } from '../../components/IssueStatusButton'-import { IssueTasks } from '../../components/IssueTasks'import { ErrorTrackingSetupPrompt } from '../../components/SetupPrompt/SetupPrompt'import { StyleVariables } from '../../components/StyleVariables'import { useErrorTagRenderer } from '../../hooks/use-error-tag-renderer'@@ -315,7 +313,6 @@ const LeftHandColumn = ({ isMobile }: { isMobile: boolean }): JSX.Element => {persistPrefix: 'error-tracking-issue-view-columns-ratio',}const { desiredSize } = useValues(resizerLogic(resizerLogicProps))- const hasTasks = useFeatureFlag('TASKS')const hasSimilarIssues = useFeatureFlag('ERROR_TRACKING_RELATED_ISSUES')return (@@ -348,12 +345,6 @@ const LeftHandColumn = ({ isMobile }: { isMobile: boolean }): JSX.Element => {<IconFilter className="mr-1" /><span className="text-nowrap">Breakdowns</span></TabsPrimitiveTrigger>- {hasTasks && (- <TabsPrimitiveTrigger className="flex items-center px-2 py-1.5" value="autofix">- <IconRobot className="mr-1" />- <span className="text-nowrap">Autofix</span>- </TabsPrimitiveTrigger>- )}{hasSimilarIssues && (<TabsPrimitiveTrigger className="flex items-center px-2 py-1.5" value="similar_issues"><IconSearch className="mr-1" />@@ -369,13 +360,6 @@ const LeftHandColumn = ({ isMobile }: { isMobile: boolean }): JSX.Element => {<TabsPrimitiveContent value="breakdowns" className="flex-1 min-h-0"><BreakdownsTab /></TabsPrimitiveContent>- {hasTasks && (- <TabsPrimitiveContent value="autofix">- <div className="p-2">- <IssueTasks />- </div>- </TabsPrimitiveContent>- )}{hasSimilarIssues && (<TabsPrimitiveContent value="similar_issues" className="flex-1 min-h-0"><SimilarIssuesList />diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.tsindex 7e496d3383e9..46ed2d173b71 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.ts+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.ts@@ -1,13 +1,8 @@import { MakeLogicType, actions, defaults, kea, path, reducers } from 'kea'-export type ErrorTrackingIssueSceneCategory = 'exceptions' | 'breakdowns' | 'autofix' | 'similar_issues'--export const VALID_CATEGORIES: ErrorTrackingIssueSceneCategory[] = [- 'exceptions',- 'breakdowns',- 'autofix',- 'similar_issues',-]+export type ErrorTrackingIssueSceneCategory = 'exceptions' | 'breakdowns' | 'similar_issues'++export const VALID_CATEGORIES: ErrorTrackingIssueSceneCategory[] = ['exceptions', 'breakdowns', 'similar_issues']export const DEFAULT_CATEGORY: ErrorTrackingIssueSceneCategory = 'exceptions'// Generated by kea-typegen. Update if you're an agent, ignore if you're human.