Improve mobile UI polish
- BottomDrawer: shift drawer up when keyboard opens using Keyboard events, add ScrollView for content overflow - NewWorktreeModal: replace FlatList with plain map to avoid nested VirtualizedList error - Home: replace Server icon with Monitor, hide IP from cards (show in action sheet), add connection status subtitle, update hero copy - About: remove redundant link labels, use neutral text color for URLs Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -47,7 +47,6 @@ export default function AboutScreen() {
|
||||
onPress={() => void Linking.openURL('https://onOrca.dev')}
|
||||
>
|
||||
<Globe size={16} color={colors.textSecondary} />
|
||||
<Text style={styles.rowLabel}>Website</Text>
|
||||
<Text style={styles.rowValue}>onOrca.dev</Text>
|
||||
</Pressable>
|
||||
<View style={styles.separator} />
|
||||
@@ -56,7 +55,6 @@ export default function AboutScreen() {
|
||||
onPress={() => void Linking.openURL('https://github.com/stablyai/orca')}
|
||||
>
|
||||
<GithubIcon />
|
||||
<Text style={styles.rowLabel}>GitHub</Text>
|
||||
<Text style={styles.rowValue}>stablyai/orca</Text>
|
||||
</Pressable>
|
||||
<View style={styles.separator} />
|
||||
@@ -65,7 +63,6 @@ export default function AboutScreen() {
|
||||
onPress={() => void Linking.openURL('https://x.com/orca_build')}
|
||||
>
|
||||
<XIcon />
|
||||
<Text style={styles.rowLabel}>X</Text>
|
||||
<Text style={styles.rowValue}>@orca_build</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
@@ -135,8 +132,10 @@ const styles = StyleSheet.create({
|
||||
color: colors.textPrimary
|
||||
},
|
||||
rowValue: {
|
||||
flex: 1,
|
||||
textAlign: 'right',
|
||||
fontSize: typography.bodySize,
|
||||
color: colors.accentBlue
|
||||
color: colors.textSecondary
|
||||
},
|
||||
separator: {
|
||||
height: StyleSheet.hairlineWidth,
|
||||
|
||||
+25
-22
@@ -2,7 +2,7 @@ import { useState, useCallback, useEffect, useMemo } from 'react'
|
||||
import { View, Text, StyleSheet, Pressable, FlatList } from 'react-native'
|
||||
import { SafeAreaView } from 'react-native-safe-area-context'
|
||||
import { useRouter, useFocusEffect } from 'expo-router'
|
||||
import { MoreHorizontal, QrCode, Server, Settings } from 'lucide-react-native'
|
||||
import { Monitor, MoreHorizontal, QrCode, Settings } from 'lucide-react-native'
|
||||
import { loadHosts, removeHost, renameHost } from '../src/transport/host-store'
|
||||
import { connect } from '../src/transport/rpc-client'
|
||||
import type { ConnectionState, HostProfile } from '../src/transport/types'
|
||||
@@ -22,6 +22,15 @@ function endpointLabel(endpoint: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
const STATUS_LABELS: Record<ConnectionState, string> = {
|
||||
connected: 'Connected',
|
||||
connecting: 'Connecting…',
|
||||
disconnected: 'Disconnected',
|
||||
reconnecting: 'Reconnecting…',
|
||||
handshaking: 'Connecting…',
|
||||
'auth-failed': 'Auth failed'
|
||||
}
|
||||
|
||||
export default function HomeScreen() {
|
||||
const router = useRouter()
|
||||
const [hosts, setHosts] = useState<HostProfile[]>([])
|
||||
@@ -106,8 +115,8 @@ export default function HomeScreen() {
|
||||
contentContainerStyle={styles.list}
|
||||
ListHeaderComponent={
|
||||
<View style={styles.hero}>
|
||||
<Text style={styles.heroTitle}>Desktops</Text>
|
||||
<Text style={styles.heroSubtitle}>Continue where your agents are running.</Text>
|
||||
<Text style={styles.heroTitle}>Paired Desktops</Text>
|
||||
<Text style={styles.heroSubtitle}>Monitor workspaces and terminals remotely.</Text>
|
||||
</View>
|
||||
}
|
||||
ItemSeparatorComponent={() => <View style={styles.cardGap} />}
|
||||
@@ -122,7 +131,7 @@ export default function HomeScreen() {
|
||||
delayLongPress={400}
|
||||
>
|
||||
<View style={styles.hostIcon}>
|
||||
<Server size={18} color={colors.textPrimary} />
|
||||
<Monitor size={18} color={colors.textPrimary} />
|
||||
</View>
|
||||
<View style={styles.hostMain}>
|
||||
<View style={styles.hostTitleRow}>
|
||||
@@ -131,8 +140,8 @@ export default function HomeScreen() {
|
||||
{item.name}
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={styles.hostEndpoint} numberOfLines={1}>
|
||||
{endpointLabel(item.endpoint)}
|
||||
<Text style={styles.hostStatus} numberOfLines={1}>
|
||||
{STATUS_LABELS[hostStates[item.id] ?? 'connecting']}
|
||||
</Text>
|
||||
</View>
|
||||
<Pressable
|
||||
@@ -147,7 +156,7 @@ export default function HomeScreen() {
|
||||
ListFooterComponent={
|
||||
<Pressable style={styles.pairCard} onPress={() => router.push('/pair-scan')}>
|
||||
<View style={styles.pairIcon}>
|
||||
<QrCode size={18} color={colors.accentBlue} />
|
||||
<QrCode size={18} color={colors.textSecondary} />
|
||||
</View>
|
||||
<View style={styles.pairTextBlock}>
|
||||
<Text style={styles.pairTitle}>Pair another desktop</Text>
|
||||
@@ -161,6 +170,7 @@ export default function HomeScreen() {
|
||||
<ActionSheetModal
|
||||
visible={actionTarget != null}
|
||||
title={actionTarget?.name}
|
||||
message={actionTarget ? endpointLabel(actionTarget.endpoint) : undefined}
|
||||
actions={[
|
||||
{
|
||||
label: 'Rename',
|
||||
@@ -288,15 +298,13 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
heroTitle: {
|
||||
color: colors.textPrimary,
|
||||
fontSize: 28,
|
||||
fontSize: 24,
|
||||
fontWeight: '800'
|
||||
},
|
||||
heroSubtitle: {
|
||||
color: colors.textSecondary,
|
||||
color: colors.textMuted,
|
||||
fontSize: typography.bodySize,
|
||||
lineHeight: 20,
|
||||
marginTop: spacing.xs,
|
||||
maxWidth: 320
|
||||
marginTop: spacing.xs
|
||||
},
|
||||
cardGap: {
|
||||
height: spacing.sm
|
||||
@@ -309,9 +317,7 @@ const styles = StyleSheet.create({
|
||||
paddingVertical: spacing.sm,
|
||||
minHeight: 70,
|
||||
borderRadius: radii.row,
|
||||
backgroundColor: colors.bgPanel,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.borderSubtle
|
||||
backgroundColor: colors.bgPanel
|
||||
},
|
||||
hostCardPressed: {
|
||||
backgroundColor: colors.bgRaised
|
||||
@@ -349,10 +355,9 @@ const styles = StyleSheet.create({
|
||||
justifyContent: 'center',
|
||||
marginLeft: spacing.xs
|
||||
},
|
||||
hostEndpoint: {
|
||||
color: colors.textSecondary,
|
||||
hostStatus: {
|
||||
color: colors.textMuted,
|
||||
fontSize: 13,
|
||||
fontFamily: typography.monoFamily,
|
||||
marginTop: spacing.xs
|
||||
},
|
||||
pairCard: {
|
||||
@@ -364,9 +369,7 @@ const styles = StyleSheet.create({
|
||||
paddingRight: spacing.md,
|
||||
paddingVertical: spacing.sm,
|
||||
borderRadius: radii.row,
|
||||
backgroundColor: colors.bgBase,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.borderSubtle
|
||||
backgroundColor: colors.bgPanel
|
||||
},
|
||||
pairIcon: {
|
||||
width: 44,
|
||||
@@ -374,7 +377,7 @@ const styles = StyleSheet.create({
|
||||
borderRadius: 11,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: colors.accentBlue + '18',
|
||||
backgroundColor: colors.bgRaised,
|
||||
marginRight: spacing.md
|
||||
},
|
||||
pairTextBlock: {
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
import { type ReactNode, useCallback, useEffect } from 'react'
|
||||
import { Modal, View, Pressable, StyleSheet, Platform, useWindowDimensions } from 'react-native'
|
||||
import {
|
||||
Modal,
|
||||
View,
|
||||
Pressable,
|
||||
StyleSheet,
|
||||
Platform,
|
||||
useWindowDimensions,
|
||||
ScrollView,
|
||||
Keyboard
|
||||
} from 'react-native'
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||
import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler'
|
||||
import Animated, {
|
||||
@@ -29,6 +38,7 @@ type Props = {
|
||||
export function BottomDrawer({ visible, onClose, children }: Props) {
|
||||
const translateY = useSharedValue(0)
|
||||
const backdropOpacity = useSharedValue(0)
|
||||
const keyboardOffset = useSharedValue(0)
|
||||
const { height: screenHeight } = useWindowDimensions()
|
||||
const insets = useSafeAreaInsets()
|
||||
|
||||
@@ -39,6 +49,31 @@ export function BottomDrawer({ visible, onClose, children }: Props) {
|
||||
}
|
||||
}, [visible])
|
||||
|
||||
// Why: KeyboardAvoidingView and useAnimatedKeyboard are both unreliable
|
||||
// inside Modal (iOS ignores KAV; Android needs adjustNothing for
|
||||
// useAnimatedKeyboard). Keyboard event listeners work on both platforms
|
||||
// and give us the exact height to shift the drawer by.
|
||||
useEffect(() => {
|
||||
if (!visible) return
|
||||
|
||||
const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow'
|
||||
const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide'
|
||||
|
||||
const onShow = Keyboard.addListener(showEvent, (e) => {
|
||||
const height = e.endCoordinates.height - insets.bottom
|
||||
keyboardOffset.value = withTiming(Math.max(height, 0), { duration: e.duration || 250 })
|
||||
})
|
||||
const onHide = Keyboard.addListener(hideEvent, (e) => {
|
||||
keyboardOffset.value = withTiming(0, { duration: e.duration || 250 })
|
||||
})
|
||||
|
||||
return () => {
|
||||
onShow.remove()
|
||||
onHide.remove()
|
||||
keyboardOffset.value = 0
|
||||
}
|
||||
}, [visible, insets.bottom])
|
||||
|
||||
const dismiss = useCallback(() => {
|
||||
onClose()
|
||||
}, [onClose])
|
||||
@@ -66,7 +101,7 @@ export function BottomDrawer({ visible, onClose, children }: Props) {
|
||||
})
|
||||
|
||||
const drawerStyle = useAnimatedStyle(() => ({
|
||||
transform: [{ translateY: translateY.value }]
|
||||
transform: [{ translateY: translateY.value - keyboardOffset.value }]
|
||||
}))
|
||||
|
||||
const backdropStyle = useAnimatedStyle(() => ({
|
||||
@@ -86,7 +121,13 @@ export function BottomDrawer({ visible, onClose, children }: Props) {
|
||||
style={[styles.drawer, { paddingBottom: insets.bottom + spacing.lg }, drawerStyle]}
|
||||
>
|
||||
<View style={styles.handle} />
|
||||
{children}
|
||||
<ScrollView
|
||||
bounces={false}
|
||||
keyboardShouldPersistTaps="handled"
|
||||
showsVerticalScrollIndicator={false}
|
||||
>
|
||||
{children}
|
||||
</ScrollView>
|
||||
<View style={styles.bottomExtension} />
|
||||
</Animated.View>
|
||||
</GestureDetector>
|
||||
@@ -135,10 +176,10 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
bottomExtension: {
|
||||
position: 'absolute',
|
||||
bottom: -100,
|
||||
bottom: -500,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: 100,
|
||||
height: 500,
|
||||
backgroundColor: colors.bgBase
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,8 +8,7 @@ import {
|
||||
StyleSheet,
|
||||
Platform,
|
||||
ActivityIndicator,
|
||||
Image,
|
||||
FlatList
|
||||
Image
|
||||
} from 'react-native'
|
||||
import { ChevronDown, ChevronUp, Check, Terminal } from 'lucide-react-native'
|
||||
import Svg, { Path, G } from 'react-native-svg'
|
||||
@@ -215,14 +214,11 @@ function PickerListModal<T extends { id: string; label: string }>({
|
||||
<Text style={styles.pickerTitle}>{title}</Text>
|
||||
</View>
|
||||
<View style={styles.pickerGroup}>
|
||||
<FlatList
|
||||
data={items}
|
||||
keyExtractor={(item) => item.id}
|
||||
style={styles.pickerList}
|
||||
ItemSeparatorComponent={() => <View style={styles.pickerSeparator} />}
|
||||
renderItem={({ item }) => {
|
||||
const selected = item.id === selectedId
|
||||
return (
|
||||
{items.map((item, index) => {
|
||||
const selected = item.id === selectedId
|
||||
return (
|
||||
<View key={item.id}>
|
||||
{index > 0 && <View style={styles.pickerSeparator} />}
|
||||
<Pressable
|
||||
style={({ pressed }) => [styles.pickerItem, pressed && styles.pickerItemPressed]}
|
||||
onPress={() => {
|
||||
@@ -239,9 +235,9 @@ function PickerListModal<T extends { id: string; label: string }>({
|
||||
</Text>
|
||||
{selected && <Check size={14} color={colors.textPrimary} />}
|
||||
</Pressable>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
})}
|
||||
</View>
|
||||
</BottomDrawer>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user