Skip to content

fix(playground): search instruments by label - #1859

Merged
joshunrau merged 2 commits into
DouglasNeuroInformatics:mainfrom
joshunrau:fix/1764-playground-instrument-search
Nov 3, 2026
Merged

joshunrau merged 2 commits into
DouglasNeuroInformatics:mainfrom
joshunrau:fix/1764-playground-instrument-search

Conversation

@joshunrau

Copy link
Copy Markdown
Collaborator

Fixes #1764. Supersedes #1817.

The playground's instrument selector searched the hidden instrument UUIDs instead of the labels people see, so typing a name found nothing and short queries like a or 3 returned an arbitrary set.

  • Each Command.Item's value is now the instrument's label, and onSelect selects by instrument.id from the closure. cmdk's default filter scores value and keywords together, so keeping the UUID as the value and adding the label as a keyword (the first fix in fix(playground): search instruments by label #1817) still matched ids: 4 listed every instrument. Labels are unique, as upload, clone and share-link import all enforce.
  • The playground page object now owns the selector and search-box locators behind searchInstruments(query), which selectInstrument reuses. The old workaround comment is gone.

The first commit is @misaelalves99's work from #1817, kept with their authorship. The second commit applies the review feedback that PR never picked up.

Verification

  • Unit: apps/playground/src/components/Header/InstrumentSelector/__tests__/InstrumentSelector.test.tsx (happy-dom, as apps/playground/AGENTS.md describes) covers matching by label, finding nothing for 4, and selecting by id. With the component reverted to the first commit, the 4 test fails.
  • E2E: testing/src/specs/playground.spec.ts searches Form Reference by its label and expects No Instruments Found for 4. Every v4 UUID has a 4, and no built-in label does.
  • pnpm --filter lint passes for playground and testing. The full pnpm lint, test:coverage and test:e2e were not run locally; CI runs them.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

misaelalves99 and others added 2 commits November 3, 2026 08:42
cmdk's default filter scores an item's value and keywords as one string,
so with the UUID as the value and the label as a keyword, any query of
hex characters still listed instruments whose hidden id matched it: `4`
listed every instrument. The label is now the item's value, and onSelect
selects the instrument by its id from the closure. Labels are unique, as
upload, clone and share-link import all enforce.

The playground page object now owns the selector and search-box locators
behind searchInstruments(), and the e2e spec asserts that `4` finds
nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshunrau
joshunrau merged commit 8eddfd1 into DouglasNeuroInformatics:main Nov 3, 2026
2 checks passed
@joshunrau
joshunrau deleted the fix/1764-playground-instrument-search branch November 4, 2026 20:04
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.

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

2 participants