Skip to content

Events page: fix series placement, country filter, and date display - #187

Merged
JanMikes merged 2 commits into
mainfrom
events-page-fixes
Aug 10, 2026
Merged

Events page: fix series placement, country filter, and date display#187
JanMikes merged 2 commits into
mainfrom
events-page-fixes

Conversation

@JanMikes

Copy link
Copy Markdown
Member

Context

Community feedback (relayed by a user) called the events tab confusing on four counts. All four were confirmed against production data before touching code:

  1. "Bucharest Championship happening through the whole year" — the row has date_from=2026-01-01, date_to=2026-12-31 (organizer placeholder for "sometime in 2026"), which makes it the only Live event and pins it on top of the page all year.
  2. "Upcoming events with no date, only when they took place last time" — series cards were hardcoded to render at the top of the Upcoming section, but only 2 of 11 production series actually have a future edition. The other 9 showed "Last: … (n months ago)" or no date at all — under the Upcoming heading.
  3. "Mexican Championship's upcoming 9th edition is actually a past edition" — same root cause: its only edition was 2026-05-23, yet the card sat under Upcoming.
  4. "Filter for Poland shows events from different countries" — two bugs stacked: series cards ignored the filters entirely, and the country compare is case-sensitive while legacy imports stored uppercase codes. Poland's only event is stored as PL, so the pl filter found nothing and left only the unfiltered foreign series cards on screen.

Changes

  • Series placement: EventsListing now exposes upcoming/past series groups split by next-edition date (upcoming sorted soonest-first, past sorted most-recent-first, series with no editions last). The listing template renders explicit Live/Upcoming/Past sections instead of detecting status transitions mid-loop. The live filter shows no series; upcoming/past show only their group.
  • Series filters: GetCompetitionSeries::allApproved()/allUnapproved() accept country + onlineOnly (existing callers unaffected — the admin approvals queue calls with defaults).
  • Country codes: case-insensitive comparison in both queries, strtolower normalization on entity writes, and migration Version20260810205813 lowercases existing rows (prod has ~50% uppercase from legacy imports).
  • Date display: new shared _event_date_range.html.twig — cross-month ranges show the month on both sides (01.01.-31.12. instead of the misleading 01.-31.12.), and the year is appended for events outside the current year. Reused in the event card, my-competitions card, event detail and edition detail.
  • Validation: CompetitionFormData now rejects dateTo < dateFrom and events longer than 30 days, so placeholder ranges like the Bucharest one can't be entered again.

Tests

  • 12 new tests written first and confirmed failing for the right reasons (raw-inserted uppercase rows missing from filtered results, past-only series rendered in the upcoming view, missing filter params/methods).
  • New fixture SERIES_PAST_ONLY (Berlin Puzzle Cup, de, single past edition) documented in .claude/fixtures.md.
  • Full suite green: 1699 tests. PHPStan max, PHPCS, doctrine:schema:validate, cache:warmup all pass.

Not in this PR (needs a decision)

  • Bucharest production row — code can't fix data. See the session summary for the proposed UPDATE (null the placeholder dates or get real dates from the organizer, maryia_p@yahoo.com).
  • Pre-existing latent bug noticed on the way: forms.* violation keys (e.g. forms.finished_at_required_for_speed) are translated against the validators domain but live in messages.*.yml, so they render as raw keys. Left untouched here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PVzv7QwEce8ek1YFMNvsmW

JanMikes and others added 2 commits August 10, 2026 23:11
…ilter honest

Community feedback tore the events tab apart, and every complaint checked out
against production data:

- Series cards rendered at the top of the "Upcoming" section no matter when
  their editions happen — 9 of 11 production series have no future edition, so
  the page opened with a wall of "Last edition: months ago" cards. Series are
  now split by their next-edition date: future editions under Upcoming, the
  rest under Past, and the live filter shows none.
- Series cards ignored the country and online filters entirely, which is why
  filtering for Poland returned events from Mexico and Slovenia. They now go
  through the same filters as standalone events.
- The country filter compared codes case-sensitively while legacy imports
  stored uppercase ISO codes ('ES', 'PL', ...). Queries now compare
  case-insensitively, entities lowercase on write, and a migration lowercases
  the existing rows.
- Cross-month ranges rendered as "01.-31.12." (looked like December); a shared
  _event_date_range partial shows the month on both sides and the year when
  the event is not in the current year.
- A 365-day placeholder range (how Bucharest ended up "live" all year) is now
  rejected at submission: events longer than 30 days don't validate, and an
  end date before the start date doesn't either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVzv7QwEce8ek1YFMNvsmW
Custom buildViolation() messages are translated against the validators domain,
but the forms.* keys lived in messages.*.yml — so users saw raw keys like
"forms.finished_at_required_for_speed" instead of sentences. Moved the keys
into validators.*.yml (keeping every locale's existing translation), converted
the one hardcoded English violation to a key, and translated the new
competition date validations into all six locales.

Also filled the 10 message keys check-translations reported missing in
de/es/fr/ja/cs (wjpf connect flow, unavailable-resource flashes) so the
checker is back to zero.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVzv7QwEce8ek1YFMNvsmW
@JanMikes
JanMikes merged commit 17834cf into main Aug 10, 2026
5 checks passed
@JanMikes
JanMikes deleted the events-page-fixes branch August 10, 2026 22:09
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.

1 participant