Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve automatic settlement timestamps #9254

Mergedeimexdev(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/9254/headmerged by juliusmarminge View on GitHub

Showing 22 changed files with 39 additions and 16 deletions (loading 19).

x
0 of 22 viewed, 22 left
9 additions and 2 deletionsapps/mobile/src/features/threads/thread-list-v2-items.tsxModified
View file
@@ -4,6 +4,7 @@
} from "@t3tools/client-runtime/state/shell";
import type { EnvironmentThreadSearchMatch } from "@t3tools/client-runtime/state/thread-search";
import { canSnooze, resolveSnoozePresets } from "@t3tools/client-runtime/state/thread-settled";
+import { resolveSettledThreadTimestamp } from "@t3tools/client-runtime/state/thread-sort";
import type { MenuAction } from "@react-native-menu/menu";
import { memo, useCallback, useEffect, useMemo, useState, type ComponentProps } from "react";
import { Alert, Platform, Pressable, useWindowDimensions, View } from "react-native";
@@ -406,7 +407,13 @@
​
const status = resolveThreadListV2Status(thread);
const statusLabel = STATUS_LABEL_BY_STATUS[status];
- const timeLabel = threadTimeLabel(thread);
+ // Settled rows label by the same stamp they sort by, so order and label
+ // can't disagree. updatedAt is always present, so the resolver never
+ // returns null here.
+ const settledTimestamp =
+ variant === "slim" && !snoozedRow ? resolveSettledThreadTimestamp(thread) : null;
+ const timeLabel =
+ settledTimestamp !== null ? relativeTime(settledTimestamp) : threadTimeLabel(thread);
​
const handleDelete = useCallback(() => onDeleteThread(thread), [onDeleteThread, thread]);
const handleRegenerateTitle = useCallback(
@@ -892,7 +899,7 @@
{snoozedRow && props.snoozeWakeLabelText !== undefined
? props.snoozeWakeLabelText
- : relativeTime(thread.latestUserMessageAt ?? thread.updatedAt ?? thread.createdAt)}