Metaculus / Metaculus/metaculus
Refactor AIB pages: Deduplicate components and use tournament API for leaderboards
@cemreinanc is already working on this.
Since Feb 9, 2026.
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 34
- Avg merge
- 16h 34m
- Merged PRs (30d)
- 30
Description
Problem
The AIB tournament pages (/aib/2024/q3 through /aib/2025/fall) are heavily duplicated. Each quarter has its own near-identical copy of every component — page-view, hero, cards, and leaderboard — with only small data differences (quarter label, start date, image URL, tournament slug). This results in ~20 files that are mostly copy-pasted, including 4 leaderboard files with ~2,300 lines of hardcoded bot ranking data.
Proposed Changes
-
Define a per-tournament config object with all the differences (quarter label, year, image URL, date/prize translation keys, tournament slug, etc.) so adding a new tournament is just a new entry.
-
Replace duplicated components with shared parameterized ones: one
Hero, oneCards, oneAibPageViewlayout, oneLeaderboard— all driven by the config. -
Replace hardcoded leaderboard data with the existing
getProjectLeaderboard(projectId)API (already used by tournament pages), or simply link to the tournament page (like Fall 2025 already does). No backend changes expected — verify that older tournaments already have leaderboard data in the API.
Scope
~20 files can be collapsed into ~5 shared components + one config:
| Component | Current files | After |
|---|---|---|
| Page views | 6 page-view-*.tsx |
1 shared layout |
| Heroes | 6 hero-*.tsx |
1 parameterized component |
| Cards | 6 cards-*.tsx |
1 parameterized component |
| Leaderboards | 5 leaderboard-*.tsx (4 hardcoded + 1 link) |
1 component using API or tournament link |
Priority
Low — cleanup/tech-debt. Ideal timing: before the next seasonal tournament ends and results need publishing.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.