Skip to content

Commit 391e5aa

Browse files
committed
refactor(settings): remove top-level ReasoningModeSelector from Providers tab
- Drop ReasoningModeSelector component and its spec; Ollama's own thinking checkbox + effort dropdown (gated on enableReasoningEffort) is the single reasoning control, so the duplicated top-level selector is removed and SettingsView no longer imports it - Clean up unused providerIdentifiers/useSelectedModel imports in SettingsView and revert the Providers section to ApiConfigManager + ApiOptions layout - Use `satisfies` instead of `as` casts in reasoning-effort spec
1 parent 9e6edc5 commit 391e5aa

4 files changed

Lines changed: 37 additions & 398 deletions

File tree

‎webview-ui/src/components/settings/ReasoningModeSelector.tsx‎

Lines changed: 0 additions & 125 deletions
This file was deleted.

‎webview-ui/src/components/settings/SettingsView.tsx‎

Lines changed: 33 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@ import {
4040
DEFAULT_AUTO_CLOSE_ZOO_OPENED_NEW_FILES,
4141
DEFAULT_CHECKPOINT_TIMEOUT_SECONDS,
4242
ImageGenerationProvider,
43-
providerIdentifiers,
4443
} from "@roo-code/types"
4544

4645
import { vscode } from "@src/utils/vscode"
4746
import { cn } from "@src/lib/utils"
4847
import { useAppTranslation } from "@src/i18n/TranslationContext"
49-
import { useSelectedModel } from "@src/components/ui/hooks/useSelectedModel"
5048
import { ExtensionStateContextType, useExtensionState } from "@src/context/ExtensionStateContext"
5149
import {
5250
AlertDialog,
@@ -70,7 +68,6 @@ import { SetCachedStateField, SetExperimentEnabled } from "./types"
7068
import { SectionHeader } from "./SectionHeader"
7169
import ApiConfigManager from "./ApiConfigManager"
7270
import ApiOptions from "./ApiOptions"
73-
import { ReasoningModeSelector } from "./ReasoningModeSelector"
7471
import { AutoApproveSettings } from "./AutoApproveSettings"
7572
import { CheckpointSettings } from "./CheckpointSettings"
7673
import { NotificationSettings } from "./NotificationSettings"
@@ -226,8 +223,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
226223

227224
const apiConfiguration = useMemo(() => cachedState.apiConfiguration ?? {}, [cachedState.apiConfiguration])
228225

229-
const selectedModelInfo = useSelectedModel(apiConfiguration).info
230-
231226
useEffect(() => {
232227
// Update when currentApiConfigName or mode changes.
233228
// Expected to be triggered by loadApiConfiguration/upsertApiConfiguration or mode switch.
@@ -775,55 +770,39 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
775770
<SectionHeader>{t("settings:sections.providers")}</SectionHeader>
776771

777772
<Section>
778-
<div className="flex flex-col gap-4 md:flex-row md:items-start">
779-
<div className="flex-1 min-w-0">
780-
<ApiConfigManager
781-
currentApiConfigName={currentApiConfigName}
782-
listApiConfigMeta={listApiConfigMeta}
783-
onSelectConfig={(configName: string) =>
784-
checkUnsaveChanges(() =>
785-
vscode.postMessage({
786-
type: "loadApiConfiguration",
787-
text: configName,
788-
}),
789-
)
790-
}
791-
onDeleteConfig={(configName: string) =>
792-
vscode.postMessage({
793-
type: "deleteApiConfiguration",
794-
text: configName,
795-
})
796-
}
797-
onRenameConfig={(oldName: string, newName: string) => {
798-
vscode.postMessage({
799-
type: "renameApiConfiguration",
800-
values: { oldName, newName },
801-
apiConfiguration,
802-
})
803-
prevApiConfigName.current = newName
804-
}}
805-
onUpsertConfig={(configName: string) =>
806-
vscode.postMessage({
807-
type: "upsertApiConfiguration",
808-
text: configName,
809-
apiConfiguration,
810-
})
811-
}
812-
/>
813-
</div>
814-
{/* Ollama owns its reasoning-effort UI inside the provider
815-
component (gated by its "Enable thinking" checkbox, which
816-
controls the native think parameter). Rendering the
817-
top-level selector for Ollama would duplicate it and its
818-
sync effect would force enableReasoningEffort back on. */}
819-
{apiConfiguration.apiProvider !== providerIdentifiers.ollama && (
820-
<ReasoningModeSelector
821-
apiConfiguration={apiConfiguration}
822-
setApiConfigurationField={setApiConfigurationField}
823-
modelInfo={selectedModelInfo}
824-
/>
825-
)}
826-
</div>
773+
<ApiConfigManager
774+
currentApiConfigName={currentApiConfigName}
775+
listApiConfigMeta={listApiConfigMeta}
776+
onSelectConfig={(configName: string) =>
777+
checkUnsaveChanges(() =>
778+
vscode.postMessage({
779+
type: "loadApiConfiguration",
780+
text: configName,
781+
}),
782+
)
783+
}
784+
onDeleteConfig={(configName: string) =>
785+
vscode.postMessage({
786+
type: "deleteApiConfiguration",
787+
text: configName,
788+
})
789+
}
790+
onRenameConfig={(oldName: string, newName: string) => {
791+
vscode.postMessage({
792+
type: "renameApiConfiguration",
793+
values: { oldName, newName },
794+
apiConfiguration,
795+
})
796+
prevApiConfigName.current = newName
797+
}}
798+
onUpsertConfig={(configName: string) =>
799+
vscode.postMessage({
800+
type: "upsertApiConfiguration",
801+
text: configName,
802+
apiConfiguration,
803+
})
804+
}
805+
/>
827806
<ApiOptions
828807
uriScheme={uriScheme}
829808
apiConfiguration={apiConfiguration}

0 commit comments

Comments
 (0)