Update review panel entries on layout resize (#21323)

GitOrigin-RevId: db9b01609a2425952671e30fc20c16de4d3b36a8
This commit is contained in:
Domagoj Kriskovic 2024-10-25 15:04:23 +02:00 committed by Copybot
parent 34c3647244
commit 4bcc7c9602

View file

@ -116,7 +116,7 @@ const ReviewPanelCurrentFile: FC = () => {
false false
)?.addCommentRanges )?.addCommentRanges
useEffect(() => { const positionsMeasureRequest = useCallback(() => {
if (aggregatedRanges) { if (aggregatedRanges) {
view.requestMeasure({ view.requestMeasure({
key: 'review-panel-position', key: 'review-panel-position',
@ -177,6 +177,9 @@ const ReviewPanelCurrentFile: FC = () => {
} }
}, [view, aggregatedRanges, addCommentRanges]) }, [view, aggregatedRanges, addCommentRanges])
useEffect(positionsMeasureRequest, [positionsMeasureRequest])
useEventListener('editor:geometry-change', positionsMeasureRequest)
const showEmptyState = useMemo( const showEmptyState = useMemo(
() => hasActiveRange(ranges, threads) === false, () => hasActiveRange(ranges, threads) === false,
[ranges, threads] [ranges, threads]