Major enhancements to connectivity tests, global search, and TUI#34
Merged
Major enhancements to connectivity tests, global search, and TUI#34
Conversation
…ering capabilities
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
Major enhancements to connectivity tests, VPN details, and global search functionality:
Connectivity Tests Improvements
bon connectivity tests to open them in Google Cloud Consoledon connectivity test in global search to see complete details (not simplified view)VPN Detail View Integration
don VPN gateways or tunnels in global search to see complete detailsShowVPNGatewayDetails()andShowVPNTunnelDetails()as reusable functionsSearch Performance & UX
⠋ project-name • 3/15 projects • 45/300 calls (15%) • 42 foundSearch Results (42) [15 instance, 12 disk, 8 bucket]↑/↓in search box to navigate through recent searches (persisted across sessions)Search View Code Refactoring
Changes
New files
internal/gcp/search/connectivity_tests.go— connectivity tests search providerinternal/cache/migrations/v8_search_history.go— database migration for search history tableinternal/tui/search_table.go— table rendering and update logic (190 lines)internal/tui/search_modals.go— modal dialog management (211 lines)internal/tui/search_helpers.go— utility functions and error handling (104 lines)internal/tui/search_state.go— state management structures (48 lines)internal/tui/search_actions.go— action handler foundation (87 lines)Modified files
Connectivity Tests
internal/tui/connectivity_view.go:bkeyboard shortcut to open test in Google Cloud ConsoleShowConnectivityTestDetails()as reusable functionVPN Views
internal/tui/vpn_view.go:ShowVPNGatewayDetails()as reusable functionShowVPNTunnelDetails()as reusable functionshowVPNDetail()to call reusable functionsSearch System
internal/gcp/search/types.go:KindConnectivityTestresource typeAllResourceKinds()internal/gcp/search/engine.go:internal/cache/affinity.go:AddSearchHistory()— records search terms with usage count and timestampGetSearchHistory()— retrieves recent searches ordered by recencyCleanSearchHistory()— removes old search history entriesinternal/tui/search_view.go:dkey (shows full details)dkey (shows full details)dkey (shows full details with BGP sessions)↑/↓navigationinternal/tui/actions.go:GetCloudConsoleURL()Technical Details
Batched Search Algorithm
High-affinity projects (based on
search_affinitytable) are searched first:Search History Implementation
search_historytable stores recent searchesuse_countand updateslast_usedtimestamplast_used↑/↓keyboard navigation in search inputConnectivity Test Details
ShowConnectivityTestDetails()function used by both:cview)dkey on connectivity test results)net-intelligence/connectivity/tests/details/{name}VPN Detail Views
ShowVPNGatewayDetails()function used by both:vview)dkey on VPN gateway results)ShowVPNTunnelDetails()function used by both:vview)dkey on VPN tunnel results)Search View Refactoring Architecture
Comprehensive refactoring to improve maintainability and code organization:
File Structure (split from 1 monolithic file into 6 focused files):
search_view.go(1,274 lines) — Main orchestration and event handlingsearch_table.go(190 lines) — Table rendering and update logicsearch_modals.go(211 lines) — Modal dialog managementsearch_helpers.go(104 lines) — Utility functions and error handlingsearch_state.go(48 lines) — State management structuressearch_actions.go(87 lines) — Action handler foundationKey Components Extracted:
TableUpdater — Manages all table operations:
UpdateWithData()— Main update with filtering and highlightingcaptureSelection()/restoreSelection()— Selection preservationbuildTypeSummary()— Resource type breakdown in titleensureSelection()— Smart selection managementSearchViewState — Consolidated state management:
ErrorHandler — Consistent error/status display:
ShowError()— Display error with auto-restoreShowSuccess()— Display success messageShowLoading()— Display loading statusModal Functions — Reusable modal dialogs:
showSearchResultDetail()— Generic result detailsshowInstanceDetailModal()— Instance-specific detailsshowSearchHelp()— Keyboard shortcuts helpBenefits:
Future Enhancements (foundation in place):
Test plan
Build & Compilation
go build ./...compiles cleanlyConnectivity Tests
compass interactive, pressc, select a connectivity test, pressb— should open in browserd— should show both forward and return pathsShift+S, search for "connectivity-test-name", verify it appears in resultsdon connectivity test — should show full details (not simplified view)VPN Details
Shift+S, search for a VPN gateway name, pressd— should show full gateway details with interfacesShift+S, search for a VPN tunnel name, pressd— should show full tunnel details with BGP sessions and prefixesv), pressdon a gateway — should show same detailed view as searchv), pressdon a tunnel — should show same detailed view as search with all BGP informationSearch Performance & UX
↑in search box — should show previous search↑multiple times — should cycle through search historySearch View Refactoring Verification
Database Migration
v8_search_history — Adds
search_historytable:search_termTEXT PRIMARY KEYlast_usedINTEGER (Unix timestamp)use_countINTEGER (increments with each search)last_used DESCfor efficient retrieval🤖 Generated with Claude Code