feat: add search/filter to cluster node dropdown and connections page#254
Open
alexey-temnikov wants to merge 5 commits intovalkey-io:mainfrom
Open
feat: add search/filter to cluster node dropdown and connections page#254alexey-temnikov wants to merge 5 commits intovalkey-io:mainfrom
alexey-temnikov wants to merge 5 commits intovalkey-io:mainfrom
Conversation
- Fix cluster node switching in header dropdown - Fix RequireConnection guard for cluster routes - Fix server-side client resolution for non-entry cluster nodes - Fix credential passing for empty username (PR valkey-io#252) - Add ca-certificates to Dockerfile for TLS - Make entire badge clickable for dropdown toggle Signed-off-by: Alexey Temnikov <attemnik@amazon.com>
Adds a SearchInput to the header node-switcher dropdown so users can quickly find nodes by partial name in clusters with many nodes (e.g. 300+). The list is scrollable with max-height and auto-focuses the search on open. Signed-off-by: Alexey Temnikov <attemnik@amazon.com>
Add SearchInput to the header node-switcher dropdown and the Connections page so users can quickly find nodes by partial name in large clusters. - Header dropdown: auto-focused search, scrollable max-h list, filters primary nodes only (not replicas) to avoid false positives - Connections page: filters both cluster groups and standalone connections by host, port, username, or alias - Both include clear button and empty-state message Signed-off-by: Alexey Temnikov <attemnik@amazon.com>
Add SearchInput to the header node-switcher dropdown and the Connections page so users can quickly find nodes by partial name in large clusters. - Header dropdown: auto-focused search, fixed-height scrollable list, filters primary nodes only (not replicas) to avoid false positives - Connections page: filters both cluster groups and standalone connections by host, port, username, or alias - Both include clear button and empty-state message Signed-off-by: Alexey Temnikov <attemnik@amazon.com>
- min-h-40 on 'no connections match' prevents page collapse on zero results - Removed useMemo (deps were new objects every render, never memoized) - Removed unused hasClusterGroups/hasStandaloneConnections vars Signed-off-by: Alexey Temnikov <attemnik@amazon.com>
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.
Summary
Adds search/filter capability to the header node-switcher dropdown and the Connections page to support large clusters (e.g., 300+ nodes) where scrolling through a flat list is impractical.
Changes
1. Header node-switcher dropdown (
app-header.tsx)Problem: The dropdown listed all cluster nodes in a flat, unsearchable list. With large clusters this was unusable.
Changes:
SearchInputat the top of the dropdown with auto-focus on openhost:portonly (not replicas), preventing false positives where e.g. "02" would match replica*-0001-002and show shard 0001h-72) to prevent UI jitter as filtered results changew-80) withtruncateon long hostnamesonClickfrom inner<button>toBadgeso entire badge area toggles dropdown (not just the tiny chevron icon)badgeRefto outside-click handler to prevent mousedown/click event conflict that caused double-toggleconnectionDetailsdestructure — replaced verboseascast with simple?? {}2. Connections page (
Connection.tsx)Problem: No way to search/filter connections on the main screen.
Changes:
SearchInputbetween the header and connection listconnectionId,host,port,username, oraliasmin-h-40when no connections match — prevents page collapse and reduces visual jitter when transitioning between results and no-results statesmatchesSearchas a pure function outside the component3. Removed dead code
useMemo— upstreamclusterGroups/standaloneConnectionsare new objects every render (from.reduce()), so memoization never cached. Replaced with honest inline filtering.hasClusterGroupsandhasStandaloneConnectionsvariablesuseMemoimport4. Layout stability
h-72on the node list prevents height changes as filter results changew-80width prevents horizontal jitter from varying hostname lengthsmin-h-40on the empty-state message prevents the page from collapsing to a single line when search yields zero results, reducing the visual shift between "all results" and "no results"Files Changed
apps/frontend/src/components/ui/app-header.tsxapps/frontend/src/components/connection/Connection.tsxTesting
Tested against a live ElastiCache Valkey cluster (6 shards, 2 replicas per shard, 18 total nodes):
Header dropdown search:
-002)Connections page search:
getBoundingClientRect), content reflow is expected filter behaviormin-h-40prevents page collapse on zero resultsGeneral: