From dc4cfbdd1dc4c43f0d0c8d2a96932f03d178405c Mon Sep 17 00:00:00 2001 From: Tajudeen Date: Thu, 23 Jul 2026 14:37:34 +0100 Subject: [PATCH] Replace VoidButtonBgDarken with design-system buttons in Settings. Settings now uses native btn btn-secondary btn-sm elements directly, removing the legacy wrapper and tightening Phase 1 design-system adoption. Co-authored-by: Cursor --- .../browser/react/src/settings/Settings.tsx | 65 ++++++++++--------- .../browser/react/src/util/inputs.tsx | 10 --- .../test/common/designSystem.test.ts | 2 + 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/src/vs/workbench/contrib/cortexide/browser/react/src/settings/Settings.tsx b/src/vs/workbench/contrib/cortexide/browser/react/src/settings/Settings.tsx index 1a0b17b7fa4..7cfde0069a5 100644 --- a/src/vs/workbench/contrib/cortexide/browser/react/src/settings/Settings.tsx +++ b/src/vs/workbench/contrib/cortexide/browser/react/src/settings/Settings.tsx @@ -6,7 +6,7 @@ import React, { useCallback, useEffect, useMemo, useState, useRef } from 'react'; // Added useRef import just in case it was missed, though likely already present import { ProviderName, SettingName, displayInfoOfSettingName, providerNames, CortexideStatefulModelInfo, customSettingNamesOfProvider, RefreshableProviderName, refreshableProviderNames, displayInfoOfProviderName, nonlocalProviderNames, localProviderNames, GlobalSettingName, featureNames, displayInfoOfFeatureName, isProviderNameDisabled, FeatureName, hasDownloadButtonsOnModelsProviderNames, subTextMdOfProviderName } from '../../../../common/cortexideSettingsTypes.js' import ErrorBoundary from '../sidebar-tsx/ErrorBoundary.js' -import { VoidButtonBgDarken, VoidCustomDropdownBox, VoidInputBox2, VoidSimpleInputBox, VoidSwitch } from '../util/inputs.js' +import { VoidCustomDropdownBox, VoidInputBox2, VoidSimpleInputBox, VoidSwitch } from '../util/inputs.js' import { useAccessor, useIsDark, useIsOptedOut, useRefreshModelListener, useRefreshModelState, useSettingsState } from '../util/services.js' import { X, RefreshCw, Loader2, Check, Asterisk, Plus } from 'lucide-react' import { URI } from '../../../../../../../base/common/uri.js' @@ -262,7 +262,7 @@ const ConfirmButton = ({ children, onConfirm, className }: { children: React.Rea }, [confirm]); return (
- { +
); }; @@ -431,9 +431,9 @@ const SimpleModelSettingsDialog = ({
- + @@ -918,12 +918,12 @@ const ProjectRulesSection = () => { {t('rules.description')}
- + +
{rules.length === 0 ? (

{t('rules.noRules')}

@@ -1529,13 +1529,13 @@ export const OneClickSwitchButton = ({ fromEditor = 'VS Code', className = '' }: } return <> - + {transferState.type === 'done' && transferState.error ? : null} } @@ -2134,12 +2134,12 @@ export const Settings = () => { {/* Settings Subcategory */}
- { fileInputSettingsRef.current?.click() }}> + + { cortexideSettingsService.resetState(); }}> Reset Settings @@ -2148,12 +2148,12 @@ export const Settings = () => { {/* Chats Subcategory */}
- { fileInputChatsRef.current?.click() }}> + + { chatThreadsService.resetState(); }}> Reset Chats @@ -2170,18 +2170,18 @@ export const Settings = () => {
- { commandService.executeCommand('workbench.action.openSettings') }}> + + + +
@@ -2266,11 +2266,12 @@ Use Model Context Protocol to provide Agent mode with more tools. `} chatMessageLocation={undefined} />
- { await mcpService.revealMCPConfigFile() }}> +
diff --git a/src/vs/workbench/contrib/cortexide/browser/react/src/util/inputs.tsx b/src/vs/workbench/contrib/cortexide/browser/react/src/util/inputs.tsx index 3f70ddf96d5..8f35d1c8414 100644 --- a/src/vs/workbench/contrib/cortexide/browser/react/src/util/inputs.tsx +++ b/src/vs/workbench/contrib/cortexide/browser/react/src/util/inputs.tsx @@ -1829,16 +1829,6 @@ export const BlockCode = ({ initValue, language, maxHeight, showScrollbars }: Bl } - -export const VoidButtonBgDarken = ({ children, disabled, onClick, className }: { children: React.ReactNode; disabled?: boolean; onClick: () => void; className?: string }) => { - return -} - // export const VoidScrollableElt = ({ options, children }: { options: ScrollableElementCreationOptions, children: React.ReactNode }) => { // const instanceRef = useRef(null); // const [childrenPortal, setChildrenPortal] = useState(null) diff --git a/src/vs/workbench/contrib/cortexide/test/common/designSystem.test.ts b/src/vs/workbench/contrib/cortexide/test/common/designSystem.test.ts index b0ee7f375af..4e00fdfaeb3 100644 --- a/src/vs/workbench/contrib/cortexide/test/common/designSystem.test.ts +++ b/src/vs/workbench/contrib/cortexide/test/common/designSystem.test.ts @@ -92,6 +92,8 @@ suite('designSystem (Phase 1 — settings adoption)', () => { const src = readFileSync(settingsPath, 'utf8'); assert.ok(src.includes('btn btn-primary'), 'expected btn-primary in settings'); assert.ok(src.includes('btn btn-secondary'), 'expected btn-secondary in settings'); + assert.ok(!src.includes('VoidButtonBgDarken'), 'settings should use native buttons, not VoidButtonBgDarken'); + assert.ok((src.match(/btn btn-secondary/g) ?? []).length >= 10, 'expected direct btn-secondary usage'); assert.ok(src.includes('btn-stop'), 'expected btn-stop for destructive Ollama delete'); assert.ok(src.includes("'dropdown "), 'expected dropdown class on Ollama selects'); });