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.
This commit is contained in:
Frank Noirot
2025-05-09 18:58:28 -04:00
committed by GitHub
parent 3e24e2c9e8
commit 85469f2d7d
2 changed files with 10 additions and 5 deletions

View File

@ -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"

View File

@ -249,12 +249,11 @@ export function createSettings() {
},
}),
allowOrbitInSketchMode: new Setting<boolean>({
/** 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<OnboardingStatus>({
defaultValue: '',