@devries-cameron20 / t3code Mirror · read-only / commits / 747ed9c5b1
Fork 0

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, 09:45 UTC

fix(mobile): show background work at the end of the feed, and even out its spacing (#37767)

Julius Marminge committed Nov 16, 2026 at 13:20 UTC 747ed9c5b1d9b2d41638ef94003bda1d996f4353
5 files changed +86 -91
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+35 -31
@@ -190,7 +190,7 @@ import {
190 FloatingWorkingControl,
191 } from "./floating-working-control";
192 import { connectionFloatingStatus, type FloatingWorkingStatus } from "./floating-working-status";
193 -import type { ThreadLifecycleEvent } from "./thread-context-divider";
193 +import type { ThreadStatusLineModel } from "./thread-context-divider";
194 import {
195 derivePendingUserInputMaxHeight,
196 ESTIMATED_KEYBOARD_HEIGHT,
@@ -341,6 +341,7 @@ function ColumnWidth(props: { readonly width: number | null; readonly children:
341 );
342 }
343 const USAGE_LIMITS_PANEL_GAP = 12;
344 +const FEED_END_GAP = 12;
345 const USAGE_LIMITS_PANEL_MIN_HEIGHT = 44;
346
347 const USER_INPUT_TOGGLE_TIMING = {
@@ -738,7 +739,31 @@ function ThreadDetailBody(
739 Dialog.alert("Pi", props.extensionStatuses?.map((status) => status.text).join("\n\n")),
740 }
741 : null;
741 - const lifecycleEvent = ((): ThreadLifecycleEvent | null => {
742 + const backgroundLine = ((): ThreadStatusLineModel | null => {
743 + if (pendingBackgroundWork === null || contentPresentationKind !== "ready") return null;
744 + return {
745 + key: "background",
746 + icon: pendingBackgroundWork.waiting ? "person.2" : "terminal",
747 + label: pendingBackgroundWork.title,
748 + accessibilityLabel: `${pendingBackgroundWork.title}: ${pendingBackgroundWork.items
749 + .map((item) => item.label)
750 + .join(", ")}`,
751 + onOpen: () => {
752 + Keyboard.dismiss();
753 + navigation.navigate("ThreadBackgroundWork", {
754 + environmentId: props.environmentId,
755 + threadId: props.selectedThread.id,
756 + });
757 + },
758 + action: {
759 + label: statusPending ? "Stopping..." : "Stop",
760 + accessibilityLabel: "Stop background work",
761 + disabled: !props.canOperateThread || statusPending,
762 + onPress: () => void runStatusAction("stop"),
763 + },
764 + };
765 + })();
766 + const lifecycleLine = ((): ThreadStatusLineModel | null => {
767 if (contentPresentationKind !== "ready" || !(lifecycleSnoozed || settled || woke)) return null;
768 const actionLabel = lifecycleSnoozed ? "Wake now" : settled ? "Un-settle" : "Dismiss";
769 const wake =
@@ -746,7 +771,8 @@ function ThreadDetailBody(
771 ? snoozeWakeLabel(snoozedUntil, { now: lifecycleNow })
772 : "now";
773 return {
749 - state: lifecycleSnoozed ? "snoozed" : settled ? "settled" : "woke",
774 + key: "lifecycle",
775 + icon: settled && !lifecycleSnoozed ? "checkmark.circle" : "alarm",
776 label: lifecycleSnoozed
777 ? wake === "now"
778 ? "Snoozed"
@@ -769,6 +795,7 @@ function ThreadDetailBody(
795 },
796 };
797 })();
798 + const statusLines = [backgroundLine, lifecycleLine].filter((line) => line !== null);
799 const floatingStatus = ((): FloatingWorkingStatus | null => {
800 const connectionStatus = connectionFloatingStatus({
801 connectionError: props.connectionError,
@@ -828,29 +855,6 @@ function ThreadDetailBody(
855 },
856 };
857 }
831 - if (pendingBackgroundWork !== null && contentPresentationKind === "ready") {
832 - return {
833 - kind: "background",
834 - label: pendingBackgroundWork.title,
835 - accessibilityLabel: `${pendingBackgroundWork.title}: ${pendingBackgroundWork.items
836 - .map((item) => item.label)
837 - .join(", ")}`,
838 - waiting: pendingBackgroundWork.waiting,
839 - onPress: () => {
840 - Keyboard.dismiss();
841 - navigation.navigate("ThreadBackgroundWork", {
842 - environmentId: props.environmentId,
843 - threadId: props.selectedThread.id,
844 - });
845 - },
846 - action: {
847 - label: statusPending ? "Stopping..." : "Stop",
848 - accessibilityLabel: "Stop background work",
849 - disabled: !props.canOperateThread || statusPending,
850 - onPress: () => void runStatusAction("stop"),
851 - },
852 - };
853 - }
858 if (props.selectedThread.goal !== null && contentPresentationKind === "ready") {
859 const goal = presentProviderGoal(props.selectedThread.goal, false);
860 return {
@@ -1119,7 +1123,8 @@ function ThreadDetailBody(
1123 questionInFlow
1124 ? 0
1125 : contentInsetEndAdjustment.value +
1122 - floatingControlCoverage.value +
1126 + // The feed's last row keeps a gap above the composer; the status row grows from it.
1127 + Math.max(FEED_END_GAP, floatingControlCoverage.value) +
1128 (userInputCoverageApplies
1129 ? userInputInsetProgress.value * userInputCardCoverage.value
1130 : 0),
@@ -1448,7 +1453,7 @@ function ThreadDetailBody(
1453 workspaceRoot={props.threadCwd}
1454 feed={props.selectedThreadFeed}
1455 pendingHandoff={props.pendingHandoff}
1451 - lifecycleEvent={lifecycleEvent}
1456 + statusLines={statusLines}
1457 worktreeSetup={props.worktreeSetup}
1458 setupWorkingStartedAt={props.setupWorkingStartedAt}
1459 preparingWorktree={
@@ -1483,7 +1488,7 @@ function ThreadDetailBody(
1488 questionInFlow
1489 ? 0
1490 : estimatedOverlayHeight +
1486 - (showFloatingStatus ? FLOATING_WORKING_CONTROL_COVERAGE : 0)
1491 + (showFloatingStatus ? FLOATING_WORKING_CONTROL_COVERAGE : FEED_END_GAP)
1492 }
1493 contentMaxWidth={contentMaxWidth}
1494 historyControls={props.historyControls}
@@ -1575,8 +1580,7 @@ function ThreadDetailBody(
1580 colorScheme={isDarkMode ? "dark" : "light"}
1581 status={floatingStatus}
1582 extensionStatus={
1578 - floatingStatus !== null &&
1579 - (floatingStatus.kind === "background" || floatingStatus.kind === "goal")
1583 + floatingStatus !== null && floatingStatus.kind === "goal"
1584 ? extensionStatus
1585 : null
1586 }
apps/mobile/src/features/threads/ThreadFeed.tsx
+11 -9
@@ -23,8 +23,8 @@ import {
23 import { formatProviderSkillDisplayName } from "@t3tools/shared/inlineSkills";
24 import {
25 ThreadContextDivider,
26 - ThreadLifecycleLine,
27 - type ThreadLifecycleEvent,
26 + ThreadStatusLine,
27 + type ThreadStatusLineModel,
28 } from "./thread-context-divider";
29 import {
30 ThreadHandoffDivider,
@@ -362,7 +362,8 @@ export interface ThreadFeedProps {
362 readonly workspaceRoot?: string | null;
363 readonly feed: ReadonlyArray<ThreadFeedEntry>;
364 readonly pendingHandoff?: HandoffEndpoints | null;
365 - readonly lifecycleEvent?: ThreadLifecycleEvent | null;
365 + /** Thread states that close the feed: background work, then snooze or settle. */
366 + readonly statusLines?: ReadonlyArray<ThreadStatusLineModel>;
367 readonly contentPresentation: ThreadContentPresentation;
368 readonly latestRun: ThreadFeedLatestRun | null;
369 readonly activeWorkStartedAt: string | null;
@@ -1604,7 +1605,7 @@ function ThreadAutomationMessageRow(props: {
1605 const summary = taskTitle ?? props.text.trim().split(/\r?\n/, 1)[0] ?? "";
1606
1607 return (
1607 - <View className="mb-5 items-end">
1608 + <View className="mb-2 items-end">
1609 <View
1610 className="min-w-0 rounded-[20px]"
1611 style={{
@@ -2218,7 +2219,8 @@ function renderFeedEntry(
2219 visibleAttachments.length + pendingBubbleAttachments.length > 0);
2220 return (
2221 <Animated.View
2221 - className={cn("items-end", props.userMessageGrouping.groupedWithNext ? "mb-1" : "mb-5")}
2222 + // A prompt sits close to its own response; the answer's margin separates turns.
2223 + className={cn("items-end", props.userMessageGrouping.groupedWithNext ? "mb-1" : "mb-2")}
2224 {...(enterAnimated ? { entering: FadeInDown.duration(220) } : {})}
2225 >
2226 {presentation.attribution === "t3code" ? (
@@ -4160,7 +4162,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
4162 </>
4163 }
4164 ListFooterComponent={
4163 - props.pendingHandoff || props.lifecycleEvent ? (
4165 + props.pendingHandoff || props.statusLines?.length ? (
4166 <>
4167 {props.pendingHandoff ? (
4168 <ThreadHandoffDivider
@@ -4171,9 +4173,9 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
4173 label="Context handoff pending"
4174 />
4175 ) : null}
4174 - {props.lifecycleEvent ? (
4175 - <ThreadLifecycleLine event={props.lifecycleEvent} iconColor={iconSubtleColor} />
4176 - ) : null}
4176 + {props.statusLines?.map((line) => (
4177 + <ThreadStatusLine key={line.key} line={line} iconColor={iconSubtleColor} />
4178 + ))}
4179 </>
4180 ) : null
4181 }
apps/mobile/src/features/threads/floating-working-control.tsx
+2 -28
@@ -81,10 +81,7 @@ export function FloatingWorkingControl(props: {
81 const extensionStatus = props.extensionStatus ?? null;
82 const extensionOnly = props.status?.kind === "extension";
83 const useGlass = NATIVE_LIQUID_GLASS_SUPPORTED && !extensionOnly;
84 - const action =
85 - props.status?.kind === "background" || props.status?.kind === "stop"
86 - ? props.status.action
87 - : null;
84 + const action = props.status?.kind === "stop" ? props.status.action : null;
85 const [agentsWidth, setAgentsWidth] = useState(0);
86 const hasQueue = props.queuedCount > 0;
87 const hasPreview = props.devicePreview !== null || props.browserPreview !== null;
@@ -164,8 +161,7 @@ export function FloatingWorkingControl(props: {
161 const statusInteractive =
162 props.status?.kind === "connection" ||
163 props.status?.kind === "extension" ||
167 - props.status?.kind === "child-input" ||
168 - props.status?.kind === "background";
164 + props.status?.kind === "child-input";
165 const capsuleInteractive =
166 statusInteractive ||
167 extensionStatus !== null ||
@@ -436,28 +432,6 @@ function FloatingStatusLabel(props: {
432 </StatusLabelRow>
433 );
434 }
439 - if (props.status.kind === "background") {
440 - return (
441 - <StatusLabelRow
442 - key="background"
443 - accessibilityLabel={props.status.accessibilityLabel}
444 - accessibilityRole="button"
445 - onPress={props.status.onPress}
446 - className="gap-2"
447 - onLayout={props.onLayout}
448 - >
449 - <SymbolView
450 - name={props.status.waiting ? "person.2" : "terminal"}
451 - size={13}
452 - tintColorClassName="accent-foreground"
453 - type="monochrome"
454 - />
455 - <Text className="shrink font-t3-medium text-xs text-foreground" numberOfLines={1}>
456 - {props.status.label}
457 - </Text>
458 - </StatusLabelRow>
459 - );
460 - }
435 if (props.status.kind === "stop") {
436 return (
437 <StatusLabelRow
apps/mobile/src/features/threads/floating-working-status.ts
-8
@@ -14,14 +14,6 @@ export type FloatingWorkingStatus =
14 readonly accessibilityLabel: string;
15 readonly onPress: () => void;
16 }
17 - | {
18 - readonly kind: "background";
19 - readonly label: string;
20 - readonly accessibilityLabel: string;
21 - readonly waiting: boolean;
22 - readonly onPress: () => void;
23 - readonly action: FloatingStatusAction;
24 - }
17 | {
18 readonly kind: "stop";
19 readonly label: string;
apps/mobile/src/features/threads/thread-context-divider.tsx
+38 -15
@@ -50,9 +50,13 @@ export function ThreadContextDivider(props: {
50 );
51 }
52
53 -export interface ThreadLifecycleEvent {
54 - readonly state: "snoozed" | "settled" | "woke";
53 +export interface ThreadStatusLineModel {
54 + readonly key: string;
55 + readonly icon: AppSymbolName;
56 readonly label: string;
57 + readonly accessibilityLabel?: string;
58 + /** Tapping the label opens the state's detail. */
59 + readonly onOpen?: () => void;
60 readonly action: {
61 readonly label: string;
62 readonly accessibilityLabel: string;
@@ -61,23 +65,42 @@ export interface ThreadLifecycleEvent {
65 };
66 }
67
64 -/** Closes the feed while the thread is snoozed, settled, or just woke. Left-aligned, as on web. */
65 -export function ThreadLifecycleLine(props: {
66 - readonly event: ThreadLifecycleEvent;
68 +/** A thread state that closes the feed with its one action, left-aligned as on web. */
69 +export function ThreadStatusLine(props: {
70 + readonly line: ThreadStatusLineModel;
71 readonly iconColor: ColorValue;
72 }) {
69 - const { action } = props.event;
70 - return (
71 - <View className="mb-3 flex-row items-center gap-1.5 px-1 py-1">
72 - <SymbolView
73 - name={props.event.state === "settled" ? "checkmark.circle" : "alarm"}
74 - size={13}
75 - tintColor={props.iconColor}
76 - type="monochrome"
77 - />
73 + const { line } = props;
74 + const { action } = line;
75 + const body = (
76 + <>
77 + <SymbolView name={line.icon} size={13} tintColor={props.iconColor} type="monochrome" />
78 <Text className="shrink font-t3-medium text-xs text-foreground-muted" numberOfLines={1}>
79 - {props.event.label}
79 + {line.label}
80 </Text>
81 + </>
82 + );
83 + return (
84 + <View className="mb-3 flex-row items-center gap-1.5 px-1 py-1">
85 + {line.onOpen ? (
86 + <Pressable
87 + accessibilityRole="button"
88 + accessibilityLabel={line.accessibilityLabel ?? line.label}
89 + onPress={line.onOpen}
90 + hitSlop={8}
91 + className="shrink flex-row items-center gap-1.5 active:opacity-70"
92 + >
93 + {body}
94 + </Pressable>
95 + ) : (
96 + <View
97 + accessible
98 + accessibilityLabel={line.accessibilityLabel ?? line.label}
99 + className="shrink flex-row items-center gap-1.5"
100 + >
101 + {body}
102 + </View>
103 + )}
104 <Text className="text-xs text-foreground-muted">·</Text>
105 <Pressable
106 accessibilityRole="button"