Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions apps/mobile/src/features/threads/thread-subagent-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export function ThreadSubagentGroup(props: {
};
});
const grouped = agents.length > 1;
const visibleAvatarCount = agents.length <= 4 ? agents.length : 3;
const label = `${agents.length} subagents`;
const summary = summarizeSubagentStatuses(agents.map((agent) => agent.status));
const expanded = props.expandedRows[props.anchorKey] ?? false;
Expand All @@ -150,14 +151,16 @@ export function ThreadSubagentGroup(props: {
className="min-h-14 flex-row items-center gap-3 rounded-lg py-2 active:bg-subtle"
>
<View className="flex-row items-center">
{agents.slice(0, 3).map((agent, index) => (
{agents.slice(0, visibleAvatarCount).map((agent, index) => (
<View key={agent.item.id} style={{ marginLeft: index === 0 ? 0 : -7 }}>
<SubagentAvatar item={agent.item} config={configOf(agent.item)} />
</View>
))}
{agents.length > 3 ? (
{agents.length > visibleAvatarCount ? (
<View className="-ml-2 h-7 w-7 items-center justify-center rounded-full border border-border bg-card">
<Text className="text-2xs text-foreground-muted">+{agents.length - 3}</Text>
<Text className="text-2xs text-foreground-muted">
+{agents.length - visibleAvatarCount}
</Text>
</View>
) : null}
</View>
Expand Down
7 changes: 4 additions & 3 deletions apps/web/src/components/chat/TimelineV2EventRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const V2SubagentGroup = memo(function V2SubagentGroup({
};
});
const summary = subagentGroupSummary(agents);
const visibleAvatarCount = agents.length <= 4 ? agents.length : 3;
const label = `${members.length} ${members.length === 1 ? "subagent" : "subagents"}`;
const statusSummary = summarizeSubagentStatuses(agents.map(({ status }) => status));
const toggleExpanded = (open: boolean) => {
Expand All @@ -103,7 +104,7 @@ const V2SubagentGroup = memo(function V2SubagentGroup({
)}
>
<span className="flex shrink-0 items-center -space-x-1.5" aria-hidden>
{agents.slice(0, 3).map(({ item, status }) => (
{agents.slice(0, visibleAvatarCount).map(({ item, status }) => (
<EnvironmentSubagentAvatar
key={item.id}
environmentId={ctx.activeThreadEnvironmentId}
Expand All @@ -113,9 +114,9 @@ const V2SubagentGroup = memo(function V2SubagentGroup({
status={agents.length === 1 ? status : undefined}
/>
))}
{agents.length > 3 ? (
{agents.length > visibleAvatarCount ? (
<span className="relative inline-flex size-6 items-center justify-center rounded-full bg-muted text-3xs font-medium text-muted-foreground ring-2 ring-background">
+{agents.length - 3}
+{agents.length - visibleAvatarCount}
</span>
) : null}
</span>
Expand Down
Loading