fix: don't mark next round as current before advancement is declared
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m48s

The applicant timeline sidebar was treating any previous round with
status ROUND_CLOSED as "advanced past", which caused the Grand Finale
to show "You are here" as soon as the semi-final round closed — before
admins declared which teams actually advanced.

Require explicit PASSED/COMPLETED project state on every prior round
before marking the next one as current. A closed-but-unresolved round
now correctly keeps the applicant anchored to it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-04-24 14:39:43 +02:00
parent be4449e4ef
commit f36f68bbf9

View File

@@ -202,15 +202,16 @@ export function CompetitionTimelineSidebar() {
// Is this entry after the elimination point?
const isAfterElimination = eliminationIndex >= 0 && index > eliminationIndex
// Is this the current round? Either has an active project state,
// or is the first round the project hasn't passed yet (for seed data
// where project states may be missing).
// Is this the current round? Either the project has an active state
// here, or every previous round has an explicit advancement outcome
// (PASSED/COMPLETED). A closed round alone isn't enough — a round can
// close before admins declare advancement, and until they do, the
// applicant has NOT moved on to the next round.
const hasActiveProjectState = !!entry.projectState && entry.projectState !== 'PASSED' && entry.projectState !== 'COMPLETED' && entry.projectState !== 'REJECTED'
const isCurrent = !isAfterElimination && (hasActiveProjectState || (
!isPassed && !isRejected && !isCompleted &&
data.entries.slice(0, index).every((prev) =>
prev.projectState === 'PASSED' || prev.projectState === 'COMPLETED' ||
prev.status === 'ROUND_CLOSED' || prev.status === 'ROUND_ARCHIVED'
prev.projectState === 'PASSED' || prev.projectState === 'COMPLETED'
) && index > 0
))