Skip to content

Conversation

@goughjo02
Copy link

The basics

The details

Resolves

Fixes #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.

add regression test asserting long queries require their trailing trigram
adjust trigram loop to cover the last trigram so partial matches stop passing
cover trigram edge cases, underscore normalization, dropdown alt text, and disambiguation of similar blocks
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.

Toolbox search: long queries drop the last trigram, causing false positives (e.g. “conso” matches “math constrain”)

1 participant