diff --git a/app/static/beauty/index.html b/app/static/beauty/index.html index 57fb0d5..b32771f 100644 --- a/app/static/beauty/index.html +++ b/app/static/beauty/index.html @@ -520,11 +520,14 @@ function app() { if (snap.alpha_only) p.set('alpha_only', 'true'); if (snap.no_sld) p.set('no_sld', 'true'); - // 'none' (Not checked) = domains never in the pipeline → DuckDB search. - // Any real status (live/dead/…), niche, site_type, country, or assessed - // requires the SQLite enriched_domains table (all server-side). - const hasEnrichFilter = (snap.prescreen_status && snap.prescreen_status !== 'none') - || snap.niche || snap.site_type || snap.country || snap.assessed; + // 'none' (Not checked) = domains never in the pipeline → always DuckDB. + // Enrichment filters (niche, site_type, country, assessed) only apply to + // domains that are already in SQLite, so they are irrelevant — and must not + // force the SQLite path — when prescreen_status is 'none'. + const isNotChecked = snap.prescreen_status === 'none'; + const hasEnrichFilter = !isNotChecked && ( + snap.prescreen_status || snap.niche || snap.site_type || snap.country || snap.assessed + ); let endpoint; if (hasEnrichFilter) { if (snap.prescreen_status) p.set('prescreen_status', snap.prescreen_status); @@ -550,11 +553,11 @@ function app() { // 'Not checked': DuckDB returns all domains joined with enriched data; // keep only those with no prescreen_status yet (truly unprocessed). - if (snap.prescreen_status === 'none') rows = rows.filter(r => !r.prescreen_status); + if (isNotChecked) rows = rows.filter(r => !r.prescreen_status); // Auto-advance: current DuckDB page was fully processed → try next page // (prevents "0 results" after bulk-validating a page of Not checked domains) - if (rows.length === 0 && snap.prescreen_status === 'none' + if (rows.length === 0 && isNotChecked && (d.results||[]).length > 0 && snap.page < 500) { this.f.page = snap.page + 1; // Do NOT await — start the next page search as a fresh call so the