Files
orca/mobile/src/session/MobileNativeChatStopButton.tsx
T
Brennan Benson 5e8d40d61b fix(mobile): remove the dead space around the chat composer (#29224)
* fix(mobile): remove the dead space around the chat composer

The Tools toggle floats over the transcript and shows only when the chat
has tool calls; the composer is one row (attach, message, mic, send) until
focused or drafted; Stop takes Send's slot while there is nothing to send;
the bridge lane's working dots move to the transcript's tail.

* fix(mobile): name the composer's content facts for their role

* fix(mobile): preserve composer controls and picker focus

* fix(mobile): typecheck working indicator test lookup

* test(mobile): find the floating Tools pill when checking a chat switch keeps it expanded
2026-10-16 21:27:06 -07:00

44 lines
1.2 KiB
TypeScript

import { ActivityIndicator, Pressable, StyleSheet } from 'react-native'
import { Square } from 'lucide-react-native'
import { NATIVE_CHAT_TURN_STATUS_COPY } from '../../../src/shared/native-chat-turn-status'
import { colors } from '../theme/mobile-theme'
/** The composer's Stop, in Send's slot. `held`: this phone's own Stop request is still in flight. */
export function MobileNativeChatStopButton({
onStop,
held
}: {
onStop?: () => void
held: boolean
}): React.JSX.Element {
return (
<Pressable
style={({ pressed }) => [styles.stopButton, pressed && styles.pressed]}
onPress={onStop}
disabled={held}
accessibilityRole="button"
accessibilityLabel={held ? NATIVE_CHAT_TURN_STATUS_COPY.stopping : 'Stop the agent'}
>
{held ? (
<ActivityIndicator size="small" color={colors.statusRed} />
) : (
<Square size={16} color={colors.statusRed} strokeWidth={2.4} fill={colors.statusRed} />
)}
</Pressable>
)
}
const styles = StyleSheet.create({
stopButton: {
width: 40,
height: 40,
borderRadius: 20,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: colors.bgRaised
},
pressed: {
opacity: 0.7
}
})