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 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-13 19:15:11 -04:00
parent d64222ca91
commit f6051156cf

View File

@@ -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 = [];