feat(settings): move macos permission review into desktop tab (#2397)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-02 17:36:26 +02:00
1 parent 17b9821879
commit f98a74170a
37 files changed
+1843 -1973

No files matched your search

@@ -4,6 +4,7 @@ import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {SettingsSection} from '@app/features/app/components/dialogs/shared/SettingsSection';
import {SettingsTabContainer} from '@app/features/app/components/dialogs/shared/SettingsTabLayout';
import {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {MacPermissionsSettingsRow} from '@app/features/permissions/system/components/MacPermissionsSettingsRow';
import {
getAutostartStatus,
getCachedAutostartStatus,
@@ -19,7 +20,7 @@ import {
relaunchDesktopApp,
setDesktopWindowBehaviorSettings,
} from '@app/features/ui/utils/DesktopWindowBehaviorUtils';
import {guessPlatform, isDesktop, isNativeLinux, isNativeMacOS} from '@app/features/ui/utils/NativeUtils';
import {getNativePlatformSync, isDesktop, isNativeLinux, isNativeMacOS} from '@app/features/ui/utils/NativeUtils';
import type {DesktopWindowBehaviorSettings} from '@app/types/electron.d';
import {msg} from '@lingui/core/macro';
import {Trans, useLingui} from '@lingui/react/macro';
@@ -59,7 +60,7 @@ const DesktopSettingsTab: React.FC = observer(() => {
);
const [desktopWindowBehaviorBusy, setDesktopWindowBehaviorBusy] = useState(cachedWindowBehavior === null);
const [trayChangePendingRestart, setTrayChangePendingRestart] = useState(false);
const platform = guessPlatform();
const platform = getNativePlatformSync();
const isMac = isNativeMacOS(platform);
const isLinux = isNativeLinux(platform);
useLayoutEffect(() => {
@@ -197,6 +198,15 @@ const DesktopSettingsTab: React.FC = observer(() => {
</>
)}
</SettingsSection>
{isMac && (
<SettingsSection
id="macos-permissions"
title={<Trans>macOS permissions</Trans>}
data-flx="user.desktop-settings-tab.macos-permissions-section"
>
<MacPermissionsSettingsRow showTitle={false} data-flx="user.desktop-settings-tab.macos-permissions-row" />
</SettingsSection>
)}
</SettingsTabContainer>
);
});
@@ -13,7 +13,6 @@ import {
import {KeybindRecorder} from '@app/features/input/components/KeybindRecorder';
import Keybind, {getDefaultKeybind} from '@app/features/input/state/InputKeybind';
import {openMacPermissionsModal} from '@app/features/permissions/system/commands/MacPermissionsModalCommands';
import {MacPermissionsSettingsRow} from '@app/features/permissions/system/components/MacPermissionsSettingsRow';
import NativePermission from '@app/features/permissions/system/state/NativePermission';
import {Button} from '@app/features/ui/button/Button';
import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
@@ -188,10 +187,6 @@ const ENTRANCE_SOUND_DESCRIPTOR = msg({
message: 'Entrance sound',
comment: 'Subsection title in the voice tab. Keep it concise.',
});
const MACOS_DESCRIPTOR = msg({
message: 'macOS',
comment: 'Subsection title in the voice tab for macOS-specific settings. Keep it concise.',
});
type NoiseSuppressionMethod = 'enhanced' | 'standard' | 'none';
@@ -698,11 +693,6 @@ export const VoiceTab: React.FC<VoiceTabProps> = observer(({voiceSettings, autoR
>
<EntranceSoundSection data-flx="user.voice-tab.entrance-sound-section" />
</SettingsTabSection>
{NativePermission.isNativeMacDesktop && (
<SettingsTabSection title={i18n._(MACOS_DESCRIPTOR)} data-flx="user.voice-tab.macos-section">
<MacPermissionsSettingsRow data-flx="user.voice-tab.macos-permissions-row" />
</SettingsTabSection>
)}
</>
);
});