Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(mobile): streaming re-renders less on the open thread screen #20963

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/20963/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 83 additions and 51 deletions.

x
0 of 3 viewed, 3 left
74 additions and 49 deletionsapps/mobile/src/features/threads/ThreadDetailScreen.tsxModified
View file
@@ -2,7 +2,11 @@
import { AsyncResult } from "effect/reactivity";
import * as Dialog from "../../components/ui/Dialog";
import { useAtomValue } from "@effect/atom-react";
-import { useChildThreadInputs, useThreadReportedModelSelection } from "../../state/entities";
+import {
+ useChildThreadInputs,
+ useThreadReportedModelSelection,
+ useThreadShell,
+} from "../../state/entities";
import { UsageLimitRecoveryCard } from "./UsageLimitRecoveryCard";
import { useNavigation } from "@react-navigation/native";
import type { WorktreeSetupCardProps } from "./worktree-setup-card";
@@ -319,6 +323,70 @@
easing: Easing.out(Easing.cubic),
​
+// The visit watermark follows the shell's updatedAt, which ticks while a run
+// streams. Keeping it in a leaf lets the screen read the quiet shell.
+function ThreadVisitWatermark(props: {
+ readonly environmentId: EnvironmentId;
+ readonly selectedThread: EnvironmentThreadShell;
+ readonly showContent: boolean;
+}) {
+ const liveThread = useThreadShell({
+ environmentId: props.environmentId,
+ threadId: props.selectedThread.id,
+ });
+ const thread = liveThread ?? props.selectedThread;