Skip to content

Add shared client-side virtualization for large job lists and dropdowns#355

Merged
DaKheera47 merged 5 commits intomainfrom
add-virtualization
Apr 13, 2026
Merged

Add shared client-side virtualization for large job lists and dropdowns#355
DaKheera47 merged 5 commits intomainfrom
add-virtualization

Conversation

@DaKheera47
Copy link
Copy Markdown
Owner

Summary

  • add @tanstack/react-virtual and a shared client-side virtualization layer for window-scrolled and element-scrolled lists
  • virtualize the main jobs list in JobListPanel while preserving existing selection, styling, routing, and window scroll behavior
  • refactor JobCommandBar to use a flattened virtualized row model for lock suggestions and results with deferred query handling
  • update SearchableDropdown to use the shared virtualized listbox path so existing large-option consumers scale automatically
  • add measurement/test helpers and update client tests for offscreen rendering, keyboard navigation, and virtual scrolling

Testing

  • ./orchestrator/node_modules/.bin/biome ci .
  • npm run check:types:shared
  • npm --workspace orchestrator run build:client
  • npm --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.tsx
  • npm --workspace orchestrator run check:types (fails due to existing missing undici resolution in src/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 existing undici/extractor environment issues above)

@DaKheera47 DaKheera47 linked an issue Apr 13, 2026 that may be closed by this pull request
@DaKheera47 DaKheera47 requested a review from Copilot April 13, 2026 20:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-virtual and a shared useVirtualizedList abstraction supporting window- and element-scrolled virtualization (with JSDOM scroll fallbacks).
  • Virtualize JobListPanel (window scroll) and refactor JobCommandBar + SearchableDropdown to 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.

Comment thread orchestrator/src/client/pages/OrchestratorPage.tsx
Comment thread orchestrator/src/components/ui/searchable-dropdown.tsx
Comment thread orchestrator/src/components/ui/searchable-dropdown.tsx
Comment thread orchestrator/src/components/ui/virtualized-listbox.tsx Outdated
Comment thread orchestrator/src/components/ui/virtualized-listbox.tsx Outdated
Comment thread orchestrator/src/client/pages/orchestrator/JobCommandBar.tsx Outdated
@DaKheera47 DaKheera47 marked this pull request as ready for review April 13, 2026 21:49
@DaKheera47 DaKheera47 merged commit 0a0fce8 into main Apr 13, 2026
10 checks passed
@DaKheera47 DaKheera47 deleted the add-virtualization branch April 13, 2026 21:53
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Large lists are slow...

2 participants