From 4bfd75a4df9a8a3b1adc3932867a034495e1791c Mon Sep 17 00:00:00 2001 From: fanziqing Date: Fri, 14 Aug 2026 16:58:53 +0800 Subject: [PATCH] feat: add Ark provider setup links --- .../gui/src/providers/ProviderSetup.test.tsx | 28 ++++++++++++++++++- surfaces/gui/src/providers/ProviderSetup.tsx | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/surfaces/gui/src/providers/ProviderSetup.test.tsx b/surfaces/gui/src/providers/ProviderSetup.test.tsx index 870aa7a0..89d0e8d2 100644 --- a/surfaces/gui/src/providers/ProviderSetup.test.tsx +++ b/surfaces/gui/src/providers/ProviderSetup.test.tsx @@ -2,7 +2,7 @@ // only the selected method's fields render, and clicking a segment switches them. import { afterEach, describe, expect, it, vi } from "vitest"; import { cleanup, fireEvent, render, screen } from "@testing-library/react"; -import { ProviderForm, type ProviderSetupState } from "./ProviderSetup"; +import { KEY_HELP, ProviderForm, ProviderMark, type ProviderSetupState } from "./ProviderSetup"; import type { ProviderInfo } from "../api"; vi.mock("../tauri", () => ({ openExternal: vi.fn() })); @@ -94,3 +94,29 @@ describe("ProviderForm auth-method choice", () => { expect(screen.queryByTestId("t-field-bedrock_api_key")).toBeNull(); }); }); + +describe("Ark provider presentation", () => { + it("uses separate BytePlus and Volcengine brand marks", () => { + const { container, rerender } = render( + , + ); + expect(container.querySelector("img")).toBeTruthy(); + + rerender( + , + ); + expect(container.querySelector("img")).toBeTruthy(); + }); + + it("links each provider to its own API key console", () => { + expect(KEY_HELP.ark.url).toBe( + "https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey", + ); + expect(KEY_HELP["ark-agent-plan-cn"].url).toContain( + "advancedActiveKey=agentPlan", + ); + }); +}); diff --git a/surfaces/gui/src/providers/ProviderSetup.tsx b/surfaces/gui/src/providers/ProviderSetup.tsx index 1d8dc881..99aeed53 100644 --- a/surfaces/gui/src/providers/ProviderSetup.tsx +++ b/surfaces/gui/src/providers/ProviderSetup.tsx @@ -21,6 +21,8 @@ export const KEY_HELP: Record = { anthropic: { url: "https://console.anthropic.com/settings/keys", label: "console.anthropic.com" }, openai: { url: "https://platform.openai.com/api-keys", label: "platform.openai.com" }, gemini: { url: "https://aistudio.google.com/apikey", label: "aistudio.google.com" }, + ark: { url: "https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey", label: "console.byteplus.com" }, + "ark-agent-plan-cn": { url: "https://console.volcengine.com/ark/region:cn-beijing/openManagement?LLM=%7B%7D&advancedActiveKey=agentPlan", label: "console.volcengine.com" }, openrouter: { url: "https://openrouter.ai/keys", label: "openrouter.ai" }, bedrock: { url: "https://console.aws.amazon.com/bedrock/home#/api-keys", label: "the AWS Bedrock console" }, fireworks: { url: "https://fireworks.ai/account/api-keys", label: "fireworks.ai" },