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.

fix(insights): drop the byline from a linked chart explanation (#130889)

Sam Pennington227739691139
diff --git a/products/product_analytics/frontend/insights/explainChart/ExplainChartByline.tsx b/products/product_analytics/frontend/insights/explainChart/ExplainChartByline.tsx
deleted file mode 100644
index af6173bc6d62..000000000000
--- a/products/product_analytics/frontend/insights/explainChart/ExplainChartByline.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { TZLabel } from 'lib/components/TZLabel'
-import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'
-
-import type { StoryAuthor } from './explainChartLogic'
-
-export function ExplainChartByline({ author }: { author: StoryAuthor }): JSX.Element {
- return (
- <div className="flex items-center gap-1.5 px-2 pt-2 text-xs text-secondary">
- <span>Explained</span>
- {author.createdBy && (
- <>
- <span>by</span>
- <ProfilePicture user={author.createdBy} showName size="sm" />
- </>
- )}
- <TZLabel time={author.createdAt} />
- </div>
- )
-}
diff --git a/products/product_analytics/frontend/insights/explainChart/InsightExplainChart.tsx b/products/product_analytics/frontend/insights/explainChart/InsightExplainChart.tsx
index 7e852d0ad72e..f5e92073b8aa 100644
--- a/products/product_analytics/frontend/insights/explainChart/InsightExplainChart.tsx
+++ b/products/product_analytics/frontend/insights/explainChart/InsightExplainChart.tsx
@@ -14,7 +14,6 @@ import {
type StoryEvidenceCharts,
} from 'products/product_analytics/mcp/apps/explainChart/ExplainChartView'
-import { ExplainChartByline } from './ExplainChartByline'
import { ExplainChartEvidenceChart } from './ExplainChartEvidenceChart'
import { ExplainChartFollowUp } from './ExplainChartFollowUp'
import { explainChartLogic } from './explainChartLogic'
@@ -41,7 +40,6 @@ export function InsightExplainChart({ insightProps, renderChart }: InsightExplai
storyVisible,
storyOutdated,
storySeriesKey,
- storyAuthor,
formatValue,
} = useValues(explainChartLogic(insightProps))
const { askFollowUp } = useActions(explainChartLogic(insightProps))
@@ -63,7 +61,6 @@ export function InsightExplainChart({ insightProps, renderChart }: InsightExplai
}
return (
<>
- {storyAuthor && <ExplainChartByline author={storyAuthor} />}
<div data-quill>
<ExplainChartView
key={story.headline}
diff --git a/products/product_analytics/frontend/insights/explainChart/explainChartLogic.ts b/products/product_analytics/frontend/insights/explainChart/explainChartLogic.ts
index 6fbd351bf903..3d96ab2d5dee 100644
--- a/products/product_analytics/frontend/insights/explainChart/explainChartLogic.ts
+++ b/products/product_analytics/frontend/insights/explainChart/explainChartLogic.ts
@@ -40,7 +40,6 @@ import {
toolStreamEventsLogic,
} from 'products/posthog_ai/frontend/api/logics'
import { insightsExplanationsRetrieve } from 'products/product_analytics/frontend/generated/api'
-import type { ChartExplanationAuthorApi } from 'products/product_analytics/frontend/generated/api.schemas'
import { trendsDataLogic } from 'products/product_analytics/frontend/insights/trends/trendsDataLogic'
import type { IndexedTrendResult } from 'products/product_analytics/frontend/insights/trends/types'
import type { ExplainChartData } from 'products/product_analytics/mcp/apps/explainChart/explainChartTypes'
@@ -80,7 +79,6 @@ export interface explainChartLogicValues {
investigationStreamKey: string | null
linkedExplanationId: string | null
story: ExplainChartData | null
- storyAuthor: StoryAuthor | null
storyAvailable: boolean
storyOutdated: boolean
storyQuery: Node | null
@@ -166,9 +164,6 @@ export interface explainChartLogicActions {
setLinkedExplanationId: (explanationId: string | null) => {
explanationId: string | null
}
- setStoryAuthor: (author: StoryAuthor) => {
- author: StoryAuthor
- }
showStory: () => {
value: true
}
@@ -277,7 +272,6 @@ export const explainChartLogic: LogicWrapper<explainChartLogicType> = kea<explai
}),
setLinkedExplanationId: (explanationId: string | null) => ({ explanationId }),
loadLinkedExplanation: true,
- setStoryAuthor: (author: StoryAuthor) => ({ author }),
showStory: true,
hideStory: true,
forgetStory: true,
@@ -329,14 +323,6 @@ export const explainChartLogic: LogicWrapper<explainChartLogicType> = kea<explai
setLinkedExplanationId: (_, { explanationId }) => explanationId,
},
],
- storyAuthor: [
- null as StoryAuthor | null,
- {
- setStoryAuthor: (_, { author }) => author,
- receiveStory: () => null,
- forgetStory: () => null,
- },
- ],
followUpContext: [
null as AttachedContextItem | null,
{
@@ -470,7 +456,6 @@ export const explainChartLogic: LogicWrapper<explainChartLogicType> = kea<explai
explainedQuery(values.savedInsight.query, explanation.data.query),
'link'
)
- actions.setStoryAuthor({ createdBy: explanation.created_by ?? null, createdAt: explanation.created_at })
} catch {
if (cache.disposables.isDisposed) {
return
@@ -610,8 +595,3 @@ function dataDiffers(a: Node | null | undefined, b: Node | null | undefined): bo
}
type StorySource = 'agent' | 'link'
-
-export interface StoryAuthor {
- createdBy: ChartExplanationAuthorApi | null
- createdAt: string
-}