From fece3b254841701efa1eaf86878812c037b87956 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Wed, 16 Apr 2025 01:18:59 -0700 Subject: [PATCH] update settings page --- .../react/src/void-settings-tsx/Settings.tsx | 459 ++++++++---------- 1 file changed, 203 insertions(+), 256 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx index 9dbb164e..a4fb5294 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx @@ -572,182 +572,6 @@ const RedoOnboardingButton = ({ className }: { className?: string }) => { } - -export const FeaturesTab = () => { - const voidSettingsState = useSettingsState() - const accessor = useAccessor() - const voidSettingsService = accessor.get('IVoidSettingsService') - - - return <> -

Models

- - - - - - - - - -

Local Providers

- {/*

{`Keep your data private by hosting AI locally on your computer.`}

*/} - {/*

{`Instructions:`}

*/} - {/*

{`Void can access any model that you host locally. We automatically detect your local models by default.`}

*/} -

{`Void can access any model that you host locally. We automatically detect your local models by default.`}

- -
- {ollamaSetupInstructions} -
- - - - - -

Providers

-

{`Void can access models from Anthropic, OpenAI, OpenRouter, and more.`}

- {/*

{`Access models like ChatGPT and Claude. We recommend using Anthropic or OpenAI as providers, or Groq as a faster alternative.`}

*/} - - - - - - -

Feature Options

- - {/* L1 */} -
- {/* FIM */} -
-

{displayInfoOfFeatureName('Autocomplete')}

-
- - Experimental.{' '} - - - Only works with FIM models.* - -
- -
- {/* Enable Switch */} -
- voidSettingsService.setGlobalSetting('enableAutocomplete', newVal)} - /> - {voidSettingsState.globalSettings.enableAutocomplete ? 'Enabled' : 'Disabled'} -
- {/* Model Dropdown */} -
- -
-
- -
- - {/* Apply */} -
-

{displayInfoOfFeatureName('Apply')}

-
Settings that control the behavior of the Apply button and the Edit tool.
- -
- {/* Sync to Chat Switch */} -
- voidSettingsService.setGlobalSetting('syncApplyToChat', newVal)} - /> - {voidSettingsState.globalSettings.syncApplyToChat ? 'Same as Chat model' : 'Different model'} -
- - {/* Model Dropdown */} -
- -
-
- - -
- {/* Fast Apply Method Dropdown */} -
- -
-
- -
- -
- - {/* L2 */} -
- - {/* Tools Section */} -
-

Tools

-
{`Tools are functions that LLMs can call. Some tools require user approval.`}
- -
- {/* Auto Accept Switch */} -
- voidSettingsService.setGlobalSetting('autoApprove', newVal)} - /> - {voidSettingsState.globalSettings.autoApprove ? 'Auto-approve' : 'Auto-approve'} -
- - {/* Tool Lint Errors Switch */} -
- voidSettingsService.setGlobalSetting('includeToolLintErrors', newVal)} - /> - {voidSettingsState.globalSettings.includeToolLintErrors ? 'Fix lint errors' : `Fix lint errors`} -
-
-
- - - -
-

Editor

-
{`Settings that control the visibility of suggestions and widgets in the code editor.`}
- -
- {/* Auto Accept Switch */} -
- voidSettingsService.setGlobalSetting('showInlineSuggestions', newVal)} - /> - {voidSettingsState.globalSettings.showInlineSuggestions ? 'Show suggestions on select' : 'Show suggestions on select'} -
-
-
- - -
- - -
- - - - -} - - type TransferEditorType = 'VS Code' | 'Cursor' | 'Windsurf' // https://github.com/VSCodium/vscodium/blob/master/docs/index.md#migrating-from-visual-studio-code-to-vscodium // https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed @@ -954,113 +778,236 @@ export const OneClickSwitchButton = ({ fromEditor = 'VS Code', className = '' }: } -const GeneralTab = () => { - const accessor = useAccessor() - const commandService = accessor.get('ICommandService') - const environmentService = accessor.get('IEnvironmentService') - const nativeHostService = accessor.get('INativeHostService') - - return <> -
-

One-Click Switch

-

{`Transfer your settings from another editor to Void in one click.`}

- -
- - - -
-
- - - -
-

Built-in Settings

-

{`IDE settings, keyboard settings, and theme customization.`}

