@devries-cameron20 / t3code-1 / commits / a50fe102fb
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(desktop): Ctrl+R on macOS reaches the preview page instead of reloading it (#29893)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Alex Southwell committed Nov 3, 2026 at 19:16 UTC a50fe102fb6d7253b03c296636c753a01fd33dda
2 files changed +30 -3
apps/desktop/src/preview/Manager.test.ts
+27
@@ -615,6 +615,33 @@ describe("PreviewManager", () => {
615 ),
616 );
617
618 + effectIt.effect.each([
619 + ["darwin", true, false, true],
620 + ["darwin", false, true, false],
621 + ["linux", false, true, true],
622 + ["win32", true, false, false],
623 + ] as const)(
624 + "reloads the preview only on the platform refresh chord: %s meta=%s ctrl=%s",
625 + ([platform, meta, control, expected]) =>
626 + withManager(
627 + (manager) =>
628 + Effect.gen(function* () {
629 + const preview = makeFaviconWebContents();
630 + fromId.mockReturnValue(preview.webContents);
631 + yield* manager.createTab("tab_refresh");
632 + yield* manager.registerWebview("tab_refresh", 42);
633 + const preventDefault = vi.fn();
634 + preview.listeners.get("before-input-event")!(
635 + { preventDefault } as never,
636 + { type: "keyDown", key: "r", meta, control, shift: false, alt: false } as never,
637 + );
638 + expect(preventDefault).toHaveBeenCalledTimes(expected ? 1 : 0);
639 + expect(preview.reload).toHaveBeenCalledTimes(expected ? 1 : 0);
640 + }),
641 + platform,
642 + ),
643 + );
644 +
645 effectIt.effect("keeps editing and forwarded shortcuts in whichever tab holds focus", () =>
646 withManager((manager) =>
647 Effect.gen(function* () {
apps/desktop/src/preview/Manager.ts
+3 -3
@@ -464,10 +464,10 @@ export const previewWindowOpenAction = (details: {
464 : "navigate";
465 };
466
467 -const isPreviewRefreshShortcut = (input: Electron.Input): boolean =>
467 +const isPreviewRefreshShortcut = (input: Electron.Input, platform: NodeJS.Platform): boolean =>
468 input.type === "keyDown" &&
469 input.key.toLowerCase() === "r" &&
470 - (input.meta || input.control) &&
470 + (platform === "darwin" ? input.meta && !input.control : input.control && !input.meta) &&
471 !input.shift &&
472 !input.alt;
473
@@ -1488,7 +1488,7 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
1488 }
1489 return;
1490 }
1491 - if (isPreviewRefreshShortcut(input)) {
1491 + if (isPreviewRefreshShortcut(input, hostPlatform)) {
1492 event.preventDefault();
1493 runFork(
1494 attempt({ operation: "shortcut.refresh", tabId, webContentsId: wc.id }, () =>