@@ -261,24 +261,15 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
261261 const fallbackInputRef = useRef < ComposerEditorHandle > ( null ) ;
262262 const inputRef = props . editorRef ?? fallbackInputRef ;
263263 const [ isFocused , setIsFocused ] = useState ( false ) ;
264- // Android: expansion starts on touch-down. Waiting for the native focus
265- // event to round-trip through JS starts the 220ms morph after the IME is
266- // already animating in, so the two play serially and look jittery.
267- const [ eagerExpand , setEagerExpand ] = useState ( false ) ;
268264 const wasExpandedBeforePreviewRef = useRef ( false ) ;
269265 const inFlightThreadIdsRef = useRef ( new Set < string > ( ) ) ;
270266 const { onExpandedChange } = props ;
271267
272268 const [ previewImageUri , setPreviewImageUri ] = useState < string | null > ( null ) ;
273269 const hasContent = props . draftMessage . trim ( ) . length > 0 || props . draftAttachments . length > 0 ;
274- const isExpanded = isFocused || eagerExpand || ( Platform . OS === "android" && hasContent ) ;
270+ const isExpanded = isFocused ;
275271 const canSend = hasContent ;
276272
277- useEffect ( ( ) => {
278- if ( Platform . OS !== "android" ) return ;
279- onExpandedChange ?.( isExpanded ) ;
280- } , [ isExpanded , onExpandedChange ] ) ;
281-
282273 const onPressImage = useCallback (
283274 ( uri : string ) => {
284275 wasExpandedBeforePreviewRef . current = isFocused ;
@@ -296,17 +287,12 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
296287
297288 const handleFocus = useCallback ( ( ) => {
298289 setIsFocused ( true ) ;
299- if ( Platform . OS !== "android" ) {
300- onExpandedChange ?.( true ) ;
301- }
290+ onExpandedChange ?.( true ) ;
302291 } , [ onExpandedChange ] ) ;
303292
304293 const handleBlur = useCallback ( ( ) => {
305294 setIsFocused ( false ) ;
306- setEagerExpand ( false ) ;
307- if ( Platform . OS !== "android" ) {
308- onExpandedChange ?.( false ) ;
309- }
295+ onExpandedChange ?.( false ) ;
310296 } , [ onExpandedChange ] ) ;
311297 const showStopAction =
312298 props . selectedThread . session ?. status === "running" ||
@@ -778,12 +764,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
778764 </ Animated . View >
779765 ) : null }
780766
781- < View
782- className = { isExpanded ? undefined : "min-w-0 flex-1" }
783- onTouchStart = {
784- Platform . OS === "android" && ! isExpanded ? ( ) => setEagerExpand ( true ) : undefined
785- }
786- >
767+ < View className = { isExpanded ? undefined : "min-w-0 flex-1" } >
787768 < ComposerEditor
788769 ref = { inputRef }
789770 multiline
0 commit comments