@devries-cameron20 / t3code-1 / commits / 08a3909406
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix: show latest reply age in active thread rows (#31825)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

shivam committed Nov 7, 2026 at 08:42 UTC 08a3909406bf010f2126fe9c75cadd93fa42ee7c
4 files changed +38 -9
apps/mobile/src/features/threads/threadListV2.test.ts
+24
@@ -1562,6 +1562,30 @@ describe("buildThreadListV2ListItems row-state stamps", () => {
1562 });
1563 const allEnvironments = new Set<EnvironmentId>([environmentId]);
1564
1565 + it("ages a read row from its latest reply", () => {
1566 + using _timers = { [Symbol.dispose]: () => vi.useRealTimers() };
1567 + vi.useFakeTimers({ now: BASE_MS });
1568 + const label = (latestUserMessageAt: string, completedAt: string) => {
1569 + const thread = makeThread({
1570 + id: ThreadId.make("stamp-read"),
1571 + title: "stamp read",
1572 + latestUserMessageAt,
1573 + lastVisitedAt: isoAt(BASE_MS),
1574 + latestRun: {
1575 + runId: RunId.make("stamp-read-run"),
1576 + status: "completed",
1577 + requestedAt: latestUserMessageAt,
1578 + startedAt: latestUserMessageAt,
1579 + completedAt,
1580 + assistantMessageId: null,
1581 + },
1582 + });
1583 + const row = buildTickList([thread], BASE_MS, [])[0]!;
1584 + return row.type === "v2-thread" ? row.timeLabel : null;
1585 + };
1586 + expect(label(isoAt(BASE_MS - 40 * MINUTE_MS), isoAt(BASE_MS - 2 * MINUTE_MS))).toBe("2m");
1587 + });
1588 +
1589 it("stamps queued outbox messages onto the matching row and notices removal", () => {
1590 const queued = buildTickList([readyThread, settledThread], BASE_MS, [], {
1591 queuedThreadKeys: new Set([`${environmentId}:stamp-ready`]),
apps/mobile/src/features/threads/threadListV2.ts
+2 -1
@@ -25,6 +25,7 @@ import {
25 import {
26 sortActiveThreadsByOrderKey,
27 resolveSettledThreadTimestamp,
28 + resolveThreadActivityTimestamp,
29 sortPinnedThreadsByOrderKey,
30 sortSettledThreads,
31 } from "@t3tools/client-runtime/state/thread-sort";
@@ -513,7 +514,7 @@ function resolveThreadListV2ItemTimeLabel(
514 const settledTimestamp =
515 variant === "slim" && !snoozed ? resolveSettledThreadTimestamp(thread) : null;
516 return relativeTime(
516 - settledTimestamp ?? thread.latestUserMessageAt ?? thread.updatedAt ?? thread.createdAt,
517 + settledTimestamp ?? resolveThreadActivityTimestamp(thread) ?? thread.createdAt,
518 );
519 }
520
apps/web/src/components/sidebar/SidebarThreadRow.tsx
+7 -8
@@ -13,7 +13,10 @@ import {
13 QUEUED_TURN_START_GRACE_MS,
14 } from "@t3tools/client-runtime/state/thread-settled";
15 import { formatDiffCount } from "@t3tools/client-runtime/diff-count";
16 -import { resolveSettledThreadTimestamp } from "@t3tools/client-runtime/state/thread-sort";
16 +import {
17 + resolveSettledThreadTimestamp,
18 + resolveThreadActivityTimestamp,
19 +} from "@t3tools/client-runtime/state/thread-sort";
20 import { type EnvironmentThreadSearchMatch } from "@t3tools/client-runtime/state/thread-search";
21 import {
22 formatWorkingDurationLabel,
@@ -145,10 +148,6 @@ function RelativeTimeLabel(props: { timestamp: string | null }) {
148 );
149 }
150
148 -function threadTimeTimestamp(thread: SidebarThreadSummary): string {
149 - return thread.latestUserMessageAt ?? thread.updatedAt;
150 -}
151 -
151 function JumpHintBadge(props: { label: string }) {
152 return (
153 <Kbd aria-hidden data-jump-hint>
@@ -1318,7 +1317,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
1317 timestamp={
1318 variantAction === "unsettle"
1319 ? resolveSettledThreadTimestamp(thread)
1321 - : threadTimeTimestamp(thread)
1320 + : resolveThreadActivityTimestamp(thread)
1321 }
1322 />
1323 </span>
@@ -1513,7 +1512,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
1512 </span>
1513 )
1514 ) : (
1516 - <RelativeTimeLabel timestamp={threadTimeTimestamp(thread)} />
1515 + <RelativeTimeLabel timestamp={resolveThreadActivityTimestamp(thread)} />
1516 )}
1517 </span>
1518 {props.settlementSupported || showSnoozeButton || hasUnsentDraft ? (
@@ -1752,7 +1751,7 @@ export const SidebarSearchResultRow = memo(function SidebarSearchResultRow(props
1751 />
1752 </span>
1753 <span className="w-8 shrink-0 text-right text-xs text-muted-foreground/55 tabular-nums">
1755 - <RelativeTimeLabel timestamp={threadTimeTimestamp(thread)} />
1754 + <RelativeTimeLabel timestamp={resolveThreadActivityTimestamp(thread)} />
1755 </span>
1756 </span>
1757 {props.searchMatch ? (
packages/client-runtime/src/state/threadSort.ts
+5
@@ -27,7 +27,12 @@ export function resolveSettledThreadTimestamp(thread: SettledThreadTimestampInpu
27 if (thread.settledAt != null && toSortableTimestamp(thread.settledAt) !== null) {
28 return thread.settledAt;
29 }
30 + return resolveThreadActivityTimestamp(thread);
31 +}
32
33 +export function resolveThreadActivityTimestamp(
34 + thread: Pick<EnvironmentThreadShell, "latestUserMessageAt" | "latestRun" | "updatedAt">,
35 +): string | null {
36 let latest: string | null = null;
37 let latestMs = Number.NEGATIVE_INFINITY;
38 for (const candidate of [