From d32cca4f5328d76120530b32fc6d494998332054 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Mon, 3 Nov 2025 21:47:25 +0800 Subject: [PATCH] feat(EntityGrid): implement infinite scroll for entity lists Add infinite scroll functionality to EntityGrid component using VueUse's useInfiniteScroll composable to handle large volumes of entities efficiently. Changes: - Integrate @vueuse/core useInfiniteScroll composable - Add infinite scroll state management (displayedCount, reset function) - Configure initial batch size (20 items) and increment size (20 items) - Update displayedEntities, alphabeticalContacts to support progressive loading - Add canLoadMore() logic for people, projects, and search modes - Reset scroll state when search term or entities prop changes - Remove maxItems prop (replaced by infinite scroll) - Simplify displayEntitiesFunction signature (removed maxItems parameter) - Update EntitySelectionStep and test files to remove max-items prop Technical details: - Uses template ref (scrollContainer) to access scrollable container - Recent contacts (3) count toward initial batch for people grid - Special entities (You, Unnamed) always displayed, don't count toward limits - Infinite scroll works for both entity types and search results - Constants are configurable at top of component (INITIAL_BATCH_SIZE, INCREMENT_SIZE) This improves performance and UX when displaying large lists of contacts or projects by loading content progressively as users scroll. --- src/components/EntityGrid.vue | 153 ++++++++++++++++++------ src/components/EntitySelectionStep.vue | 1 - src/test/EntityGridFunctionPropTest.vue | 16 +-- 3 files changed, 124 insertions(+), 46 deletions(-) diff --git a/src/components/EntityGrid.vue b/src/components/EntityGrid.vue index de7d6a12..6c84eb7b 100644 --- a/src/components/EntityGrid.vue +++ b/src/components/EntityGrid.vue @@ -42,7 +42,10 @@ projects, and special entities with selection. * * @author Matthew Raymer */ search. -