From 1d15d29a19889bf6762e2091088d05d68d29c00a Mon Sep 17 00:00:00 2001 From: vrtnis <123119434+vrtnis@users.noreply.github.com> Date: Sun, 18 May 2025 20:46:45 +0000 Subject: [PATCH 1/6] Updated Settings.tsx with new sidebar tabs --- .../react/src/void-settings-tsx/Settings.tsx | 110 +++++++++++++++--- 1 file changed, 95 insertions(+), 15 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 2200dee7..14af51ed 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 @@ -19,6 +19,16 @@ import { ToolApprovalType, toolApprovalTypes } from '../../../../common/toolsSer import Severity from '../../../../../../../base/common/severity.js' import { getModelCapabilities, ModelOverrides } from '../../../../common/modelCapabilities.js'; import { TransferEditorType, TransferFilesInfo } from '../../../extensionTransferTypes.js'; +// ───────────────────────────────────────────── +// Sidebar navigation helpers +// ───────────────────────────────────────────── +type SectionKey = + | 'models' + | 'localProviders' + | 'providers' + | 'featureOptions' + | 'general' + | 'all'; const ButtonLeftTextRightOption = ({ text, leftButton }: { text: string, leftButton?: React.ReactNode }) => { @@ -906,6 +916,19 @@ export const OneClickSwitchButton = ({ fromEditor = 'VS Code', className = '' }: export const Settings = () => { const isDark = useIsDark() + // ─── sidebar nav ────────────────────────── + const [selectedSection, setSelectedSection] = + useState('models'); + + const navItems: { key: SectionKey; label: string }[] = [ + { key: 'models', label: 'Models' }, + { key: 'localProviders', label: 'Local Providers' }, + { key: 'providers', label: 'Providers' }, + { key: 'featureOptions', label: 'Feature Options' }, + { key: 'general', label: 'General' }, + { key: 'all', label: 'All Settings' }, + ]; + const show = (key: SectionKey) => selectedSection === 'all' || selectedSection === key; const accessor = useAccessor() const commandService = accessor.get('ICommandService') const environmentService = accessor.get('IEnvironmentService') @@ -979,10 +1002,44 @@ export const Settings = () => { } - return
-
+ return ( +
+
+ {/* ────────────── SIDEBAR ────────────── */} -
+ + + {/* ───────────── MAIN PANE ───────────── */} +
+ + + +

{`Void's Settings`}

@@ -997,13 +1054,19 @@ export const Settings = () => { {/* Models section (formerly FeaturesTab) */} +{show('models') && ( +<>

Models

+ + )} - +{show('localProviders') && ( + + <>

Local Providers

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

@@ -1012,18 +1075,26 @@ export const Settings = () => {
- - - + + +
+)} +{show('providers') && ( + + <>

Providers

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

- + - - + +
+)} +{show('featureOptions') && ( + + <>

Feature Options

@@ -1108,7 +1179,6 @@ export const Settings = () => { - {/* Tools Section */}

Tools

@@ -1161,8 +1231,14 @@ export const Settings = () => {
+ + +)} +{show('general') && ( + <> + {/* General section (formerly GeneralTab) */}
@@ -1248,9 +1324,13 @@ Alternatively, place a \`.voidrules\` file in the root of your workspace. -
-
-
-} + +)} +
+ +
+ +); +} From 382ecaae1b1be42ea51f75009a1d5d60561ae0e8 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 00:34:42 -0700 Subject: [PATCH 2/6] auto format --- .../react/src/void-settings-tsx/Settings.tsx | 642 +++++++++--------- 1 file changed, 321 insertions(+), 321 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 1efb8d63..6ae26df6 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 @@ -23,12 +23,12 @@ import { TransferEditorType, TransferFilesInfo } from '../../../extensionTransfe // Sidebar navigation helpers // ───────────────────────────────────────────── type SectionKey = - | 'models' - | 'localProviders' - | 'providers' - | 'featureOptions' - | 'general' - | 'all'; + | 'models' + | 'localProviders' + | 'providers' + | 'featureOptions' + | 'general' + | 'all'; const ButtonLeftTextRightOption = ({ text, leftButton }: { text: string, leftButton?: React.ReactNode }) => { @@ -910,19 +910,19 @@ export const OneClickSwitchButton = ({ fromEditor = 'VS Code', className = '' }: export const Settings = () => { const isDark = useIsDark() - // ─── sidebar nav ────────────────────────── - const [selectedSection, setSelectedSection] = - useState('models'); + // ─── sidebar nav ────────────────────────── + const [selectedSection, setSelectedSection] = + useState('models'); - const navItems: { key: SectionKey; label: string }[] = [ - { key: 'models', label: 'Models' }, - { key: 'localProviders', label: 'Local Providers' }, - { key: 'providers', label: 'Providers' }, - { key: 'featureOptions', label: 'Feature Options' }, - { key: 'general', label: 'General' }, - { key: 'all', label: 'All Settings' }, - ]; - const show = (key: SectionKey) => selectedSection === 'all' || selectedSection === key; + const navItems: { key: SectionKey; label: string }[] = [ + { key: 'models', label: 'Models' }, + { key: 'localProviders', label: 'Local Providers' }, + { key: 'providers', label: 'Providers' }, + { key: 'featureOptions', label: 'Feature Options' }, + { key: 'general', label: 'General' }, + { key: 'all', label: 'All Settings' }, + ]; + const show = (key: SectionKey) => selectedSection === 'all' || selectedSection === key; const accessor = useAccessor() const commandService = accessor.get('ICommandService') const environmentService = accessor.get('IEnvironmentService') @@ -997,334 +997,334 @@ export const Settings = () => { return ( -
-
- {/* ────────────── SIDEBAR ────────────── */} +
+
+ {/* ────────────── SIDEBAR ────────────── */} - - - {/* ───────────── MAIN PANE ───────────── */} -
- - - -
- -

{`Void's Settings`}

- -
- - {/* Models section (formerly FeaturesTab) */} - - - - -
- - {/* Models section (formerly FeaturesTab) */} - -{show('models') && ( -<> -

Models

- -
- - - - )} - -{show('localProviders') && ( - - <> - -

Local Providers

-

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

- -
- -
- - - - -
-)} -{show('providers') && ( - - <> -

Providers

-

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

- - - -
-)} - - -{show('featureOptions') && ( - - <> -

Feature Options

- -
- - {/* 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.
- -
- {/* Sync to Chat Switch */} -
- voidSettingsService.setGlobalSetting('syncApplyToChat', newVal)} - /> - {settingsState.globalSettings.syncApplyToChat ? 'Same as Chat model' : 'Different model'} -
- - {/* Model Dropdown */} -
- -
-
- - -
- {/* Fast Apply Method Dropdown */} -
- -
-
- -
-
- - - - - {/* Tools Section */} -
-

Tools

-
{`Tools are functions that LLMs can call. Some tools require user approval.`}
- -
- {/* Auto Accept Switch */} - - {[...toolApprovalTypes].map((approvalType) => { - return
- -
- })} - -
- - {/* Tool Lint Errors Switch */} - - -
- voidSettingsService.setGlobalSetting('includeToolLintErrors', newVal)} - /> - {settingsState.globalSettings.includeToolLintErrors ? 'Fix lint errors' : `Fix lint errors`} -
-
-
+ > + {label} + + ))}
+ + + {/* ───────────── MAIN PANE ───────────── */} +
-
-

Editor

-
{`Settings that control the visibility of Void suggestions in the code editor.`}
+
-
- {/* Auto Accept Switch */} +

{`Void's Settings`}

+ +
+ + {/* Models section (formerly FeaturesTab) */} + + + + +
+ + {/* Models section (formerly FeaturesTab) */} + + {show('models') && ( + <> +

Models

+ +
+ + + + )} + + {show('localProviders') && ( -
- voidSettingsService.setGlobalSetting('showInlineSuggestions', newVal)} - /> - {settingsState.globalSettings.showInlineSuggestions ? 'Show suggestions on select' : 'Show suggestions on select'} -
+ <> + +

Local Providers

+

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

+ +
+ +
+ + + +
-
-
-
- - -)} + )} + {show('providers') && ( + + <> +

Providers

+

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

+ + + +
+ )} -{show('general') && ( - <> + {show('featureOptions') && ( + + <> +

Feature Options

- {/* General section (formerly GeneralTab) */} -
- -

One-Click Switch

-

{`Transfer your editor settings into Void.`}

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

{displayInfoOfFeatureName('Autocomplete')}

+
+ + Experimental.{' '} + + + Only works with FIM models.* + +
-
- - - -
- -
+
+ {/* Enable Switch */} + +
+ voidSettingsService.setGlobalSetting('enableAutocomplete', newVal)} + /> + {settingsState.globalSettings.enableAutocomplete ? 'Enabled' : 'Disabled'} +
+
- {/* Import/Export section, as its own block right after One-Click Switch */} -
-

Import/Export

-

{`Transfer Void's settings and chats in and out of Void.`}

-
- {/* Settings Subcategory */} -
- - { fileInputSettingsRef.current?.click() }}> - Import Settings - - onDownload('Settings')}> - Export Settings - - { voidSettingsService.resetState(); }}> - Reset Settings - -
- {/* Chats Subcategory */} -
- - { fileInputChatsRef.current?.click() }}> - Import Chats - - onDownload('Chats')}> - Export Chats - - { chatThreadsService.resetState(); }}> - Reset Chats - -
-
-
+ {/* Model Dropdown */} + +
+ +
+
+ +
+ +
+
+ + {/* Apply */} + + +
+

