Skip to content

Commit 05b38dd

Browse files
shivamhwpclaude
andcommitted
fix(mobile): approval card scrolls when it outgrows the room
A stacked approval card with many options, or a long command, could grow past the space between the header and the composer on iOS. Cap it at that space and scroll, as child approvals already do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c388ff7 commit 05b38dd

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,16 @@ function ThreadDetailBody(
10091009
maxHeight: pendingUserInputMaxHeight.value,
10101010
flexGrow: 0,
10111011
}));
1012+
// Questions overlay the composer on iOS; an approval sits above it, so it gives up its height.
1013+
const approvalHeightStyle = useAnimatedStyle(() => ({
1014+
maxHeight: derivePendingUserInputMaxHeight({
1015+
windowHeight: screenAreaHeight,
1016+
keyboardHeight: keyboardStickyEnabled ? -keyboardTranslation.value : 0,
1017+
navigationHeaderHeight,
1018+
composerOverlapHeight,
1019+
}),
1020+
flexGrow: 0,
1021+
}));
10121022
// The usage panel stacks with the composer and any approval card, so it gets
10131023
// whatever room they leave below the header. Measured only while it is open
10141024
// so typing in the composer does not re-render the screen.
@@ -1705,12 +1715,18 @@ function ThreadDetailBody(
17051715
exiting={FadeOut.duration(140)}
17061716
>
17071717
{props.activePendingApproval ? (
1708-
<PendingApprovalCard
1709-
canOperateThread={props.canOperateThread}
1710-
approval={props.activePendingApproval}
1711-
respondingApprovalId={props.respondingApprovalId}
1712-
onRespond={props.onRespondToApproval}
1713-
/>
1718+
<Animated.ScrollView
1719+
style={approvalHeightStyle}
1720+
keyboardShouldPersistTaps="handled"
1721+
nestedScrollEnabled
1722+
>
1723+
<PendingApprovalCard
1724+
canOperateThread={props.canOperateThread}
1725+
approval={props.activePendingApproval}
1726+
respondingApprovalId={props.respondingApprovalId}
1727+
onRespond={props.onRespondToApproval}
1728+
/>
1729+
</Animated.ScrollView>
17141730
) : null}
17151731
{props.activePendingUserInput ? (
17161732
<PendingUserInputCard

0 commit comments

Comments
 (0)