From fc9d3755c2f5d6ee08d0a17538831f6634c72767 Mon Sep 17 00:00:00 2001 From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com> Date: Fri, 18 Aug 2023 12:26:39 +0300 Subject: [PATCH] Merge pull request #14361 from overleaf/ii-add-comment-review-panel [web] Open current file view mode when adding comment through editor widget GitOrigin-RevId: 7028ab2a2b6369064712d456c8ae1d33498b8002 --- .../components/review-panel/editor-widgets/editor-widgets.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx b/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx index 0c6f4ede8f..51fb561ee1 100644 --- a/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx +++ b/services/web/frontend/js/features/source-editor/components/review-panel/editor-widgets/editor-widgets.tsx @@ -23,7 +23,8 @@ function EditorWidgets() { handleShowBulkRejectDialog, handleConfirmDialog, } = useBulkActionsModal() - const { setIsAddingComment } = useReviewPanelUpdaterFnsContext() + const { setIsAddingComment, handleSetSubview } = + useReviewPanelUpdaterFnsContext() const [addNewComment] = useScopeValue<(e: React.MouseEvent) => void>( 'addNewComment' @@ -47,6 +48,7 @@ function EditorWidgets() { addNewComment(e) setTimeout(() => { // Re-render the comment box in order to add autofocus every time + handleSetSubview('cur_file') setIsAddingComment(false) setIsAddingComment(true) }, 0)