You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(programa): wire favourites filter through event delegation + add status
The 'Only favourites' filter button wasn't doing anything because two
click handlers were firing on each click:
1. The new event-delegation handler that toggles aria-pressed and
the CSS class
2. The old direct listener (from the previous commit) that toggled
aria-pressed again
Net effect: aria-pressed went true → false → true, leaving the
button exactly as it was. No visible change, no class added.
Fix: remove the old direct listener; the event-delegation handler
in the document click listener now owns both the per-session
favourite toggle and the filter toggle. Also refactored to share
a single announce() helper.
While here:
- Replace the buggy 'has-[:checked]:' Tailwind utilities (the button
has no :checked state, it uses aria-pressed) with the correct
'aria-pressed:' variants — those have proper specificity and
the orange-pressed look now actually applies
- Add status announcements for the filter toggle via the existing
#favorite-status live region: 'Favourites filter on. Showing N
favourite session(s).' / 'Favourites filter off. Showing all
sessions.'
- Decompose the i18n message into prefix + singular + plural words
(filterOnPrefix, filterOnSingular, filterOnPlural, filterOff) so
the script can build the count-aware message at runtime
0 commit comments