: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
fix(today): title report rows the way the report page does (#117822)
Shy Alter2b3efb5d1223
diff --git a/frontend/src/scenes/project-homepage/today/TodayBriefingItemRow.tsx b/frontend/src/scenes/project-homepage/today/TodayBriefingItemRow.tsxindex 510ead486c05..77bf5bb8f0fb 100644--- a/frontend/src/scenes/project-homepage/today/TodayBriefingItemRow.tsx+++ b/frontend/src/scenes/project-homepage/today/TodayBriefingItemRow.tsx@@ -9,6 +9,7 @@ import { TodayReportRowDetail } from './TodayReportRowDetail'import { TodayRow } from './TodayRow'import { pullRequestFact, rowFacts } from './todayRowFacts'import { briefingItemIcon } from './todayRowIcons'+import { reportTitle } from './todaySignalReports'import { TodayVerdictButtons } from './TodayVerdictButtons'import type { TodayReportVerdictTarget } from './todayVerdictLogic'@@ -34,10 +35,11 @@ export function TodayBriefingItemRow({ item, done }: { item: BriefingItemApi; doconst reportId = itemReportId(item)const preview = reportPreviews[item.key]const to = itemHref(item)+ const title = item.report ? reportTitle(item) : item.titleconst target: TodayReportVerdictTarget | null = reportId? {reportId,- title: item.title,+ title,hasOpenPullRequest:!!item.report?.pull_request_url &&item.report.pull_request_state !== 'closed' &&@@ -48,7 +50,7 @@ export function TodayBriefingItemRow({ item, done }: { item: BriefingItemApi; do<TodayRowtone={priorityTone(priority)}icon={briefingItemIcon(item)}- title={item.title}+ title={title}label={priority ?? undefined}facts={donediff --git a/frontend/src/scenes/project-homepage/today/TodayReportHeader.tsx b/frontend/src/scenes/project-homepage/today/TodayReportHeader.tsxindex 98dc5dc8d821..74caf1752b84 100644--- a/frontend/src/scenes/project-homepage/today/TodayReportHeader.tsx+++ b/frontend/src/scenes/project-homepage/today/TodayReportHeader.tsx@@ -6,7 +6,6 @@ import { Badge, Button, Heading, IconStack, IconStackItem, Text, cn } from '@posimport { dayjs } from 'lib/dayjs'import { LinkPrimitive } from 'lib/lemon-ui/Link'-import { capitalizeFirstLetter } from 'lib/utils/strings'import { urls } from 'scenes/urls'import { SHEET_PARTS } from '~/layout/today/todayMenuParts'@@ -15,7 +14,6 @@ import { todayShellLogic } from '~/layout/today/todayShellLogic'import { SignalReport } from 'products/signals/frontend/inbox/types'import { hasOpenImplementationPr } from 'products/signals/frontend/inbox/utils/reportActions'-import { displayConventionalCommitTitle } from 'products/signals/frontend/inbox/utils/reportPresentation'import { TodayActionButton } from './TodayActionButton'import { itemStateLabel } from './todayBriefingItems'@@ -206,7 +204,7 @@ export function TodayReportHeader({ report }: { report: SignalReport }): JSX.Ele</div><div className="flex flex-col gap-2"><Heading size="xl" render={<h1 />} className="leading-snug text-balance">- {capitalizeFirstLetter(displayConventionalCommitTitle(report.title, 'Untitled report'))}+ {reportTitle(report)}</Heading>{lead && (<div data-today-figures>diff --git a/frontend/src/scenes/project-homepage/today/todaySignalReports.test.ts b/frontend/src/scenes/project-homepage/today/todaySignalReports.test.tsindex e76f348251a2..ccb010100ac1 100644--- a/frontend/src/scenes/project-homepage/today/todaySignalReports.test.ts+++ b/frontend/src/scenes/project-homepage/today/todaySignalReports.test.ts@@ -1,4 +1,4 @@-import { reportSourceLine, scoutLabel } from './todaySignalReports'+import { reportSourceLine, reportTitle, scoutLabel } from './todaySignalReports'describe('todaySignalReports', () => {test.each([@@ -25,4 +25,13 @@ describe('todaySignalReports', () => {])('names the sources of %s', (_, report, expected) => {expect(reportSourceLine(report)).toEqual(expected)})++ test.each([+ ['fix(desktop): stop a provider 400 killing an agent turn', 'Stop a provider 400 killing an agent turn'],+ ['Checkout errors spike after deploy', 'Checkout errors spike after deploy'],+ [' ', 'Untitled report'],+ [null, 'Untitled report'],+ ])('titles the report %p the way its page does', (title, expected) => {+ expect(reportTitle({ title })).toEqual(expected)+ })})diff --git a/frontend/src/scenes/project-homepage/today/todaySignalReports.ts b/frontend/src/scenes/project-homepage/today/todaySignalReports.tsindex 0111916f854b..e3888d207cac 100644--- a/frontend/src/scenes/project-homepage/today/todaySignalReports.ts+++ b/frontend/src/scenes/project-homepage/today/todaySignalReports.ts@@ -1,7 +1,9 @@import { dayjs } from 'lib/dayjs'import { scoutDisplayName } from 'lib/signals/signalCardSourceLine'+import { capitalizeFirstLetter } from 'lib/utils/strings'import { SignalReport } from 'products/signals/frontend/inbox/types'+import { displayConventionalCommitTitle } from 'products/signals/frontend/inbox/utils/reportPresentation'export type TodayReportIcon =| 'pr'@@ -63,7 +65,7 @@ const FALLBACK_SOURCE: TodayReportSource = {}export function reportTitle(report: Pick<SignalReport, 'title'>): string {- return report.title?.trim() || 'Untitled report'+ return capitalizeFirstLetter(displayConventionalCommitTitle(report.title, 'Untitled report'))}export function sourceLabel(source: string): string {