Skip to content

Commit d312b70

Browse files
committed
Move hardcoded text to copy.json content pipeline
1 parent 8a49185 commit d312b70

3 files changed

Lines changed: 119 additions & 206 deletions

File tree

‎src/components/pages/LeaderboardPage.svelte‎

Lines changed: 36 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
<script>
2+
import { getContext } from "svelte";
23
import SortableTable from "$components/helpers/SortableTable.svelte";
34
45
export let leaderboardData = { global: [], stratified: [] };
56
7+
const copy = getContext("copy") || {};
8+
const lp = copy.leaderboardPage || {};
9+
10+
const pageTitle = lp.title ?? "FormulaCode Leaderboard";
11+
const globalTitle = lp.global?.title ?? "Global Leaderboard";
12+
const stratTitle = lp.stratified?.title ?? "Stratified Leaderboard";
13+
const stratDesc =
14+
lp.stratified?.description ??
15+
'Performance broken down by optimization scope: <strong>L1</strong> (Params), <strong>L2</strong> (Function), <strong>L3</strong> (Class), <strong>L4</strong> (Module).';
16+
const submitTitle = lp.submit?.title ?? "Submit Your Model";
17+
const submitDesc =
18+
lp.submit?.description ??
19+
"To evaluate your own agent on FormulaCode, follow our installation guide.";
20+
const submitButtonText = lp.submit?.buttonText ?? "Get Started";
21+
const submitRepoUrl =
22+
lp.submit?.repoUrl ?? "https://github.com/formula-code/fc-eval";
23+
624
const globalColumns = [
725
{ key: "rank", label: "RP Rank", numeric: true, decimals: 0, prefix: "#" },
826
{ key: "agent", label: "Agent", numeric: false },
@@ -36,21 +54,28 @@
3654
},
3755
{
3856
key: "level1",
39-
label: "Level 1 (Module)",
57+
label: "L1 (Params)",
4058
numeric: true,
4159
colorCode: true,
4260
colorThreshold: 0
4361
},
4462
{
4563
key: "level2",
46-
label: "Level 2 (Class)",
64+
label: "L2 (Function)",
4765
numeric: true,
4866
colorCode: true,
4967
colorThreshold: 0
5068
},
5169
{
5270
key: "level3",
53-
label: "Level 3 (Function)",
71+
label: "L3 (Class)",
72+
numeric: true,
73+
colorCode: true,
74+
colorThreshold: 0
75+
},
76+
{
77+
key: "level4",
78+
label: "L4 (Module)",
5479
numeric: true,
5580
colorCode: true,
5681
colorThreshold: 0
@@ -61,35 +86,10 @@
6186
<div class="leaderboard-page">
6287
<section class="section">
6388
<div class="container">
64-
<h1>FormulaCode Leaderboard</h1>
65-
66-
<ul class="metrics-list">
67-
<li class="metric-item">
68-
<h3>Advantage (Adv)</h3>
69-
<p>
70-
Human-relative advantage. A value of 0 means the agent performs
71-
exactly as well as a human expert. Positive values indicate
72-
superhuman performance.
73-
</p>
74-
</li>
75-
<li class="metric-item">
76-
<h3>Speedup</h3>
77-
<p>
78-
Geometric mean of speedup ratios across all workloads. &gt;1.0 means
79-
faster than baseline.
80-
</p>
81-
</li>
82-
<li class="metric-item">
83-
<h3>RP Rank</h3>
84-
<p>
85-
Ranked Pairs algorithm rank. Aggregate ranking based on pairwise
86-
comparisons.
87-
</p>
88-
</li>
89-
</ul>
89+
<h1>{pageTitle}</h1>
9090
9191
<div class="table-section">
92-
<h2>Global Leaderboard</h2>
92+
<h2>{globalTitle}</h2>
9393
<SortableTable
9494
columns={globalColumns}
9595
rows={leaderboardData.global}
@@ -99,12 +99,9 @@
9999
</div>
100100
101101
<div class="table-section">
102-
<h2>Stratified Leaderboard</h2>
102+
<h2>{stratTitle}</h2>
103103
<p class="section-desc">
104-
Performance broken down by optimization scope:
105-
<strong>Level 1</strong> (Module),
106-
<strong>Level 2</strong> (Class),
107-
<strong>Level 3</strong> (Function).
104+
{@html stratDesc}
108105
</p>
109106
<SortableTable
110107
columns={stratifiedColumns}
@@ -115,14 +112,11 @@
115112
</div>
116113
117114
<div class="submission-highlight">
118-
<h2>Submit Your Model</h2>
119-
<p>
120-
To evaluate your own agent on FormulaCode, follow our installation
121-
guide.
122-
</p>
115+
<h2>{submitTitle}</h2>
116+
<p>{submitDesc}</p>
123117
<a
124-
href="https://github.com/formula-code/terminal-bench"
125-
class="cta-button">Get Started</a
118+
href={submitRepoUrl}
119+
class="cta-button">{submitButtonText}</a
126120
>
127121
</div>
128122
</div>
@@ -163,37 +157,6 @@
163157
color: var(--text-secondary);
164158
}
165159
166-
.metrics-list {
167-
list-style: none;
168-
padding: 0;
169-
margin: 0 0 4rem 0;
170-
display: grid;
171-
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
172-
gap: 1.5rem;
173-
}
174-
175-
.metric-item {
176-
background: var(--bg-secondary);
177-
padding: 1.5rem;
178-
border-radius: 8px;
179-
border: 1px solid var(--border-secondary);
180-
}
181-
182-
.metric-item h3 {
183-
font-family: var(--sans);
184-
font-size: 1.1rem;
185-
margin-bottom: 0.5rem;
186-
color: var(--accent-secondary);
187-
}
188-
189-
.metric-item p {
190-
font-family: var(--sans);
191-
font-size: 0.9rem;
192-
line-height: 1.5;
193-
color: var(--text-secondary);
194-
margin: 0;
195-
}
196-
197160
.table-section {
198161
margin-bottom: 4rem;
199162
}

0 commit comments

Comments
 (0)