Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/mobile/src/features/threads/PendingApprovalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) {
{warning ? (
<Text className="font-sans text-xs leading-normal text-warning-foreground">{warning}</Text>
) : null}
<View className="flex-row flex-wrap gap-2.5">
<View className="gap-2">
{options.map((option) => (
<Button
key={option.decision}
Expand All @@ -94,6 +94,7 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) {
}
disabled={disabled || !props.canOperateThread}
onPress={() => void props.onRespond(props.approval.requestId, option.decision)}
fullWidth
/>
))}
</View>
Expand Down
29 changes: 23 additions & 6 deletions apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,16 @@ function ThreadDetailBody(
maxHeight: pendingUserInputMaxHeight.value,
flexGrow: 0,
}));
// Questions overlay the composer on iOS; an approval sits above it, so it gives up its height.
const approvalHeightStyle = useAnimatedStyle(() => ({
maxHeight: derivePendingUserInputMaxHeight({
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
windowHeight: screenAreaHeight,
keyboardHeight: keyboardStickyEnabled ? -keyboardTranslation.value : 0,
navigationHeaderHeight,
composerOverlapHeight,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
}),
flexGrow: 0,
}));
// The usage panel stacks with the composer and any approval card, so it gets
// whatever room they leave below the header. Measured only while it is open
// so typing in the composer does not re-render the screen.
Expand Down Expand Up @@ -1718,12 +1728,19 @@ function ThreadDetailBody(
exiting={FadeOut.duration(140)}
>
{props.activePendingApproval ? (
<PendingApprovalCard
canOperateThread={props.canOperateThread}
approval={props.activePendingApproval}
respondingApprovalId={props.respondingApprovalId}
onRespond={props.onRespondToApproval}
/>
<Animated.ScrollView
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
key={props.activePendingApproval.requestId}
style={approvalHeightStyle}
keyboardShouldPersistTaps="handled"
nestedScrollEnabled
>
<PendingApprovalCard
canOperateThread={props.canOperateThread}
approval={props.activePendingApproval}
respondingApprovalId={props.respondingApprovalId}
onRespond={props.onRespondToApproval}
/>
</Animated.ScrollView>
) : null}
{props.activePendingUserInput ? (
<PendingUserInputCard
Expand Down
Loading