From 36037e890c84d4a684a12a1901964c97aeabbc9a Mon Sep 17 00:00:00 2001 From: rian-dolphin Date: Thu, 30 Jul 2026 13:41:37 +0100 Subject: [PATCH] feat(review): add Cmd/Ctrl+Shift+Y shortcut to copy feedback --- packages/review-editor/App.tsx | 21 +++++++++++++++++++++ packages/review-editor/shortcuts.ts | 6 ++++++ 2 files changed, 27 insertions(+) diff --git a/packages/review-editor/App.tsx b/packages/review-editor/App.tsx index d164abfdd..c14c0dcfb 100644 --- a/packages/review-editor/App.tsx +++ b/packages/review-editor/App.tsx @@ -2797,6 +2797,27 @@ const ReviewApp: React.FC = () => { handleApprove, handleSendFeedback, handlePlatformAction ]); + // Cmd/Ctrl+Shift+Y keyboard shortcut to copy feedback, mirroring the + // Copy Feedback button in the header and the review sidebar. + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key.toLowerCase() !== 'y' || !(e.metaKey || e.ctrlKey) || !e.shiftKey) return; + + const tag = (e.target as HTMLElement)?.tagName; + if (tag === 'INPUT' || tag === 'TEXTAREA') return; + if (platformCommentDialog || showExportModal || showNoAnnotationsDialog || showApproveWarning || showExitWarning) return; + + e.preventDefault(); + handleCopyFeedback(); + }; + + window.addEventListener('keydown', handleKeyDown); + return () => window.removeEventListener('keydown', handleKeyDown); + }, [ + platformCommentDialog, showExportModal, showNoAnnotationsDialog, showApproveWarning, showExitWarning, + handleCopyFeedback + ]); + if (isLoading) { return ( diff --git a/packages/review-editor/shortcuts.ts b/packages/review-editor/shortcuts.ts index d889678be..cddbba721 100644 --- a/packages/review-editor/shortcuts.ts +++ b/packages/review-editor/shortcuts.ts @@ -23,6 +23,12 @@ export const reviewEditorShortcuts = defineShortcutScope({ section: 'Actions', displayOrder: 10, }, + copyFeedback: { + description: 'Copy feedback to clipboard', + bindings: ['Mod+Shift+Y'], + section: 'Actions', + displayOrder: 20, + }, focusSearch: { description: 'Focus search', bindings: ['Mod+F'],