refactor(spotlight): reuse fuzzy search utilities - #778
Closed
beruro wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Superseded by #780, which preserves this change as an independent commit and has passed the consolidated CI suite. The source branch is retained for recovery. |
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.
Problem
Editor symbol search carried private copies of the same fuzzy-match and relevance-score algorithms already owned by
src/util/search/fuzzy.ts. Any scoring change could make symbol results rank differently from other Spotlight and autocomplete surfaces.Solution
Delete the private copies and import the canonical
fuzzyMatchandfuzzyScoreutilities. The implementations were identical, so filtering, exact/prefix/substring priority, boundary bonuses, and sort order remain unchanged while the algorithm has one owner and one test suite.Potential risks
The only risk is an accidental dependency or import-resolution change in the Editor Palette bundle. The shared utility is already used by Chat input surfaces, has no runtime dependencies, and its focused tests plus full typecheck pass. No state, async request, cache, or rendered UI contract changed. Rollback is a single-commit revert.
Architecture
Verification
pnpm exec vitest run src/util/search/__tests__/fuzzy.test.ts— 14 passed.pnpm exec eslint src/scaffold/GlobalSpotlight/palettes/EditorPalette/hooks/useSymbolMode.ts— passed.pnpm typecheck— full TypeScript check executed and passed.git diff --check— passed.verify:quickorverify:final, so the focused algorithm suite/lint and full typecheck entry point were used.