blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

fix: toolbox search final trigram

Open goughjo02 opened this issue 3 weeks ago • 1 comments

The basics

The details

Resolves

Fixes https://github.com/RaspberryPiFoundation/blockly-samples/issues/2645

Proposed Changes

  • Include the final trigram when generating search tokens to prevent partial matches on long queries.
  • Add a regression test covering the “conso” false positive case.
  • Expand BlockSearcher tests for short/empty input, underscore normalization, dropdown alt text indexing, and disambiguation between similar blocks.

Reason for Changes

  • Prevent toolbox search from returning false positives for queries longer than three characters and improve overall search accuracy.

Test Coverage

  • npm test -- --runInBand (blockly-scripts test)

Documentation

  • No documentation updates needed.

Additional Information

  • Additional tests define temporary blocks/dropdowns to exercise edge cases; no user-facing behavior changes beyond correcting search results.

goughjo02 avatar Dec 05 '25 21:12 goughjo02

Thank you for identifying and reporting this issue and sending a fix! I really appreciate the improved tests as well. I just had two minor questions, and if you could run npm run format and commit the results of that to make the linter happy I think we should be good to merge this.

gonfunko avatar Dec 12 '25 23:12 gonfunko