Add extensive debugging for suggestion clicks

This commit is contained in:
itsaygea
2026-01-24 09:13:23 -07:00
parent 4017893616
commit 33029e53aa
+6
View File
@@ -619,6 +619,8 @@
const sorted = Object.entries(scores).sort((a, b) => b[1] - a[1]).slice(0, 3); const sorted = Object.entries(scores).sort((a, b) => b[1] - a[1]).slice(0, 3);
console.log('updateSuggestions called, sorted:', sorted);
if (sorted.length === 0) { if (sorted.length === 0) {
list.innerHTML = '<p style="color:var(--text-secondary);font-size:13px;">No synergy data available for selected operators. Try adding a main DPS like Laevatain or Yvonne.</p>'; list.innerHTML = '<p style="color:var(--text-secondary);font-size:13px;">No synergy data available for selected operators. Try adding a main DPS like Laevatain or Yvonne.</p>';
} else { } else {
@@ -644,9 +646,13 @@
`; `;
}).join(''); }).join('');
console.log('Suggestions HTML set, list.children:', list.children.length);
// Add click listeners to suggestion items using event delegation // Add click listeners to suggestion items using event delegation
list.onclick = function(e) { list.onclick = function(e) {
console.log('list clicked, target:', e.target);
const item = e.target.closest('.suggestion-item'); const item = e.target.closest('.suggestion-item');
console.log('closest item:', item);
if (item) { if (item) {
const operatorId = item.dataset.operatorId; const operatorId = item.dataset.operatorId;
console.log('Clicked suggestion:', operatorId); console.log('Clicked suggestion:', operatorId);