Skip to content

The playground instrument selector's search matches instrument UUIDs instead of labels, so typing a name finds nothing #1764

Open

Description

@joshunrau

The playground instrument selector's search box matches instrument UUIDs instead of labels, so typing an instrument's name finds nothing. Each Command.Item gets value={instrument.id}, and cmdk filters items by value (plus keywords, which are not set). So the typed text is fuzzy-matched against random crypto.randomUUID() strings. Typing Unilingual shows "No Instruments Found". A short query like a or 3 returns an arbitrary set of instruments whose UUIDs happen to contain those characters, and the set changes on every reload because the ids of examples and templates are regenerated each load. The e2e page object already works around this: selectInstrument clicks the option without typing, with the comment "The list's search box matches on instrument ids rather than labels".

Where

apps/playground/src/components/Header/InstrumentSelector/InstrumentSelector.tsx:49-57:

{instruments.map((instrument) => (
  <Command.Item
    key={instrument.id}
    value={instrument.id}
    onSelect={(id) => {
      setSelectedInstrument(id);
      setOpen(false);
    }}
  >

Reproduce

  1. Open the playground and click the instrument selector.
  2. Type Unilingual.

Actual: the list shows "No Instruments Found".
Expected: Unilingual Form is listed.

Tests

E2E in testing/src/specs/playground.spec.ts: open the selector, type Form Reference, and assert that the Form Reference option is visible. Change selectInstrument in testing/src/pages/playground/index.page.ts to type the label before clicking, and drop its workaround comment. The fix is a prop on a third-party component and has no logic to unit-test.

Suggested fix

Keep value={instrument.id} for selection and add keywords={[instrument.label]} to each Command.Item (cmdk scores keywords together with the value). Alternatively, use the label as value and select with setSelectedInstrument(instrument.id) from the closure.

Activity

  1. added
    BugType: existing behavior is wrong
    Difficulty: LowIsolated change, about 2 hours or less
    Area: Playgroundapps/playground (in-browser instrument editor)
    Good First IssueWell-scoped, low-risk and self-contained; a good entry point for a new contributor
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Playgroundapps/playground (in-browser instrument editor)BugType: existing behavior is wrongDifficulty: LowIsolated change, about 2 hours or lessGood First IssueWell-scoped, low-risk and self-contained; a good entry point for a new contributorPriority: MediumReal value; schedule normally

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions