Skip to content
Merged
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
6 changes: 0 additions & 6 deletions crates/wizard-gui/wizard-ui/src/agents/AgentConfiguration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,6 @@ export function RoutingFieldset<M extends string>({
<TokenNote token={token} hub={hub} disabled={disabled} />
)
)}
{agent === "claude" && selected === "hub" && (
<Text>При применении настроек Wizard установит скилл /coreinfra-video и подключит видеомодели через MCP.</Text>
)}
{agent === "claude_desktop" && selected === "hub" && (
<Text>После применения настроек Claude Desktop автоматически установит скилл CoreInfra Video. Для работы с видеомоделями оставьте Wizard открытым.</Text>
)}
<ActionBar leading={actions} className={actionsClassName}>
<Button
type="button"
Expand Down
4 changes: 2 additions & 2 deletions crates/wizard-gui/wizard-ui/src/agents/AgentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export function AgentPage({
onPrepare={prepare}
/>
)}
<VideoConnection agent="ChatGPT" signedIn={account.signedIn} disabled={isChangeInProgress} />
<VideoConnection signedIn={account.signedIn} disabled={isChangeInProgress} />
{(codex.status === "not_found" || (codex.status === "found" && codex.data.cli.status === "not_found")) && (
<MissingAgent agent="codex" />
)}
Expand Down Expand Up @@ -293,7 +293,7 @@ export function AgentPage({
/>
)}
{claude.status === "found" && claude.data.routing_mode === "hub" && (
<VideoConnection agent="Claude Code" signedIn={account.signedIn} disabled={isChangeInProgress} />
<VideoConnection signedIn={account.signedIn} disabled={isChangeInProgress} />
)}
</>
);
Expand Down
18 changes: 8 additions & 10 deletions crates/wizard-gui/wizard-ui/src/agents/VideoConnection.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { invoke } from "@tauri-apps/api/core";
import { useEffect, useState } from "react";
import { Button } from "../components/catalyst/button";
import { Fieldset, Legend } from "../components/catalyst/fieldset";
import { Fieldset } from "../components/catalyst/fieldset";
import { Text } from "../components/catalyst/text";
import { ErrorText } from "../components/ErrorText";

type Status = { enabled: boolean; running: boolean; error: string | null };

export function VideoConnection({ agent, signedIn, disabled }: { agent: "ChatGPT" | "Claude Code"; signedIn: boolean; disabled: boolean }) {
export function VideoConnection({ signedIn, disabled }: { signedIn: boolean; disabled: boolean }) {
const [status, setStatus] = useState<Status>();
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string>();
Expand All @@ -33,19 +33,17 @@ export function VideoConnection({ agent, signedIn, disabled }: { agent: "ChatGPT
}
}

return <Fieldset className="mt-10 space-y-3" disabled={busy || disabled}>
<Legend>Видеомодели CoreInfra</Legend>
{status?.running && <Text>{signedIn
? `Попросите ${agent} показать видеомодели в новом чате. Для генерации Wizard использует ключ agent-codex выбранного хаба.`
: "Для генерации войдите в CoreInfra Hub в Wizard."}</Text>}
if (!status && !error) return null;

return <Fieldset aria-label="Видеомодели" className="mt-10 space-y-3" disabled={busy || disabled}>
{status?.running && !signedIn && <Text>Для генерации войдите в CoreInfra Hub в Wizard.</Text>}
{status && !status.enabled && <Text>Видеомодели отключены.</Text>}
{(error || status?.error) && <ErrorText>{error || status?.error}</ErrorText>}
{status && <Text>Подключение общее для ChatGPT, Codex и Claude Code.</Text>}
{status && <div className="flex flex-wrap gap-2">
{!status.running && <Button onClick={() => void apply(true)}>
{status.enabled ? "Повторить подключение" : "Включить видеомодели"}
{status.enabled ? "Переподключить видеомодели" : "Включить видеомодели"}
</Button>}
{status.enabled && <Button outline onClick={() => void apply(false)}>Отключить</Button>}
{status.enabled && <Button outline onClick={() => void apply(false)}>Отключить видеомодели</Button>}
</div>}
</Fieldset>;
}
17 changes: 9 additions & 8 deletions crates/wizard-gui/wizard-ui/src/test/flows.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ afterEach(() => {
it("shows the automatic video connection on the Codex page and lets the user reconnect it", async () => {
const user = userEvent.setup();
launch("current", "/agents/codex");
const video = within(await screen.findByRole("group", { name: "Видеомодели CoreInfra" }));
expect(await video.findByText(/ключ agent-codex/)).toBeVisible();
const group = await screen.findByRole("group", { name: "Видеомодели" });
const video = within(group);
const disconnect = await video.findByRole("button", { name: "Отключить видеомодели" });
expect(group).toHaveTextContent(/^Отключить видеомодели$/);
expect(environment.calls).not.toContain("set_video_connection");
await user.click(video.getByRole("button", { name: "Отключить" }));
await user.click(disconnect);
await user.click(await video.findByRole("button", { name: "Включить видеомодели" }));
expect(await video.findByRole("button", { name: "Отключить" })).toBeVisible();
expect(await video.findByRole("button", { name: "Отключить видеомодели" })).toBeVisible();
});

it("offers one Apply to install video in an existing Claude Code gateway profile", async () => {
Expand All @@ -61,15 +63,13 @@ it("offers one Apply to install video in an existing Claude Code gateway profile
if (claude.status !== "found") throw new Error("Claude Code fixture missing");
agents.publish({ ...agents.value, claude: { ...claude, data: { ...claude.data, video_needs_apply: true } } });
});
expect(await screen.findByText(/установит скилл \/coreinfra-video/)).toBeVisible();
expect(await screen.findByRole("group", { name: "Видеомодели CoreInfra" })).toBeVisible();
expect(await screen.findByRole("button", { name: "Отключить видеомодели" })).toBeVisible();
expect(screen.queryByText(/установит скилл/)).not.toBeInTheDocument();
await user.click(screen.getByRole("button", { name: "Применить" }));
const plan = await screen.findByRole("dialog", { name: "План изменений: Claude Code" });
await user.click(within(plan).getByRole("button", { name: "Применить" }));
await waitFor(() => expect(screen.queryByRole("dialog")).not.toBeInTheDocument());
expect(screen.getByRole("button", { name: "Применить" })).toBeDisabled();
await user.click(screen.getByRole("radio", { name: "Своя подписка Claude" }));
expect(screen.queryByText(/установит скилл/)).not.toBeInTheDocument();
});

describe("shared installation flow", () => {
Expand Down Expand Up @@ -521,6 +521,7 @@ describe("application transitions", () => {
expect(apply).toBeEnabled();
await user.click(screen.getByRole("radio", { name: "API-доступ" }));
expect(apply).toBeDisabled();
expect(screen.queryByText(/установит скилл/)).not.toBeInTheDocument();
expect(environment.calls).not.toContain("prepare_agent_change");
expect(environment.calls).not.toContain("apply_agent_plan");
});
Expand Down
Loading