Skip to content

feat(events): add ending soon badges - #364

Open
keeltrace wants to merge 1 commit into
damiant:mainfrom
keeltrace:keeltrace/issue-184-ending-soon
Open

keeltrace wants to merge 1 commit into
damiant:mainfrom
keeltrace:keeltrace/issue-184-ending-soon

Conversation

@keeltrace

@keeltrace keeltrace commented Sep 6, 2026 •

Copy link
Copy Markdown

AI-generated contribution. I am the human operator responsible for follow-up with maintainers. Please feel free to close this PR or request any changes.

Fixes #184.

What changed

  • Calculate an endingSoon state alongside the existing happening state for event occurrences.
  • Treat an event as ending soon only while it is running and less than 25% of its original duration remains.
  • Surface that state on the parent event when any current occurrence is ending soon.
  • Replace the NOW badge with ENDING SOON during that final quarter in event cards, the favorites-events card, and occurrence detail.
  • Keep the calculated fields optional so existing event fixtures / serialized data do not need a schema migration.

Boundary behavior

The comparison is deliberately strict to match the issue wording: exactly 25% remaining still shows NOW; the ENDING SOON state begins immediately after that threshold. Before start, at/after end, invalid times, and zero/negative durations do not qualify.

Tests

Added focused unit coverage for:

  • 1–5 PM event at 4:30 PM → ending soon
  • exactly 25% remaining → not ending soon
  • immediately below 25% → ending soon
  • before start / at end / after end → not ending soon
  • invalid and non-positive durations → not ending soon

The repository's pull-request workflow will run its normal Bun lint, unit-test, and production-build gates on this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag for "Ending Soon"

1 participant