Repository navigation
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
aor3returned an arbitrary set.Command.Item'svalueis now the instrument's label, andonSelectselects byinstrument.idfrom the closure. cmdk's default filter scoresvalueandkeywordstogether, 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:4listed every instrument. Labels are unique, as upload, clone and share-link import all enforce.searchInstruments(query), whichselectInstrumentreuses. 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
apps/playground/src/components/Header/InstrumentSelector/__tests__/InstrumentSelector.test.tsx(happy-dom, asapps/playground/AGENTS.mddescribes) covers matching by label, finding nothing for4, and selecting by id. With the component reverted to the first commit, the4test fails.testing/src/specs/playground.spec.tssearchesForm Referenceby its label and expectsNo Instruments Foundfor4. Every v4 UUID has a4, and no built-in label does.pnpm --filterlint passes for playground and testing. The fullpnpm lint,test:coverageandtest:e2ewere not run locally; CI runs them.Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com