- -
- { commandService.executeCommand('workbench.action.openSettings') }}> - General Settings - -
-
- { commandService.executeCommand('workbench.action.openGlobalKeybindings') }}> - Keyboard Settings - -
-
- { commandService.executeCommand('workbench.action.selectTheme') }}> - Theme Settings - -
-
- { nativeHostService.showItemInFolder(environmentService.logsHome.fsPath) }}> - Open Logs - -
-
- - -
-

AI Instructions

-

{`Instructions to include on all AI requests.`}

- -
- - - -} - // full settings export const Settings = () => { const isDark = useIsDark() - - const [tab, setTab] = useState('models') + const accessor = useAccessor() + const commandService = accessor.get('ICommandService') + const environmentService = accessor.get('IEnvironmentService') + const nativeHostService = accessor.get('INativeHostService') + const settingsState = useSettingsState() + const voidSettingsService = accessor.get('IVoidSettingsService') return
-
+

{`Void's Settings`}

{/* separator */}
-
+ {/* Models section (formerly FeaturesTab) */} + +

Models

+ + + + + +
+ + +

Local Providers

+

{`Void can access any model that you host locally. We automatically detect your local models by default.`}

+ +
+ {ollamaSetupInstructions} +
+ + + + + +

Providers

+

{`Void can access models from Anthropic, OpenAI, OpenRouter, and more.`}

+ + + + + + +

Feature Options

+ {/* L1 */} + + +
+ {/* FIM */} +
+

{displayInfoOfFeatureName('Autocomplete')}

+
+ + Experimental.{' '} + + + Only works with FIM models.* + +
+ +
+ {/* Enable Switch */} +
+ voidSettingsService.setGlobalSetting('enableAutocomplete', newVal)} + /> + {settingsState.globalSettings.enableAutocomplete ? 'Enabled' : 'Disabled'} +
+ {/* Model Dropdown */} +
+ +
+
+ +
+ + {/* Apply */} +
+

{displayInfoOfFeatureName('Apply')}

+
Settings that control the behavior of the Apply button and the Edit tool.
+ +
+ {/* Sync to Chat Switch */} +
+ voidSettingsService.setGlobalSetting('syncApplyToChat', newVal)} + /> + {settingsState.globalSettings.syncApplyToChat ? 'Same as Chat model' : 'Different model'} +
+ + {/* Model Dropdown */} +
+ +
+
+ + +
+ {/* Fast Apply Method Dropdown */} +
+ +
+
+ +
- {/* tabs */} -
- -
- - {/* separator */} -
+ - {/* content */} -
+ {/* L2 */} + -
- +
+ + {/* Tools Section */} +
+

Tools

+
{`Tools are functions that LLMs can call. Some tools require user approval.`}
+ +
+ {/* Auto Accept Switch */} +
+ voidSettingsService.setGlobalSetting('autoApprove', newVal)} + /> + {settingsState.globalSettings.autoApprove ? 'Auto-approve' : 'Auto-approve'} +
+ + {/* Tool Lint Errors Switch */} +
+ voidSettingsService.setGlobalSetting('includeToolLintErrors', newVal)} + /> + {settingsState.globalSettings.includeToolLintErrors ? 'Fix lint errors' : `Fix lint errors`} +
+
-
- -
+ +
+

Editor

+
{`Settings that control the visibility of suggestions and widgets in the code editor.`}
+ +
+ {/* Auto Accept Switch */} +
+ voidSettingsService.setGlobalSetting('showInlineSuggestions', newVal)} + /> + {settingsState.globalSettings.showInlineSuggestions ? 'Show suggestions on select' : 'Show suggestions on select'} +
+
+
+
+ + + + {/* General section (formerly GeneralTab) */} +
+

One-Click Switch

+

{`Transfer your settings from another editor to Void in one click.`}

+ +
+ + +
+ + +
+

Built-in Settings

+

{`IDE settings, keyboard settings, and theme customization.`}

+ +
+ { commandService.executeCommand('workbench.action.openSettings') }}> + General Settings + +
+
+ { commandService.executeCommand('workbench.action.openGlobalKeybindings') }}> + Keyboard Settings + +
+
+ { commandService.executeCommand('workbench.action.selectTheme') }}> + Theme Settings + +
+
+ { nativeHostService.showItemInFolder(environmentService.logsHome.fsPath) }}> + Open Logs + +
+
+ + +
+

AI Instructions

+

{`Instructions to include on all AI requests.`}

+ +
-
}