-
Type:
Story
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Compass has settings that don't apply in a browser context (local file system paths, native OS integration, Electron-only behavior). Before persistence goes live, do a pass through every preference definition and settings UI tab to classify which are irrelevant to compass-web, then hide/remove them from the compass-web Settings UI.
Implementation detail (moved here from the technical design, WRITING-39309)
The ui flag means "the renderer process is allowed to change this value", not "this is displayed in the Settings modal". Leave ui untouched and introduce a separate, explicit property for settings-modal visibility.
In packages/compass-preferences-model/src/preferences-schema.tsx:
- Add a CompassRunningEnvironment type and a new exposedInSettingsUI property to every preference definition, alongside ui:
export type CompassRunningEnvironment = 'desktop' | 'web' | 'atlas'; export type PreferenceDefinition<K extends keyof AllPreferences> = { ui: K extends keyof UserConfigurablePreferences ? true : false; /** In which GUI environments this preference is exposed in the Settings UI. */ exposedInSettingsUI: K extends keyof UserConfigurablePreferences ? CompassRunningEnvironment[] | '*' : never[]; ... };The conditional type keeps the existing grouping validation: only user-configurable preferences can name environments; everything else must be []. '*' is shorthand for "every environment" (maxTimeMS, defaultSortOrder, timezone, enableExplainPlan). Desktop-only concerns like shell, proxy, OIDC, Kerberos, auto-updates are declared as ['desktop'].
- Make Preferences aware of the environment it runs in via a new runningEnvironment constructor option, defaulting to 'desktop'. CompassWebPreferencesAccess accepts it as a third constructor argument and defaults to 'atlas', so Data Explorer gets the restricted set with no call-site change, while packages/compass-web/sandbox/sandbox-preferences.ts passes 'web' explicitly to opt the standalone sandbox into the wider set.
- Rename Preferences::getConfigurableUserPreferences to getSettingsUIPreferences and filter on both flags. The return type becomes Partial<UserConfigurablePreferences> and propagates through PreferencesAccess, the IPC channel (compass:get-settings-ui-preferences), and the settings plugin's getSandboxState().userPreferences.
- Gate individual settings in packages/compass-settings/src/components/settings/settings-list.tsx using the current available settings in the store (retrieved via getSettingsUIPreferences).
- Hide empty categories in packages/compass-settings/src/components/modal.tsx: each setting group in packages/compass-settings/src/components/settings/ exports the list of preferences it renders independently of the environment and it's matched with the settingsUIPreferences — if the intersection is empty, the category is hidden.