Skip to content

fix(site): allow search by label in MultiSelectComboBox#24421

Merged
johnstcn merged 2 commits intomainfrom
cian/codagt-103-allowed-templates-search-returns-no-results
Apr 16, 2026
Merged

fix(site): allow search by label in MultiSelectComboBox#24421
johnstcn merged 2 commits intomainfrom
cian/codagt-103-allowed-templates-search-returns-no-results

Conversation

@johnstcn
Copy link
Copy Markdown
Member

Fixes https://linear.app/codercom/issue/CODAGT-103

  • Add keywords={[option.label]} to CommandItem in MultiSelectCombobox so cmdk's default filter matches against the visible label text, not just the value (UUID)
  • Extend OpenCombobox story with type-to-filter assertions
  • Add "search filters by display name" step to TemplateAllowlist story
Root cause & decision log

cmdk's default filter matches CommandItem's value prop. MultiSelectCombobox was passing option.value (a UUID/ID) as value while rendering option.label (the display name) as children. Users type display names but the filter searched UUIDs — nothing ever matched.

cmdk supports a keywords prop on CommandItem that the built-in filter also searches. Adding keywords={[option.label]} is the minimal fix: it doesn't change the value identity semantics (used by onSelect), requires zero consumer changes, and fixes the same latent bug in IdpGroupSyncForm, IdpOrgSyncPageView, and IdpRoleSyncForm.

🤖

cmdk's default filter was matching search input against the CommandItem
value prop (a UUID), not the visible label text. Users type display names
but the filter searched UUIDs, so nothing ever matched.

Add keywords={[option.label]} to CommandItem so cmdk's built-in filter
also matches against the human-readable label. This fixes the allowed
templates search and also benefits IdpGroupSync, IdpOrgSync, and
IdpRoleSync pages that had the same latent bug.
Copy link
Copy Markdown
Member Author

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

self-reviewed

@johnstcn johnstcn changed the title fix(site): teach MultiSelectCombobox to search by label, not by UUID fix(site): search by label instead of UUID in template allowlist Apr 16, 2026
@johnstcn johnstcn changed the title fix(site): search by label instead of UUID in template allowlist fix(site): allow search by label in MultiSelectComboBox Apr 16, 2026
@johnstcn johnstcn marked this pull request as ready for review April 16, 2026 15:41
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

Fixes cmdk filtering in MultiSelectCombobox so type-to-search matches the user-visible label (e.g., “Docker Development”) instead of only the underlying value (UUID/ID), and adds Storybook play assertions to prevent regressions.

Changes:

  • Add keywords={[option.label]} to each CommandItem in MultiSelectCombobox so cmdk’s default filter searches the display label.
  • Extend the OpenCombobox Storybook play test with type-to-filter assertions.
  • Add a “search filters by display name” step to the TemplateAllowlist story.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx Adds cmdk keywords to ensure filtering matches display labels.
site/src/components/MultiSelectCombobox/MultiSelectCombobox.stories.tsx Adds play-test assertions for filtering by display name.
site/src/pages/AgentsPage/AgentSettingsTemplatesPageView.stories.tsx Adds story step covering template search/filter behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread site/src/pages/AgentsPage/AgentSettingsTemplatesPageView.stories.tsx Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@johnstcn johnstcn merged commit 383b10f into main Apr 16, 2026
27 checks passed
@johnstcn johnstcn deleted the cian/codagt-103-allowed-templates-search-returns-no-results branch April 16, 2026 16:44
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants