Repository navigation
Conversation
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.
This pull request introduces a centralized, robust client-side server search and ranking system, replacing all previous ad-hoc filtering logic across the app. The new matcher provides consistent, relevance-ranked results for all server search surfaces, supporting typo tolerance, accent/case insensitivity, and smart tokenization. All affected components now use this shared logic, ensuring users see the best matches first.
Centralized server search and ranking:
server-search.tsimplementing a hybrid, zero-dependency search matcher that normalizes text (removing color codes, accents, and case), tokenizes queries, and ranks results by strict tiers (exact, prefix, word-start, substring, 1-edit typo), with name matches always prioritized over IPs. Fuzzy matching is limited to a single edit for tokens of 5+ letters, and never applies to IPs/ports. Includes comprehensive tests. [1] [2]Component integration and logic updates:
useServersFilterSorthook, home page server list, account servers tab, and search bar to use the newsearchServersfunction for all server filtering and search, replacing previous substring-based logic. This ensures consistent ranking and filtering everywhere. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Sorting logic improvements:
useServersFilterSortso that when a search query is present, the relevance ranking from the matcher is used as the sort order, preventing secondary sorts (like by popularity or name) from burying the best matches. [1] [2] [3] [4]Testing:
server-search.test.ts, ensuring correct and robust search results.