Skip to content

Comments

feat(homepage): limit upcoming events to 5, preserve 3 dates#2504

Merged
olleolleolle merged 2 commits intocodebar:masterfrom
mroderick:feature/homepage-events-limit
Feb 23, 2026
Merged

feat(homepage): limit upcoming events to 5, preserve 3 dates#2504
olleolleolle merged 2 commits intocodebar:masterfrom
mroderick:feature/homepage-events-limit

Conversation

@mroderick
Copy link
Collaborator

@mroderick mroderick commented Feb 21, 2026

Summary

  • Limit homepage to display max 5 upcoming events (workshops + meetings + events)
  • Ensure at least 3 dates are shown even if fewer than 5 events
  • Add conditional "Explore all events →" link that appears when more events exist

Changes

  • dashboard_controller.rb: Added MAX_WORKSHOP_QUERY constant, @has_more_events instance variable, total_upcoming_events_count helper, and updated upcoming_events method to limit results
  • show.html.haml: Added conditional link to /events

Testing

  • All 857 tests passing

Manual Verification

  1. Reseed the database (this takes a while):
    bundle exec rake db:drop db:create db:migrate db:seed
    
  2. Start the server: bundle exec rails server
  3. Visit http://localhost:3000
  4. Scroll to the "Upcoming events" section
  5. Verify:
    • No more than 5 events are displayed
    • At least 3 different dates are shown (if 3+ dates exist with events)
    • If there are more than 5 upcoming events, an "Explore all events →" button appears below the list
    • If there are 5 or fewer upcoming events, the button does not appear

@mroderick mroderick marked this pull request as draft February 21, 2026 15:57
@mroderick mroderick force-pushed the feature/homepage-events-limit branch from 990cff5 to 941775f Compare February 21, 2026 16:34
@mroderick mroderick marked this pull request as ready for review February 21, 2026 17:04
@mroderick mroderick force-pushed the feature/homepage-events-limit branch from 941775f to 1bcf5ee Compare February 23, 2026 12:05
Copy link
Collaborator

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@olleolleolle olleolleolle merged commit ec0fe62 into codebar:master Feb 23, 2026
8 checks passed
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.

3 participants