From aa2e573f0e69fd8ade986c342bb068a923520aee Mon Sep 17 00:00:00 2001 From: Padreug Date: Mon, 25 May 2026 11:46:19 +0200 Subject: [PATCH] fix(activities): "Past events" chip narrows to past-only, not include-past MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../composables/useActivityFilters.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/modules/activities/composables/useActivityFilters.ts b/src/modules/activities/composables/useActivityFilters.ts index 6585faa..8f9914b 100644 --- a/src/modules/activities/composables/useActivityFilters.ts +++ b/src/modules/activities/composables/useActivityFilters.ts @@ -50,8 +50,8 @@ export function useActivityFilters() { let result = activities // Specific date filter (from DatePickerStrip) takes priority over - // temporal. Picking a date also bypasses the past-events hide so - // the user can browse activities for any day they choose. + // temporal. Picking a date also bypasses the past/upcoming split + // so the user can browse activities for any day they choose. if (selectedDate.value) { const dayStart = startOfDay(selectedDate.value) const dayEnd = endOfDay(selectedDate.value) @@ -62,15 +62,16 @@ export function useActivityFilters() { } else { // Temporal filter result = applyTemporalFilter(result, temporal.value) - // Past-events hide (default ON). Composes with temporal pills: - // e.g. "This Week" + showPast=false drops days already passed. - if (!showPast.value) { - const now = new Date() - result = result.filter(a => { - const activityEnd = a.endDate ?? a.startDate - return activityEnd >= now - }) - } + // Past/upcoming split — the chip narrows to one side of "now", + // mirroring the "My tickets" / "Hosting" mental model. Default + // (showPast=false) is upcoming-only; toggling on flips to + // past-only. Composes with temporal pills: "This Week" + + // showPast=true shows only the days already passed this week. + const now = new Date() + result = result.filter(a => { + const activityEnd = a.endDate ?? a.startDate + return showPast.value ? activityEnd < now : activityEnd >= now + }) } // Category filter