diff --git a/src/visualizer/public/index.html b/src/visualizer/public/index.html index 05d9532..741e518 100644 --- a/src/visualizer/public/index.html +++ b/src/visualizer/public/index.html @@ -744,7 +744,7 @@
🔍 - +
@@ -796,14 +796,8 @@
🔮
-
Ask about your code
-
Try: "How does authentication work?" or "What happens when a user signs in?"
-
- - - - -
+
Search for a starting point
+
Type a symbol name, pick it, and trace its call chain
@@ -1459,9 +1453,27 @@ if (e.key === 'Enter') { e.preventDefault(); const query = e.target.value.trim(); - if (query) { - hideSearchDropdown(); - exploreQuery(query); + if (!query) return; + + // If dropdown is visible and has results, select the first one + const dropdown = document.getElementById('search-results-dropdown'); + const firstItem = dropdown.querySelector('.search-result-item'); + if (dropdown.classList.contains('visible') && firstItem) { + firstItem.click(); + } else { + // Trigger a search and auto-select first result + (async () => { + try { + const data = await api.search(query, null, 10); + if (data.results.length > 0) { + selectSearchResult(data.results[0].node.id); + } else { + showToast('No symbols found. Try a different search.'); + } + } catch (err) { + showToast('Search error: ' + err.message); + } + })(); } } }