fix: load full filter suggestions (up to 100) and fix Direct referrer duplicate

Filter dropdowns previously only showed ~10 values from cached dashboard
data. Now lazy-loads up to 100 values per dimension when the dropdown
opens. Also removes duplicate "Direct" entry from referrer suggestions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Usman Baig
2026-03-06 23:27:54 +01:00
parent b046978256
commit 2c82c1a52a
4 changed files with 138 additions and 40 deletions

View File

@@ -55,8 +55,6 @@ export function parseFiltersFromURL(raw: string): DimensionFilter[] {
export function filterLabel(f: DimensionFilter): string {
const dim = DIMENSION_LABELS[f.dimension] || f.dimension
const op = OPERATOR_LABELS[f.operator] || f.operator
const rawVal = f.values.length > 1 ? `${f.values[0]} +${f.values.length - 1}` : f.values[0]
// Show "Direct" for empty referrer values (direct traffic has no referrer in DB)
const val = f.dimension === 'referrer' && rawVal === '' ? 'Direct' : rawVal
const val = f.values.length > 1 ? `${f.values[0]} +${f.values.length - 1}` : f.values[0]
return `${dim} ${op} ${val}`
}