feat(voice): rework screen share delivery behind an experiment (#2859)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-20 06:10:20 +02:00
1 parent 574a93257c
commit c157ab5752
121 files changed
+7205 -5502

No files matched your search

@@ -44,7 +44,6 @@ import {
UnreadBadgeCustomizationControl,
} from '@app/features/user/components/modals/tabs/advanced_settings_tab/AdvancedExperimentalControls';
import {
OpenH264Control,
ScreenShareAv1OptInControl,
ScreenShareCodecControl,
ScreenShareEncoderControls,
@@ -91,7 +90,6 @@ export const DIRECT_CONTROL_ITEM_IDS = new Set([
'voice-video-screen-share-codec',
'voice-video-screen-share-av1-opt-in',
'voice-video-screen-share-hevc-opt-in',
'voice-video-openh264-codec',
'voice-video-screen-share-preview-behavior',
'voice-video-screen-share-encoder-controls',
'advanced-unread-badge-customization',
@@ -129,7 +127,6 @@ export const COMPACT_SWITCH_CONTROL_ITEM_IDS = new Set([
'chat-settings-hide-muted-channels',
'voice-video-new-device-alerts',
'voice-video-connection-volume-controls',
'voice-video-openh264-codec',
'voice-video-screen-share-av1-opt-in',
'voice-video-screen-share-hevc-opt-in',
'advanced-unread-badge-customization',
@@ -291,10 +288,6 @@ export const AdvancedSettingControl = observer(({item}: {item: SearchableSetting
return (
<ScreenShareHevcOptInControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.screen-share-hevc-opt-in-control" />
);
case 'voice-video-openh264-codec':
return (
<OpenH264Control data-flx="user.advanced-setting-direct-controls.advanced-setting-control.open-h264-control" />
);
case 'voice-video-screen-share-preview-behavior':
return (
<ScreenSharePreviewBehaviorControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.screen-share-preview-behavior-control" />
@@ -9,7 +9,6 @@ import {Combobox, type ComboboxOption} from '@app/features/ui/components/form/Fo
import {Switch} from '@app/features/ui/components/form/FormSwitch';
import {SwitchGroup, SwitchGroupItem} from '@app/features/ui/components/SwitchGroup';
import PiP from '@app/features/ui/state/PiP';
import {getElectronAPI, isDesktop} from '@app/features/ui/utils/NativeUtils';
import styles from '@app/features/user/components/modals/tabs/AdvancedSettingsTab.module.css';
import {selectScreenShareEncoderPathDescription} from '@app/features/user/components/modals/tabs/advanced_settings_tab/AdvancedVideoControlsState';
import {CompactComboboxRow} from '@app/features/user/components/modals/tabs/components/CompactComboboxRow';
@@ -31,7 +30,6 @@ import {
type HardwareEncodeReport,
loadGpuEncoderReport,
} from '@app/features/voice/utils/GpuEncoderCapabilities';
import {setOpenH264Enabled} from '@app/features/voice/utils/OpenH264Status';
import {CODEC_DISPLAY_LABEL} from '@app/features/voice/utils/ScreenShareCodecPolicy';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
@@ -39,11 +37,6 @@ import {GearIcon} from '@phosphor-icons/react';
import {observer} from 'mobx-react-lite';
import {useCallback, useEffect, useState} from 'react';
const OPENH264_LABEL_DESCRIPTOR = msg({
message: 'OpenH264 Video Codec provided by Cisco Systems, Inc.',
comment:
'Switch label for the OpenH264 codec toggle. "OpenH264" is a product name and "Cisco Systems, Inc." is a company name; do not translate either.',
});
const PAUSE_PREVIEW_BACKGROUND_DESCRIPTOR = msg({
message: 'Pause my screen share preview in the background',
comment: 'Short label for an advanced screen-share preview preference.',
@@ -226,24 +219,6 @@ export const ScreenShareHevcOptInControl = observer(() => {
);
});
export const OpenH264Control = observer(() => {
const {i18n} = useLingui();
const handleChange = useCallback((value: boolean) => {
VoiceSettingsCommands.update({openH264Enabled: value});
void setOpenH264Enabled(value);
}, []);
if (!isDesktop() || getElectronAPI()?.platform !== 'linux') return null;
return (
<Switch
ariaLabel={i18n._(OPENH264_LABEL_DESCRIPTOR)}
value={VoiceSettings.openH264Enabled}
onChange={handleChange}
compact
data-flx="user.advanced-settings-tab.switch.openh264"
/>
);
});
export const ScreenSharePreviewBehaviorControl = observer(() => {
const {i18n} = useLingui();
const handleDisableScreenSharePopoutToggle = useCallback((value: boolean) => {
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {getElectronAPI, isDesktop} from '@app/features/ui/utils/NativeUtils';
import type {SearchableSettingDescriptor} from '@app/features/user/components/settings_utils/search_index/SearchIndexTypes';
import {msg} from '@lingui/core/macro';
@@ -106,22 +105,6 @@ const HEVC_KEYWORD_DESCRIPTOR = msg({
message: 'HEVC',
comment: 'Settings search synonym. Codec name; keep literal. Used to match this term in the settings search bar.',
});
const OPENH264_VIDEO_CODEC_DESCRIPTOR = msg({
message: 'OpenH264 video codec',
comment: 'Settings search entry label. Names the settings search entry in the settings UI.',
});
const H264_DESCRIPTOR = msg({
message: 'H.264',
comment: 'Settings search synonym. Used to match this term when the user types it in the settings search bar.',
});
const CISCO_DESCRIPTOR = msg({
message: 'Cisco',
comment: 'Settings search synonym. Used to match this term when the user types it in the settings search bar.',
});
const ENABLE_OPENH264_SOFTWARE_ENCODING_AND_DECODING_ON_LINUX_DESCRIPTOR = msg({
message: 'OpenH264 software codec on Linux',
comment: 'Settings search entry description. One-line summary of what the settings search entry controls.',
});
const SCREEN_SHARE_PREVIEW_BEHAVIOR_DESCRIPTOR = msg({
message: 'Screen share preview behavior',
comment: 'Settings search entry label. Names the settings search entry in the settings UI.',
@@ -236,17 +219,6 @@ export const voiceVideoIndex: Array<SearchableSettingDescriptor> = [
audience: 'advanced',
tags: ['media', 'voice'],
},
{
id: 'voice-video-openh264-codec',
tabType: 'voice_video',
sectionId: 'video',
label: OPENH264_VIDEO_CODEC_DESCRIPTOR,
keywords: [H264_DESCRIPTOR, CODEC_DESCRIPTOR, CISCO_DESCRIPTOR],
description: ENABLE_OPENH264_SOFTWARE_ENCODING_AND_DECODING_ON_LINUX_DESCRIPTOR,
audience: 'advanced',
tags: ['media', 'voice'],
isVisible: () => isDesktop() && getElectronAPI()?.platform === 'linux',
},
{
id: 'voice-video-screen-share-preview-behavior',
tabType: 'voice_video',