feat: resolve observer project page round default and add selector

The observer full project page used to call getProjectDetail without
a round, getting cross-round contaminated stats. It now resolves a
default — the currently OPEN round the project is in, falling back
to the most recently CLOSED one — and renders a selector chip in
the score card whenever the project participated in more than one
candidate round. Initial selection respects the ?round= query param.

A new observer procedure (getProjectRoundsForObserver) returns the
project's open or closed rounds for the picker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-04-27 13:18:36 +02:00
parent cfd9dc6afe
commit 6f3e8885e0
3 changed files with 67 additions and 4 deletions

View File

@@ -6,10 +6,13 @@ export const dynamic = 'force-dynamic'
export default async function ObserverProjectDetailPage({
params,
searchParams,
}: {
params: Promise<{ projectId: string }>
searchParams: Promise<{ round?: string }>
}) {
const { projectId } = await params
const sp = await searchParams
return <ObserverProjectDetail projectId={projectId} />
return <ObserverProjectDetail projectId={projectId} initialRoundId={sp.round} />
}