Skip to content

Commit dabd639

Browse files
committed
Update agents on workspace start and show startup progress
1 parent 7f72428 commit dabd639

5 files changed

Lines changed: 321 additions & 20 deletions

File tree

mobile/src/screens/WorkspaceDetailScreen.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export function WorkspaceDetailScreen({ route, navigation }: any) {
178178

179179
const isRunning = isHost ? true : workspace?.status === 'running'
180180
const isCreating = isHost ? false : workspace?.status === 'creating'
181+
const startupSteps = workspace?.startup?.steps ?? []
181182

182183
const { data: sessionsData, isLoading: sessionsLoading, refetch: refetchSessions } = useQuery({
183184
queryKey: ['sessions', name, agentFilter],
@@ -414,6 +415,32 @@ export function WorkspaceDetailScreen({ route, navigation }: any) {
414415
<ActivityIndicator size="large" color={colors.warning} style={{ marginBottom: 16 }} />
415416
<Text style={[styles.notRunningText, { color: colors.textMuted }]}>Workspace is starting</Text>
416417
<Text style={[styles.notRunningSubtext, { color: colors.textMuted }]}>Please wait while the container starts up</Text>
418+
{startupSteps.length > 0 && (
419+
<View style={[styles.startupSteps, { borderColor: colors.border, backgroundColor: colors.surfaceSecondary }]}>
420+
{startupSteps.map((step) => {
421+
const color = step.status === 'done'
422+
? colors.success
423+
: step.status === 'running'
424+
? colors.warning
425+
: step.status === 'error'
426+
? colors.error
427+
: step.status === 'skipped'
428+
? colors.textMuted
429+
: colors.textMuted
430+
return (
431+
<View key={step.id} style={styles.startupStepRow}>
432+
<View style={[styles.startupStepDot, { backgroundColor: color }]} />
433+
<View style={styles.startupStepText}>
434+
<Text style={[styles.startupStepTitle, { color: colors.text }]}>{step.label}</Text>
435+
{step.message && (
436+
<Text style={[styles.startupStepMessage, { color: colors.textMuted }]}>{step.message}</Text>
437+
)}
438+
</View>
439+
</View>
440+
)
441+
})}
442+
</View>
443+
)}
417444
</View>
418445
) : (
419446
<View style={styles.notRunning}>
@@ -640,6 +667,37 @@ const styles = StyleSheet.create({
640667
color: '#636366',
641668
marginTop: 6,
642669
},
670+
startupSteps: {
671+
width: '100%',
672+
marginTop: 16,
673+
borderWidth: 1,
674+
borderRadius: 10,
675+
paddingVertical: 8,
676+
paddingHorizontal: 12,
677+
gap: 10,
678+
},
679+
startupStepRow: {
680+
flexDirection: 'row',
681+
alignItems: 'flex-start',
682+
gap: 10,
683+
},
684+
startupStepDot: {
685+
width: 8,
686+
height: 8,
687+
borderRadius: 4,
688+
marginTop: 6,
689+
},
690+
startupStepText: {
691+
flex: 1,
692+
},
693+
startupStepTitle: {
694+
fontSize: 14,
695+
fontWeight: '600',
696+
},
697+
startupStepMessage: {
698+
fontSize: 12,
699+
marginTop: 2,
700+
},
643701
empty: {
644702
flex: 1,
645703
alignItems: 'center',

src/shared/client-types.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ export interface WorkspaceInfo {
2525
};
2626
lastUsed?: string;
2727
tailscale?: WorkspaceTailscale;
28+
startup?: WorkspaceStartupState;
29+
}
30+
31+
export type WorkspaceStartupStatus = 'pending' | 'running' | 'done' | 'error' | 'skipped';
32+
33+
export interface WorkspaceStartupStep {
34+
id: string;
35+
label: string;
36+
status: WorkspaceStartupStatus;
37+
message?: string;
38+
}
39+
40+
export interface WorkspaceStartupState {
41+
steps: WorkspaceStartupStep[];
42+
updatedAt: string;
2843
}
2944

3045
export interface RecentSession {

src/shared/types.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ export interface ClientConfig {
122122
}
123123

124124
export type WorkspaceStatus = 'running' | 'stopped' | 'creating' | 'error';
125+
export type WorkspaceStartupStatus = 'pending' | 'running' | 'done' | 'error' | 'skipped';
126+
127+
export interface WorkspaceStartupStep {
128+
id: string;
129+
label: string;
130+
status: WorkspaceStartupStatus;
131+
message?: string;
132+
}
133+
134+
export interface WorkspaceStartupState {
135+
steps: WorkspaceStartupStep[];
136+
updatedAt: string;
137+
}
125138

126139
export interface PortMapping {
127140
host: number;
@@ -143,6 +156,7 @@ export interface WorkspaceInfo {
143156
ports: WorkspacePorts;
144157
lastUsed?: string;
145158
tailscale?: WorkspaceTailscale;
159+
startup?: WorkspaceStartupState;
146160
}
147161

148162
export interface WorkspaceState {

0 commit comments

Comments
 (0)