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(signals): omit unavailable status rows (#104866)

Mikayla Thompson21b756370c2f
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 921dc47b53dd..d05d5355468c 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -8865,9 +8865,9 @@ snapshots:
scenes-app-inbox-detail--run-ready--light:
hash: v1.k794b7964.2a7035c21bc396a44a81e18222d5f9a50f8ca650d47bc387b27a4c8ab72db7aa.BZ_qNCVpWT1v8Ov60-xHUyKzBwvr1BPNjoLZgjobYw4
scenes-app-inbox-detail--status-block--dark:
- hash: v1.k794b7964.148f4a5544247ea0b41319a952c04ac691cad44ea68cf54111d14fd2ed966d4e.oAn41_hwgL3qIFsXmxxXIDR8qaRZbw6dCeFA75ygoUY
+ hash: v1.k794b7964.189c608515e82f3e8a5728874697f6fa630dda7a2474111a1d845193f3f87355.TqbvlfdTdFj16UeVhMZk6TLE_Csl6Mtiv0QjDXzVg40
scenes-app-inbox-detail--status-block--light:
- hash: v1.k794b7964.d12f5544875dc4c95d22c295cd2cbf5ce68f0966037f289994fc8a3471c96cb1.6wrKJibO7lFJlx8oJdLLciZmA_mBZuiJ45tJvBV6ErY
+ hash: v1.k794b7964.a09f3a7fd36c862547c7662c940e7c031ec1411289caaf894568f3e11203d637.GjYjPtXXQJTxJu_k_3DCCvjezkXV5EsocqAtwBLrBYg
scenes-app-inbox-detail-follow-up-checks--every-state--dark:
hash: v1.k794b7964.db65be880b7ea05e9d05d47e6a55dd09cf96097fe23069a4ad58bee132d4a29f.5Ujk0VN9aRboEk8AT2Et2hucpwBeKvQ_cQVOhpPhDLM
scenes-app-inbox-detail-follow-up-checks--every-state--light:
diff --git a/products/signals/frontend/inbox/components/detail/ReportStatusSection.test.tsx b/products/signals/frontend/inbox/components/detail/ReportStatusSection.test.tsx
index 7f6b3c2f9890..1328a8bd1bc4 100644
--- a/products/signals/frontend/inbox/components/detail/ReportStatusSection.test.tsx
+++ b/products/signals/frontend/inbox/components/detail/ReportStatusSection.test.tsx
@@ -1,6 +1,6 @@
import '@testing-library/jest-dom'
-import { render, screen } from '@testing-library/react'
+import { render, screen, within } from '@testing-library/react'
import { makeReport } from '../../__mocks__/inboxMocks'
import { SignalReportStatus } from '../../types'
@@ -89,8 +89,8 @@ describe('ReportStatusSection', () => {
expect(container).not.toHaveTextContent('Pull request')
})
- it('does not imply approval when GitHub has no review decision', () => {
- render(
+ it('hides the review row when GitHub has no review decision', () => {
+ const { container } = render(
<ReportStatusSection
report={makeReport({
pull_requests: [
@@ -110,6 +110,33 @@ describe('ReportStatusSection', () => {
/>
)
- expect(screen.getByText('Review unavailable')).toBeInTheDocument()
+ expect(within(container).getByText('Open')).toBeInTheDocument()
+ expect(within(container).queryByText('Review')).not.toBeInTheDocument()
+ expect(within(container).queryByText('Review unavailable')).not.toBeInTheDocument()
+ })
+
+ it('hides the merged time row when GitHub has no merge time', () => {
+ const { container } = render(
+ <ReportStatusSection
+ report={makeReport({
+ pull_requests: [
+ {
+ id: 'pr-1',
+ url: 'https://github.com/example/app/pull/42',
+ state: 'merged',
+ merged: true,
+ review_decision: null,
+ merged_at: null,
+ claim_id: null,
+ attached_at: null,
+ attached_by: null,
+ },
+ ],
+ })}
+ />
+ )
+
+ expect(within(container).getAllByText('Merged')).toHaveLength(1)
+ expect(within(container).queryByText('Time unavailable')).not.toBeInTheDocument()
})
})
diff --git a/products/signals/frontend/inbox/components/detail/ReportStatusSection.tsx b/products/signals/frontend/inbox/components/detail/ReportStatusSection.tsx
index 368ece82fd5c..7e4dc9859351 100644
--- a/products/signals/frontend/inbox/components/detail/ReportStatusSection.tsx
+++ b/products/signals/frontend/inbox/components/detail/ReportStatusSection.tsx
@@ -56,7 +56,7 @@ export function ReportStatusSection({
const trackerUrl = safeHttpUrl(report.tracker_issue_url ?? '')
return (
- <DetailSection icon={<IconInfo />} title="Status" rightSlot={rightSlot}>
+ <DetailSection icon={<IconInfo />} title="Status" rightSlot={rightSlot} collapsible>
<dl className="m-0 flex flex-col gap-2">
<StatusRow label="Report status">{STATUS_LABELS[report.status] ?? report.status}</StatusRow>
{externalClaim && <StatusRow label="In progress by">{externalClaim}</StatusRow>}
@@ -64,9 +64,6 @@ export function ReportStatusSection({
{pullRequests.map((pullRequest, index) => {
const prUrl = safeHttpUrl(pullRequest.url)
const prRef = prUrl ? parsePrUrlParts(prUrl) : null
- const reviewDecision = pullRequest.review_decision
- ? REVIEW_DECISIONS[pullRequest.review_decision]
- : 'Review unavailable'
const isOpen = pullRequest.state === 'open' || pullRequest.state === 'draft'
return (
@@ -90,14 +87,12 @@ export function ReportStatusSection({
<StatusRow label="Status">
{PULL_REQUEST_STATES[pullRequest.state] ?? PULL_REQUEST_STATES.unknown}
</StatusRow>
- {isOpen && <StatusRow label="Review">{reviewDecision}</StatusRow>}
- {pullRequest.state === 'merged' && (
+ {isOpen && pullRequest.review_decision && (
+ <StatusRow label="Review">{REVIEW_DECISIONS[pullRequest.review_decision]}</StatusRow>
+ )}
+ {pullRequest.state === 'merged' && pullRequest.merged_at && (
<StatusRow label="Merged">
- {pullRequest.merged_at ? (
- <TZLabel time={pullRequest.merged_at} timestampStyle="absolute" />
- ) : (
- <span className="text-tertiary">Time unavailable</span>
- )}
+ <TZLabel time={pullRequest.merged_at} timestampStyle="absolute" />
</StatusRow>
)}
</div>