Skip to content

Commit adb7ccb

Browse files
committed
fix(mobile): keep composer within folded screen after resume
1 parent 7a12aff commit adb7ccb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,12 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
679679
const isSplitLayout = layoutVariant === "split";
680680
const contentMaxWidth = isSplitLayout ? CHAT_CONTENT_MAX_WIDTH : undefined;
681681
const workspaceContentWidth = useWorkspaceContentWidth();
682+
// Clearing animated width can retain the unfolded width after Android resumes folded.
683+
// Assign both layouts explicitly so the dock always follows its current parent.
682684
const composerWidthStyle = useAnimatedStyle(() =>
683685
isSplitLayout && workspaceContentWidth !== null
684-
? { width: workspaceContentWidth.value, right: undefined }
685-
: { width: undefined, right: 0 },
686+
? { width: workspaceContentWidth.value }
687+
: { width: "100%" },
686688
);
687689
const selectedInstanceId = props.selectedThread.modelSelection.instanceId;
688690
useStreamingHaptics(props.selectedThread.id, props.selectedThreadFeed);
@@ -964,7 +966,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
964966
<Animated.View
965967
layout={COMPOSER_LAYOUT_TRANSITION}
966968
pointerEvents="box-none"
967-
style={[{ position: "absolute", bottom: 0, left: 0, right: 0 }, composerWidthStyle]}
969+
style={[{ position: "absolute", bottom: 0, left: 0 }, composerWidthStyle]}
968970
>
969971
{/* No paddingTop here: the overlay's measured height becomes the
970972
list's bottom inset, so any padding above the pill/composer

0 commit comments

Comments
 (0)