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
)?.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]