Skip to content

Commit 728dbd4

Browse files
committed
fix(android): keep the turn timer out of the one-row composer
With a turn running, the timer ticking beside the editor stopped a tap from bringing the keyboard back after Back closed it, so the split view never stepped aside and the timer jumped between the composer and the pill. The timer now stays in the pill above the composer.
1 parent 2d72c91 commit 728dbd4

2 files changed

Lines changed: 2 additions & 27 deletions

File tree

‎apps/mobile/src/features/threads/ThreadComposer.tsx‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { ComposerTextPaste } from "../../native/T3ComposerEditor.types";
22
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
3-
import { WorkingTimer } from "./floating-working-control";
43
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
54
import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
65
import { useAtomValue } from "@effect/atom-react";
@@ -207,8 +206,6 @@ export interface ThreadComposerProps {
207206
readonly onUpdateInteractionMode: (interactionMode: ProviderInteractionMode) => void;
208207
/** True while the composer renders its multi-row card rather than the one-row capsule. */
209208
readonly onExpandedChange?: (expanded: boolean) => void;
210-
/** Turn timer shown in the focused one-row composer of Android split view. */
211-
readonly activeWorkStartedAt?: string | null;
212209
/** Fires on editor focus/blur; hosts use it to vet stale keyboard state. */
213210
readonly onEditorFocusChange?: (focused: boolean) => void;
214211
}
@@ -1133,16 +1130,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
11331130
) : null}
11341131
{!usesCard ? (
11351132
<View className="flex-row items-center">
1136-
{isExpanded ? (
1137-
<>
1138-
{props.activeWorkStartedAt ? (
1139-
<View className="px-1.5">
1140-
<WorkingTimer startedAt={props.activeWorkStartedAt} />
1141-
</View>
1142-
) : null}
1143-
{modelControl}
1144-
</>
1145-
) : null}
1133+
{isExpanded ? modelControl : null}
11461134
<ComposerDictationStartAction
11471135
state={voiceInput.state}
11481136
isAvailable={voiceInput.isAvailable}

‎apps/mobile/src/features/threads/ThreadDetailScreen.tsx‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
490490
const pendingBackgroundWork = presentPendingBackgroundWork(
491491
props.selectedThread.pendingBackgroundTasks,
492492
);
493-
const pillStatus = ((): FloatingWorkingStatus | null => {
493+
const floatingStatus = ((): FloatingWorkingStatus | null => {
494494
const connectionStatus = connectionFloatingStatus({
495495
connectionError: props.connectionError,
496496
connectionState: props.connectionStateLabel,
@@ -558,14 +558,6 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
558558
}
559559
return null;
560560
})();
561-
// The focused one-row composer of Android split view carries the timer itself,
562-
// so the pill row stops taking feed height while the keyboard is up.
563-
const composerShowsTimer =
564-
Platform.OS === "android" &&
565-
props.layoutVariant === "split" &&
566-
composerFocused &&
567-
pillStatus?.kind === "working";
568-
const floatingStatus = composerShowsTimer ? null : pillStatus;
569561
const showWorkingControl = floatingStatus !== null;
570562
// Connection and working status occupy the same space. Keep the feed inset
571563
// stable when reconnecting hands off to syncing and then to a running turn.
@@ -1487,11 +1479,6 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
14871479
onUpdateRuntimeMode={props.onUpdateThreadRuntimeMode}
14881480
onUpdateInteractionMode={props.onUpdateThreadInteractionMode}
14891481
onExpandedChange={setComposerExpanded}
1490-
activeWorkStartedAt={
1491-
composerShowsTimer && pillStatus?.kind === "working"
1492-
? pillStatus.startedAt
1493-
: null
1494-
}
14951482
onEditorFocusChange={handleComposerFocusChange}
14961483
/>
14971484
</>

0 commit comments

Comments
 (0)