@@ -620,10 +620,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
620620 const activeUserInputRequestId = props . activePendingUserInput ?. requestId ?? null ;
621621 const composerSlotHidden =
622622 activeUserInputRequestId !== null || props . creationState ?. kind === "failed" ;
623- const voiceTarget = useMemo (
624- ( ) => ( { environmentId : props . environmentId , threadId : props . selectedThread . id } ) ,
625- [ props . environmentId , props . selectedThread . id ] ,
626- ) ;
623+ const voiceTarget = { environmentId : props . environmentId , threadId : props . selectedThread . id } ;
627624 const voiceLiveHere = useVoiceModePhase ( voiceTarget ) !== "idle" ;
628625 // The open /usage-limits panel for this thread, model and turn. Only the open
629626 // moment is stored: the rows read live provider data, so a redeemed reset
@@ -712,30 +709,27 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
712709 // Android lays the screen out below its opaque header and reports a zero
713710 // header height, so the window height overstates the room by the header.
714711 const [ screenHeight , setScreenHeight ] = useState < number | null > ( null ) ;
715- const handleScreenLayout = useCallback ( ( event : LayoutChangeEvent ) => {
712+ const handleScreenLayout = ( event : LayoutChangeEvent ) => {
716713 setScreenHeight ( event . nativeEvent . layout . height ) ;
717- } , [ ] ) ;
714+ } ;
718715 const screenAreaHeight = screenHeight ?? windowHeight ;
719716 // The usage panel stacks with the composer and any approval card, so it gets
720717 // whatever room they leave below the header. Measured only while it is open
721718 // so typing in the composer does not re-render the screen.
722719 const usageLimitsOpen = usageLimitsReport !== null && activeUserInputRequestId === null ;
723720 const [ usageLimitsLayout , setUsageLimitsLayout ] = useState ( { overlay : 0 , panel : 0 } ) ;
724- const handleComposerOverlayLayout = useCallback (
725- ( event : LayoutChangeEvent ) => {
726- onComposerLayout ( event ) ;
727- if ( ! usageLimitsOpen ) return ;
728- const overlay = event . nativeEvent . layout . height ;
729- setUsageLimitsLayout ( ( current ) =>
730- current . overlay === overlay ? current : { ...current , overlay } ,
731- ) ;
732- } ,
733- [ onComposerLayout , usageLimitsOpen ] ,
734- ) ;
735- const handleUsageLimitsLayout = useCallback ( ( event : LayoutChangeEvent ) => {
721+ const handleComposerOverlayLayout = ( event : LayoutChangeEvent ) => {
722+ onComposerLayout ( event ) ;
723+ if ( ! usageLimitsOpen ) return ;
724+ const overlay = event . nativeEvent . layout . height ;
725+ setUsageLimitsLayout ( ( current ) =>
726+ current . overlay === overlay ? current : { ...current , overlay } ,
727+ ) ;
728+ } ;
729+ const handleUsageLimitsLayout = ( event : LayoutChangeEvent ) => {
736730 const panel = event . nativeEvent . layout . height ;
737731 setUsageLimitsLayout ( ( current ) => ( current . panel === panel ? current : { ...current , panel } ) ) ;
738- } , [ ] ) ;
732+ } ;
739733 const overlayBesideUsageLimits =
740734 usageLimitsLayout . overlay > 0
741735 ? usageLimitsLayout . overlay - usageLimitsLayout . panel
@@ -1369,10 +1363,10 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
13691363 ) : null }
13701364 </ View >
13711365
1372- { /* The composer below hides for a question card; keep a live
1366+ { /* The composer below hides for a question card; keep a live
13731367 voice conversation's mute and stop controls reachable. */ }
1374- { activeUserInputRequestId !== null && voiceLiveHere ? < ComposerVoiceStrip /> : null }
1375- { /* Hidden (not unmounted) while a user-input request owns the
1368+ { activeUserInputRequestId !== null && voiceLiveHere ? < ComposerVoiceStrip /> : null }
1369+ { /* Hidden (not unmounted) while a user-input request owns the
13761370 composer slot, so composer drafts and editor state survive.
13771371 A rejected creation has no thread to send to; the failure card
13781372 owns the slot instead. */ }
0 commit comments