Skip to content

Comments

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

Open
mroderick wants to merge 2 commits intocodebar:masterfrom
mroderick:feature/homepage-events-limit
Open

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

Conversation

@mroderick
Copy link
Collaborator

@mroderick mroderick commented Feb 21, 2026

⚠️ In order to really replicate the challenge in this one locally, #2499 should be merged first (or at least used for seeding the development database locally)


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
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.

2 participants