: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(signals): show web report runs newest first (#120910)
Georgiy Tarasovce83fe438aac
diff --git a/docs/internal/signals-pr-lifecycle.md b/docs/internal/signals-pr-lifecycle.mdindex 66114896818c..4a57f5f5e6e8 100644--- a/docs/internal/signals-pr-lifecycle.md+++ b/docs/internal/signals-pr-lifecycle.md@@ -247,5 +247,7 @@ Missing data, failed checks, and inconclusive results do not establish that the## Opening a report task+The web report's Runs section lists linked tasks newest first, regardless of their purpose, using each task's first association with the report. Repository-selection tasks remain hidden.+When a report has a linked task run, the View task button opens it in the PostHog AI sidebar.The button fits its label, including when it appears below the Solution section.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 91b75822308a..9794506b4d8c 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -11455,17 +11455,17 @@ snapshots:scenes-app-inbox-detail--report-with-metrics--light:hash: v1.k794b7964.4de3d1ece62803b2df3384770fb41f5ffc7432cd12a3473282c5a64fce9d790c.qI80JMmo2_l87iPe57D4ANPDf52i7RPRCEdgnXiI1PAscenes-app-inbox-detail--run-failed--dark:- hash: v1.k794b7964.8ea3a3172853ee54499c2c6cfefce80607be334c6e811241d34287a6f765653c.-6vgVoBAALRraFupOI_QA0z0eBbSWQn1uYV0rckIjsg+ hash: v1.k794b7964.38fdff452ce25a9b505345dfd59c0bfa3065c8053fd1136793ddf73cbaba51c5.aG5Vu0yvoky1h-ANVIuJ1kegDqu4IX4Ob3TTFF1wEccscenes-app-inbox-detail--run-failed--light:- hash: v1.k794b7964.fc3316cfa56e2cb68215f1e5bedf0afff66d97dd89b3b6399eefa4f30631fc88.RjIHic-nM5H4gzyq0aIR_xBNKnPj34xD5ezDHtKNiDk+ hash: v1.k794b7964.08e731638d5d1f643a24d7f597bf18f04da5d179fddffb4906e99325ed4a7462.dTCTuY0UWjrAUZW22MuoyOBLFPS19g9rGqd68cJeb0wscenes-app-inbox-detail--run-in-progress--dark:- hash: v1.k794b7964.dc6d56db7348706b6b21c61c15ab0b46cebe1f34ed2e7d356a67f0b23d462e9b.fsMnFqNIFF6O4iJylI-LIlj1vW-0y_QNV6btMpC4WRw+ hash: v1.k794b7964.9f74262bfc830e4d972966608d071e56acd10ec3421e93a080a29ec8132097d3.15NUFTNhHAdFSCwzyFeyXfKWlXLYYWtzLE4NhGZkQyIscenes-app-inbox-detail--run-in-progress--light:- hash: v1.k794b7964.eed9654f6551d18c0707bb196c885034a571768e49a6a557e69a65b07744aaa2.EZQyoFOwlA_qgHVREpUKWDLQweNOk5tHOJt0rL3U_I0+ hash: v1.k794b7964.0e9c90443955e68e4df76a73cf602dfd94cc824ee8425bf7a21a670688001464.XiMAyuRQlAO1P74ZMgRrLUrbwuiF70dcriVLei2FxJMscenes-app-inbox-detail--run-ready--dark:- hash: v1.k794b7964.6d25562ee11eb3e2bc5ecf6aedff4fe058299de21db40a241d22ec348566b5e7.1QCX8kAJWvaKf9rBXs7O4S-9Nh9tbQR6zn2IL5ehZpo+ hash: v1.k794b7964.5efde06f51857a95b2a0f8144c9c61d02199f9c8568694a2519df4186c1908b4.qiirX9NLlP7jvVgVoemAwYzb2fE6weoAiFGrL2qb3Ucscenes-app-inbox-detail--run-ready--light:- hash: v1.k794b7964.2a7035c21bc396a44a81e18222d5f9a50f8ca650d47bc387b27a4c8ab72db7aa.BZ_qNCVpWT1v8Ov60-xHUyKzBwvr1BPNjoLZgjobYw4+ hash: v1.k794b7964.cca5538b606ba80f576dffcf667a47fbf765ae11be91bd80dd94b2f29ad79810.K5HimK01aiTMAfyrNciQ6VD_UpL3WDVvrNDOFOJGoYQscenes-app-inbox-detail--status-block--dark:hash: v1.k794b7964.189c608515e82f3e8a5728874697f6fa630dda7a2474111a1d845193f3f87355.TqbvlfdTdFj16UeVhMZk6TLE_Csl6Mtiv0QjDXzVg40scenes-app-inbox-detail--status-block--light:diff --git a/products/signals/frontend/inbox/components/detail/artefactTypes.ts b/products/signals/frontend/inbox/components/detail/artefactTypes.tsindex 09f3f03c805a..838fbd0e6f27 100644--- a/products/signals/frontend/inbox/components/detail/artefactTypes.ts+++ b/products/signals/frontend/inbox/components/detail/artefactTypes.ts@@ -415,9 +415,6 @@ export function artefactAttributionLabel(artefact: SignalReportArtefact): string/** A task↔report association's derived purpose. `other` covers custom-agent runs. */export type ReportTaskPurpose = 'research' | 'implementation' | 'other'-/** Sort order for linked-task rows: implementation first, then research, then everything else. */-export const PURPOSE_ORDER: ReportTaskPurpose[] = ['implementation', 'research', 'other']-export interface DerivedPurpose {purpose: ReportTaskPurposepurposeLabel: stringdiff --git a/products/signals/frontend/inbox/logics/inboxReportDetailLogic.test.ts b/products/signals/frontend/inbox/logics/inboxReportDetailLogic.test.tsindex 0d0f65818abf..1bc97cd32054 100644--- a/products/signals/frontend/inbox/logics/inboxReportDetailLogic.test.ts+++ b/products/signals/frontend/inbox/logics/inboxReportDetailLogic.test.ts@@ -31,6 +31,50 @@ const linkedTask = (purpose: ReportTaskPurpose, status: TaskRunStatus | null, pr}) as unknown as ReportTaskEntrydescribe('inboxReportDetailLogic', () => {+ it('orders report runs newest first across purposes using their first association', async () => {+ const runs = [+ { taskId: 'implementation-old', type: 'implementation', startedAt: '2026-01-01T01:00:00Z' },+ { taskId: 'research', type: 'research', startedAt: '2026-01-01T02:00:00Z' },+ { taskId: 'implementation-new', type: 'implementation', startedAt: '2026-01-01T03:00:00Z' },+ { taskId: 'scout', type: 'scout', startedAt: '2026-01-01T04:00:00Z' },+ { taskId: 'implementation-old', type: 'implementation', startedAt: '2026-01-01T05:00:00Z' },+ ]+ useMocks({+ get: {+ '/api/projects/:team_id/signals/reports/:id/feedback_state/': { sentiment: null, note: '' },+ '/api/projects/:team_id/signals/reports/:id/artefacts/': {+ results: runs.map(({ taskId, type, startedAt }, index) => ({+ id: `task-run-${index}`,+ type: 'task_run',+ content: { task_id: taskId, product: 'signals', type },+ created_at: startedAt,+ })),+ },+ '/api/projects/:team_id/signals/reports/:id/signals/': { signals: [] },+ '/api/projects/:team_id/signals/reports/:id/checks/': { results: [] },+ '/api/projects/:team_id/signals/reports/available_reviewers/': [],+ '/api/projects/:team_id/tasks/:id/': (req) => [+ 200,+ { id: req.params.id, latest_run: { status: TaskRunStatus.COMPLETED } },+ ],+ },+ })+ initKeaTests()+ const logic = inboxReportDetailLogic({ reportId: REPORT.id, report: REPORT })+ logic.mount()+ try {+ await expectLogic(logic).toFinishAllListeners()+ expect(logic.values.reportTasks?.map((entry) => entry.task.id)).toEqual([+ 'scout',+ 'implementation-new',+ 'research',+ 'implementation-old',+ ])+ } finally {+ logic.unmount()+ }+ })+describe('priority editing', () => {let logic: ReturnType<typeof inboxReportDetailLogic.build>diff --git a/products/signals/frontend/inbox/logics/inboxReportDetailLogic.ts b/products/signals/frontend/inbox/logics/inboxReportDetailLogic.tsindex 3e16cc425e55..6afb6a21c16b 100644--- a/products/signals/frontend/inbox/logics/inboxReportDetailLogic.ts+++ b/products/signals/frontend/inbox/logics/inboxReportDetailLogic.ts@@ -59,12 +59,7 @@ import type {import type { SignalNodeApi } from 'products/signals/frontend/generated/api.schemas'import type { SignalReportFeedbackSentimentEnumApi } from '../../generated/api.schemas'-import {- deriveTaskPurpose,- PURPOSE_ORDER,- ReportTaskPurpose,- TaskRunArtefactContent,-} from '../components/detail/artefactTypes'+import { deriveTaskPurpose, ReportTaskPurpose, TaskRunArtefactContent } from '../components/detail/artefactTypes'import {AvailableReviewerOption,buildAddReviewerOptions,@@ -924,11 +919,7 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([)return entries.filter((entry): entry is ReportTaskEntry => entry !== null)- .sort(- (a, b) =>- PURPOSE_ORDER.indexOf(a.purpose) - PURPOSE_ORDER.indexOf(b.purpose) ||- new Date(a.startedAt).getTime() - new Date(b.startedAt).getTime()- )+ .sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime())},},],