import { useRef, useState } from "react"; import { createRoot } from "react-dom/client"; import type { IServiceAccessor } from "@zcode/services"; import type { IPlatformService, ZCodeConfigOption } from "@zcode/shared"; import { ThoughtLevelCycleControl } from "@/chat-input-toolbar/ThoughtLevelCycleControl.js"; import { getNextThoughtLevelValue } from "@/chat-input-toolbar/thoughtLevelOptions.js"; import { TooltipProvider } from "@/components/ui/tooltip.js"; import { PlatformProvider } from "@/hooks/usePlatform.js"; import { ServiceProvider } from "@/hooks/useServices.js"; import { ZCodeIntlProvider, useZCodeIntl } from "@/i18n/IntlProvider.js"; import { SubagentReasoningField } from "@/settings/SubagentReasoningField.js"; import { useToolbarShortcutBindings } from "@/v4/composer/toolbarShortcuts.js"; import "@/styles.css"; const params = new URLSearchParams(location.search); document.documentElement.className = params.get("theme") === "light" ? "light theme-zai-light" : "dark theme-zai-dark"; const services = { settingService: { get: async () => ({}) } } as unknown as IServiceAccessor; const platform = {} as IPlatformService; const values = [ "nothink", "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "extra-high", "extra_high", "default", ]; const options = values.map((value) => ({ value, name: value === "default" ? "Provider default" : value, })); const noop = () => {}; function Fixture() { const { intl } = useZCodeIntl(); const [value, setValue] = useState("minimal"); const [committed, setCommitted] = useState(""); const selectRef = useRef(null); const cycleRef = useRef(null); const option: ZCodeConfigOption = { id: "thought_level", category: "thought_level", type: "select", currentValue: value, options, }; const select = (next: string) => { setValue(next); setCommitted(next); }; useToolbarShortcutBindings({ hasAnyOption: true, toolbarDisabled: false, modelMenuDisabled: true, thoughtOption: option, onOpenModelMenu: noop, onCycleSessionMode: noop, onCycleThoughtLevel: () => { const next = getNextThoughtLevelValue(option); if (next !== null) select(next); }, }); return (

Composer

Subagent

{value} {committed}
); } createRoot(document.getElementById("root")!).render( , );