diff --git a/frontend/src/client/events.ts b/frontend/src/client/events.ts index 1d01f67..a78a7eb 100644 --- a/frontend/src/client/events.ts +++ b/frontend/src/client/events.ts @@ -125,8 +125,11 @@ const STATUS_OPTIONS_DEADLINE: StatusOption[] = [ { value: "completed", key: "deadlines.filter.completed" }, ]; +// Appointment status options — m/paliad#54: the legacy 'upcoming' / +// "Ab heute" option was a UI lie (backend never narrowed past events for +// appointments) and is removed. 'today' is the sane default — matches the +// dashboard tile. 'all' stays as the explicit opt-in for past events. const STATUS_OPTIONS_APPOINTMENT: StatusOption[] = [ - { value: "upcoming", key: "events.filter.status.upcoming" }, { value: "today", key: "deadlines.filter.today" }, { value: "this_week", key: "deadlines.filter.thisweek" }, { value: "next_week", key: "deadlines.filter.nextweek" }, @@ -140,7 +143,7 @@ function statusOptionsFor(type: EventTypeChoice): StatusOption[] { } function defaultStatusFor(type: EventTypeChoice): string { - return type === "appointment" ? "upcoming" : "pending"; + return type === "appointment" ? "today" : "pending"; } let currentType: EventTypeChoice = "deadline"; diff --git a/internal/services/event_service.go b/internal/services/event_service.go index e525da5..4639f7c 100644 --- a/internal/services/event_service.go +++ b/internal/services/event_service.go @@ -279,7 +279,12 @@ func shouldExcludeAppointmentsForStatus(status DeadlineStatusFilter) bool { // matches a bucket-style deadline status — used to filter the // appointment side when the user clicks a card on the unified events // page. Returns (nil, nil) for non-bucket statuses (pending / all / -// upcoming / "" / overdue / completed — those are handled separately). +// "" / overdue / completed — those are handled separately). +// +// DeadlineFilterUpcoming maps to "start_at >= today" so legacy +// `?status=upcoming` URLs hide past appointments instead of falling +// through to the unfiltered query (m/paliad#54 — the UI option that +// surfaced this status has been removed, but bookmarks may persist). func bucketAppointmentWindow(status DeadlineStatusFilter, b deadlineBucketBounds) (*time.Time, *time.Time) { switch status { case DeadlineFilterToday: @@ -293,6 +298,8 @@ func bucketAppointmentWindow(status DeadlineStatusFilter, b deadlineBucketBounds return &b.nextMonday, &t case DeadlineFilterLater: return &b.weekAfter, nil + case DeadlineFilterUpcoming: + return &b.today, nil } return nil, nil }