From 85469f2d7dcb51f74559099158a825b32c2ecd0b Mon Sep 17 00:00:00 2001 From: Frank Noirot Date: Fri, 9 May 2025 18:58:28 -0400 Subject: [PATCH] Hide "Allow orbit in sketch mode" setting from the app (#6803) The ability to orbit while in sketch mode is not well-tested or well-used, so we should pull it from the app. The easiest way to do that is leave the setting in the WASM definition, but configure the setting to be uneditable from the interface. --- src/components/Settings/SettingsSearchBar.tsx | 10 ++++++++-- src/lib/settings/initialSettings.tsx | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/Settings/SettingsSearchBar.tsx b/src/components/Settings/SettingsSearchBar.tsx index 40e48190f..b845dca02 100644 --- a/src/components/Settings/SettingsSearchBar.tsx +++ b/src/components/Settings/SettingsSearchBar.tsx @@ -9,6 +9,7 @@ import { CustomIcon } from '@src/components/CustomIcon' import { interactionMap } from '@src/lib/settings/initialKeybindings' import type { SettingsLevel } from '@src/lib/settings/settingsTypes' import { useSettings } from '@src/lib/singletons' +import { isDesktop } from '@src/lib/isDesktop' type ExtendedSettingsLevel = SettingsLevel | 'keybindings' @@ -39,7 +40,12 @@ export function SettingsSearchBar() { Object.entries(categorySettings).flatMap(([settingName, setting]) => { const s = setting return (['project', 'user'] satisfies SettingsLevel[]) - .filter((l) => s.hideOnLevel !== l) + .filter( + (l) => + s.hideOnLevel !== l && + s.hideOnPlatform !== 'both' && + s.hideOnPlatform !== (isDesktop() ? 'desktop' : 'web') + ) .map((l) => ({ category: decamelize(category, { separator: ' ' }), name: settingName, @@ -86,7 +92,7 @@ export function SettingsSearchBar() { ref={inputRef} onChange={(event) => setQuery(event.target.value)} className="w-full bg-transparent focus:outline-none selection:bg-primary/20 dark:selection:bg-primary/40 dark:focus:outline-none" - placeholder="Search settings (^.)" + placeholder="Search settings (Ctrl+.)" autoCapitalize="off" autoComplete="off" autoCorrect="off" diff --git a/src/lib/settings/initialSettings.tsx b/src/lib/settings/initialSettings.tsx index 9ea8d546c..ae923bf96 100644 --- a/src/lib/settings/initialSettings.tsx +++ b/src/lib/settings/initialSettings.tsx @@ -249,12 +249,11 @@ export function createSettings() { }, }), allowOrbitInSketchMode: new Setting({ + /** Unhide this once we make sketch mode unbreakable */ + hideOnPlatform: 'both', defaultValue: false, description: 'Toggle free camera while in sketch mode', validate: (v) => typeof v === 'boolean', - commandConfig: { - inputType: 'boolean', - }, }), onboardingStatus: new Setting({ defaultValue: '',