DPS-42065 : Virtualization changes for autocomplete, Loading message indicator - #654
Conversation
…tocomplete_virtualization
There was a problem hiding this comment.
Pull request overview
This PR introduces virtualization for CloudPulse resource selection to improve Autocomplete performance with large option sets, and adds a delayed “taking longer than expected” loading indicator message for long-running CloudPulse loading states.
Changes:
- Add
react-window(and types) and aVirtualizedListboximplementation for virtualized Autocomplete list rendering. - Add a reusable
useDelayedLoadingIndicatorhook (with tests) and integrate it into CloudPulse dashboard filters and alert resource loading states. - Tune Autocomplete filtering via
createFilterOptionsto reduce work while typing.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks new dependencies (react-window, memoize-one, @types/react-window) and related snapshot updates. |
| packages/manager/package.json | Adds react-window and @types/react-window to Manager dependencies. |
| packages/manager/src/features/CloudPulse/Utils/useDelayedLoadingIndicator.ts | New hook to show a secondary loading indicator after a delay. |
| packages/manager/src/features/CloudPulse/Utils/useDelayedLoadingIndicator.test.ts | Unit tests for the delayed loading hook using fake timers. |
| packages/manager/src/features/CloudPulse/shared/VirtualizedListBox.tsx | New react-window-based virtualized listbox component. |
| packages/manager/src/features/CloudPulse/shared/VirtualizedListBox.css | Styling for the virtualized listbox scrollbar behavior. |
| packages/manager/src/features/CloudPulse/shared/CloudPulseResourcesSelect.tsx | Integrates virtualized listbox and optimized filtering into the resources Autocomplete. |
| packages/manager/src/features/CloudPulse/shared/CloudPulseDashboardFilterBuilder.tsx | Adds delayed “taking longer” message to the filter builder loading state. |
| packages/manager/src/features/CloudPulse/Alerts/AlertsResources/AlertsResources.tsx | Adds delayed “taking longer” message to alerts resources loading state. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Wrapper component to connect VirtualizedListbox with MUI Autocomplete | ||
| const ListboxWrapper = React.forwardRef< | ||
| HTMLDivElement, | ||
| React.HTMLAttributes<HTMLElement> | ||
| >((props, ref) => { | ||
| // Extract children and forward to VirtualizedListbox | ||
| const { children, ...otherProps } = props; | ||
| return ( | ||
| <Box ref={ref} {...otherProps}> | ||
| <VirtualizedListbox>{children}</VirtualizedListbox> | ||
| </Box> | ||
| ); | ||
| }); |
There was a problem hiding this comment.
The virtualized listbox introduces a nested scroll container (Box wrapping FixedSizeList). MUI’s Autocomplete uses the listbox ref/element to manage scrolling the highlighted option into view; with this structure, the forwarded ref points to the Box, but the actual scrollable element is inside FixedSizeList, which can break keyboard navigation/auto-scroll. Consider making the provided listbox component itself the scroll container and forwarding the ref to react-window’s outerRef (or otherwise wiring MUI’s listbox ref to the element that actually scrolls).
| <CircleProgress size="md" /> | ||
| {showLoadingIndicator && ( | ||
| <Typography mt={2} variant="body1"> | ||
| The loading time is over 10 seconds. Please wait while the process completes. |
There was a problem hiding this comment.
The delayed-loading message is hard-coded to “over 10 seconds”, which couples UI copy to the 10000ms parameter and can become incorrect if the delay changes. Consider deriving the displayed duration from the delay value (or a shared constant) and using clearer user-facing copy (e.g., “Loading is taking longer than expected…”).
| The loading time is over 10 seconds. Please wait while the process completes. | |
| Loading is taking longer than expected. Please wait while the process completes. |
| <CircleProgress /> | ||
| {showLoadingIndicator && ( | ||
| <Typography variant="body1"> | ||
| The loading time is over 10 seconds. Please wait while the process completes. |
There was a problem hiding this comment.
The delayed-loading message is hard-coded to “over 10 seconds”, which couples UI copy to the 10000ms parameter and can become incorrect if the delay changes. Consider deriving the displayed duration from the delay value (or a shared constant) and using clearer user-facing copy (e.g., “Loading is taking longer than expected…”).
| The loading time is over 10 seconds. Please wait while the process completes. | |
| Loading is taking longer than expected. Please wait while the process completes. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ents is greater than 100
…amai/manager into autocomplete_virtualization
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
all the cypress failures will be fixed in automation PR |
Description 📝
Highlight the Pull Request's context and intentions.
Changes 🔄
List any change(s) relevant to the reviewer.
Scope 🚢
Upon production release, changes in this PR will be visible to:
Target release date 🗓️
Please specify a release date (and environment, if applicable) to guarantee timely review of this PR. If exact date is not known, please approximate and update it as needed.
Preview 📷
Include a screenshot
<img src="" />or video<video src="" />of the change.🔒 Use the Mask Sensitive Data setting for security.
💡 For changes requiring multiple steps to validate, prefer a video for clarity.
How to test 🧪
Prerequisites
(How to setup test environment)
Reproduction steps
(How to reproduce the issue, if applicable)
Verification steps
(How to verify changes)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
Check all that apply
As an Author, before moving this PR from Draft to Open, I confirmed ✅