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:
@ -9,6 +9,7 @@ import { CustomIcon } from '@src/components/CustomIcon'
|
|||||||
import { interactionMap } from '@src/lib/settings/initialKeybindings'
|
import { interactionMap } from '@src/lib/settings/initialKeybindings'
|
||||||
import type { SettingsLevel } from '@src/lib/settings/settingsTypes'
|
import type { SettingsLevel } from '@src/lib/settings/settingsTypes'
|
||||||
import { useSettings } from '@src/lib/singletons'
|
import { useSettings } from '@src/lib/singletons'
|
||||||
|
import { isDesktop } from '@src/lib/isDesktop'
|
||||||
|
|
||||||
type ExtendedSettingsLevel = SettingsLevel | 'keybindings'
|
type ExtendedSettingsLevel = SettingsLevel | 'keybindings'
|
||||||
|
|
||||||
@ -39,7 +40,12 @@ export function SettingsSearchBar() {
|
|||||||
Object.entries(categorySettings).flatMap(([settingName, setting]) => {
|
Object.entries(categorySettings).flatMap(([settingName, setting]) => {
|
||||||
const s = setting
|
const s = setting
|
||||||
return (['project', 'user'] satisfies SettingsLevel[])
|
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) => ({
|
.map((l) => ({
|
||||||
category: decamelize(category, { separator: ' ' }),
|
category: decamelize(category, { separator: ' ' }),
|
||||||
name: settingName,
|
name: settingName,
|
||||||
@ -86,7 +92,7 @@ export function SettingsSearchBar() {
|
|||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
onChange={(event) => setQuery(event.target.value)}
|
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"
|
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"
|
autoCapitalize="off"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
autoCorrect="off"
|
autoCorrect="off"
|
||||||
|
@ -249,12 +249,11 @@ export function createSettings() {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
allowOrbitInSketchMode: new Setting<boolean>({
|
allowOrbitInSketchMode: new Setting<boolean>({
|
||||||
|
/** Unhide this once we make sketch mode unbreakable */
|
||||||
|
hideOnPlatform: 'both',
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
description: 'Toggle free camera while in sketch mode',
|
description: 'Toggle free camera while in sketch mode',
|
||||||
validate: (v) => typeof v === 'boolean',
|
validate: (v) => typeof v === 'boolean',
|
||||||
commandConfig: {
|
|
||||||
inputType: 'boolean',
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
onboardingStatus: new Setting<OnboardingStatus>({
|
onboardingStatus: new Setting<OnboardingStatus>({
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
|
Reference in New Issue
Block a user