Skip to content

refactor: move internal parts and utils from select to listbox - #5204

Open
amanabiy wants to merge 4 commits into
mainfrom
refactor/move-shared-listbox-parts
Open

amanabiy wants to merge 4 commits into
mainfrom
refactor/move-shared-listbox-parts

Conversation

@amanabiy

@amanabiy amanabiy commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

This is a follow up of #5179
Moves Select's option row, type-ahead hook and plain list into src/internal/components/listbox/ and has Select and Multiselect use them, with no behavior change.

Related links, issue #, if available: n/a

How has this been tested?

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Moves useNativeSearch from select/utils to internal/components/listbox as
useTypeAhead, and renames its useInteractiveGroups option to
interactiveGroups. No behavior change.
Merges select/parts/item.tsx and select/parts/multiselect-item.tsx into
internal/components/listbox/parts/item.tsx. The row is chosen with
selectionType: 'single' renders today's Select row, 'multi' renders
today's Multiselect row (checkbox, interactive groups, select-all,
afterHeader). render-options passes selectionType instead of picking a
component, and the hasCheckbox/checkboxes plumbing is removed because
Select never rendered checkboxes and Multiselect always did.

Styles still come from select/parts/styles.scss, so class names and
test-utils selectors are unchanged.

Dev pages: item.permutations maps hasCheckbox to selectionType, and
list-with-sticky-item uses selectionType="multi" (it now shows the
checkbox every multi row renders).
Moves select/parts/plain-list.tsx (PlainList and SelectListProps) to
internal/components/listbox/parts. Select, Multiselect, embedded
Multiselect and VirtualList import it from there. No behavior change.
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.03846% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.74%. Comparing base (544e428) to head (6c48dd2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/internal/components/listbox/parts/item.tsx 98.91% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5204   +/-   ##
=======================================
  Coverage   97.74%   97.74%           
=======================================
  Files        1000      999    -1     
  Lines       32328    32325    -3     
  Branches    11962    11957    -5     
=======================================
- Hits        31598    31596    -2     
+ Misses        685      684    -1     
  Partials       45       45           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amanabiy amanabiy changed the title refactor: Move more internal tools to listbox refactor: Move more internal tools from select to listbox Oct 29, 2026
@amanabiy amanabiy changed the title refactor: Move more internal tools from select to listbox refactor: Move internal parts from select to listbox Oct 29, 2026
@amanabiy amanabiy changed the title refactor: Move internal parts from select to listbox refactor: Move internal parts and utils from select to listbox Oct 29, 2026
@amanabiy amanabiy changed the title refactor: Move internal parts and utils from select to listbox refactor: move internal parts and utils from select to listbox Oct 29, 2026
@amanabiy
amanabiy requested a balanced review from Copilot October 29, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@amanabiy
amanabiy marked this pull request as ready for review October 29, 2026 17:05
@amanabiy
amanabiy requested a review from a team as a code owner October 29, 2026 17:05
@amanabiy
amanabiy requested review from a team and cansuaa and removed request for a team October 29, 2026 17:05
const { inGroupIndex, groupIndex, throughIndex } = getTestOptionIndexes(option) || {};
return {
...optionProps,
hasCheckbox: checkboxes,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hasCheckbox is not needed anymore because on last PR I introduced selectionType: 'single' | 'mult'. The multi row always draws the checkbox and the single row never does.

@amanabiy
amanabiy removed the request for review from a team October 29, 2026 17:29
After the checkboxes input was removed, "with keyboard" made the same
call with the same expectation as "should return props for the first
child in the first group".

This branch was successfully deployed

3 active deployments
dev-pages-react18 — 6c48dd2c Deployed Oct 29, 2026 by amanabiy via deploy (React 18) / deploy #3048
dev-pages-react16 — 6c48dd2c Deployed Oct 29, 2026 by amanabiy via deploy (React 16) / deploy #3048
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.

2 participants