Skip to content

FE-681: add multiselect to ds - #9505

Merged
alex-e-leon merged 9 commits into
mainfrom
FE-681-add-multiselect-to-ds
Sep 7, 2026
Merged

FE-681: add multiselect to ds#9505
alex-e-leon merged 9 commits into
mainfrom
FE-681-add-multiselect-to-ds

Conversation

@alex-e-leon

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

  • Adds multiple prop to select to enable multi select
  • Adds searcheable prop to select

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Sep 7, 2026 7:52am UTC
hashdotdesign-tokens Ready Ready Preview Sep 7, 2026 7:52am UTC
petrinaut Ready Ready Preview Sep 7, 2026 7:52am UTC
petrinaut-docs Ready Ready Preview Sep 7, 2026 7:52am UTC

Request Review

@cursor

cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Expands the public Select API and interaction model (multi-value, search, keyboard); regressions could affect forms app-wide, though changes are isolated to ds-components with typed props and stories.

Overview
Select gains multiple mode with array value/onChange, optional maxItems, and richer dropdown rows via MultiSelectItem (checkbox/tick/highlight variants, tones, suffixes, hover "Only" to isolate one choice). Single- and multi-select props are split at the type level so renderSelectedItem and maxItems stay correct.

A shared searchable dropdown filter filters by item text, calls onSearch, resets on close, and keeps list highlight in sync for keyboard use from the search field (SearchHighlightSync). SelectableListSearch replaces duplicated search UI in SortMenu and adds placement-aware styling so the search row stays next to the trigger when the popover flips upward; SelectableList layout and Select custom-row key handling support that.

Supporting tweaks include clear-button focus visibility, multi-select list spacing, new Ladle stories, and exporting MultiSelectItem from the package entry.

Reviewed by Cursor Bugbot for commit 04bb78e. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread libs/@hashintel/ds-components/src/components/Select/select.tsx
Comment thread libs/@hashintel/ds-components/src/components/Select/select.tsx Outdated
@alex-e-leon
alex-e-leon force-pushed the FE-681-add-multiselect-to-ds branch from 88cfe85 to 9c6f30c Compare September 7, 2026 07:42

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 04bb78e. Configure here.

@lunelson lunelson 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.

I'm wondering only if the value should be sorted in the same order as the options. It's possible to create different values which are logically identical but will appear different depending on the order in which they were clicked

@alex-e-leon
alex-e-leon added this pull request to the merge queue Sep 7, 2026
@alex-e-leon

alex-e-leon commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

I'm wondering only if the value should be sorted in the same order as the options. It's possible to create different values which are logically identical but will appear different depending on the order in which they were clicked

Its not a bad idea, and I almost went ahead and implemented it, but after thinking about it I think it's better not to have this.

In practice it's not really an issue - it won't create any issues with memoization, since in order to change the order, a user would need to unselect and re-select options which would already trigger onChange with the inbetween states and therefore break any memoization in the interim.

And in cases where the order is important the consuming developer is likely already sorting, and in practice its often not a straight alphabetical sort, so we would be double sorting in some scenarios.

But the actual reasons I decided it's better not to implement it are
a) either the selected UI would annoyingly sort for users (so when a user selected an item it could be added to the front) or the data + ui would be out of sync
b) it also prevents a consumer from knowing the order a user selected options, and in some situations the order may be important. Leaving it unsorted gives developers more control on how its used.

Merged via the queue into main with commit 8d1e5fa Sep 7, 2026
71 checks passed
@alex-e-leon
alex-e-leon deleted the FE-681-add-multiselect-to-ds branch September 7, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants