diff --git a/app/templates/partials/repertoire-index.php b/app/templates/partials/repertoire-index.php index d721e35..c0dafa9 100644 --- a/app/templates/partials/repertoire-index.php +++ b/app/templates/partials/repertoire-index.php @@ -111,11 +111,15 @@ foreach ($filterColumns as $col) {
- ($b['matched'] <=> $a['matched']) ?: strcasecmp($a['value'], $b['value']) -); +// Sort filter columns: matched first (alpha), then unmatched (alpha) — keeps +// viable entries at the top so users don't have to scroll past faded ones. +$sortMatchedFirst = fn($a, $b) => + ($b['matched'] <=> $a['matched']) ?: strcasecmp($a['value'], $b['value']); +usort($repData['years'], $sortMatchedFirst); +usort($repData['ap_programs'], $sortMatchedFirst); +usort($repData['orientations'], $sortMatchedFirst); +usort($repData['finality_types'], $sortMatchedFirst); +usort($repData['keywords'], $sortMatchedFirst); // Render filter columns in the correct left-to-right order. // Students column (non-filter) is inserted between keywords and AP/or/fi/years.