From 0a0d9e3e6af26d0c9995895d432af7d93a4cf4f6 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Thu, 28 May 2026 12:29:00 +0100 Subject: [PATCH 1/2] feat(mobile): show relative timestamp on inbox signal cards Mirrors the desktop change (PostHog/code#2240): each signal card on the report detail screen now displays a short relative timestamp ("2h ago", "3d ago") in the header, sourced from the signal's own timestamp. Reuses the existing `formatRelativeTime` util from `@/lib/format` rather than introducing a new component, since the desktop's `` wrapper exists mainly to add a tooltip that has no native mobile equivalent. Generated-By: PostHog Code Task-Id: 20e1fb88-d6bc-4c56-ba14-468a32bd491b --- .../src/features/inbox/components/SignalCard.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/features/inbox/components/SignalCard.tsx b/apps/mobile/src/features/inbox/components/SignalCard.tsx index 6ed9845419..d29135bb32 100644 --- a/apps/mobile/src/features/inbox/components/SignalCard.tsx +++ b/apps/mobile/src/features/inbox/components/SignalCard.tsx @@ -16,6 +16,7 @@ import { import { useState } from "react"; import { Linking, Pressable, View } from "react-native"; import { MarkdownText } from "@/features/chat/components/MarkdownText"; +import { formatRelativeTime } from "@/lib/format"; import { useThemeColors } from "@/lib/theme"; import type { Signal, SignalFindingContent } from "../types"; @@ -207,6 +208,9 @@ export function SignalCard({ signal, finding }: SignalCardProps) { const externalUrl = issueUrl ?? ticketUrl ?? null; + const timestampMs = signal.timestamp ? Date.parse(signal.timestamp) : NaN; + const hasTimestamp = !Number.isNaN(timestampMs); + return ( {/* Header */} @@ -215,9 +219,18 @@ export function SignalCard({ signal, finding }: SignalCardProps) { product={signal.source_product} color={themeColors.gray[10]} /> - + {sourceLine(signal)} + + {hasTimestamp && ( + + {formatRelativeTime(timestampMs)} + + )} {verified !== undefined && } From 0cc7a41bfd687e7e3efcb1b1bd4bfbf619079192 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Thu, 28 May 2026 12:44:55 +0100 Subject: [PATCH 2/2] fix(mobile): hide signal timestamp when in the future MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `formatRelativeTime` doesn't bound-check negative diffs, so a server timestamp ahead of the device clock would render as e.g. `-120m ago`. Clamp at the caller — if the timestamp is in the future, just omit it. Generated-By: PostHog Code Task-Id: 20e1fb88-d6bc-4c56-ba14-468a32bd491b --- apps/mobile/src/features/inbox/components/SignalCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mobile/src/features/inbox/components/SignalCard.tsx b/apps/mobile/src/features/inbox/components/SignalCard.tsx index d29135bb32..ba8521a566 100644 --- a/apps/mobile/src/features/inbox/components/SignalCard.tsx +++ b/apps/mobile/src/features/inbox/components/SignalCard.tsx @@ -209,7 +209,7 @@ export function SignalCard({ signal, finding }: SignalCardProps) { const externalUrl = issueUrl ?? ticketUrl ?? null; const timestampMs = signal.timestamp ? Date.parse(signal.timestamp) : NaN; - const hasTimestamp = !Number.isNaN(timestampMs); + const hasTimestamp = !Number.isNaN(timestampMs) && timestampMs <= Date.now(); return (