feat(activities): hide past events by default + "Past events" filter chip #77

Merged
padreug merged 2 commits from past-events-filter into dev 2026-05-25 09:49:34 +00:00
Owner

Closes #72.

Summary

  • Past events are now hidden by default in the activities feed (endDate < now, falling back to startDate).
  • New Past events filter chip on ActivitiesPage (next to "My tickets" / "Hosting"). Toggle ON to include past activities; OFF by default. Always visible — works for logged-out users too.
  • Past ActivityCards get a small Past badge with the lucide History icon, bottom-left. Suppressed only when a Pending/Rejected status badge is already taking that slot.
  • ActivityDetailPage replaces the Buy ticket CTA with a muted "This event has already happened" notice when the event is past, so the buy flow is unambiguous if a user lands on a past event by direct link. The owned-tickets pill above still renders so past attendees can find their tickets.
  • i18n: pastEvents, past, pastEvent keys added to en/es/fr.

Design notes

  • Filter logic lives in useActivityFilters.applyFilters, inside the else branch of the existing selectedDate guard — so date-pick on a specific past date bypasses the hide (per issue test plan).
  • Composes naturally with temporal pills: e.g. "This Week" + past hidden drops the days already passed within this week.
  • showPast counts as an active filter and resets via resetFilters.

Test plan

  • Feed renders only upcoming activities on default load.
  • Toggle "Past events" chip → past activities appear, each with a Past badge.
  • Combine with category filter → intersection works (only past activities in the selected categories).
  • Date-picker on a specific past date → activities for that date show regardless of the chip state.
  • Combine with "Today" / "This Week" temporal pill → past hours/days within the window are dropped when the chip is off.
  • Open a past event's detail page → buy CTA replaced by "This event has already happened" notice; owned-tickets pill still appears if the user has tickets.
  • Logged-out user → "Past events" chip is visible and works; "My tickets" / "Hosting" chips remain hidden.
Closes #72. ## Summary - Past events are now hidden by default in the activities feed (`endDate < now`, falling back to `startDate`). - New **Past events** filter chip on `ActivitiesPage` (next to "My tickets" / "Hosting"). Toggle ON to include past activities; OFF by default. Always visible — works for logged-out users too. - Past `ActivityCard`s get a small `Past` badge with the lucide `History` icon, bottom-left. Suppressed only when a Pending/Rejected status badge is already taking that slot. - `ActivityDetailPage` replaces the Buy ticket CTA with a muted "This event has already happened" notice when the event is past, so the buy flow is unambiguous if a user lands on a past event by direct link. The owned-tickets pill above still renders so past attendees can find their tickets. - i18n: `pastEvents`, `past`, `pastEvent` keys added to en/es/fr. ## Design notes - Filter logic lives in `useActivityFilters.applyFilters`, inside the `else` branch of the existing `selectedDate` guard — so date-pick on a specific past date bypasses the hide (per issue test plan). - Composes naturally with temporal pills: e.g. "This Week" + past hidden drops the days already passed within this week. - `showPast` counts as an active filter and resets via `resetFilters`. ## Test plan - [x] Feed renders only upcoming activities on default load. - [x] Toggle "Past events" chip → past activities appear, each with a `Past` badge. - [x] Combine with category filter → intersection works (only past activities in the selected categories). - [ ] Date-picker on a specific past date → activities for that date show regardless of the chip state. - [x] Combine with "Today" / "This Week" temporal pill → past hours/days within the window are dropped when the chip is off. - [x] Open a past event's detail page → buy CTA replaced by "This event has already happened" notice; owned-tickets pill still appears if the user has tickets. - [x] Logged-out user → "Past events" chip is visible and works; "My tickets" / "Hosting" chips remain hidden.
Closes aiolabs/webapp#72.

useActivityFilters gains `showPast` (default false) and `togglePast`.
applyFilters drops activities whose end-or-start date is before now
unless the chip is toggled on. Sits next to the existing temporal
filter inside the no-selectedDate branch, so picking a specific past
date in the DatePickerStrip still surfaces that day's activities —
mirroring how date-pick already bypasses the temporal pills. Counts
as an active filter and resets cleanly.

ActivitiesPage adds the chip in the role-filter row, outside the
auth gate so logged-out users can still browse past events. Uses the
lucide `History` icon.

ActivityCard gains an `isPast` computed and renders a small Past
badge bottom-left when applicable, suppressed when a Pending /
Rejected status badge is already taking that slot (creator's own
past draft — vanishingly rare, status hint is more actionable).

ActivityDetailPage replaces the Buy ticket CTA with a muted "This
event has already happened" notice when the event is past, so the
buy flow stays unambiguous even when the user lands on a past
event by direct link. The owned-tickets pill above still renders so
past attendees can still see their tickets.

i18n: pastEvents (chip) + past (badge) + pastEvent (detail notice)
added to en/es/fr.
The chip should mirror the "My tickets" / "Hosting" mental model
(narrow to *only* X), not "additionally include X". Toggling ON with
"This Week" / "This Month" / "Tomorrow" was leaking upcoming events
through — confusing because the other role chips don't behave that
way.

Flip the past-events filter from a hide-when-off guard to a
side-of-now split: showPast=false → upcoming-only (default),
showPast=true → past-only. The DatePickerStrip override stays outside
this branch so date-pick still bypasses the split.
Author
Owner

changed behavior so that Date-picker, e.g., this month combined with past events filter would only show past events this month.

changed behavior so that Date-picker, e.g., `this month` combined with `past events` filter would only show past events this month.
padreug deleted branch past-events-filter 2026-05-25 09:49:34 +00:00
Sign in to join this conversation.
No description provided.