From a086eae06bb6021d0a3aa9c604cbb482c9b1d282 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 21 Apr 2026 16:41:46 -0700 Subject: [PATCH] fix(settings): trigger RC channel and hidden-experimental via plain Shift (#919) --- src/main/menu/register-app-menu.test.ts | 8 ++------ src/main/menu/register-app-menu.ts | 17 +++++++---------- src/main/updater.ts | 8 ++++---- .../components/settings/ExperimentalPane.tsx | 2 +- .../src/components/settings/GeneralPane.tsx | 8 ++++---- .../src/components/settings/Settings.tsx | 19 +++++++------------ 6 files changed, 25 insertions(+), 37 deletions(-) diff --git a/src/main/menu/register-app-menu.test.ts b/src/main/menu/register-app-menu.test.ts index 06f8d8814..239646ba9 100644 --- a/src/main/menu/register-app-menu.test.ts +++ b/src/main/menu/register-app-menu.test.ts @@ -110,7 +110,7 @@ describe('registerAppMenu', () => { expect(reloadMock).not.toHaveBeenCalled() }) - it('includes prereleases when Check for Updates is clicked with cmd+shift', () => { + it('includes prereleases when Check for Updates is clicked with shift held', () => { const options = buildMenuOptions() registerAppMenu(options) @@ -119,16 +119,12 @@ describe('registerAppMenu', () => { const submenu = appMenu?.submenu as Electron.MenuItemConstructorOptions[] const item = submenu.find((entry) => entry.label === 'Check for Updates...') + item?.click?.({} as never, undefined as never, { shiftKey: true } as Electron.KeyboardEvent) item?.click?.( {} as never, undefined as never, { metaKey: true, shiftKey: true } as Electron.KeyboardEvent ) - item?.click?.( - {} as never, - undefined as never, - { ctrlKey: true, shiftKey: true } as Electron.KeyboardEvent - ) item?.click?.({} as never, undefined as never, {} as Electron.KeyboardEvent) item?.click?.({} as never, undefined as never, { metaKey: true } as Electron.KeyboardEvent) diff --git a/src/main/menu/register-app-menu.ts b/src/main/menu/register-app-menu.ts index e2d560a49..e9f2ac05c 100644 --- a/src/main/menu/register-app-menu.ts +++ b/src/main/menu/register-app-menu.ts @@ -38,17 +38,14 @@ export function registerAppMenu({ { role: 'about' }, { label: 'Check for Updates...', - // Why: holding Cmd+Shift (or Ctrl+Shift on win/linux) while clicking - // opts this check into the release-candidate channel. The event - // carries the modifier keys down from the native menu — we only act - // on the mouse chord, not accelerator-triggered invocations (there - // is no accelerator on this item, so triggeredByAccelerator should - // always be false here, but guarding makes the intent explicit). + // Why: holding Shift while clicking opts this check into the + // release-candidate channel. The event carries the modifier keys + // down from the native menu — we only act on the mouse chord, not + // accelerator-triggered invocations (there is no accelerator on + // this item, so triggeredByAccelerator should always be false here, + // but guarding makes the intent explicit). click: (_menuItem, _window, event) => { - const includePrerelease = - !event.triggeredByAccelerator && - (event.metaKey === true || event.ctrlKey === true) && - event.shiftKey === true + const includePrerelease = !event.triggeredByAccelerator && event.shiftKey === true onCheckForUpdates({ includePrerelease }) } }, diff --git a/src/main/updater.ts b/src/main/updater.ts index 858225eb1..c14b3d91a 100644 --- a/src/main/updater.ts +++ b/src/main/updater.ts @@ -25,10 +25,10 @@ let currentStatus: UpdateStatus = { state: 'idle' } let userInitiatedCheck = false let onBeforeQuitCleanup: (() => void) | null = null let autoUpdaterInitialized = false -// Why: Cmd+Shift-clicking "Check for Updates" opts the user into the RC -// release channel for the rest of this process. We switch to the GitHub -// provider with allowPrerelease=true so both the check AND any follow-up -// download resolve against the same (possibly prerelease) release manifest. +// Why: Shift-clicking "Check for Updates" opts the user into the RC release +// channel for the rest of this process. We switch to the GitHub provider +// with allowPrerelease=true so both the check AND any follow-up download +// resolve against the same (possibly prerelease) release manifest. // Resetting only after the check would leave a downloaded RC pointing at a // feed URL that no longer advertises it. See design comment in // enableIncludePrerelease. diff --git a/src/renderer/src/components/settings/ExperimentalPane.tsx b/src/renderer/src/components/settings/ExperimentalPane.tsx index d7464d0f3..66cac215b 100644 --- a/src/renderer/src/components/settings/ExperimentalPane.tsx +++ b/src/renderer/src/components/settings/ExperimentalPane.tsx @@ -14,7 +14,7 @@ type ExperimentalPaneProps = { settings: GlobalSettings updateSettings: (updates: Partial) => void /** Hidden-experimental group is only rendered once the user has unlocked - * it via Cmd+Shift-clicking the Experimental sidebar entry. */ + * it via Shift-clicking the Experimental sidebar entry. */ hiddenExperimentalUnlocked?: boolean } diff --git a/src/renderer/src/components/settings/GeneralPane.tsx b/src/renderer/src/components/settings/GeneralPane.tsx index ead6694d7..2c4dfa585 100644 --- a/src/renderer/src/components/settings/GeneralPane.tsx +++ b/src/renderer/src/components/settings/GeneralPane.tsx @@ -768,12 +768,12 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea