Akhil/optimise nosql - #215
Merged
Merged
Conversation
Add SearchBar component for Redis Commander key search feature with: - Mode indicator with icon (⚡ glob, 🔍 fuzzy, .* regex) - Match count badge - Clear button and Escape key support - Advanced panel toggle - Inline regex error display - Full accessibility and keyboard support Add SearchMode type definition to types.ts for use across search components. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Implements collapsible panel for Redis search mode override with: - Current mode explanation with examples - Toggle buttons for glob, fuzzy, and regex modes - Reset to Auto-Detect functionality - Styled with shadcn/ui Button and Tailwind CSS Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add smart search (glob/regex/fuzzy) with auto-detection to the Redis key browser. Introduces search-utils.ts with matching helpers and wires SearchBar + AdvancedSearchPanel into KeyBrowser with debounced filtering, allKeys/displayedKeys split, and per-mode override support. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add visual highlighting showing which parts of Redis key names matched the search pattern. Implements HighlightedKeyText component that: - For fuzzy mode: highlights individual matched characters with yellow background - For glob/regex mode: highlights the matched segment with blue background - Extends search-utils with mode-aware getMatchIndices() function - Only displays highlighting when search is active Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add useEffect hook to KeyBrowser component that clears search input and state whenever the Redis connection (redisUrl) changes. This ensures search filters are reset when switching between different Redis connections. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
handleClearSearch previously depended on `allKeys`, causing it to get a new identity on every page load (whenever setAllKeys ran). The `useEffect([redisUrl, handleClearSearch])` then re-fired on every scroll page, wiping the active search query. Fix: replace the `allKeys` closure reference with `allKeysRef` so handleClearSearch has a stable identity (empty dep array). The clear effect now only fires when `redisUrl` truly changes. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add 67 comprehensive test cases covering all five exported functions: - detectSearchMode: 23 tests for glob, regex, and fuzzy patterns - globMatch: 10 tests for pattern matching with wildcards - regexMatch: 7 tests for regex patterns and error handling - fuzzyMatch: 9 tests for subsequence matching - getFuzzyMatchIndices: 7 tests for character position detection - getGlobMatchIndices: 5 tests for segment boundary detection - getRegexMatchIndices: 5 tests for regex match positions - getMatchIndices: 7 tests for mode-based matching Setup Jest with ts-jest preset and configuration for the monorepo. All 67 tests pass with no type errors or linting issues. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
No description provided.