atmo.rsvp

fix(past-events): stop an ongoing event resurfacing on page 2 master

The past-events list bounds its D1 query on startsAt, which still admits an event that began earlier and has NOT finished. Page 1 narrowed that away with an inline predicate; the load-more resumer did not. So an event that started last week and runs until next week was filtered off page 1 and then appeared on page 2 of "Past Events". Extract the predicate to `hasEnded(event, asOf)` and apply it on both sides, the way `orQueryFromSlug` is already shared between the topic load and its resumer. Page 1 can now filter a full backend batch down to nothing while still holding a cursor. Render the list whenever a cursor remains, so that case shows a Load more button instead of "No past events found." — previously the genuinely past events behind it were unreachable. Note the residual: because the predicate runs after pagination, a Load more click can still return zero new events when a whole batch is ongoing. Making the resumer scan ahead for a non-empty page is a bigger change and is left out of here deliberately.


+39 -6
4 changed files