Skip to content
Closed
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
15 changes: 15 additions & 0 deletions apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { InfoIcon } from "lucide-react";
import { ThreadId } from "@t3tools/contracts";
import type { ReactNode } from "react";
import { expect, it, vi } from "vite-plus/test";

Expand All @@ -11,6 +12,20 @@ import {
NoticeText,
type ComposerBannerStackItem,
} from "./ComposerBannerStack";
import { goalNowItem } from "./ThreadActivityBanners";

it("offers Resume for a paused goal while another turn is working", async () => {
const goal = goalNowItem({
threadId: ThreadId.make("thread:goal-resume"),
goal: { objective: "Fix the tests", status: "paused" },
isWorking: true,
onSendCommand: async () => {},
});
await using screen = await render(
<ComposerBannerStack items={[{ ...goal, variant: "default" }]} />,
);
await expect.element(screen.getByRole("button", { name: "Resume", exact: true })).toBeVisible();
});

function notice(title: string, group?: ComposerBannerStackItem["group"]): ComposerBannerStackItem {
return { id: title, variant: "default", icon: <InfoIcon />, title, ...(group ? { group } : {}) };
Expand Down
3 changes: 1 addition & 2 deletions apps/web/src/components/chat/ThreadActivityBanners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ export function goalNowItem(input: {
? presentation.title
: `${presentation.title} · ${presentation.usage}`,
description: presentation.objective,
// Clear stops goal work; Resume would stop unrelated work, so it waits.
actions: (
<>
{presentation.canResume && !isWorking ? (
{presentation.canResume ? (
<>
<InlineButton
onClick={() => void onSendCommand("/goal resume", "Failed to resume goal.")}
Expand Down
Loading