From 4c347daa8f5b8f86ebfd319485dd76946957ddee Mon Sep 17 00:00:00 2001 From: PostHog Code Date: Mon, 27 Apr 2026 09:01:56 +0000 Subject: [PATCH] feat: cmd+enter on a single inbox report opens Create PR dialog Mirrors the existing Create PR run-action button so the keyboard shortcut and the click target stay in sync. Generated-By: PostHog Code Task-Id: 35931fe5-864a-4502-89a5-b0a98c8e7f21 --- .../components/detail/ReportDetailPane.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/apps/code/src/renderer/features/inbox/components/detail/ReportDetailPane.tsx b/apps/code/src/renderer/features/inbox/components/detail/ReportDetailPane.tsx index 2cf151fe0..c98317b90 100644 --- a/apps/code/src/renderer/features/inbox/components/detail/ReportDetailPane.tsx +++ b/apps/code/src/renderer/features/inbox/components/detail/ReportDetailPane.tsx @@ -224,6 +224,32 @@ export function ReportDetailPane({ report, onClose }: ReportDetailPaneProps) { openCloudConfirm(repositories[0] ?? null); }, [repositories, openCloudConfirm]); + // Cmd/Ctrl+Enter while a single report is selected mirrors the "Create PR" button. + useEffect(() => { + if (!canCreateImplementationPr) return; + const handler = (e: KeyboardEvent) => { + if (e.key !== "Enter") return; + if (!(e.metaKey || e.ctrlKey)) return; + if ( + document.querySelector( + "[data-radix-popper-content-wrapper], [role='dialog'][data-state='open']", + ) + ) { + return; + } + const target = e.target as HTMLElement | null; + if ( + target?.closest("input, select, textarea, [contenteditable='true']") + ) { + return; + } + e.preventDefault(); + handleOpenCloudConfirm(); + }; + window.addEventListener("keydown", handler); + return () => window.removeEventListener("keydown", handler); + }, [canCreateImplementationPr, handleOpenCloudConfirm]); + const handleRunCloudTask = useCallback(async () => { if (!canCreateImplementationPr) return; const prompt = cloudPromptDraft.trim();