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:
@@ -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} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user