From 7727b19b3ca1c92a8742b865f15b328159c351da Mon Sep 17 00:00:00 2001 From: Mathew Pareles Date: Sat, 21 Jun 2025 04:07:23 -0700 Subject: [PATCH] finish adding toggle --- .../void/browser/react/src/util/services.tsx | 2 - .../react/src/void-settings-tsx/Settings.tsx | 63 +++++++++---------- .../void/electron-main/metricsMainService.ts | 3 +- 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx b/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx index a19abac4..90455ee0 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/util/services.tsx @@ -418,9 +418,7 @@ export const useIsOptedOut = () => { useEffect(() => { const disposables = new DisposableStore(); const d = storageService.onDidChangeValue(StorageScope.APPLICATION, OPT_OUT_KEY, disposables)(e => { - console.log('VALUE!!!!!!!!', e.target, getVal()) ss(getVal()) - }) disposables.add(d) return () => disposables.clear() 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 75197adb..510e6f10 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 @@ -1219,7 +1219,7 @@ export const Settings = () => { {/* FIM */}

{displayInfoOfFeatureName('Autocomplete')}

-
+
Experimental.{' '} @@ -1263,7 +1263,7 @@ export const Settings = () => {

{displayInfoOfFeatureName('Apply')}

-
Settings that control the behavior of the Apply button.
+
Settings that control the behavior of the Apply button.
{/* Sync to Chat Switch */} @@ -1299,7 +1299,7 @@ export const Settings = () => { {/* Tools Section */}

Tools

-
{`Tools are functions that LLMs can call. Some tools require user approval.`}
+
{`Tools are functions that LLMs can call. Some tools require user approval.`}
{/* Auto Accept Switch */} @@ -1343,7 +1343,7 @@ export const Settings = () => {

Editor

-
{`Settings that control the visibility of Void suggestions in the code editor.`}
+
{`Settings that control the visibility of Void suggestions in the code editor.`}
{/* Auto Accept Switch */} @@ -1365,7 +1365,7 @@ export const Settings = () => {

{displayInfoOfFeatureName('SCM')}

-
Settings that control the behavior of the commit message generator.
+
Settings that control the behavior of the commit message generator.
{/* Sync to Chat Switch */} @@ -1392,32 +1392,6 @@ export const Settings = () => { {/* General section */}
- {/* Metrics section */} -
-

Metrics

-
(Very) basic usage tracking helps us understand whether people are using Void. Regardless of this setting, Void never sees your code, messages, or API keys.
- -
- {/* Disable All Metrics Switch */} - -
- { - storageService.store(OPT_OUT_KEY, newVal, StorageScope.APPLICATION, StorageTarget.MACHINE) - metricsService.capture(`Set metrics to ${newVal}`, {}) // this only fires if it's enabled, so it's fine to have here - }} - /> - {isOptedOut ? 'Disabled' : 'Enabled'} -
-
- Void only tracks basic anonymous usage, like whether you've opened the app, or the number of messages you sent. Opting out is optional (requires a restart). -
-
-
-
- {/* One-Click Switch section */}
@@ -1450,8 +1424,9 @@ export const Settings = () => { Reset Settings
+ {/* Chats Subcategory */} -
+
{ fileInputChatsRef.current?.click() }}> Import Chats @@ -1492,6 +1467,29 @@ export const Settings = () => {
+ {/* Metrics section */} +
+

Metrics

+
Very basic usage tracking helps us understand whether people are using Void. Regardless of this setting, Void never sees your code, messages, or API keys.
+ +
+ {/* Disable All Metrics Switch */} + +
+ { + storageService.store(OPT_OUT_KEY, newVal, StorageScope.APPLICATION, StorageTarget.MACHINE) + metricsService.capture(`Set metrics opt-out to ${newVal}`, {}) // this only fires if it's enabled, so it's fine to have here + }} + /> + {'Opt-out (requires restart)'} +
+
+
+
+ {/* AI Instructions section */}

AI Instructions

@@ -1525,6 +1523,7 @@ Alternatively, place a \`.voidrules\` file in the root of your workspace.
+
diff --git a/src/vs/workbench/contrib/void/electron-main/metricsMainService.ts b/src/vs/workbench/contrib/void/electron-main/metricsMainService.ts index bfac3f63..f30daae1 100644 --- a/src/vs/workbench/contrib/void/electron-main/metricsMainService.ts +++ b/src/vs/workbench/contrib/void/electron-main/metricsMainService.ts @@ -123,8 +123,9 @@ export class MetricsMainService extends Disposable implements IMetricsService { properties: this._initProperties, } - const didOptOut = this._appStorage.get(OPT_OUT_KEY, StorageScope.APPLICATION) !== undefined + const didOptOut = this._appStorage.getBoolean(OPT_OUT_KEY, StorageScope.APPLICATION, false) + console.log('User is opted out of basic Void metrics?', didOptOut) if (didOptOut) { this.client.optOut() }