From 9273ad9e08d292a962dec05452c22f11fed579db Mon Sep 17 00:00:00 2001 From: Kiet <31864905+Kitenite@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:45:40 -0700 Subject: [PATCH 1/3] fix(desktop): Cmd+O firing open-in twice on v1 workspace route (#3511) OPEN_IN_APP was registered both in OpenInMenuButton and in the v1 workspace page, so pressing Cmd+O ran two separate openInApp mutations (one per component's own useMutation instance) while clicking the button only ran one. Remove the page-level registration so the shortcut goes through the same handler as the click. --- .../_authenticated/_dashboard/workspace/$workspaceId/page.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx index c3b8e620aef..a7480603674 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx @@ -540,7 +540,6 @@ export function WorkspacePage({ }); } }, [workspace?.worktreePath, resolvedDefaultApp, mutateOpenInApp, projectId]); - useHotkey("OPEN_IN_APP", handleOpenInApp, { enabled: isActive }); // Copy path shortcut const { copyToClipboard } = useCopyToClipboard(); From 72b1944a6497eee19c8f8fef4d7a5c659e802d7f Mon Sep 17 00:00:00 2001 From: MocA-Love <64681295+MocA-Love@users.noreply.github.com> Date: Sat, 18 Apr 2026 04:41:43 +0900 Subject: [PATCH 2/3] fix(desktop): keep v1 OPEN_IN_APP hotkey alive in tearoff windows FORK NOTE: upstream #3511 removed the page-level OPEN_IN_APP hotkey on the v1 workspace route to avoid firing Cmd+O twice with OpenInMenuButton. The fork renders no TopBar in tearoff windows (layout.tsx gates it on !isTearoff), so removing the page-level registration killed Cmd+O inside tearoff windows entirely. Guard the registration with isTearoffWindow() so the main window still gets the upstream double-fire fix while tearoff windows retain the shortcut. --- .../_dashboard/workspace/$workspaceId/page.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx index a7480603674..806d32de1ca 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx @@ -9,6 +9,7 @@ import { import { useCallback, useEffect, useMemo } from "react"; import { useCopyToClipboard } from "renderer/hooks/useCopyToClipboard"; import { useFileOpenMode } from "renderer/hooks/useFileOpenMode"; +import { isTearoffWindow } from "renderer/hooks/useTearoffInit"; import { useRightSidebarOpenViewWidth } from "renderer/hooks/useRightSidebarOpenViewWidth"; import { useHotkey } from "renderer/hotkeys"; import { @@ -540,6 +541,13 @@ export function WorkspacePage({ }); } }, [workspace?.worktreePath, resolvedDefaultApp, mutateOpenInApp, projectId]); + // FORK NOTE: upstream #3511 removed this page-level hotkey to avoid double + // firing with OpenInMenuButton. Fork tearoff windows do not render TopBar + // (layout.tsx gates it on !isTearoff), so OpenInMenuButton is absent there + // — keep the page-level registration alive only in tearoff windows. + useHotkey("OPEN_IN_APP", handleOpenInApp, { + enabled: isActive && isTearoffWindow(), + }); // Copy path shortcut const { copyToClipboard } = useCopyToClipboard(); From ab4ba8fcbefca59f22877110a25bd5d22a298eec Mon Sep 17 00:00:00 2001 From: MocA-Love <64681295+MocA-Love@users.noreply.github.com> Date: Sat, 18 Apr 2026 04:52:28 +0900 Subject: [PATCH 3/3] style(desktop): organize imports for tearoff hotkey fork adaptation --- .../_authenticated/_dashboard/workspace/$workspaceId/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx index 806d32de1ca..4ef075ec179 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx @@ -9,8 +9,8 @@ import { import { useCallback, useEffect, useMemo } from "react"; import { useCopyToClipboard } from "renderer/hooks/useCopyToClipboard"; import { useFileOpenMode } from "renderer/hooks/useFileOpenMode"; -import { isTearoffWindow } from "renderer/hooks/useTearoffInit"; import { useRightSidebarOpenViewWidth } from "renderer/hooks/useRightSidebarOpenViewWidth"; +import { isTearoffWindow } from "renderer/hooks/useTearoffInit"; import { useHotkey } from "renderer/hotkeys"; import { addBrowserShortcutListener,