Files
orca/mobile/src/session/MobileSessionContentRow.tsx
T
2026-08-31 23:35:08 -07:00

62 lines
2.4 KiB
TypeScript

import { View, Text, Pressable } from 'react-native'
import { AlertTriangle, X } from 'lucide-react-native'
import { SessionDockColumn } from './SessionDockColumn'
import { dismissMobileSessionCreateWarningState } from './mobile-session-create-warning-state'
import { colors } from '../theme/mobile-theme'
import { styles } from './mobile-session-styles'
import type { MobileSessionController } from './use-mobile-session-controller'
import { MobileSessionActiveContent } from './MobileSessionActiveContent'
import { MobileSessionCommandDock } from './MobileSessionCommandDock'
export function MobileSessionContentRow({ controller }: { controller: MobileSessionController }) {
const {
hostId,
worktreeId,
worktreeName,
activePanel,
setActivePanel,
sessionContentRowWidth,
canDockPanel,
setCreateWarningState,
createWarning,
handleFileOpenStart,
handleOpenedFileDiff,
handleSessionContentRowLayout
} = controller
return (
<View style={styles.sessionContentRow} onLayout={handleSessionContentRowLayout}>
<View style={styles.sessionContentMain}>
{createWarning ? (
<View style={styles.createWarningBanner}>
<AlertTriangle size={16} color={colors.statusAmber} strokeWidth={2.2} />
<Text style={styles.createWarningText}>{createWarning}</Text>
<Pressable
style={styles.createWarningDismiss}
onPress={() => setCreateWarningState(dismissMobileSessionCreateWarningState)}
accessibilityLabel="Dismiss workspace creation warning"
hitSlop={8}
>
<X size={16} color={colors.textMuted} strokeWidth={2.2} />
</Pressable>
</View>
) : null}
<MobileSessionActiveContent controller={controller} />
{/* Why: translate instead of resize so keyboard toggles don't trigger a server-side PTY viewport change. */}
<MobileSessionCommandDock controller={controller} />
</View>
{canDockPanel && activePanel !== null && (
<SessionDockColumn
activePanel={activePanel}
hostId={hostId}
worktreeId={worktreeId}
name={worktreeName || ''}
availableWidth={sessionContentRowWidth}
onRequestClose={() => setActivePanel(null)}
onFileOpenStart={handleFileOpenStart}
onOpenedFileDiff={handleOpenedFileDiff}
/>
)}
</View>
)
}