Skip to content

Commit 7fd3ae9

Browse files
fix(web): simplify the waiting subagent action label
1 parent 505a13b commit 7fd3ae9

1 file changed

Lines changed: 27 additions & 39 deletions

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5186,8 +5186,6 @@ export default function ChatView(props: ChatViewProps) {
51865186
if (presentation === null || !activeThread) {
51875187
return null;
51885188
}
5189-
const onlyItem = presentation.items.length === 1 ? presentation.items[0] : undefined;
5190-
const onlyChildThreadId = onlyItem?.childThreadId;
51915189
return {
51925190
id: `background-work:${activeThread.id}`,
51935191
variant: "default",
@@ -5203,44 +5201,34 @@ export default function ChatView(props: ChatViewProps) {
52035201
),
52045202
title: presentation.title,
52055203
description:
5206-
onlyItem !== undefined ? (
5207-
onlyChildThreadId === undefined ? undefined : (
5208-
<InlineButton
5209-
tone="muted"
5210-
aria-label={`Show subagent ${onlyItem.label}`}
5211-
onClick={() => onOpenRelatedThreadStable(onlyChildThreadId)}
5212-
>
5213-
Show
5214-
</InlineButton>
5215-
)
5216-
) : (
5217-
presentation.items.map((item, index) => {
5218-
const childThreadId = item.childThreadId;
5219-
const separator = index < presentation.items.length - 1 ? "," : null;
5220-
return (
5221-
<Fragment key={item.taskId}>
5222-
{index > 0 ? " " : null}
5223-
{childThreadId === undefined ? (
5224-
<>
5225-
{item.label}
5226-
{separator}
5227-
</>
5228-
) : (
5229-
<span className="whitespace-nowrap">
5230-
<InlineButton
5231-
tone="muted"
5232-
aria-label={`Open subagent ${item.label}`}
5233-
onClick={() => onOpenRelatedThreadStable(childThreadId)}
5234-
>
5204+
presentation.items.length === 1 && presentation.items[0]?.childThreadId === undefined
5205+
? undefined
5206+
: presentation.items.map((item, index) => {
5207+
const childThreadId = item.childThreadId;
5208+
const separator = index < presentation.items.length - 1 ? "," : null;
5209+
return (
5210+
<Fragment key={item.taskId}>
5211+
{index > 0 ? " " : null}
5212+
{childThreadId === undefined ? (
5213+
<>
52355214
{item.label}
5236-
</InlineButton>
5237-
{separator}
5238-
</span>
5239-
)}
5240-
</Fragment>
5241-
);
5242-
})
5243-
),
5215+
{separator}
5216+
</>
5217+
) : (
5218+
<span className="whitespace-nowrap">
5219+
<InlineButton
5220+
tone="muted"
5221+
aria-label={`${presentation.items.length === 1 ? "Show" : "Open"} subagent ${item.label}`}
5222+
onClick={() => onOpenRelatedThreadStable(childThreadId)}
5223+
>
5224+
{presentation.items.length === 1 ? "Show" : item.label}
5225+
</InlineButton>
5226+
{separator}
5227+
</span>
5228+
)}
5229+
</Fragment>
5230+
);
5231+
}),
52445232
actions: (
52455233
<Button
52465234
size="xs"

0 commit comments

Comments
 (0)