Skip to content

Redesign homepage leaderboard cards and add pantheon community race - #328

Merged
owens1127 merged 4 commits into
mainfrom
feat/homepage-redesign-pantheon-community-race
Jun 13, 2026
Merged

Redesign homepage leaderboard cards and add pantheon community race#328
owens1127 merged 4 commits into
mainfrom
feat/homepage-redesign-pantheon-community-race

Conversation

@owens1127

Copy link
Copy Markdown
Contributor

Summary

  • Replaces category-based home buckets with per-activity cards using splash headers, manifest-driven names/release dates, and split Team/Speedrun/Individual (raid) or version-grouped (pantheon) link sections
  • Adds responsive quick-link tile grid below lg, with 3/4/5 column breakpoints on smaller viewports
  • Adds pantheon community race leaderboard page and home link (gold accent, Insurrection Prime group, first in version order) wired to /leaderboard/team/custom/pantheon-community-race
  • Fixes activity splash images using object-cover on fill to prevent stretched leaderboard headers

Test plan

  • Verify homepage cards layout at mobile, tablet, and wide desktop widths
  • Confirm active pantheon card shows Community Race (gold) under Insurrection Prime Revolutionary before other versions
  • Open /leaderboards/team/custom/pantheon-community-race and confirm leaderboard loads (requires Raid-Hub/API#137 deployed)
  • Spot-check other team leaderboard splashes are cropped, not stretched

Made with Cursor

Group raid and pantheon links into clearer per-activity cards with manifest-driven titles, release dates, and responsive layout. Adds the pantheon community race leaderboard page and home link ahead of API PR #137.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
raid-hub Ready Ready Preview Jun 13, 2026 2:29pm

Request Review

title={version.name}
subtitle="Community Race Leaderboard">
<CloudflareActivitySplash
activityId={version.associatedActivityId!}

This comment was marked as outdated.

Comment on lines +65 to +70
<CloudflareActivitySplash
activityId={version.associatedActivityId!}
versionId={version.id}
fill
className="z-[-1]"
/>

This comment was marked as outdated.

Comment thread src/components/home/HomeBuckets.tsx Outdated
((v.id == 1 ? raidId >= 15 : !isReprised) ||
(isReprised && !v.isChallengeMode))
)
const PANTHEON_COMMUNITY_RACE_VERSION_PATH = "insurrection-revolutionary"

This comment was marked as outdated.

owens1127 and others added 3 commits June 13, 2026 10:20
Use version splash URLs when versionId is provided, guard null associatedActivityId, and identify the community race by version id instead of path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines 154 to +156
variants[variants.length - 1]
).name
const content = activityVariants.find(c => c.size === size)!
const content = splashVariants.find(c => c.size === size)!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The image loader may crash with a TypeError if the API returns only image sizes, like "full", that are not in the hardcoded cloudflareVariants list.
Severity: HIGH

Suggested Fix

Add a guard to handle the case where the filtered variants array is empty. Before accessing variants[variants.length - 1], check if the array has elements. If it is empty, provide a safe fallback variant or default size to prevent the TypeError.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/components/CloudflareImage.tsx#L154-L156

Potential issue: The loader function in `CloudflareImage.tsx` filters a hardcoded list
of variants (`cloudflareVariants`) against sizes returned by the API. The API can return
a size of `"full"`, which is not present in the hardcoded list. If the API returns only
the `"full"` size, the filtered `variants` array will be empty. The subsequent code
attempts to access an element from this empty array (`variants[variants.length - 1]`),
which evaluates to `undefined`. Accessing the `.name` property on this `undefined` value
will cause a `TypeError`, crashing the component.

const versionGroups = useMemo(
() =>
versions
.toSorted((a, b) => b - a)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The code re-sorts Pantheon versions by numeric ID, ignoring the intentional "display order" provided by the API, which will cause them to appear in the wrong order.
Severity: MEDIUM

Suggested Fix

Remove the .toSorted((a, b) => b - a) call. The versions array is already in the correct display order as provided by the API, so no client-side sorting is necessary.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/components/home/HomeBuckets.tsx#L232

Potential issue: The backend API provides a list of Pantheon version IDs
(`pantheonVersionIds`) in a specific, intentional "display order". However, the frontend
code in `HomeBuckets.tsx` explicitly re-sorts this list by numeric ID in descending
order using `.toSorted((a, b) => b - a)`. This overrides the API's intended ordering. As
a result, if a version intended to be first (like the community race version 134) has a
lower ID than other active versions, it will be displayed in the wrong position on the
homepage's Pantheon card.

Comment on lines +13 to +23
export const fetchCache = "default-no-store"

export async function generateMetadata(): Promise<Metadata> {
const manifest = await prefetchManifest()
const activityId = getActivePantheonIds(manifest)[0]
const activity = activityId != null ? manifest.activityDefinitions[activityId] : undefined
const version = manifest.versionDefinitions[PANTHEON_COMMUNITY_RACE_VERSION_ID]

if (!activity || version?.associatedActivityId == null) {
notFound()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Calling notFound() in generateMetadata for a statically generated page (force-static) will cause the entire application build to fail if the necessary data is missing.
Severity: CRITICAL

Suggested Fix

In generateMetadata, instead of calling notFound(), return fallback metadata (e.g., a generic title). Move the logic for checking data availability and calling notFound() into the Page component itself. This ensures the page can still be statically generated, and the 404 is handled at request time.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/app/leaderboards/team/custom/pantheon-community-race/page.tsx#L11-L23

Potential issue: The Pantheon community race page is configured for static generation
via `export const dynamic = "force-static"`. Its `generateMetadata` function calls
`notFound()` if the required manifest data is unavailable at build time. In Next.js,
calling `notFound()` within `generateMetadata` for a statically generated page is not
supported and will cause the entire application build to fail. This could happen if the
API manifest is incomplete or unavailable during deployment, thus preventing new
versions of the site from being deployed.

@owens1127
owens1127 merged commit 36cc68d into main Jun 13, 2026
6 checks passed
@owens1127
owens1127 deleted the feat/homepage-redesign-pantheon-community-race branch June 13, 2026 14:31
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