mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 00:02:10 +00:00
fix(mobile): say the host status is unreadable instead of nothing when it is
With the update copy now reserved for a host that answered without agent launch, an unread status left the AI buttons disabled with no explanation. They now say "Could not read this host's status. Go back and reopen it.", the words the mobile web shell already uses for the same failure; leaving the host re-reads its status.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { useState } from 'react'
|
||||
import { Pressable, StyleSheet, Text, View, type StyleProp, type TextStyle } from 'react-native'
|
||||
import { useClipboardWriter } from '../platform/clipboard'
|
||||
import { AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE } from '../session/mobile-existing-agent-launch'
|
||||
import {
|
||||
AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE,
|
||||
AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE
|
||||
} from '../session/mobile-existing-agent-launch'
|
||||
import type { MobileAgentLaunchAvailability } from '../session/mobile-agent-launch-availability'
|
||||
import { colors, spacing, typography } from '../theme/mobile-theme'
|
||||
|
||||
@@ -17,7 +20,12 @@ type Props = {
|
||||
export function AgentLaunchNotice({ availability, error, undeliveredPrompt, errorStyle }: Props) {
|
||||
const clipboard = useClipboardWriter()
|
||||
const [copyState, setCopyState] = useState<{ prompt: string; label: string } | null>(null)
|
||||
const message = availability === 'update-required' ? AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE : error
|
||||
const message =
|
||||
availability === 'update-required'
|
||||
? AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE
|
||||
: availability === 'unverified'
|
||||
? AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE
|
||||
: error
|
||||
if (!message) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -85,7 +85,9 @@ function useSendActions(controller: ReturnType<typeof useMobileDiffReviewControl
|
||||
disabled: comments.length === 0 || controller.agentLaunchAvailability !== 'available',
|
||||
...(controller.agentLaunchAvailability === 'update-required'
|
||||
? { hint: 'Update Orca on your computer' }
|
||||
: {}),
|
||||
: controller.agentLaunchAvailability === 'unverified'
|
||||
? { hint: "Could not read this host's status" }
|
||||
: {}),
|
||||
skipAutoClose: true,
|
||||
onPress: () => void controller.createTerminalAndSend(comments)
|
||||
},
|
||||
|
||||
@@ -25,6 +25,10 @@ export const PROMPTED_AGENT_LAUNCH_TIMEOUT_MS = 90_000
|
||||
export const AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE =
|
||||
'Update Orca on your computer to start an agent from your phone.'
|
||||
|
||||
// Same words the mobile web shell uses for a status read that failed; leaving the host re-reads it.
|
||||
export const AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE =
|
||||
"Could not read this host's status. Go back and reopen it."
|
||||
|
||||
export const AGENT_LAUNCH_UNCONFIRMED_MESSAGE =
|
||||
"Couldn't confirm the agent started. Check the workspace before trying again."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user