@@ -14,21 +14,18 @@ import type {
1414 ServerConfig as T3ServerConfig ,
1515 ThreadId ,
1616} from "@t3tools/contracts" ;
17- import { formatElapsed } from "@t3tools/shared/orchestrationTiming" ;
1817import * as Haptics from "expo-haptics" ;
1918import { memo , useCallback , useEffect , useLayoutEffect , useMemo , useRef , useState } from "react" ;
2019import { Platform , View , type GestureResponderEvent } from "react-native" ;
2120import { KeyboardController , KeyboardStickyView } from "react-native-keyboard-controller" ;
22- import Animated , { FadeInDown , FadeOut , LinearTransition } from "react-native-reanimated" ;
21+ import Animated , { FadeInDown , FadeOut } from "react-native-reanimated" ;
2322import { useSafeAreaInsets } from "react-native-safe-area-context" ;
2423
25- import { AppText as Text } from "../../components/AppText" ;
2624import type { ComposerEditorHandle } from "../../components/ComposerEditor" ;
2725import type { StatusTone } from "../../components/StatusPill" ;
2826import type { DraftComposerImageAttachment } from "../../lib/composerImages" ;
2927import { CHAT_CONTENT_MAX_WIDTH , type LayoutVariant } from "../../lib/layout" ;
3028import { scopedThreadKey } from "../../lib/scopedEntities" ;
31- import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass" ;
3229import type {
3330 PendingApproval ,
3431 PendingUserInput ,
@@ -172,54 +169,6 @@ function useStreamingHaptics(threadId: ThreadId, feed: ReadonlyArray<ThreadFeedE
172169 } , [ threadId , feed ] ) ;
173170}
174171
175- // Pre-measurement estimate for the working pill's slot (the real height is
176- // measured via onComposerLayout since the pill lives inside the composer
177- // overlay). Matches the rendered pill: pt-2 + pb-2 (16) wrapping a bordered
178- // px-3/py-2 row (~36), so ~52 — keep it in sync with WorkingDurationPill.
179- const WORKING_INDICATOR_HEIGHT = 52 ;
180-
181- const WorkingDurationPill = memo ( function WorkingDurationPill ( props : {
182- readonly startedAt : string ;
183- } ) {
184- const [ nowMs , setNowMs ] = useState ( ( ) => Date . now ( ) ) ;
185-
186- useEffect ( ( ) => {
187- const intervalId = setInterval ( ( ) => {
188- setNowMs ( Date . now ( ) ) ;
189- } , 1_000 ) ;
190- return ( ) => clearInterval ( intervalId ) ;
191- } , [ props . startedAt ] ) ;
192-
193- const durationLabel = formatElapsed ( props . startedAt , new Date ( nowMs ) . toISOString ( ) ) ?? "0s" ;
194-
195- return (
196- < Animated . View
197- className = "shrink-0 px-4 pb-2 pt-2"
198- entering = { FadeInDown . duration ( 200 ) }
199- exiting = { FadeOut . duration ( 140 ) }
200- >
201- < View
202- className = {
203- Platform . OS === "ios" && ! NATIVE_LIQUID_GLASS_SUPPORTED
204- ? "self-start rounded-full border border-border bg-card px-3 py-2"
205- : "self-start rounded-full border border-neutral-200/80 bg-neutral-50/90 px-3 py-2 dark:border-white/[0.08] dark:bg-white/[0.04]"
206- }
207- >
208- < View className = "flex-row items-center gap-2" >
209- < View className = "flex-row items-center gap-1" >
210- < View className = "h-1.5 w-1.5 rounded-full bg-neutral-400 dark:bg-neutral-500" />
211- < View className = "h-1.5 w-1.5 rounded-full bg-neutral-400/80 dark:bg-neutral-500/80" />
212- < View className = "h-1.5 w-1.5 rounded-full bg-neutral-400/60 dark:bg-neutral-500/60" />
213- </ View >
214- < Text className = "font-t3-medium text-xs text-neutral-600 dark:text-neutral-400" >
215- Working for { durationLabel }
216- </ Text >
217- </ View >
218- </ View >
219- </ Animated . View >
220- ) ;
221- } ) ;
222-
223172export const ThreadDetailScreen = memo ( function ThreadDetailScreen ( props : ThreadDetailScreenProps ) {
224173 const insets = useSafeAreaInsets ( ) ;
225174 const agentLabel = `${ props . selectedThread . modelSelection . instanceId } agent` ;
@@ -253,8 +202,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
253202 const selectedThreadFeed = props . selectedThreadFeed ;
254203 const composerChrome = composerExpanded ? COMPOSER_EXPANDED_CHROME : COMPOSER_COLLAPSED_CHROME ;
255204 const composerOverlapHeight = composerChrome + composerBottomInset ;
256- const activeWorkIndicatorHeight = props . activeWorkStartedAt ? WORKING_INDICATOR_HEIGHT : 0 ;
257- const estimatedOverlayHeight = composerOverlapHeight + activeWorkIndicatorHeight ;
205+ const estimatedOverlayHeight = composerOverlapHeight ;
258206 // The overlay's measured height includes the home-indicator inset (the
259207 // composer pads it), but contentInsetAdjustmentBehavior="automatic" makes
260208 // UIKit add the safe-area bottom to the content inset AGAIN — leaving a
@@ -411,6 +359,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
411359 contentPresentation = { props . contentPresentation }
412360 agentLabel = { agentLabel }
413361 latestTurn = { props . selectedThread . latestTurn }
362+ activeWorkStartedAt = { props . activeWorkStartedAt }
414363 listRef = { listRef }
415364 freeze = { freeze }
416365 anchorMessageId = { anchorMessageId }
@@ -438,15 +387,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
438387 list's bottom inset, so any padding above the pill/composer
439388 pushes the resting content floor up by the same amount. */ }
440389 < View ref = { composerOverlayRef } onLayout = { onComposerLayout } className = "w-full" >
441- < Animated . View
442- className = "w-full self-center"
443- layout = { LinearTransition . duration ( 220 ) }
444- style = { { maxWidth : contentMaxWidth } }
445- >
446- { props . activeWorkStartedAt ? (
447- < WorkingDurationPill startedAt = { props . activeWorkStartedAt } />
448- ) : null }
449-
390+ < View className = "w-full self-center" style = { { maxWidth : contentMaxWidth } } >
450391 { props . activePendingApproval || props . activePendingUserInput ? (
451392 < Animated . View
452393 className = "shrink-0 gap-3 px-4 pb-3"
@@ -473,7 +414,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
473414 ) : null }
474415 </ Animated . View >
475416 ) : null }
476- </ Animated . View >
417+ </ View >
477418
478419 < ThreadComposer
479420 editorRef = { composerEditorRef }
0 commit comments