Fix results overflow and add debug logging for reference badges
CSS Changes: - Added max-width and overflow handling to .badge-row - Added word-wrap and overflow protection to .item - Added overflow-x: hidden to .window-body - Badges now use white-space: nowrap to prevent text wrapping - Item titles now break words properly with word-break JavaScript Changes: - Added console.log debugging for reference counts - Logs show whether fields are present and their values - Helps diagnose why badges aren't appearing This should fix the overflow issue and help debug badge visibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -995,6 +995,18 @@ async function updateFrequencyChart(term, channels, year, queryMode) {
|
||||
// Add reference count badges
|
||||
const refByCount = item.referenced_by_count || 0;
|
||||
const refToCount = item.internal_references_count || 0;
|
||||
|
||||
// Debug: log reference counts for first item
|
||||
if (badges.length === 0 || badges.length <= 2) {
|
||||
console.log('Reference counts:', {
|
||||
title: item.title,
|
||||
referenced_by_count: refByCount,
|
||||
internal_references_count: refToCount,
|
||||
hasReferencedBy: 'referenced_by_count' in item,
|
||||
hasInternalRefs: 'internal_references_count' in item
|
||||
});
|
||||
}
|
||||
|
||||
if (refByCount > 0) badges.push(`${refByCount} backlink${refByCount !== 1 ? 's' : ''}`);
|
||||
if (refToCount > 0) badges.push(`${refToCount} reference${refToCount !== 1 ? 's' : ''}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user