Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): show Working timer, Monitoring and Done in the thread list like desktop #13349

ClosedPESHian(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/13349/headopened View on GitHub

Showing 11 changed files with 59 additions and 19 deletions (loading 8).

x
0 of 11 viewed, 11 left
19 additions and 0 deletionsapps/mobile/src/features/threads/ThreadRouteScreen.tsxModified
View file
@@ -1,3 +1,6 @@
+import { resolveThreadVisitStamp } from "@t3tools/client-runtime/state/thread-status";
+​
+import { useMarkThreadVisited } from "./use-thread-visits";
import { makeTurnCommandMetadata } from "../../lib/commandMetadata";
import { enqueueThreadOutboxMessage } from "../../state/thread-outbox";
import {
@@ -336,6 +339,22 @@
} = useThreadSelection();
const selectedThreadDetailState = props.selectedThreadDetailState;
const selectedThreadDetail = Option.getOrNull(selectedThreadDetailState.data);
+ // Opening a thread stamps a visit so the list's Done label clears, and so a completion that
+ // lands after the reader leaves still signals. See resolveThreadVisitStamp for what is stamped.
+ // Focus-gated: this screen stays mounted under Files and Terminal, and a completion that lands
+ // while the reader is there has not been seen.
+ const markThreadVisited = useMarkThreadVisited();
+ const visitedThreadKey =
+ selectedThread === null
+ ? null
+ : scopedThreadKey(selectedThread.environmentId, selectedThread.id);
+ const visitedAt = selectedThread === null ? null : resolveThreadVisitStamp(selectedThread);
+ useFocusEffect(
+ useCallback(() => {
+ if (visitedThreadKey === null || visitedAt === null) return;
+ markThreadVisited(visitedThreadKey, visitedAt);
+ }, [markThreadVisited, visitedThreadKey, visitedAt]),
+ );
// "Load earlier turns" header state for windowed (paginated) thread loads.
const loadEarlierTurns = useMemo(() => {
if (selectedThread === null || !threadHasOlderTurns(selectedThreadDetailState)) {