From 4bcc7c9602ed56836e9ed45df30d3dbfa730f9a9 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Fri, 25 Oct 2024 15:04:23 +0200 Subject: [PATCH] Update review panel entries on layout resize (#21323) GitOrigin-RevId: db9b01609a2425952671e30fc20c16de4d3b36a8 --- .../components/review-panel-current-file.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/review-panel-new/components/review-panel-current-file.tsx b/services/web/frontend/js/features/review-panel-new/components/review-panel-current-file.tsx index 7b136cddb0..67e9a94476 100644 --- a/services/web/frontend/js/features/review-panel-new/components/review-panel-current-file.tsx +++ b/services/web/frontend/js/features/review-panel-new/components/review-panel-current-file.tsx @@ -116,7 +116,7 @@ const ReviewPanelCurrentFile: FC = () => { false )?.addCommentRanges - useEffect(() => { + const positionsMeasureRequest = useCallback(() => { if (aggregatedRanges) { view.requestMeasure({ key: 'review-panel-position', @@ -177,6 +177,9 @@ const ReviewPanelCurrentFile: FC = () => { } }, [view, aggregatedRanges, addCommentRanges]) + useEffect(positionsMeasureRequest, [positionsMeasureRequest]) + useEventListener('editor:geometry-change', positionsMeasureRequest) + const showEmptyState = useMemo( () => hasActiveRange(ranges, threads) === false, [ranges, threads]