Skip to content

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

Closed
misaelalves99 wants to merge 1 commit into
DouglasNeuroInformatics:mainfrom
misaelalves99:fix/1764-playground-instrument-search
Closed

misaelalves99 wants to merge 1 commit into
DouglasNeuroInformatics:mainfrom
misaelalves99:fix/1764-playground-instrument-search

Conversation

@misaelalves99

Copy link
Copy Markdown
Contributor

Summary

  • Fix the playground instrument selector's search to match visible instrument labels while preserving instrument UUIDs as selection values.
  • Update the playground page object to search by label before selecting an instrument.
  • Add an end-to-end regression test for searching Form Reference by its visible label.

Fixes #1764.

Validation

  • RED: Regression test failed as expected because the instrument option was not found when filtering by its label.
  • GREEN: Regression test passed after the fix.
  • Playground E2E: 9/9 Chromium tests passed.
  • Static checks: Prettier, targeted ESLint, playground TypeScript, and testing TypeScript checks passed.
  • Playground Vitest: Passed.

Testing limitations

  • The repository-wide production build was blocked by the API's RELEASE_VERSION requirement.
  • The isolated playground production build encountered a Node.js heap out-of-memory error.
  • The repository-wide CI suite was not executed locally.

@joshunrau joshunrau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for picking this up! Searching by label works now, and this is the fix #1764 suggested first. A few things before it can go in:

  1. The search still matches the UUIDs. cmdk's default filter joins value and keywords into one string and scores that, so the hidden UUID is still searched. Any query made only of hex characters (3, a, face) still lists instruments whose UUID happens to match. 4 lists every instrument, because every v4 UUID contains a 4. That's the "a or 3 returns an arbitrary set" part of #1764. Could you switch to the issue's alternative fix? In InstrumentSelector.tsx (lines 50-57), use value={instrument.label}, drop keywords, and call setSelectedInstrument(instrument.id) from the closure in onSelect. Labels are already unique: upload, clone and share-link import each give a new instrument a unique label.
  2. Cover that in the e2e test. In playground.spec.ts, also fill the search with 4 and expect No Instruments Found. The result is deterministic, because crypto.randomUUID() always puts a 4 in the version digit and no built-in label contains one. The assertion fails on the branch as it stands.
  3. Go through the page object. The new test repeats the combobox and search-box locators (playground.spec.ts:113-114) that PlaygroundPage.selectInstrument already uses. Please move them into testing/src/pages/playground/index.page.ts, either as locators set in the constructor or as a small searchInstruments(query) method that selectInstrument reuses. Then drive the spec through it.

If you hand this to Claude Code, Opus 5 is the right size. The edits are three small, fully specified changes across the playground and the e2e suite.

Reviewed at commit d257bf6.

This was referenced Oct 26, 2026
@joshunrau joshunrau closed this Nov 5, 2026
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