{displayInfoOfFeatureName('Apply')}

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

Built-in Settings

-

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

+ {/* Tools Section */} +
+

Tools

+
{`Tools are functions that LLMs can call. Some tools require user approval.`}
- -
- { 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 - -
-
-
+
+ {/* Auto Accept Switch */} + + {[...toolApprovalTypes].map((approvalType) => { + return
+ +
+ })} + +
+ + {/* Tool Lint Errors Switch */} + + +
+ voidSettingsService.setGlobalSetting('includeToolLintErrors', newVal)} + /> + {settingsState.globalSettings.includeToolLintErrors ? 'Fix lint errors' : `Fix lint errors`} +
+
+
+
-
-

AI Instructions

-

- +

Editor

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

+
+ +
+ )} + + + {show('general') && ( + <> + + {/* General section (formerly GeneralTab) */} +
+ +

One-Click Switch

+

{`Transfer your editor settings into Void.`}

+ +
+ + + +
+
+
+ + {/* Import/Export section, as its own block right after One-Click Switch */} +
+

Import/Export

+

{`Transfer Void's settings and chats in and out of Void.`}

+
+ {/* Settings Subcategory */} +
+ + { fileInputSettingsRef.current?.click() }}> + Import Settings + + onDownload('Settings')}> + Export Settings + + { voidSettingsService.resetState(); }}> + Reset Settings + +
+ {/* Chats Subcategory */} +
+ + { fileInputChatsRef.current?.click() }}> + Import Chats + + onDownload('Chats')}> + Export Chats + + { chatThreadsService.resetState(); }}> + Reset Chats + +
+
+
+ + + +
+ +

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

