mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 10:58:10 +00:00
* refactor(mobile): give relay and encryption concrete owners * refactor(mobile): organize session and review feature owners * refactor(mobile): organize RPC and host ownership * test(mobile): point render fixtures at concrete owners * refactor(mobile): use explicit type-only owner imports
68 lines
2.8 KiB
TypeScript
68 lines
2.8 KiB
TypeScript
import { View, Text, Pressable } from 'react-native'
|
|
import { AlertTriangle, X } from 'lucide-react-native'
|
|
import { SessionDockColumn } from './SessionDockColumn'
|
|
import { dismissMobileSessionCreateWarningState } from './tabs/mobile-session-create-warning-state'
|
|
import { colors, pressedStyle } from '../theme/mobile-theme'
|
|
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
|
|
import { useMobileTranslation } from '../i18n/use-mobile-translation'
|
|
import { styles } from './mobile-session-styles'
|
|
import type { MobileSessionController } from './use-mobile-session-controller'
|
|
import { MobileSessionActiveContent } from './MobileSessionActiveContent'
|
|
import { MobileSessionCommandDock } from './MobileSessionCommandDock'
|
|
import { MobileDictationStatusAnnouncement } from '../dictation/MobileDictationStatusAnnouncement'
|
|
|
|
export function MobileSessionContentRow({ controller }: { controller: MobileSessionController }) {
|
|
useMobileColorScheme()
|
|
const t = useMobileTranslation()
|
|
const {
|
|
hostId,
|
|
worktreeId,
|
|
worktreeName,
|
|
activePanel,
|
|
setActivePanel,
|
|
sessionContentRowWidth,
|
|
canDockPanel,
|
|
setCreateWarningState,
|
|
createWarning,
|
|
dictation,
|
|
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={({ pressed }) => [styles.createWarningDismiss, pressed && pressedStyle]}
|
|
onPress={() => setCreateWarningState(dismissMobileSessionCreateWarningState)}
|
|
accessibilityLabel={t(
|
|
'session.contentRow.dismissCreationWarning',
|
|
'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} />
|
|
<MobileDictationStatusAnnouncement dictation={dictation} />
|
|
</View>
|
|
{canDockPanel && activePanel !== null && (
|
|
<SessionDockColumn
|
|
activePanel={activePanel}
|
|
hostId={hostId}
|
|
worktreeId={worktreeId}
|
|
name={worktreeName || ''}
|
|
availableWidth={sessionContentRowWidth}
|
|
onRequestClose={() => setActivePanel(null)}
|
|
/>
|
|
)}
|
|
</View>
|
|
)
|
|
}
|