diff --git a/webview-ui/src/components/chat/ApiConfigSelector.tsx b/webview-ui/src/components/chat/ApiConfigSelector.tsx index ef5151a00d..2cc675b364 100644 --- a/webview-ui/src/components/chat/ApiConfigSelector.tsx +++ b/webview-ui/src/components/chat/ApiConfigSelector.tsx @@ -1,5 +1,6 @@ -import { useState, useMemo, useCallback } from "react" +import { useState, useMemo, useCallback, useEffect, type ReactNode } from "react" import { Fzf } from "fzf" +import { Brain, ChevronDown } from "lucide-react" import { cn } from "@/lib/utils" import { enabledSelectorTriggerClassName, selectorTriggerClassName } from "@/components/ui/selectorTriggerStyles" @@ -10,10 +11,14 @@ import { vscode } from "@/utils/vscode" import { Button } from "@/components/ui" import { IconButton } from "./IconButton" +import { PickerSearchField } from "./PickerSearchField" interface ApiConfigSelectorProps { value: string displayName: string + modelId?: string + reasoningEffort?: string + quickSettings?: ReactNode | ((onModelSelected: () => void) => ReactNode) disabled?: boolean title: string onChange: (value: string) => void @@ -28,6 +33,9 @@ interface ApiConfigSelectorProps { export const ApiConfigSelector = ({ value, displayName, + modelId, + reasoningEffort, + quickSettings, disabled = false, title, onChange, @@ -41,6 +49,12 @@ export const ApiConfigSelector = ({ const { t } = useAppTranslation() const [open, setOpen] = useState(false) const [searchValue, setSearchValue] = useState("") + const [showProfiles, setShowProfiles] = useState(false) + const [pendingProfileId, setPendingProfileId] = useState(null) + const isProfileView = !quickSettings || showProfiles + useEffect(() => { + setPendingProfileId(null) + }, [value]) const portalContainer = useRooPortal("roo-portal") // Create searchable items for fuzzy search. @@ -79,10 +93,13 @@ export const ApiConfigSelector = ({ const handleSelect = useCallback( (configId: string) => { onChange(configId) - setOpen(false) + if (quickSettings) { + setPendingProfileId(configId === value ? null : configId) + setShowProfiles(false) + } else setOpen(false) setSearchValue("") }, - [onChange], + [onChange, quickSettings, value], ) const handleEditClick = useCallback(() => { @@ -97,6 +114,10 @@ export const ApiConfigSelector = ({ return (
{ + if (event.key === "Enter" && event.target === event.currentTarget) handleSelect(config.id) + }} onClick={() => handleSelect(config.id)} className={cn( "px-3 py-1.5 text-sm cursor-pointer flex items-center group", @@ -143,11 +164,21 @@ export const ApiConfigSelector = ({
) }, - [value, handleSelect, t, togglePinnedApiConfig], + [value, handleSelect, t, togglePinnedApiConfig, quickSettings], ) return ( - + { + setOpen(nextOpen) + if (!nextOpen) { + setShowProfiles(false) + setPendingProfileId(null) + setSearchValue("") + } + }} + data-testid="api-config-selector-root"> - {displayName} + + + {displayName} + {modelId && <> / {modelId}} + + {reasoningEffort && reasoningEffort !== "disable" && ( + + + )} +
- {/* Search input or info blurb */} - {listApiConfigMeta.length > 6 ? ( -
- setSearchValue(e.target.value)} - placeholder={t("common:ui.search_placeholder")} - className="w-full h-8 px-2 py-1 text-xs bg-vscode-input-background text-vscode-input-foreground border border-vscode-input-border rounded focus:outline-0" - autoFocus + {quickSettings && ( + + )} + {!isProfileView && + (pendingProfileId && pendingProfileId !== value ? ( +
+ {t("chat:modelPicker.loadingProfile")} +
+ ) : typeof quickSettings === "function" ? ( + quickSettings(() => setOpen(false)) + ) : ( + quickSettings + ))} + {isProfileView && ( + <> + {/* Search input or info blurb */} + {quickSettings || listApiConfigMeta.length > 6 ? ( + + ) : ( +
+

+ {t("prompts:apiConfiguration.select")} +

)} -
- ) : ( -
-

- {t("prompts:apiConfiguration.select")} -

-
- )} - {/* Config list - single scroll container */} - {filteredConfigs.length === 0 && searchValue ? ( -
{t("common:ui.no_results")}
- ) : ( -
- {/* Pinned configs - sticky header */} - {pinnedConfigs.length > 0 && ( -
0 && "border-b border-vscode-dropdown-foreground/10", - )} - aria-label="Pinned configurations"> - {pinnedConfigs.map((config) => renderConfigItem(config, true))} + {/* Config list - single scroll container */} + {filteredConfigs.length === 0 && searchValue ? ( +
+ {t("common:ui.no_results")}
- )} + ) : ( +
+ {/* Pinned configs - sticky header */} + {pinnedConfigs.length > 0 && ( +
0 && + "border-b border-vscode-dropdown-foreground/10", + )} + aria-label="Pinned configurations"> + {pinnedConfigs.map((config) => renderConfigItem(config, true))} +
+ )} - {/* Unpinned configs */} - {unpinnedConfigs.length > 0 && ( -
- {unpinnedConfigs.map((config) => renderConfigItem(config, false))} + {/* Unpinned configs */} + {unpinnedConfigs.length > 0 && ( +
+ {unpinnedConfigs.map((config) => renderConfigItem(config, false))} +
+ )}
)} -
+ )} - {/* Bottom bar with buttons on left and title on right */}
diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 2c539766fe..c8a9478f31 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -3,7 +3,7 @@ import { useEvent } from "react-use" import DynamicTextArea from "react-textarea-autosize" import { VolumeX, Image, WandSparkles, SendHorizontal, X, ListEnd, Square } from "lucide-react" -import type { ExtensionMessage } from "@roo-code/types" +import { type ExtensionMessage, providerIdentifiers } from "@roo-code/types" import { mentionRegex, mentionRegexGlobal, commandRegexGlobal, unescapeSpaces } from "@roo/context-mentions" import { WebviewMessage } from "@roo/WebviewMessage" @@ -23,10 +23,12 @@ import { import { cn } from "@src/lib/utils" import { convertToMentionPath } from "@src/utils/path-mentions" import { StandardTooltip } from "@src/components/ui" +import { useSelectedModel } from "@src/components/ui/hooks/useSelectedModel" import Thumbnails from "../common/Thumbnails" import { ModeSelector } from "./ModeSelector" import { ApiConfigSelector } from "./ApiConfigSelector" +import { ProfileQuickSettings } from "./ProfileQuickSettings" import { AutoApproveDropdown } from "./AutoApproveDropdown" import { MAX_IMAGES_PER_MESSAGE } from "./constants" import ContextMenu from "./ContextMenu" @@ -90,6 +92,7 @@ export const ChatTextArea = forwardRef( const { t } = useAppTranslation() const { + apiConfiguration, filePaths, openedTabs, currentApiConfigName, @@ -105,6 +108,22 @@ export const ChatTextArea = forwardRef( enterBehavior, lockApiConfigAcrossModes, } = useExtensionState() + const { id: selectedModelId, info: selectedModelInfo } = useSelectedModel(apiConfiguration) + const supportsEffort = selectedModelInfo?.supportsReasoningEffort + const hasEffort = + (apiConfiguration?.apiProvider === providerIdentifiers.openai && + apiConfiguration.enableReasoningEffort === true) || + supportsEffort === true || + (Array.isArray(supportsEffort) && supportsEffort.length > 0) + const selectedEffort = + (apiConfiguration?.apiProvider === providerIdentifiers.openai + ? apiConfiguration.openAiCustomModelInfo?.reasoningEffort + : apiConfiguration?.reasoningEffort) ?? selectedModelInfo?.reasoningEffort + const reasoningEffort = + hasEffort && + (selectedModelInfo?.requiredReasoningEffort || apiConfiguration?.enableReasoningEffort !== false) + ? selectedEffort + : undefined // Find the ID and display text for the currently selected API configuration. const { currentConfigId, displayName } = useMemo(() => { @@ -1309,6 +1328,15 @@ export const ChatTextArea = forwardRef( ( + + )} disabled={selectApiConfigDisabled} title={t("chat:selectApiConfig")} onChange={handleApiConfigChange} diff --git a/webview-ui/src/components/chat/PickerSearchField.tsx b/webview-ui/src/components/chat/PickerSearchField.tsx new file mode 100644 index 0000000000..c56e7b0740 --- /dev/null +++ b/webview-ui/src/components/chat/PickerSearchField.tsx @@ -0,0 +1,47 @@ +import { useRef } from "react" +import { Search, X } from "lucide-react" + +import { useAppTranslation } from "@src/i18n/TranslationContext" + +interface PickerSearchFieldProps { + label: string + value: string + onChange: (value: string) => void + disabled?: boolean +} + +/** Shared geometry and interactions for the profile and model views of the picker. */ +export function PickerSearchField({ label, value, onChange, disabled = false }: PickerSearchFieldProps) { + const { t } = useAppTranslation() + const inputRef = useRef(null) + return ( +
+
+
+
+ ) +} diff --git a/webview-ui/src/components/chat/ProfileQuickSettings.tsx b/webview-ui/src/components/chat/ProfileQuickSettings.tsx new file mode 100644 index 0000000000..5c795e1eed --- /dev/null +++ b/webview-ui/src/components/chat/ProfileQuickSettings.tsx @@ -0,0 +1,238 @@ +import { useEffect, useRef, useState } from "react" +import { Brain, Check } from "lucide-react" +import { + type ExtensionMessage, + type ModelInfo, + type ProviderSettings, + type ReasoningEffortExtended, + OpenAiModelsMessageType, + isDynamicProvider, + isRetiredProvider, + openAiModelInfoSaneDefaults, + providerIdentifiers, + reasoningEfforts, +} from "@roo-code/types" + +import { useExtensionState } from "@src/context/ExtensionStateContext" +import { useSelectedModel } from "@src/components/ui/hooks/useSelectedModel" +import { useRouterModels } from "@src/components/ui/hooks/useRouterModels" +import { getProviderModelConfig, getStaticModelsForProvider } from "@src/components/settings/utils/providerModelConfig" +import { filterModels } from "@src/components/settings/utils/organizationFilters" +import { vscode } from "@src/utils/vscode" +import { cn } from "@src/lib/utils" +import { PickerSearchField } from "./PickerSearchField" +import { useAppTranslation } from "@src/i18n/TranslationContext" + +type EffortOption = ReasoningEffortExtended | "disable" + +export function ProfileQuickSettings({ + disabled = false, + onModelSelected, +}: { + disabled?: boolean + onModelSelected?: () => void +}) { + const { t } = useAppTranslation() + const { apiConfiguration, currentApiConfigName, setApiConfiguration, organizationAllowList } = useExtensionState() + const { id: modelId, info } = useSelectedModel(apiConfiguration) + const provider = apiConfiguration?.apiProvider + const { data: routerModels } = useRouterModels({ provider, enabled: !!provider && isDynamicProvider(provider) }) + const [search, setSearch] = useState("") + const [openAiModels, setOpenAiModels] = useState>({}) + const latestConfiguration = useRef(apiConfiguration) + useEffect(() => { + latestConfiguration.current = apiConfiguration + }, [apiConfiguration]) + + useEffect(() => { + if (provider !== providerIdentifiers.openai) return + const onMessage = (event: MessageEvent) => { + if (event.data.type === OpenAiModelsMessageType.openAiModels) { + setOpenAiModels( + Object.fromEntries((event.data.openAiModels ?? []).map((id) => [id, openAiModelInfoSaneDefaults])), + ) + } + } + window.addEventListener("message", onMessage) + vscode.postMessage({ + type: OpenAiModelsMessageType.requestOpenAiModels, + values: { + baseUrl: apiConfiguration.openAiBaseUrl, + apiKey: apiConfiguration.openAiApiKey, + customHeaders: {}, + openAiHeaders: apiConfiguration.openAiHeaders ?? {}, + }, + }) + return () => window.removeEventListener("message", onMessage) + }, [provider, apiConfiguration.openAiBaseUrl, apiConfiguration.openAiApiKey, apiConfiguration.openAiHeaders]) + + if (!provider || isRetiredProvider(provider) || !currentApiConfigName) return null + const modelConfig = getProviderModelConfig(provider, apiConfiguration) + const models = + filterModels( + provider === providerIdentifiers.openai + ? openAiModels + : { + ...getStaticModelsForProvider(provider, undefined, apiConfiguration), + ...(isDynamicProvider(provider) ? routerModels?.[provider] : {}), + }, + provider, + organizationAllowList, + ) ?? {} + const modelIds = Object.keys(models) + .filter((id) => id !== "custom-arn" && (!models[id].deprecated || id === modelId)) + .filter((id) => id.toLowerCase().includes(search.toLowerCase())) + .sort((a, b) => a.localeCompare(b)) + const supports = + provider === providerIdentifiers.openai + ? (["disable", "low", "medium", "high", "xhigh", "max"] as const) + : info?.supportsReasoningEffort + const effortOptions: readonly EffortOption[] = + supports === true ? reasoningEfforts : Array.isArray(supports) ? supports : [] + const availableEfforts = info?.requiredReasoningEffort + ? effortOptions.filter((effort) => effort !== "disable") + : supports === true + ? ["disable" as const, ...effortOptions] + : effortOptions + const storedEffort = + provider === providerIdentifiers.openai + ? apiConfiguration.openAiCustomModelInfo?.reasoningEffort + : apiConfiguration.reasoningEffort + const defaultEffort = info?.reasoningEffort ?? (info?.requiredReasoningEffort ? "medium" : "disable") + const rawEffort = + !info?.requiredReasoningEffort && apiConfiguration.enableReasoningEffort === false + ? "disable" + : (storedEffort ?? defaultEffort) + const currentEffort = availableEfforts.includes(rawEffort) + ? rawEffort + : availableEfforts.includes(defaultEffort) + ? defaultEffort + : availableEfforts[0] + + // This menu is deliberately immediate-save, unlike the buffered SettingsView form. + const save = (patch: Partial) => { + if (disabled) return + const next = { ...latestConfiguration.current, ...patch } + latestConfiguration.current = next + setApiConfiguration(next) + vscode.postMessage({ type: "upsertApiConfiguration", text: currentApiConfigName, apiConfiguration: next }) + } + const selectModel = (id: string) => { + if (!modelConfig || disabled) return + save({ + [modelConfig.field]: id, + reasoningEffort: undefined, + enableReasoningEffort: undefined, + modelMaxTokens: undefined, + modelMaxThinkingTokens: undefined, + ...(provider === providerIdentifiers.bedrock ? { awsCustomArn: "" } : {}), + ...(provider === providerIdentifiers.openai + ? { + openAiCustomModelInfo: { + ...(latestConfiguration.current.openAiCustomModelInfo ?? openAiModelInfoSaneDefaults), + reasoningEffort: undefined, + }, + } + : {}), + }) + setSearch("") + onModelSelected?.() + } + const selectEffort = (effort: EffortOption) => { + save({ + reasoningEffort: effort, + enableReasoningEffort: effort !== "disable", + ...(provider === providerIdentifiers.openai + ? { + openAiCustomModelInfo: { + ...(latestConfiguration.current.openAiCustomModelInfo ?? openAiModelInfoSaneDefaults), + reasoningEffort: effort === "disable" ? undefined : effort, + }, + } + : {}), + }) + } + + return ( +
+ {modelConfig ? ( +
+ +
+ {modelIds.map((id) => ( + + ))} + {modelIds.length === 0 && ( +
+ {t("common:ui.no_results")} +
+ )} +
+
+ ) : ( +
+ {t("chat:modelPicker.modelSettingsHint")} +
+ )} + {availableEfforts.length > 0 && ( +
+
+
+
+ {availableEfforts.map((effort) => ( + + ))} +
+
+ )} +
+ ) +} diff --git a/webview-ui/src/components/chat/__tests__/ApiConfigSelector.spec.tsx b/webview-ui/src/components/chat/__tests__/ApiConfigSelector.spec.tsx index 420249b365..bb969e82f3 100644 --- a/webview-ui/src/components/chat/__tests__/ApiConfigSelector.spec.tsx +++ b/webview-ui/src/components/chat/__tests__/ApiConfigSelector.spec.tsx @@ -38,8 +38,19 @@ vi.mock("@roo-code/types", () => ({ // Mock Popover components to be testable vi.mock("@/components/ui", () => ({ - Popover: ({ children, open }: any) => ( + Popover: ({ + children, + open, + onOpenChange, + }: { + children: React.ReactNode + open: boolean + onOpenChange: (open: boolean) => void + }) => (
+ {children}
), @@ -48,6 +59,7 @@ vi.mock("@/components/ui", () => ({ {children} ), + PopoverAnchor: ({ children }: { children: React.ReactNode }) => <>{children}, PopoverContent: ({ children }: any) =>
{children}
, StandardTooltip: ({ children }: any) => <>{children}, Button: ({ children, onClick, ...props }: any) => ( @@ -89,6 +101,93 @@ describe("ApiConfigSelector", () => { expect(trigger).toHaveTextContent("Config 1") }) + test("shows models by default and temporarily replaces them with profiles", () => { + const { rerender } = render( + Model settings panel
} />, + ) + fireEvent.click(screen.getByTestId("toggle-popover")) + expect(screen.getByText("Model settings panel")).toBeInTheDocument() + expect(screen.queryByText("Config 2")).not.toBeInTheDocument() + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.selectProfile" })) + expect(screen.queryByText("Model settings panel")).not.toBeInTheDocument() + fireEvent.mouseEnter(screen.getByText("Config 2")) + expect(mockOnChange).not.toHaveBeenCalled() + fireEvent.click(screen.getByText("Config 2")) + expect(mockOnChange).toHaveBeenCalledWith("config2") + expect(screen.getByText("chat:modelPicker.loadingProfile")).toBeInTheDocument() + expect(screen.getByTestId("popover-root")).toHaveAttribute("data-open", "true") + rerender( + New profile models
} + />, + ) + expect(screen.getByText("New profile models")).toBeInTheDocument() + expect(screen.queryByText("chat:modelPicker.loadingProfile")).not.toBeInTheDocument() + }) + + test("can return from profile selection without changing the active profile", () => { + render(Model settings panel
} />) + const header = screen.getByRole("button", { name: "chat:modelPicker.selectProfile" }) + fireEvent.click(header) + fireEvent.click(header) + expect(screen.getByText("Model settings panel")).toBeInTheDocument() + expect(mockOnChange).not.toHaveBeenCalled() + }) + + test("closes the entire picker after a model is selected", () => { + render( + } + />, + ) + fireEvent.click(screen.getByTestId("toggle-popover")) + expect(screen.getByTestId("popover-root")).toHaveAttribute("data-open", "true") + fireEvent.click(screen.getByRole("button", { name: "Choose model" })) + expect(screen.getByTestId("popover-root")).toHaveAttribute("data-open", "false") + }) + + test("keeps profile search available for a short profile list in the combined picker", () => { + render(Model settings panel
} />) + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.selectProfile" })) + const input = screen.getByRole("textbox") + expect(input.parentElement?.parentElement).toHaveClass("px-3", "py-2") + const focus = vi.fn() + input.focus = focus + fireEvent.change(input, { target: { value: "Config 2" } }) + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.clearSearch" })) + expect(input).toHaveValue("") + expect(focus).toHaveBeenCalled() + }) + + test("shows profile / model and the reasoning badge on the existing trigger", () => { + render() + const trigger = screen.getByTestId("dropdown-trigger") + expect(trigger).toHaveTextContent("Config 1 / gpt-6.1-sol") + expect(trigger.querySelector('[aria-label="chat:modelPicker.reasoningEffortValue"]')).toHaveTextContent( + "chat:modelPicker.effort.high", + ) + fireEvent.click(screen.getByText("Config 2")) + expect(mockOnChange).toHaveBeenCalledWith("config2") + }) + + test.each([undefined, "disable"])("hides the badge when effort is %s", (reasoningEffort) => { + render() + expect( + screen + .getByTestId("dropdown-trigger") + .querySelector('[aria-label="chat:modelPicker.reasoningEffortValue"]'), + ).toBeNull() + }) + + test("keeps none visible as a valid reasoning effort", () => { + render() + expect(screen.getByLabelText("chat:modelPicker.reasoningEffortValue")).toBeInTheDocument() + }) + test("handles disabled state correctly", () => { render() diff --git a/webview-ui/src/components/chat/__tests__/PickerSearchField.spec.tsx b/webview-ui/src/components/chat/__tests__/PickerSearchField.spec.tsx new file mode 100644 index 0000000000..1c7fd122fa --- /dev/null +++ b/webview-ui/src/components/chat/__tests__/PickerSearchField.spec.tsx @@ -0,0 +1,42 @@ +import { useState } from "react" +import { fireEvent, render, screen } from "@testing-library/react" + +import { PickerSearchField } from "../PickerSearchField" + +function SearchFixture() { + const [value, setValue] = useState("") + return +} + +describe("PickerSearchField", () => { + it("uses shared spacing, placeholder and focus treatment", () => { + render() + const input = screen.getByRole("textbox", { name: "Search models" }) + expect(input).toHaveAttribute("placeholder", "common:ui.search_placeholder") + expect(input).toHaveClass("h-8") + expect(input.parentElement).toHaveClass("focus-within:ring-1") + expect(input.parentElement?.parentElement).toHaveClass("px-3", "py-2", "border-b") + }) + + it("clears the query and returns focus to the input", () => { + render() + const input = screen.getByRole("textbox") + // The shared test setup replaces native focus with a no-op for FAST compatibility. + const focus = vi.fn() + input.focus = focus + expect(screen.queryByRole("button", { name: "chat:modelPicker.clearSearch" })).not.toBeInTheDocument() + fireEvent.change(input, { target: { value: "query" } }) + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.clearSearch" })) + expect(input).toHaveValue("") + expect(focus).toHaveBeenCalled() + }) + + it("disables both the input and clear button", () => { + const onChange = vi.fn() + render() + expect(screen.getByRole("textbox")).toBeDisabled() + expect(screen.getByRole("button", { name: "chat:modelPicker.clearSearch" })).toBeDisabled() + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.clearSearch" })) + expect(onChange).not.toHaveBeenCalled() + }) +}) diff --git a/webview-ui/src/components/chat/__tests__/ProfileQuickSettings.spec.tsx b/webview-ui/src/components/chat/__tests__/ProfileQuickSettings.spec.tsx new file mode 100644 index 0000000000..7b897f6fcf --- /dev/null +++ b/webview-ui/src/components/chat/__tests__/ProfileQuickSettings.spec.tsx @@ -0,0 +1,155 @@ +import { fireEvent, render, screen } from "@testing-library/react" +import { type ModelInfo, type ProviderSettings, providerIdentifiers } from "@roo-code/types" + +import { ProfileQuickSettings } from "../ProfileQuickSettings" + +const mocks = vi.hoisted(() => ({ + configuration: {} as ProviderSettings, + info: { + contextWindow: 128000, + supportsPromptCache: false, + supportsReasoningEffort: ["low", "high"], + requiredReasoningEffort: true, + reasoningEffort: "high", + } as ModelInfo, + postMessage: vi.fn(), + setApiConfiguration: vi.fn(), +})) + +vi.mock("@src/utils/vscode", () => ({ vscode: { postMessage: mocks.postMessage } })) +vi.mock("@src/context/ExtensionStateContext", () => ({ + useExtensionState: () => ({ + apiConfiguration: mocks.configuration, + currentApiConfigName: "Work", + setApiConfiguration: mocks.setApiConfiguration, + organizationAllowList: { allowAll: true }, + }), +})) +vi.mock("@src/components/ui/hooks/useSelectedModel", () => ({ + useSelectedModel: () => ({ + id: mocks.configuration.apiModelId ?? mocks.configuration.openAiModelId, + info: mocks.info, + }), +})) +vi.mock("@src/components/ui/hooks/useRouterModels", () => ({ useRouterModels: () => ({ data: {} }) })) +vi.mock("@src/components/settings/utils/providerModelConfig", () => ({ + getProviderModelConfig: (provider: string) => ({ + field: provider === providerIdentifiers.openai ? "openAiModelId" : "apiModelId", + }), + getStaticModelsForProvider: () => ({ "model-a": {}, "model-b": {} }), +})) + +describe("ProfileQuickSettings", () => { + beforeEach(() => { + vi.clearAllMocks() + mocks.configuration = { + apiProvider: providerIdentifiers.openaiNative, + apiModelId: "model-a", + apiKey: "keep-secret", + } + mocks.info = { + contextWindow: 128000, + supportsPromptCache: false, + supportsReasoningEffort: ["low", "high"], + requiredReasoningEffort: true, + reasoningEffort: "high", + } + }) + + it("does not save on mount and filters available models", () => { + render() + expect(mocks.postMessage).not.toHaveBeenCalled() + expect( + screen.getByRole("textbox", { name: "chat:modelPicker.searchModels" }).parentElement?.parentElement, + ).toHaveClass("py-2") + fireEvent.change(screen.getByRole("textbox", { name: "chat:modelPicker.searchModels" }), { + target: { value: "model-b" }, + }) + expect(screen.queryByRole("button", { name: "model-a" })).not.toBeInTheDocument() + expect(screen.getByRole("button", { name: "model-b" })).toBeInTheDocument() + }) + + it("saves a selected model in the active profile and preserves credentials", () => { + render() + fireEvent.click(screen.getByRole("button", { name: "model-b" })) + expect(mocks.postMessage).toHaveBeenCalledWith({ + type: "upsertApiConfiguration", + text: "Work", + apiConfiguration: expect.objectContaining({ + apiModelId: "model-b", + apiKey: "keep-secret", + reasoningEffort: undefined, + }), + }) + expect(screen.getByRole("textbox", { name: "chat:modelPicker.searchModels" })).toBeInTheDocument() + }) + + it("saves effort after a model change without reverting the model", () => { + render() + fireEvent.click(screen.getByRole("button", { name: "model-b" })) + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.effort.low" })) + expect(mocks.postMessage).toHaveBeenLastCalledWith( + expect.objectContaining({ + apiConfiguration: expect.objectContaining({ + apiModelId: "model-b", + reasoningEffort: "low", + enableReasoningEffort: true, + }), + }), + ) + expect(screen.queryByRole("button", { name: "chat:modelPicker.off" })).not.toBeInTheDocument() + }) + + it("hides effort controls for a model without support", () => { + mocks.info = { contextWindow: 128000, supportsPromptCache: false, supportsReasoningEffort: false } + render() + expect(screen.queryByRole("group", { name: "chat:modelPicker.reasoningEffort" })).not.toBeInTheDocument() + }) + + it("loads OpenAI-compatible models and persists effort in custom model metadata", () => { + mocks.configuration = { + apiProvider: providerIdentifiers.openai, + openAiModelId: "custom", + openAiBaseUrl: "https://example.com/v1", + } + render() + expect(mocks.postMessage).toHaveBeenCalledWith(expect.objectContaining({ type: "requestOpenAiModels" })) + fireEvent( + window, + new MessageEvent("message", { data: { type: "openAiModels", openAiModels: ["custom", "other"] } }), + ) + fireEvent.click(screen.getByRole("button", { name: "other" })) + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.effort.xhigh" })) + expect(mocks.postMessage).toHaveBeenLastCalledWith( + expect.objectContaining({ + apiConfiguration: expect.objectContaining({ + openAiModelId: "other", + enableReasoningEffort: true, + openAiCustomModelInfo: expect.objectContaining({ reasoningEffort: "xhigh" }), + }), + }), + ) + }) + + it("disables writes while profile selection is disabled", () => { + render() + fireEvent.click(screen.getByRole("button", { name: "model-b" })) + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.effort.low" })) + expect(mocks.postMessage).not.toHaveBeenCalled() + }) + + it("requests closing only after saving a model, not after changing effort", () => { + const onModelSelected = vi.fn() + render() + fireEvent.click(screen.getByRole("button", { name: "chat:modelPicker.effort.low" })) + expect(onModelSelected).not.toHaveBeenCalled() + fireEvent.click(screen.getByRole("button", { name: "model-b" })) + expect(mocks.postMessage).toHaveBeenLastCalledWith( + expect.objectContaining({ + type: "upsertApiConfiguration", + apiConfiguration: expect.objectContaining({ apiModelId: "model-b" }), + }), + ) + expect(onModelSelected).toHaveBeenCalledTimes(1) + }) +}) diff --git a/webview-ui/src/components/chat/__tests__/modelPicker.translations.spec.tsx b/webview-ui/src/components/chat/__tests__/modelPicker.translations.spec.tsx new file mode 100644 index 0000000000..adf662bf75 --- /dev/null +++ b/webview-ui/src/components/chat/__tests__/modelPicker.translations.spec.tsx @@ -0,0 +1,54 @@ +import i18next from "i18next" +import { render, screen } from "@testing-library/react" + +import english from "@src/i18n/locales/en/chat.json" +import russian from "@src/i18n/locales/ru/chat.json" +import { TranslationContext } from "@src/i18n/TranslationContext" +import { PickerSearchField } from "../PickerSearchField" + +const locales = import.meta.glob<{ modelPicker: typeof english.modelPicker }>("../../../i18n/locales/*/chat.json", { + eager: true, + import: "default", +}) + +describe("model picker translations", () => { + it("provides every new label and effort level in all 18 locales", () => { + expect(Object.keys(locales)).toHaveLength(18) + for (const locale of Object.values(locales)) { + expect(Object.keys(locale.modelPicker).sort()).toEqual(Object.keys(english.modelPicker).sort()) + expect(Object.keys(locale.modelPicker.effort).sort()).toEqual( + Object.keys(english.modelPicker.effort).sort(), + ) + expect(locale.modelPicker.reasoningEffortValue).toContain("{{effort}}") + for (const value of Object.values(locale.modelPicker)) { + if (typeof value === "string") expect(value.trim()).not.toBe("") + } + } + }) + + it.each([ + ["en", "Clear search"], + ["ru", "Очистить поиск"], + ])("renders the search controls using the %s locale", async (language, clearLabel) => { + const instance = i18next.createInstance() + await instance.init({ + lng: language, + fallbackLng: "en", + resources: { en: { chat: english }, ru: { chat: russian } }, + }) + render( + instance.t(key, options), i18n: instance }}> + + , + ) + expect(screen.getByRole("button", { name: clearLabel })).toBeInTheDocument() + expect(screen.getByRole("textbox")).toHaveAccessibleName(instance.t("chat:modelPicker.searchModels")) + expect( + instance.t("chat:modelPicker.reasoningEffortValue", { effort: instance.t("chat:modelPicker.effort.high") }), + ).not.toContain("{{") + }) +}) diff --git a/webview-ui/src/i18n/locales/ca/chat.json b/webview-ui/src/i18n/locales/ca/chat.json index 76ec98e8f2..042e57409a 100644 --- a/webview-ui/src/i18n/locales/ca/chat.json +++ b/webview-ui/src/i18n/locales/ca/chat.json @@ -1,5 +1,26 @@ { "greeting": "Benvingut a Zoo Code!", + "modelPicker": { + "profile": "Perfil:", + "selectProfile": "Tria un perfil", + "loadingProfile": "S'està carregant el perfil…", + "searchModels": "Cerca models", + "providerModels": "Models del proveïdor actual", + "modelSettingsHint": "Tria un model a la configuració del perfil.", + "clearSearch": "Esborra la cerca", + "reasoningEffort": "Esforç de raonament", + "reasoningEffortValue": "Esforç de raonament: {{effort}}", + "off": "Desactivat", + "effort": { + "none": "Cap", + "minimal": "Mínim", + "low": "Baix", + "medium": "Mitjà", + "high": "Alt", + "xhigh": "Molt alt", + "max": "Màxim" + } + }, "task": { "title": "Tasca", "expand": "Expandir tasca", diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index eb0903d0ba..0eb498134a 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -1,5 +1,26 @@ { "greeting": "Willkommen bei Zoo Code!", + "modelPicker": { + "profile": "Profil:", + "selectProfile": "Profil auswählen", + "loadingProfile": "Profil wird geladen…", + "searchModels": "Modelle suchen", + "providerModels": "Modelle des aktuellen Anbieters", + "modelSettingsHint": "Wähle ein Modell in den Profileinstellungen aus.", + "clearSearch": "Suche leeren", + "reasoningEffort": "Denkaufwand", + "reasoningEffortValue": "Denkaufwand: {{effort}}", + "off": "Aus", + "effort": { + "none": "Keiner", + "minimal": "Minimal", + "low": "Niedrig", + "medium": "Mittel", + "high": "Hoch", + "xhigh": "Sehr hoch", + "max": "Maximal" + } + }, "task": { "title": "Aufgabe", "expand": "Aufgabe erweitern", diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index d3d219a54c..1d9fc93e5d 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -1,5 +1,26 @@ { "greeting": "Welcome to Zoo Code!", + "modelPicker": { + "profile": "Profile:", + "selectProfile": "Choose profile", + "loadingProfile": "Loading profile…", + "searchModels": "Search models", + "providerModels": "Models from the current provider", + "modelSettingsHint": "Choose a model in the profile settings.", + "clearSearch": "Clear search", + "reasoningEffort": "Reasoning effort", + "reasoningEffortValue": "Reasoning effort: {{effort}}", + "off": "Off", + "effort": { + "none": "None", + "minimal": "Minimal", + "low": "Low", + "medium": "Medium", + "high": "High", + "xhigh": "Extra high", + "max": "Max" + } + }, "task": { "title": "Task", "expand": "Expand task", diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index 602a109faa..44c1b77dbc 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -1,5 +1,26 @@ { "greeting": "¡Bienvenido a Zoo Code!", + "modelPicker": { + "profile": "Perfil:", + "selectProfile": "Elige un perfil", + "loadingProfile": "Cargando perfil…", + "searchModels": "Buscar modelos", + "providerModels": "Modelos del proveedor actual", + "modelSettingsHint": "Elige un modelo en la configuración del perfil.", + "clearSearch": "Borrar búsqueda", + "reasoningEffort": "Esfuerzo de razonamiento", + "reasoningEffortValue": "Esfuerzo de razonamiento: {{effort}}", + "off": "Desactivado", + "effort": { + "none": "Ninguno", + "minimal": "Mínimo", + "low": "Bajo", + "medium": "Medio", + "high": "Alto", + "xhigh": "Muy alto", + "max": "Máximo" + } + }, "task": { "title": "Tarea", "expand": "Expandir tarea", diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index ffff4caada..9526036644 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -1,5 +1,26 @@ { "greeting": "Bienvenue sur Zoo Code !", + "modelPicker": { + "profile": "Profil :", + "selectProfile": "Choisir un profil", + "loadingProfile": "Chargement du profil…", + "searchModels": "Rechercher des modèles", + "providerModels": "Modèles du fournisseur actuel", + "modelSettingsHint": "Choisis un modèle dans les paramètres du profil.", + "clearSearch": "Effacer la recherche", + "reasoningEffort": "Effort de raisonnement", + "reasoningEffortValue": "Effort de raisonnement : {{effort}}", + "off": "Désactivé", + "effort": { + "none": "Aucun", + "minimal": "Minimal", + "low": "Faible", + "medium": "Moyen", + "high": "Élevé", + "xhigh": "Très élevé", + "max": "Maximal" + } + }, "task": { "title": "Tâche", "expand": "Développer la tâche", diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index 3ac03b47c1..67483f715a 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -1,5 +1,26 @@ { "greeting": "Zoo Code में आपका स्वागत है!", + "modelPicker": { + "profile": "प्रोफ़ाइल:", + "selectProfile": "प्रोफ़ाइल चुनो", + "loadingProfile": "प्रोफ़ाइल लोड हो रही है…", + "searchModels": "मॉडल खोजो", + "providerModels": "मौजूदा प्रदाता के मॉडल", + "modelSettingsHint": "प्रोफ़ाइल सेटिंग में मॉडल चुनो।", + "clearSearch": "खोज साफ़ करो", + "reasoningEffort": "तर्क की गहराई", + "reasoningEffortValue": "तर्क की गहराई: {{effort}}", + "off": "बंद", + "effort": { + "none": "कोई नहीं", + "minimal": "न्यूनतम", + "low": "कम", + "medium": "मध्यम", + "high": "अधिक", + "xhigh": "बहुत अधिक", + "max": "अधिकतम" + } + }, "task": { "title": "कार्य", "expand": "कार्य विस्तृत करें", diff --git a/webview-ui/src/i18n/locales/id/chat.json b/webview-ui/src/i18n/locales/id/chat.json index 2833e146b9..94b0aa8ebd 100644 --- a/webview-ui/src/i18n/locales/id/chat.json +++ b/webview-ui/src/i18n/locales/id/chat.json @@ -1,5 +1,26 @@ { "greeting": "Selamat datang di Zoo Code!", + "modelPicker": { + "profile": "Profil:", + "selectProfile": "Pilih profil", + "loadingProfile": "Memuat profil…", + "searchModels": "Cari model", + "providerModels": "Model dari penyedia saat ini", + "modelSettingsHint": "Pilih model di pengaturan profil.", + "clearSearch": "Hapus pencarian", + "reasoningEffort": "Upaya penalaran", + "reasoningEffortValue": "Upaya penalaran: {{effort}}", + "off": "Nonaktif", + "effort": { + "none": "Tanpa penalaran", + "minimal": "Minimal", + "low": "Rendah", + "medium": "Sedang", + "high": "Tinggi", + "xhigh": "Sangat tinggi", + "max": "Maksimal" + } + }, "task": { "title": "Tugas", "expand": "Perluas tugas", diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index 5f4daf25e3..65b5ed4a87 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -1,5 +1,26 @@ { "greeting": "Benvenuto in Zoo Code!", + "modelPicker": { + "profile": "Profilo:", + "selectProfile": "Scegli un profilo", + "loadingProfile": "Caricamento del profilo…", + "searchModels": "Cerca modelli", + "providerModels": "Modelli del fornitore attuale", + "modelSettingsHint": "Scegli un modello nelle impostazioni del profilo.", + "clearSearch": "Cancella la ricerca", + "reasoningEffort": "Sforzo di ragionamento", + "reasoningEffortValue": "Sforzo di ragionamento: {{effort}}", + "off": "Disattivato", + "effort": { + "none": "Nessuno", + "minimal": "Minimo", + "low": "Basso", + "medium": "Medio", + "high": "Alto", + "xhigh": "Molto alto", + "max": "Massimo" + } + }, "task": { "title": "Attività", "expand": "Espandi attività", diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index 868232b977..53da695382 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -1,5 +1,26 @@ { "greeting": "Zoo Code へようこそ!", + "modelPicker": { + "profile": "プロファイル:", + "selectProfile": "プロファイルを選択", + "loadingProfile": "プロファイルを読み込み中…", + "searchModels": "モデルを検索", + "providerModels": "現在のプロバイダーのモデル", + "modelSettingsHint": "プロファイル設定でモデルを選択してね。", + "clearSearch": "検索をクリア", + "reasoningEffort": "推論の深さ", + "reasoningEffortValue": "推論の深さ: {{effort}}", + "off": "オフ", + "effort": { + "none": "なし", + "minimal": "最小", + "low": "低", + "medium": "中", + "high": "高", + "xhigh": "非常に高い", + "max": "最大" + } + }, "task": { "title": "タスク", "expand": "タスクを展開", diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index 623a391b56..515832a6b9 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -1,5 +1,26 @@ { "greeting": "Zoo Code에 오신 것을 환영합니다!", + "modelPicker": { + "profile": "프로필:", + "selectProfile": "프로필 선택", + "loadingProfile": "프로필 불러오는 중…", + "searchModels": "모델 검색", + "providerModels": "현재 제공업체의 모델", + "modelSettingsHint": "프로필 설정에서 모델을 선택해 줘.", + "clearSearch": "검색 지우기", + "reasoningEffort": "추론 강도", + "reasoningEffortValue": "추론 강도: {{effort}}", + "off": "끄기", + "effort": { + "none": "없음", + "minimal": "최소", + "low": "낮음", + "medium": "보통", + "high": "높음", + "xhigh": "매우 높음", + "max": "최대" + } + }, "task": { "title": "작업", "expand": "작업 펼치기", diff --git a/webview-ui/src/i18n/locales/nl/chat.json b/webview-ui/src/i18n/locales/nl/chat.json index 9bb3d0e3dc..5156bc93e7 100644 --- a/webview-ui/src/i18n/locales/nl/chat.json +++ b/webview-ui/src/i18n/locales/nl/chat.json @@ -1,5 +1,26 @@ { "greeting": "Welkom bij Zoo Code!", + "modelPicker": { + "profile": "Profiel:", + "selectProfile": "Profiel kiezen", + "loadingProfile": "Profiel laden…", + "searchModels": "Modellen zoeken", + "providerModels": "Modellen van de huidige aanbieder", + "modelSettingsHint": "Kies een model in de profielinstellingen.", + "clearSearch": "Zoekopdracht wissen", + "reasoningEffort": "Redeneerinspanning", + "reasoningEffortValue": "Redeneerinspanning: {{effort}}", + "off": "Uit", + "effort": { + "none": "Geen", + "minimal": "Minimaal", + "low": "Laag", + "medium": "Gemiddeld", + "high": "Hoog", + "xhigh": "Zeer hoog", + "max": "Maximaal" + } + }, "task": { "title": "Taak", "expand": "Taak uitvouwen", diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index 21f903ced2..b70b984661 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -1,5 +1,26 @@ { "greeting": "Witamy w Zoo Code!", + "modelPicker": { + "profile": "Profil:", + "selectProfile": "Wybierz profil", + "loadingProfile": "Ładowanie profilu…", + "searchModels": "Szukaj modeli", + "providerModels": "Modele bieżącego dostawcy", + "modelSettingsHint": "Wybierz model w ustawieniach profilu.", + "clearSearch": "Wyczyść wyszukiwanie", + "reasoningEffort": "Intensywność rozumowania", + "reasoningEffortValue": "Intensywność rozumowania: {{effort}}", + "off": "Wył.", + "effort": { + "none": "Brak", + "minimal": "Minimalna", + "low": "Niska", + "medium": "Średnia", + "high": "Wysoka", + "xhigh": "Bardzo wysoka", + "max": "Maksymalna" + } + }, "task": { "title": "Zadanie", "expand": "Rozwiń zadanie", diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index 1de53f8d2f..19ea628010 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -1,5 +1,26 @@ { "greeting": "Bem-vindo ao Zoo Code!", + "modelPicker": { + "profile": "Perfil:", + "selectProfile": "Escolher perfil", + "loadingProfile": "Carregando perfil…", + "searchModels": "Buscar modelos", + "providerModels": "Modelos do provedor atual", + "modelSettingsHint": "Escolha um modelo nas configurações do perfil.", + "clearSearch": "Limpar busca", + "reasoningEffort": "Esforço de raciocínio", + "reasoningEffortValue": "Esforço de raciocínio: {{effort}}", + "off": "Desativado", + "effort": { + "none": "Nenhum", + "minimal": "Mínimo", + "low": "Baixo", + "medium": "Médio", + "high": "Alto", + "xhigh": "Muito alto", + "max": "Máximo" + } + }, "task": { "title": "Tarefa", "expand": "Expandir tarefa", diff --git a/webview-ui/src/i18n/locales/ru/chat.json b/webview-ui/src/i18n/locales/ru/chat.json index 77f561b679..ddb6989f39 100644 --- a/webview-ui/src/i18n/locales/ru/chat.json +++ b/webview-ui/src/i18n/locales/ru/chat.json @@ -1,5 +1,26 @@ { "greeting": "Добро пожаловать в Zoo Code!", + "modelPicker": { + "profile": "Профиль:", + "selectProfile": "Выбрать профиль", + "loadingProfile": "Загрузка профиля…", + "searchModels": "Поиск моделей", + "providerModels": "Модели текущего провайдера", + "modelSettingsHint": "Выбери модель в настройках профиля.", + "clearSearch": "Очистить поиск", + "reasoningEffort": "Глубина рассуждений", + "reasoningEffortValue": "Глубина рассуждений: {{effort}}", + "off": "Выкл.", + "effort": { + "none": "Без рассуждений", + "minimal": "Минимальная", + "low": "Низкая", + "medium": "Средняя", + "high": "Высокая", + "xhigh": "Очень высокая", + "max": "Максимальная" + } + }, "task": { "title": "Задача", "expand": "Развернуть задачу", diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index 83c82c9aa2..ffb6421892 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -1,5 +1,26 @@ { "greeting": "Zoo Code'a hoş geldin!", + "modelPicker": { + "profile": "Profil:", + "selectProfile": "Profil seç", + "loadingProfile": "Profil yükleniyor…", + "searchModels": "Model ara", + "providerModels": "Geçerli sağlayıcının modelleri", + "modelSettingsHint": "Profil ayarlarından bir model seç.", + "clearSearch": "Aramayı temizle", + "reasoningEffort": "Akıl yürütme çabası", + "reasoningEffortValue": "Akıl yürütme çabası: {{effort}}", + "off": "Kapalı", + "effort": { + "none": "Yok", + "minimal": "Asgari", + "low": "Düşük", + "medium": "Orta", + "high": "Yüksek", + "xhigh": "Çok yüksek", + "max": "Azami" + } + }, "task": { "title": "Görev", "expand": "Görevi genişlet", diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index 5ca5b9eb46..9e9d7ec5dd 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -1,5 +1,26 @@ { "greeting": "Chào mừng đến với Zoo Code!", + "modelPicker": { + "profile": "Hồ sơ:", + "selectProfile": "Chọn hồ sơ", + "loadingProfile": "Đang tải hồ sơ…", + "searchModels": "Tìm mô hình", + "providerModels": "Mô hình của nhà cung cấp hiện tại", + "modelSettingsHint": "Chọn mô hình trong phần cài đặt hồ sơ.", + "clearSearch": "Xóa tìm kiếm", + "reasoningEffort": "Mức độ suy luận", + "reasoningEffortValue": "Mức độ suy luận: {{effort}}", + "off": "Tắt", + "effort": { + "none": "Không", + "minimal": "Tối thiểu", + "low": "Thấp", + "medium": "Trung bình", + "high": "Cao", + "xhigh": "Rất cao", + "max": "Tối đa" + } + }, "task": { "title": "Nhiệm vụ", "expand": "Mở rộng nhiệm vụ", diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index bb7caf68c2..ff735c95a3 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -1,5 +1,26 @@ { "greeting": "欢迎使用 Zoo Code!", + "modelPicker": { + "profile": "配置:", + "selectProfile": "选择配置", + "loadingProfile": "正在加载配置…", + "searchModels": "搜索模型", + "providerModels": "当前提供商的模型", + "modelSettingsHint": "在配置设置中选择模型。", + "clearSearch": "清除搜索", + "reasoningEffort": "推理强度", + "reasoningEffortValue": "推理强度:{{effort}}", + "off": "关闭", + "effort": { + "none": "无", + "minimal": "最低", + "low": "低", + "medium": "中", + "high": "高", + "xhigh": "超高", + "max": "最高" + } + }, "task": { "title": "任务", "expand": "展开任务", diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index 4675e39848..00f4e63302 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -1,5 +1,26 @@ { "greeting": "歡迎使用 Zoo Code!", + "modelPicker": { + "profile": "設定檔:", + "selectProfile": "選擇設定檔", + "loadingProfile": "正在載入設定檔…", + "searchModels": "搜尋模型", + "providerModels": "目前供應商的模型", + "modelSettingsHint": "在設定檔設定中選擇模型。", + "clearSearch": "清除搜尋", + "reasoningEffort": "推理強度", + "reasoningEffortValue": "推理強度:{{effort}}", + "off": "關閉", + "effort": { + "none": "無", + "minimal": "最低", + "low": "低", + "medium": "中", + "high": "高", + "xhigh": "超高", + "max": "最高" + } + }, "task": { "title": "工作", "expand": "展開工作",