+

+ -

- - - -
- -)} + + + + +
+ + )} -
-
-
-
-); +
+
+
+
+ ); } From 57d94d2d449f1b58c27e5efb57707ce74f37b772 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 00:54:59 -0700 Subject: [PATCH 3/6] fix spacing issues and make scroll whole settings page --- .../react/src/void-settings-tsx/Settings.tsx | 122 +++++++++--------- 1 file changed, 59 insertions(+), 63 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 6ae26df6..eeae0c09 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 @@ -22,7 +22,7 @@ import { TransferEditorType, TransferFilesInfo } from '../../../extensionTransfe // ───────────────────────────────────────────── // Sidebar navigation helpers // ───────────────────────────────────────────── -type SectionKey = +type Tab = | 'models' | 'localProviders' | 'providers' @@ -912,17 +912,17 @@ export const Settings = () => { const isDark = useIsDark() // ─── sidebar nav ────────────────────────── const [selectedSection, setSelectedSection] = - useState('models'); + useState('models'); - const navItems: { key: SectionKey; label: string }[] = [ - { key: 'models', label: 'Models' }, - { key: 'localProviders', label: 'Local Providers' }, - { key: 'providers', label: 'Providers' }, - { key: 'featureOptions', label: 'Feature Options' }, - { key: 'general', label: 'General' }, - { key: 'all', label: 'All Settings' }, + const navItems: { tab: Tab; label: string }[] = [ + { tab: 'models', label: 'Models' }, + { tab: 'localProviders', label: 'Local Providers' }, + { tab: 'providers', label: 'Other Providers' }, + { tab: 'featureOptions', label: 'Feature Options' }, + { tab: 'general', label: 'General' }, + { tab: 'all', label: 'All Settings' }, ]; - const show = (key: SectionKey) => selectedSection === 'all' || selectedSection === key; + const shouldShowTab = (tab: Tab) => selectedSection === 'all' || selectedSection === tab; const accessor = useAccessor() const commandService = accessor.get('ICommandService') const environmentService = accessor.get('IEnvironmentService') @@ -997,27 +997,27 @@ export const Settings = () => { return ( -
-
+
+
{/* ────────────── SIDEBAR ────────────── */} -
+ {/* MCP section */} +
+ +

MCP

+

+ +

