From f86deaf02fc768a302807474db984a0498b6496b Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Fri, 10 Jul 2026 12:35:40 +0200 Subject: [PATCH] repertoire: remove matched-first sorting and faded/disabled system for filter entries Remove the system that sorted valid (matched) filter entries to the top and faded/disabled unmatched ones when any filter was active. Entries now stay in their natural alphabetical/numeric order regardless of selection state. - Drop usort calls that reordered entries by matched status - Simplify repFilterEntry: remove anyActive and colHasMatch params - Remove colHasMatches computation - Remove rep-entry--faded CSS rule - All filter buttons remain clickable at all times --- app/public/assets/css/repertoire.css | 7 ----- app/templates/partials/repertoire-index.php | 33 ++------------------- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/app/public/assets/css/repertoire.css b/app/public/assets/css/repertoire.css index 82a6e48..eb90288 100644 --- a/app/public/assets/css/repertoire.css +++ b/app/public/assets/css/repertoire.css @@ -359,13 +359,6 @@ color: var(--accent-primary); } -/* Faded/disabled: muted, not interactive */ -.rep-entry--faded { - opacity: 0.3; - cursor: not-allowed; - pointer-events: none; -} - /* Years column — big numbers, semi-bold (BBBDMSans Medium weight) */ .repertoire-col[data-col="years"] .rep-entry { font-size: var(--step-3); diff --git a/app/templates/partials/repertoire-index.php b/app/templates/partials/repertoire-index.php index 99e4a5c..6892d06 100644 --- a/app/templates/partials/repertoire-index.php +++ b/app/templates/partials/repertoire-index.php @@ -62,22 +62,18 @@ function repFilterEntry( array $item, string $dim, array $activeSets, - bool $anyActive, - bool $colHasMatch, string $hx, ): void { $val = (string)$item['value']; $isActive = in_array($val, $activeSets[$dim], true); - $isFaded = $anyActive && $colHasMatch && !$item['matched'] && !$isActive; $cls = 'rep-entry' - . ($isActive ? ' rep-entry--selected' : '') - . ($isFaded ? ' rep-entry--faded' : ''); + . ($isActive ? ' rep-entry--selected' : ''); $url = repToggleUrl($activeSets, $dim, $val); ?>
  • @@ -87,10 +83,6 @@ function repFilterEntry( // ── Column definitions ────────────────────────────────────────────────────── $hx = 'hx-target="#repertoire-index" hx-swap="outerHTML" hx-push-url="true" hx-indicator="#rep-indicator"'; -$anyActive = !empty($activeSets['years']) || !empty($activeSets['ap']) - || !empty($activeSets['or']) || !empty($activeSets['fi']) - || !empty($activeSets['kw']); - $filterColumns = [ ['dataKey' => 'years', 'dim' => 'years', 'heading' => 'Années'], ['dataKey' => 'ap_programs', 'dim' => 'ap', 'heading' => 'Ateliers Pluridisciplinaires'], @@ -99,29 +91,10 @@ $filterColumns = [ ['dataKey' => 'keywords', 'dim' => 'kw', 'heading' => 'Mots-clés'], ]; -$colHasMatches = []; -foreach ($filterColumns as $col) { - $colHasMatches[$col['dim']] = !empty(array_filter( - $repData[$col['dataKey']], - fn($i) => $i['matched'] - )); -} - ?>
    - ($b['matched'] <=> $a['matched']) ?: strcasecmp($a['value'], $b['value']); -usort($repData['years'], fn($a, $b) => - ($b['matched'] <=> $a['matched']) ?: ($b['value'] <=> $a['value'])); -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. $renderOrder = ['years', 'ap', 'or', 'fi', 'students', 'kw']; @@ -184,7 +157,7 @@ foreach ($renderOrder as $colKey):