From 2c3a017ff2e68add62ab0da47574e69509c8ac79 Mon Sep 17 00:00:00 2001 From: "Vedana.Voronina" Date: Mon, 29 Jul 2024 20:56:08 +0000 Subject: [PATCH] [collab/space] IDEA-356878: replace listReviewsV2 with listReviewsV3, fix multiplying load requests on list scroll Merge-request: IJ-MR-141225 Merged-by: Veda Voronina GitOrigin-RevId: 028ab8af216825ca1c203c1a258631d2128e511f --- .../util/ui/scroll/BoundedRangeModelThresholdListener.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/platform-api/src/com/intellij/util/ui/scroll/BoundedRangeModelThresholdListener.kt b/platform/platform-api/src/com/intellij/util/ui/scroll/BoundedRangeModelThresholdListener.kt index 1ede96f4353f..71310777f4a9 100644 --- a/platform/platform-api/src/com/intellij/util/ui/scroll/BoundedRangeModelThresholdListener.kt +++ b/platform/platform-api/src/com/intellij/util/ui/scroll/BoundedRangeModelThresholdListener.kt @@ -6,6 +6,12 @@ import javax.swing.JScrollBar import javax.swing.event.ChangeEvent import javax.swing.event.ChangeListener +/** + * Note: Use with caution as for large models the threshold set as a percent value will require more requests for data with each scroll. + * E.g., list containing 1000 elements with a threshold set to 0.7 when reaching the bottom of the scroll, + * will request data loading until total elements count reaches 1430 elements. + * Which for request with batch size of 30 elements is 15 requests. + */ abstract class BoundedRangeModelThresholdListener( private val model: BoundedRangeModel, private val thresholdPercent: Float