Add running dot to sub-agent list
This commit is contained in:
@@ -181,10 +181,15 @@ function AgentScreenContent({ serverId, agentId, onBack }: AgentScreenContentPro
|
|||||||
// This prevents infinite loops caused by useShallow not doing deep equality on object arrays
|
// This prevents infinite loops caused by useShallow not doing deep equality on object arrays
|
||||||
const childAgents = useMemo(() => {
|
const childAgents = useMemo(() => {
|
||||||
if (!resolvedAgentId || !allAgents) return [];
|
if (!resolvedAgentId || !allAgents) return [];
|
||||||
const children: Array<{ id: string; title: string | null; createdAt: Date }> = [];
|
const children: Array<{
|
||||||
|
id: string;
|
||||||
|
title: string | null;
|
||||||
|
createdAt: Date;
|
||||||
|
status: Agent["status"];
|
||||||
|
}> = [];
|
||||||
for (const [id, a] of allAgents) {
|
for (const [id, a] of allAgents) {
|
||||||
if (a.parentAgentId === resolvedAgentId) {
|
if (a.parentAgentId === resolvedAgentId) {
|
||||||
children.push({ id, title: a.title, createdAt: a.createdAt });
|
children.push({ id, title: a.title, createdAt: a.createdAt, status: a.status });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
children.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
|
children.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
|
||||||
@@ -664,7 +669,12 @@ function AgentScreenContent({ serverId, agentId, onBack }: AgentScreenContentPro
|
|||||||
>
|
>
|
||||||
{child.title || "Untitled Agent"}
|
{child.title || "Untitled Agent"}
|
||||||
</Text>
|
</Text>
|
||||||
<ChevronRight size={16} color={theme.colors.mutedForeground} />
|
<View style={styles.menuSubAgentMeta}>
|
||||||
|
{child.status === "running" ? (
|
||||||
|
<View style={styles.menuSubAgentDot} />
|
||||||
|
) : null}
|
||||||
|
<ChevronRight size={16} color={theme.colors.mutedForeground} />
|
||||||
|
</View>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
))}
|
))}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
@@ -960,4 +970,15 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
marginRight: theme.spacing[2],
|
marginRight: theme.spacing[2],
|
||||||
},
|
},
|
||||||
|
menuSubAgentMeta: {
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: theme.spacing[1],
|
||||||
|
},
|
||||||
|
menuSubAgentDot: {
|
||||||
|
width: 6,
|
||||||
|
height: 6,
|
||||||
|
borderRadius: 999,
|
||||||
|
backgroundColor: "#3b82f6",
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user