+
+ { await mcpService.revealMCPConfigFile() }}> + Add MCP Server + +
+ + + + +
+
+ {/* General section */}
{/* One-Click Switch section */} @@ -1397,7 +1420,6 @@ export const Settings = () => { {/* Built-in Settings section */}
-

Built-in Settings

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

@@ -1432,8 +1454,29 @@ Alternatively, place a \`.voidrules\` file in the root of your workspace. + {/* --- Disable System Message Toggle --- */} +
+ +
+ { + voidSettingsService.setGlobalSetting('disableSystemMessage', newValue); + }} + /> + + {'Disable system message'} + +
+
+
+ {`When disabled, Void will not include anything in the system message except for content you specified above.`} +
+
+
From 020fb60d7472a6648b86037c0b28776d197fdf77 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 01:08:11 -0700 Subject: [PATCH 5/6] mcp tool rename --- src/vs/workbench/contrib/void/browser/chatThreadService.ts | 2 +- .../void/browser/react/src/sidebar-tsx/SidebarChat.tsx | 2 +- src/vs/workbench/contrib/void/common/toolsServiceTypes.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/chatThreadService.ts b/src/vs/workbench/contrib/void/browser/chatThreadService.ts index eb1a6883..30f38f10 100644 --- a/src/vs/workbench/contrib/void/browser/chatThreadService.ts +++ b/src/vs/workbench/contrib/void/browser/chatThreadService.ts @@ -641,7 +641,7 @@ class ChatThreadService extends Disposable implements IChatThreadService { // 2. if tool requires approval, break from the loop, awaiting approval - const approvalType = isBuiltInTool ? approvalTypeOfBuiltinToolName[toolName] : 'mcp-tools' + const approvalType = isBuiltInTool ? approvalTypeOfBuiltinToolName[toolName] : 'MCP tools' if (approvalType) { const autoApprove = this._settingsService.state.globalSettings.autoApprove[approvalType] // add a tool_request because we use it for UI if a tool is loading (this should be improved in the future) diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx index 26b12cc8..4bd6424a 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx @@ -1616,7 +1616,7 @@ const ToolRequestAcceptRejectButtons = ({ toolName }: { toolName: ToolName }) => ) - const approvalType = isABuiltinToolName(toolName) ? approvalTypeOfBuiltinToolName[toolName] : 'mcp-tools' + const approvalType = isABuiltinToolName(toolName) ? approvalTypeOfBuiltinToolName[toolName] : 'MCP tools' const approvalToggle = approvalType ?
: null diff --git a/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts b/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts index d930f5de..d5da3e17 100644 --- a/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts +++ b/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts @@ -18,7 +18,7 @@ export type ShallowDirectoryItem = { } -export const approvalTypeOfBuiltinToolName: Partial<{ [T in BuiltinToolName]?: 'edits' | 'terminal' | 'mcp-tools' }> = { +export const approvalTypeOfBuiltinToolName: Partial<{ [T in BuiltinToolName]?: 'edits' | 'terminal' | 'MCP tools' }> = { 'create_file_or_folder': 'edits', 'delete_file_or_folder': 'edits', 'rewrite_file': 'edits', @@ -35,7 +35,7 @@ export type ToolApprovalType = NonNullable<(typeof approvalTypeOfBuiltinToolName export const toolApprovalTypes = new Set([ ...Object.values(approvalTypeOfBuiltinToolName), - 'mcp-tools', + 'MCP tools', ]) From 822430535ea62e69888db90aec3bf2c98564bce6 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 01:12:34 -0700 Subject: [PATCH 6/6] MCP --- .../react/src/void-settings-tsx/Settings.tsx | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 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 b4249f3b..60294f06 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 @@ -1037,8 +1037,8 @@ export const Settings = () => { { tab: 'localProviders', label: 'Local Providers' }, { tab: 'providers', label: 'Other Providers' }, { tab: 'featureOptions', label: 'Feature Options' }, - { tab: 'mcp', label: 'MCP' }, { tab: 'general', label: 'General' }, + { tab: 'mcp', label: 'MCP' }, { tab: 'all', label: 'All Settings' }, ]; const shouldShowTab = (tab: Tab) => selectedSection === 'all' || selectedSection === tab; @@ -1345,27 +1345,6 @@ export const Settings = () => {
- {/* MCP section */} -
- -

MCP

-

- -

-
- { await mcpService.revealMCPConfigFile() }}> - Add MCP Server - -
- - - - -
-
- {/* General section */}
{/* One-Click Switch section */} @@ -1477,6 +1456,33 @@ Alternatively, place a \`.voidrules\` file in the root of your workspace.
+ + + {/* MCP section */} +
+ +

MCP

+

+ +

+
+ { await mcpService.revealMCPConfigFile() }}> + Add MCP Server + +
+ + + + +
+
+ + + + +