Repository navigation
refactor: Move list rendering and helpers into internal listbox - #5178
Merged
Merged
Conversation
Pure move with no behaviour change. First PR of the OptionList/listbox stack, built on main. The options-list rename is not included. Moves the shared list rendering parts and helpers from src/select into src/internal/components/listbox (parts/common, parts/option-group, parts/get-item-props, parts/render-options, parts/scroll-to-index, use-announcement, utils/connect-options, utils/check-option-value-field, plus their unit tests). Only import specifiers changed in consumers (select, multiselect, autosuggest, prompt-input). No SCSS moved and no CSS-module class names or test-utils selectors changed. Stayed in src/select: - parts/item.tsx (and multiselect-item.tsx): depend on select/parts/styles.scss and are rewritten rather than moved later in the stack, so they are deferred to a later PR. - parts/plain-list.tsx, parts/virtual-list.tsx: Select-specific list wrappers; they only had their imports updated. - utils/use-native-search.ts: Select-only typeahead behaviour, not part of the shared listbox. - utils/use-select.ts, use-load-items.ts, dropdown-customization.tsx: Select-specific state and customization.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review supports a consistent, behavior-preserving relocation with no blocking issues identified; automated tests were not run.
No open issues 🎉
What changed in this PR
Moves shared list-rendering code and helpers from Select into the internal listbox directory, preparing for the OptionList component without changing behavior or public APIs.
Changes:
- Relocates rendering helpers, option utilities, announcements, and associated unit tests.
- Updates imports in Select, Multiselect, Autosuggest, and PromptInput.
- Keeps Select-specific wrappers, item components, styles, and selectors unchanged.
| File | Description |
|---|---|
src/select/utils/use-select.ts |
Imports relocated option-matching helper. |
src/select/parts/virtual-list.tsx |
Imports relocated rendering and scrolling helpers. |
src/select/parts/plain-list.tsx |
Imports relocated rendering and scrolling helpers. |
src/select/internal.tsx |
Updates announcement and validation imports. |
src/prompt-input/components/menu-dropdown.tsx |
Updates announcement import. |
src/multiselect/use-multiselect.tsx |
Updates shared helper imports. |
src/internal/components/listbox/utils/connect-options.ts |
Relocates option-matching utilities. |
src/internal/components/listbox/utils/check-option-value-field.ts |
Relocates option-value validation. |
src/internal/components/listbox/use-announcement.ts |
Relocates announcement hook. |
src/internal/components/listbox/parts/scroll-to-index.ts |
Relocates scrolling helper. |
src/internal/components/listbox/parts/render-options.tsx |
Relocates shared option rendering. |
src/internal/components/listbox/parts/option-group.tsx |
Relocates group rendering while retaining Select styles. |
src/internal/components/listbox/parts/get-item-props.ts |
Relocates item-property helper. |
src/internal/components/listbox/parts/common.ts |
Relocates fallback item-height constant. |
src/internal/components/listbox/__tests__/use-announcement.test.ts |
Relocates announcement tests and updates imports. |
src/internal/components/listbox/__tests__/scroll-to-index.test.ts |
Relocates scrolling tests and updates import. |
src/internal/components/listbox/__tests__/get-item-props.test.ts |
Relocates item-property tests and updates imports. |
src/internal/components/listbox/__tests__/connect-options.test.ts |
Places option-matching tests alongside relocated utilities. |
src/autosuggest/options-list.tsx |
Updates announcement import. |
src/autosuggest/internal.tsx |
Updates option-value validation import. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5178 +/- ##
=======================================
Coverage 97.73% 97.73%
=======================================
Files 996 996
Lines 32152 32219 +67
Branches 11860 11906 +46
=======================================
+ Hits 31424 31490 +66
- Misses 722 723 +1
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
amanabiy
marked this pull request as draft
October 22, 2026 13:20
amanabiy
marked this pull request as ready for review
October 22, 2026 13:20
pan-kot
approved these changes
Oct 22, 2026
This branch was successfully deployed
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.
Description
We're adding the OptionList component. Docs: CUJAl2wq1b6Z and 5evHnSwN7iHe
Plan: OptionList is a list like the ones inside Select and Multiselect, but that list code lives in
Select's private folders today. Instead of OptionList depending on Select's internals, the three components
will share one internal list engine in
src/internal/components/listbox/. To keep each change small,reviewable and safe to revert, we get there in steps:
src/select(no behaviour change) - this PRRelated links, issue #, if available: Docs: CUJAl2wq1b6Z and 5evHnSwN7iHe
How has this been tested?
All previous tests are working as expected
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.