Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/review-editor/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ThemeProvider defaultTheme="dark">
Expand Down
6 changes: 6 additions & 0 deletions packages/review-editor/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down