Add schedule event type filters#393
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds event-type filtering controls to the schedule page so users can narrow down visible events by type, addressing usability concerns from #244.
Changes:
- Introduces an
EventFiltercomponent (with styles) and wires it intoEventsListto filter displayed schedule cards by event type. - Builds filter options dynamically from the existing event-type “source of truth” and only shows types present in the current schedule.
- Adds a component test to verify filtering behavior and restoring the full event list.
Show a summary per file
| File | Description |
|---|---|
| tests/events-list.test.jsx | Adds a test covering event-type filtering and reset-to-all behavior. |
| styles/styles.scss | Globally imports the new event-filter SCSS. |
| content/commons.json | Adds i18n strings for the filter label and “All event types” option. |
| components/events-list/EventsList.jsx | Adds selected-type state, builds filter options, filters the rendered events, and shows a “no matches” empty state. |
| components/event-filter/event-filter.scss | Styles the new filter control and active/hover/focus states. |
| components/event-filter/EventFilter.jsx | Implements the filter UI as a button group using event type labels and counts. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 2
| <div className="event-filter" aria-label={getLiteral('schedule:filter-label')}> | ||
| <span className="event-filter__label"> | ||
| {getLiteral('schedule:filter-label')} | ||
| </span> | ||
| <div className="event-filter__options"> |
There was a problem hiding this comment.
aria-label on a plain <div> typically isn’t exposed unless the element has an explicit/implicit ARIA role, so the filter group may be unlabeled for assistive tech. Consider using role="group" with aria-labelledby pointing at the visible label, or use a <fieldset> + <legend> so the control group has proper semantics.
| const baseEvent = { | ||
| formattedDate: { | ||
| date: 'May 14', | ||
| startTime: { utc: '7:00 pm', pt: '12:00 pm' }, | ||
| endTime: { utc: '8:00 pm', pt: '1:00 pm' }, | ||
| timeDisplay: 'specific', | ||
| }, |
There was a problem hiding this comment.
The test fixtures don’t include the raw date field (mm/dd) that EventsList uses for the same-date class logic (event.date === ...). Using an event shape that differs from parseEvent() output can make this test pass while masking regressions; add a realistic date (and optionally endDate) to the test events.
Summary
Context
Validation