fix(compass-sidebar): connection search empty state for invalid patterns COMPASS-9970#8016
Draft
cursor[bot] wants to merge 1 commit intomainfrom
Draft
fix(compass-sidebar): connection search empty state for invalid patterns COMPASS-9970#8016cursor[bot] wants to merge 1 commit intomainfrom
cursor[bot] wants to merge 1 commit intomainfrom
Conversation
When the search field contains a non-empty string that does not compile as a RegExp, keep filtering active so users see "No results found." instead of the full list. Sync filter updates in useLayoutEffect to reduce a one-frame flash of stale results. COMPASS-9970
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.
Description
The connections sidebar already shows No results found. when a valid search yields no matches. If the user typed a non-empty string that is not a valid regular expression (for example an unmatched
(),createRegExpreturnednull, the filter hook treated that as “not filtering”, and the UI fell back to the full connection list—often feeling like “nothing happened” or an ambiguous loading state.This change:
searchTextfrom the search field onConnectionsFilter.searchTextis non-empty andregexisnull, keeps filtering active and applies a never-match pattern sofilteredis an empty array and the existing empty state (data-testid="no-search-results") renders.useLayoutEffectso the filtered list updates in the same paint as the input, reducing a brief flash of stale (unfiltered) results.Checklist
Motivation and Context
Addresses COMPASS-9970: make it clear when a connections search has no results, including invalid search patterns.
Open Questions
None.
Dependents
None.
Types of changes