Add shared client-side virtualization for large job lists and dropdowns#355
Merged
DaKheera47 merged 5 commits intomainfrom Apr 13, 2026
Merged
Add shared client-side virtualization for large job lists and dropdowns#355DaKheera47 merged 5 commits intomainfrom
DaKheera47 merged 5 commits intomainfrom
Conversation
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a shared client-side virtualization layer (based on @tanstack/react-virtual) and applies it to large, frequently-rendered UI surfaces (jobs list, command bar results, and searchable dropdown options) to reduce DOM mount cost while preserving existing UX.
Changes:
- Add
@tanstack/react-virtualand a shareduseVirtualizedListabstraction supporting window- and element-scrolled virtualization (with JSDOM scroll fallbacks). - Virtualize
JobListPanel(window scroll) and refactorJobCommandBar+SearchableDropdownto render virtualized rows/options with updated keyboard navigation and tests. - Add DOM measurement + virtualization test helpers and update/extend client tests for offscreen rendering and virtual scrolling.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| package-lock.json | Adds @tanstack/react-virtual + @tanstack/virtual-core lock entries. |
| orchestrator/package.json | Declares @tanstack/react-virtual dependency for the client. |
| orchestrator/src/setupTests.ts | Replaces ad-hoc ResizeObserver stub with shared DOM measurement mocks. |
| orchestrator/src/client/lib/virtual-list.ts | New shared virtualization hook wrapping TanStack (window/element modes + JSDOM scrollToFn support). |
| orchestrator/src/components/ui/virtualized-listbox.tsx | New hook to apply shared virtualization to listbox-like element scroll containers. |
| orchestrator/src/components/ui/searchable-dropdown.tsx | Refactors dropdown to use virtualized listbox rendering and custom keyboard navigation. |
| orchestrator/src/components/ui/searchable-dropdown.test.tsx | Adds tests ensuring large option sets remain virtualized and keyboard selection works. |
| orchestrator/src/client/test/dom-measurement.ts | New measurement helpers/mocks (ResizeObserver + rect/scroll utilities). |
| orchestrator/src/client/test/virtualization.ts | New helper to simulate window virtualization in tests (viewport + scroll). |
| orchestrator/src/client/pages/orchestrator/virtualizedList.ts | Adds a local element-virtualization wrapper used by the command bar. |
| orchestrator/src/client/pages/orchestrator/virtualizedList.test-utils.ts | Adds test utilities to mock rects/ResizeObserver for element virtualizer sizing. |
| orchestrator/src/client/pages/orchestrator/useScrollToJobItem.ts | Switches scroll-to-job behavior from DOM querying/scrollIntoView to virtualizer scrollToIndex. |
| orchestrator/src/client/pages/orchestrator/JobListPanel.tsx | Virtualizes the main jobs list (window scroll) and exposes a scroll handle via forwardRef. |
| orchestrator/src/client/pages/orchestrator/JobListPanel.test.tsx | Extends tests to validate virtualization and offscreen row rendering on scroll. |
| orchestrator/src/client/pages/orchestrator/JobCommandBar.utils.ts | Introduces a flattened “row model” to support virtualized command bar rendering. |
| orchestrator/src/client/pages/orchestrator/JobCommandBar.tsx | Refactors command bar to render virtualized rows (locks + results) with deferred query handling. |
| orchestrator/src/client/pages/orchestrator/JobCommandBar.test.tsx | Updates tests for async rendering/virtualization and keyboard navigation across offscreen items. |
| orchestrator/src/client/pages/OrchestratorPage.tsx | Wires JobListPanel scroll handle into useScrollToJobItem for programmatic scrolling. |
| orchestrator/src/client/pages/OrchestratorPage.test.tsx | Updates mocks/assertions to account for ref-based list scroll behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
therealsamyak
pushed a commit
to therealsamyak/job-ops
that referenced
this pull request
Apr 14, 2026
…ns (DaKheera47#355) * Virtualize large client lists across jobs, command bar, and dropdowns * Fix dropdown accessibility and virtual list scrolling * Fix PR test harness and extractor test config * Format extractor registry mock setup * revert tsconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@tanstack/react-virtualand a shared client-side virtualization layer for window-scrolled and element-scrolled listsJobListPanelwhile preserving existing selection, styling, routing, and window scroll behaviorJobCommandBarto use a flattened virtualized row model for lock suggestions and results with deferred query handlingSearchableDropdownto use the shared virtualized listbox path so existing large-option consumers scale automaticallyTesting
./orchestrator/node_modules/.bin/biome ci .npm run check:types:sharednpm --workspace orchestrator run build:clientnpm --workspace orchestrator run test:run -- src/client/pages/orchestrator/JobListPanel.test.tsx src/client/pages/OrchestratorPage.test.tsx src/client/pages/orchestrator/JobCommandBar.test.tsx src/components/ui/searchable-dropdown.test.tsxnpm --workspace orchestrator run check:types(fails due to existing missingundiciresolution insrc/server/api/routes/test-utils.ts)npm --workspace gradcracker-extractor run check:types(fails due to existing missing extractor dependencies/config)npm --workspace ukvisajobs-extractor run check:types(fails due to existing missing extractor dependencies/config)npm --workspace orchestrator run test:run(fails due to the existingundici/extractor environment issues above)