From ca084c485da3fd3f9838ca0423c792805f136adf Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 18 Sep 2025 05:21:59 +0200 Subject: [PATCH] fix: Comment sidebar bouncing in and out (#10202) --- app/scenes/Document/components/Comments.tsx | 117 ++++++++++---------- 1 file changed, 60 insertions(+), 57 deletions(-) diff --git a/app/scenes/Document/components/Comments.tsx b/app/scenes/Document/components/Comments.tsx index 5277daece2..4e064536a5 100644 --- a/app/scenes/Document/components/Comments.tsx +++ b/app/scenes/Document/components/Comments.tsx @@ -126,9 +126,65 @@ function Comments() { prevThreadCount.current = threads.length; }, [sortOption.type, threads.length, viewingResolved]); - if (!document || !isEditorInitialized) { - return null; - } + const content = + !document || !isEditorInitialized ? null : ( + <> + + + {hasComments ? ( + threads.map((thread) => ( + + )) + ) : ( + + + {viewingResolved + ? t("No resolved comments") + : t("No comments yet")} + + + )} + {showJumpToRecentBtn && ( + + + + {t("New comments")}  + + + + + )} + + + + {(!focusedComment || isMobile) && can.comment && !viewingResolved && ( + + )} + + + ); return ( ui.set({ commentsExpanded: false })} scrollable={false} > - - - {hasComments ? ( - threads.map((thread) => ( - - )) - ) : ( - - - {viewingResolved - ? t("No resolved comments") - : t("No comments yet")} - - - )} - {showJumpToRecentBtn && ( - - - - {t("New comments")}  - - - - - )} - - - - {(!focusedComment || isMobile) && can.comment && !viewingResolved && ( - - )} - + {content} ); }