From 0d2e77dceb52eba997cd61357dbe5d647c67ab2b Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Thu, 4 Dec 2025 17:48:26 +0000 Subject: [PATCH] The fix is complete. Here's a summary of the changes: (#1435) ## Summary Fixed GitHub issue #1433 - "Clicking on add review comment button no longer focus on the edit box" ### Changes Made **1. `frontend/src/components/ui/wysiwyg.tsx`** (+5 lines) - Added import for `AutoFocusPlugin` from `@lexical/react/LexicalAutoFocusPlugin` - Added `autoFocus?: boolean` prop to `WysiwygProps` type - Conditionally renders `` when `autoFocus` is true and editor is editable **2. `frontend/src/components/diff/CommentWidgetLine.tsx`** (+1 line) - Added `autoFocus` prop to the `WYSIWYGEditor` when creating new review comments **3. `frontend/src/components/diff/ReviewCommentRenderer.tsx`** (+1 line) - Added `autoFocus` prop to the `WYSIWYGEditor` when editing existing review comments ### Verification - TypeScript type check: Passed - ESLint: Passed - Prettier: Passed --- frontend/src/components/diff/CommentWidgetLine.tsx | 1 + frontend/src/components/diff/ReviewCommentRenderer.tsx | 1 + frontend/src/components/ui/wysiwyg.tsx | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/frontend/src/components/diff/CommentWidgetLine.tsx b/frontend/src/components/diff/CommentWidgetLine.tsx index 7e42a8be..7e521914 100644 --- a/frontend/src/components/diff/CommentWidgetLine.tsx +++ b/frontend/src/components/diff/CommentWidgetLine.tsx @@ -83,6 +83,7 @@ export function CommentWidgetLine({ className="w-full bg-primary text-primary-foreground text-sm font-mono min-h-[60px]" projectId={projectId} onCmdEnter={handleSave} + autoFocus />