Remove upper date bound on starred events so future events always show

Starred events should appear in the countdown widget regardless of how
far in the future they are. The _not_parent_template filter still
excludes recurring parent templates while allowing starred children.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kyle 2026-03-15 01:59:11 +08:00
parent 348fe8988b
commit bdfd8448b1

View File

@ -92,13 +92,12 @@ async def get_dashboard(
total_todos = todo_row.total
total_incomplete_todos = todo_row.incomplete
# Starred events (within upcoming_days window, ordered by date, scoped to user's calendars)
upcoming_cutoff_dt = datetime.combine(upcoming_cutoff, datetime.max.time())
# Starred events — no upper date bound so future events always appear in countdown.
# _not_parent_template excludes recurring parent templates (children still show).
starred_query = select(CalendarEvent).where(
CalendarEvent.calendar_id.in_(user_calendar_ids),
CalendarEvent.is_starred == True,
CalendarEvent.start_datetime > today_start,
CalendarEvent.start_datetime <= upcoming_cutoff_dt,
_not_parent_template,
).order_by(CalendarEvent.start_datetime.asc()).limit(5)
starred_result = await db.execute(starred_query)