Skip to content
Merged
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
29 changes: 21 additions & 8 deletions apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6297,6 +6297,9 @@ export default function ChatView(props: ChatViewProps) {
}
const working = activeBackgroundLiveness === "working";
const liveCount = agentPanelModel.liveCount;
// Hidden once the Agents surface is on screen; the link would point at nothing.
const showViewAgents =
liveCount > 0 && !(rightPanelOpen && activeRightPanelSurface?.kind === "agents");
return {
id: `background-liveness:${activeThread.id}`,
variant: "default",
Expand All @@ -6313,22 +6316,32 @@ export default function ChatView(props: ChatViewProps) {
: "Background work"
: "Monitoring",
actions: (
<Button
size="xs"
variant="ghost"
disabled={isStoppingBackgroundWork}
onClick={() => void handleStopBackgroundWork()}
>
{isStoppingBackgroundWork ? "Stopping..." : "Stop"}
</Button>
<>
{showViewAgents ? (
<Button size="xs" variant="ghost" aria-label="View agents" onClick={addAgentsSurface}>
View
</Button>
) : null}
<Button
size="xs"
variant="ghost"
disabled={isStoppingBackgroundWork}
onClick={() => void handleStopBackgroundWork()}
>
{isStoppingBackgroundWork ? "Stopping..." : "Stop"}
</Button>
</>
),
};
}, [
activeBackgroundLiveness,
activeRightPanelSurface?.kind,
activeThread,
addAgentsSurface,
agentPanelModel.liveCount,
handleStopBackgroundWork,
isStoppingBackgroundWork,
rightPanelOpen,
]);
// A woken thread announces itself in the open view, not just the sidebar
// pill. Dismissing marks the wake as seen (same acknowledgment as the
Expand Down
Loading