The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 11:00 UTC
fix(mobile): show thread sync status in the header, not above the composer (#37076)
Julius Marminge committed
Nov 14, 2026 at 23:02 UTC
d738edf401ec3c82a5e9a1991cfa164d8600a573
6 files changed
+51
-50
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
-19
@@ -31,7 +31,6 @@ import { queuedRunEditBlockedReason } from "@t3tools/client-runtime/queued-run-e
31
import {
32
childThreadInputsTitle,
33
type CodexFeedbackSubmission,
34
- type EnvironmentThreadStatus,
34
} from "@t3tools/client-runtime/state/threads";
35
import { useKeyboardScrollToEnd } from "@legendapp/list/keyboard";
36
import { resolveProviderSkillsForCwd } from "@t3tools/client-runtime/providerSkills";
@@ -269,7 +268,6 @@ export interface ThreadDetailScreenProps {
268
readonly respondingUserInputId: RuntimeRequestId | null;
269
readonly connectionStateLabel: EnvironmentConnectionPhase;
270
readonly connectionAwaitingApproval?: boolean;
272
- readonly threadSyncStatus?: EnvironmentThreadStatus;
271
readonly historyControls?: ThreadFeedHistoryControls;
272
readonly activeThreadBusy: boolean;
273
readonly canStopThread: boolean;
@@ -568,20 +566,6 @@ function ThreadDetailBody(
566
);
567
const composerKeyboardOffset = composerBottomInset;
568
const contentPresentationKind = props.contentPresentation.kind;
571
- const realThreadSyncLabel = (() => {
572
- switch (props.threadSyncStatus) {
573
- case "empty":
574
- case "cached":
575
- case "synchronizing":
576
- if (contentPresentationKind === "ready") {
577
- return "Syncing messages...";
578
- }
579
- return contentPresentationKind === "loading" ? "Loading messages..." : null;
580
- default:
581
- return null;
582
- }
583
- })();
584
- const threadSyncLabel = useDelayedStatus(selectedThreadKey, realThreadSyncLabel);
569
const connectionRetrying =
570
props.connectionStateLabel === "connecting" || props.connectionStateLabel === "reconnecting";
571
const retryError = connectionRetrying ? props.connectionError : null;
@@ -813,9 +797,6 @@ function ThreadDetailBody(
797
if (props.creationState?.kind === "failed") {
798
return null;
799
}
816
- if (threadSyncLabel !== null) {
817
- return { kind: "syncing", label: threadSyncLabel };
818
- }
800
const childInput = childThreadInputs[0];
801
if (childInput && contentPresentationKind === "ready") {
802
return {
apps/mobile/src/features/threads/ThreadRouteScreen.tsx
+33
-13
@@ -51,6 +51,7 @@ import { vcsEnvironment } from "../../state/vcs";
51
import { EmptyState } from "../../components/ui/EmptyState";
52
import { LoadingScreen } from "../../components/LoadingScreen";
53
import { scopedThreadKey } from "../../lib/scopedEntities";
54
+import { useDelayedStatus } from "../../lib/useDelayedStatus";
55
import { scopeThreadRef } from "@t3tools/client-runtime/environment";
56
import { useThreadShell } from "../../state/entities";
57
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
@@ -95,7 +96,10 @@ import { resolveLatestMergeBackRun } from "@t3tools/client-runtime/state/thread-
96
import { threadEnvironment } from "../../state/threads";
97
import { EMPTY_ENVIRONMENT_THREAD_STATE } from "@t3tools/client-runtime/state/threads";
98
import { useProjects } from "../../state/entities";
98
-import { projectThreadContentPresentation } from "./threadContentPresentation";
99
+import {
100
+ projectThreadContentPresentation,
101
+ threadSyncStatusLabel,
102
+} from "./threadContentPresentation";
103
import {
104
Inspector,
105
useAdaptiveWorkspaceLayout,
@@ -290,8 +294,11 @@ function LiveThreadRouteController(props: ThreadRouteScreenProps) {
294
}
295
296
if (selectedThread !== null && selectedThreadKey === routeThreadKey) {
293
- return withInspectorHeader(
294
- <ThreadRouteContent {...props} selectedThreadDetailState={selectedThreadDetailState} />,
297
+ // ThreadRouteContent draws its own inspector header so it can show the sync status.
298
+ return (
299
+ <InspectorHeaderShownContext value={props.inspectorPresentation !== undefined}>
300
+ <ThreadRouteContent {...props} selectedThreadDetailState={selectedThreadDetailState} />
301
+ </InspectorHeaderShownContext>
302
);
303
}
304
@@ -944,14 +951,6 @@ function ThreadRouteContent(
951
serverOwned: false,
952
};
953
})();
947
- if (!environmentId || !threadId) {
948
- return <OpeningThreadLoadingScreen />;
949
- }
950
-
951
- if (!selectedThread) {
952
- return <OpeningThreadLoadingScreen />;
953
- }
954
-
954
// Queued creation displays its prompt before server creation; temporary not-found is expected.
955
const contentPresentation =
956
creationState !== null
@@ -962,6 +961,27 @@ function ThreadRouteContent(
961
detailDeleted: selectedThreadDetailState.status === "deleted",
962
connectionState: routeConnectionState,
963
});
964
+ // Shown in the header subtitle so the composer's status slot doesn't jump while history syncs.
965
+ const threadSyncLabel = useDelayedStatus(
966
+ selectedThread === null ? "" : scopedThreadKey(selectedThread.environmentId, selectedThread.id),
967
+ threadSyncStatusLabel(selectedThreadDetailState.status, contentPresentation.kind),
968
+ );
969
+ const inspectorHeader = props.inspectorPresentation ? (
970
+ <ThreadInspectorHeader
971
+ title={selectedThread?.title ?? "Thread"}
972
+ subtitle={threadSyncLabel ?? undefined}
973
+ {...props.inspectorPresentation}
974
+ />
975
+ ) : null;
976
+ if (!environmentId || !threadId || !selectedThread) {
977
+ return (
978
+ <>
979
+ {inspectorHeader}
980
+ <OpeningThreadLoadingScreen />
981
+ </>
982
+ );
983
+ }
984
+
985
const serverConfig = routeEnvironmentRuntime?.serverConfig ?? null;
986
const renderThreadRouteBody = () => (
987
<>
@@ -977,7 +997,7 @@ function ThreadRouteContent(
997
props.inspectorPresentation ? null : (
998
<ThreadHeader
999
title={selectedThread.title}
980
- subtitle={headerSubtitle}
1000
+ subtitle={threadSyncLabel ?? headerSubtitle}
1001
gitControls={threadGitControlProps}
1002
hasThreadCwd={selectedThreadCwd !== null}
1003
inspectorMode={inspectorMode}
@@ -1043,7 +1063,6 @@ function ThreadRouteContent(
1063
respondingUserInputId={requests.respondingUserInputId}
1064
connectionStateLabel={routeConnectionState}
1065
connectionAwaitingApproval={routeEnvironmentRuntime?.connectionAwaitingApproval === true}
1046
- threadSyncStatus={selectedThreadDetailState.status}
1066
historyControls={historyControls}
1067
activeThreadBusy={composer.activeThreadBusy}
1068
canStopThread={awaitingBootstrapTurn || composer.interruptibleRunId !== null}
@@ -1092,6 +1111,7 @@ function ThreadRouteContent(
1111
1112
return (
1113
<>
1114
+ {inspectorHeader}
1115
{!props.inspectorPresentation && inspectorContent ? (
1116
<Inspector
1117
// A route's own inspector (files) opens once per thread; going back keeps the user's choice.
apps/mobile/src/features/threads/floating-working-control.tsx
-15
@@ -427,21 +427,6 @@ function FloatingStatusLabel(props: {
427
</StatusLabelRow>
428
);
429
}
430
- if (props.status.kind === "syncing") {
431
- return (
432
- <StatusLabelRow
433
- key="syncing"
434
- accessibilityLabel={props.status.label}
435
- className="gap-2"
436
- onLayout={props.onLayout}
437
- >
438
- <AppActivityIndicator size="small" colorClassName="accent-icon-muted" />
439
- <Text className="shrink font-t3-medium text-xs text-foreground" numberOfLines={1}>
440
- {props.status.label}
441
- </Text>
442
- </StatusLabelRow>
443
- );
444
- }
430
if (props.status.kind === "compacting") {
431
return <CompactingLabel key="compacting" onLayout={props.onLayout} />;
432
}
apps/mobile/src/features/threads/floating-working-status.ts
-1
@@ -10,7 +10,6 @@ export interface FloatingStatusAction {
10
11
export type FloatingWorkingStatus =
12
| { readonly kind: "working"; readonly environmentId: EnvironmentId; readonly startedAt: string }
13
- | { readonly kind: "syncing"; readonly label: string }
13
| { readonly kind: "compacting" }
14
| {
15
readonly kind: "child-input";
apps/mobile/src/features/threads/thread-inspector-preview.tsx
+8
-2
@@ -22,12 +22,13 @@ export type ThreadInspectorPresentation =
22
| { readonly onClose: () => void };
23
24
export function ThreadInspectorHeader(
25
- props: ThreadInspectorPresentation & { readonly title: string },
25
+ props: ThreadInspectorPresentation & { readonly title: string; readonly subtitle?: string },
26
) {
27
if ("onMaximize" in props) {
28
return (
29
<AppBar
30
title={props.title}
31
+ subtitle={props.subtitle}
32
actions={[
33
{
34
accessibilityLabel: "Maximize thread",
@@ -39,7 +40,12 @@ export function ThreadInspectorHeader(
40
);
41
}
42
return (
42
- <SheetHeader title={props.title} onClose={props.onClose} accessibilityLabel="Close thread" />
43
+ <SheetHeader
44
+ title={props.title}
45
+ subtitle={props.subtitle}
46
+ onClose={props.onClose}
47
+ accessibilityLabel="Close thread"
48
+ />
49
);
50
}
51
apps/mobile/src/features/threads/threadContentPresentation.ts
+10
@@ -1,4 +1,5 @@
1
import { type EnvironmentConnectionPhase } from "@t3tools/client-runtime/connection";
2
+import type { EnvironmentThreadStatus } from "@t3tools/client-runtime/state/threads";
3
4
export type ThreadContentPresentation =
5
| { readonly kind: "ready" }
@@ -45,3 +46,12 @@ export function projectThreadContentPresentation(input: {
46
detail: "Reconnect this environment to load the conversation.",
47
};
48
}
49
+
50
+export function threadSyncStatusLabel(
51
+ status: EnvironmentThreadStatus,
52
+ presentation: ThreadContentPresentation["kind"],
53
+): string | null {
54
+ if (status !== "empty" && status !== "cached" && status !== "synchronizing") return null;
55
+ if (presentation === "ready") return "Syncing messages…";
56
+ return presentation === "loading" ? "Loading messages…" : null;
57
+}