From f6051156cfc4750eb1691ae261bffae5909a5c80 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Mon, 13 Apr 2026 19:15:11 -0400 Subject: [PATCH] fix(badges): include sort selection in active-filters check Sort changes without a text query were falling through to the fallback liveQuery (50 badges sorted by given_name), ignoring the selected sort entirely. Added params.sort to has_active_filters so any explicit sort selection triggers the full search path. Co-Authored-By: Claude Sonnet 4.6 --- src/routes/events/[event_id]/(badges)/badges/+page.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/events/[event_id]/(badges)/badges/+page.svelte b/src/routes/events/[event_id]/(badges)/badges/+page.svelte index d8313175..a0fb095b 100644 --- a/src/routes/events/[event_id]/(badges)/badges/+page.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/+page.svelte @@ -218,9 +218,10 @@ async function handle_search_refresh(params: any) { const min_chars = params.min_chars; // Defense-in-depth: enforce min_chars even if the search component lets one through. - // Exception: if the user has set a non-default filter (printed status, type, affiliations), - // that is an explicit intent — run the search even without a text query. - const has_active_filters = printed_status !== 'all' || !!type_code || !!aff_str; + // Exception: if the user has set a non-default filter or sort, that is explicit intent — + // run the search even without a text query. + const has_active_filters = + printed_status !== 'all' || !!type_code || !!aff_str || !!params.sort; if (qry_str.length < min_chars && !has_active_filters) { untrack(() => { event_badge_id_li = [];