Merge pull request #2498 from kydorn/feat/linux-window-controls-style

feat(desktop): gate traffic-lights behind window-controls style setting
This commit is contained in:
Serhii Dziupin
2026-07-30 10:47:39 +03:00
committed by GitHub
18 changed files with 258 additions and 21 deletions
@@ -197,6 +197,12 @@ export const createSettingsHelpers = (dependencies) => {
result.desktopWindowControlsPosition = 'left';
}
}
if (typeof candidate.desktopWindowControlsStyle === 'string') {
const style = candidate.desktopWindowControlsStyle.trim();
if (style === 'classic' || style === 'traffic-lights') {
result.desktopWindowControlsStyle = style;
}
}
if (candidate.permissionAutoAccept && typeof candidate.permissionAutoAccept === 'object' && !Array.isArray(candidate.permissionAutoAccept)) {
const sessions = {};
const sourceSessions = candidate.permissionAutoAccept.sessions;
@@ -169,6 +169,19 @@ describe('settings helpers', () => {
expect(helpers.sanitizeSettingsUpdate({ desktopWindowControlsPosition: 'center' })).toEqual({});
});
it('sanitizes desktopWindowControlsStyle and rejects unknown values', () => {
const helpers = createTestHelpers();
expect(helpers.sanitizeSettingsUpdate({ desktopWindowControlsStyle: 'classic' })).toEqual({
desktopWindowControlsStyle: 'classic',
});
expect(helpers.sanitizeSettingsUpdate({ desktopWindowControlsStyle: 'traffic-lights' })).toEqual({
desktopWindowControlsStyle: 'traffic-lights',
});
expect(helpers.sanitizeSettingsUpdate({ desktopWindowControlsStyle: 'macos' })).toEqual({});
expect(helpers.sanitizeSettingsUpdate({ desktopWindowControlsStyle: 'auto' })).toEqual({});
});
it('sanitizes the persisted permission auto-accept policy', () => {
const helpers = createTestHelpers();