Skip to content

Commit d426995

Browse files
committed
update leaderboard
1 parent 84feaa3 commit d426995

File tree

2 files changed

+86
-9
lines changed

2 files changed

+86
-9
lines changed

static/css/index.css

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,11 +825,16 @@ tr:hover {
825825
.leaderboard-table-wrapper {
826826
max-height: 600px; /* Set your desired maximum height here */
827827
overflow-y: auto; /* Enable vertical scrolling for entire container */
828-
overflow-x: auto; /* Hide horizontal overflow */
828+
overflow-x: auto; /* Enable horizontal scrolling */
829829
border: 2px solid #ddd;
830830
border-radius: 8px;
831831
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
832832
background: white;
833+
/* 创建新的堆叠上下文来解决重合问题 */
834+
position: relative;
835+
z-index: 1;
836+
/* 确保滚动时背景不透明 */
837+
background-clip: padding-box;
833838
}
834839

835840

@@ -860,7 +865,8 @@ tr:hover {
860865
border-right: none;
861866
position: sticky;
862867
top: 0;
863-
z-index: 11;
868+
z-index: 15; /* 确保表头在Human行之上 */
869+
background-clip: padding-box;
864870
}
865871

866872

@@ -1041,3 +1047,57 @@ tr:hover {
10411047
.agent-link strong {
10421048
font-weight: 600;
10431049
}
1050+
1051+
/* Human row special styling */
1052+
.human-row {
1053+
background-color: #f8f9fa !important; /* 更柔和的灰色背景 */
1054+
border-top: 1px solid #dee2e6 !important; /* 更细的灰色边框 */
1055+
border-bottom: 1px solid #dee2e6 !important;
1056+
font-style: italic;
1057+
opacity: 0.85; /* 稍微提高不透明度 */
1058+
position: sticky;
1059+
top: 41px; /* Position below the header */
1060+
z-index: 9; /* Below header but above other content */
1061+
box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* 更轻微的阴影 */
1062+
/* 确保在水平滚动时也能正确显示 */
1063+
background-clip: padding-box;
1064+
isolation: isolate;
1065+
}
1066+
1067+
.human-row td {
1068+
font-weight: 450; /* 稍微加重字体 */
1069+
color: #495057; /* 更深的灰色文字 */
1070+
background-color: #f8f9fa !important; /* 确保每个td都有背景色 */
1071+
/* 防止背景透明导致重合 */
1072+
background-clip: padding-box;
1073+
position: relative;
1074+
z-index: 1;
1075+
}
1076+
1077+
.human-row:hover {
1078+
background-color: #e9ecef !important; /* hover时更柔和的灰色 */
1079+
}
1080+
1081+
.human-row:hover td {
1082+
background-color: #e9ecef !important; /* hover时td也要变色 */
1083+
}
1084+
1085+
.human-indicator {
1086+
color: #495057; /* 更深的灰色图标 */
1087+
margin-left: 8px;
1088+
font-size: 0.8em; /* 更小的图标 */
1089+
}
1090+
1091+
.human-reference-badge {
1092+
background-color: #495057; /* 更深的灰色背景 */
1093+
color: white;
1094+
padding: 2px 6px; /* 更小的padding */
1095+
border-radius: 3px; /* 更小的圆角 */
1096+
font-size: 0.7em; /* 更小的字体 */
1097+
font-weight: normal; /* 普通字体重量 */
1098+
font-style: normal;
1099+
}
1100+
1101+
1102+
1103+

static/js/leaderboard.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class LeaderboardTable {
22
constructor() {
33
this.data = null;
44
this.currentSet = 'eval_set';
5-
this.sortColumn = 'success_rate';
5+
this.sortColumn = 'partial_completion'; // 改为默认按 partial_completion 排序
66
this.sortDirection = 'desc';
77
this.init();
88
}
@@ -116,6 +116,7 @@ class LeaderboardTable {
116116
sortedData.forEach((model, index) => {
117117
const info = model.info;
118118
const results = model[this.currentSet];
119+
const isHuman = info.name === 'Human'; // 检查是否是 Human 行
119120

120121
let agentNameHtml;
121122
if (info.url && info.url.trim() !== "") {
@@ -128,17 +129,22 @@ class LeaderboardTable {
128129
agentNameHtml = `${info.name}`;
129130
}
130131

132+
// 为 Human 行添加特殊的 class 和样式
133+
const rowClass = isHuman ? 'model-row human-row' : 'model-row';
134+
const rankDisplay = isHuman ? '<span class="human-reference-badge">Reference</span>' : `${index + 1}`;
135+
131136
tableHtml += `
132-
<tr class="model-row" data-rank="${index + 1}">
137+
<tr class="${rowClass}" data-rank="${index + 1}">
133138
<td class="model-name-cell">
134139
<div class="model-info">
135140
${agentNameHtml}
141+
${isHuman ? ' <span class="human-indicator"><i class="fas fa-user"></i></span>' : ''}
136142
</div>
137143
</td>
138144
<td class="has-text-centered">${info.date}</td>
139-
<td class="has-text-centered metric-cell">${this.formatMetric(results.partial_completion, maxValues.partial_completion)}</td>
140-
<td class="has-text-centered metric-cell">${this.formatMetric(results.success_rate, maxValues.success_rate)}</td>
141-
<td class="has-text-centered metric-cell">${this.formatMetric(results.pass3, maxValues.pass3)}</td>
145+
<td class="has-text-centered metric-cell">${this.formatMetric(results.partial_completion, isHuman ? null : maxValues.partial_completion)}</td>
146+
<td class="has-text-centered metric-cell">${this.formatMetric(results.success_rate, isHuman ? null : maxValues.success_rate)}</td>
147+
<td class="has-text-centered metric-cell">${this.formatMetric(results.pass3, isHuman ? null : maxValues.pass3)}</td>
142148
<td class="has-text-centered metric-cell">${this.formatMetric(results.time)}</td>
143149
<td class="has-text-centered metric-cell">${this.formatMetric(results.answer_length)}</td>
144150
</tr>
@@ -190,6 +196,11 @@ class LeaderboardTable {
190196
};
191197

192198
data.forEach(model => {
199+
// 跳过 Human 数据
200+
if (model.info?.name === 'Human') {
201+
return;
202+
}
203+
193204
const results = model[this.currentSet];
194205

195206
// Check each metric
@@ -249,9 +260,12 @@ class LeaderboardTable {
249260
return [];
250261
}
251262

252-
let sortedData = [...this.data];
263+
// 先分离出 Human 和其他条目
264+
const humanData = this.data.filter(item => item.info?.name === 'Human');
265+
const otherData = this.data.filter(item => item.info?.name !== 'Human');
253266

254-
return sortedData.sort((a, b) => {
267+
// 对非 Human 条目进行排序
268+
const sortedOtherData = otherData.sort((a, b) => {
255269
let aValue, bValue;
256270

257271
if (this.sortColumn === 'date') {
@@ -278,6 +292,9 @@ class LeaderboardTable {
278292
return aValue > bValue ? -1 : aValue < bValue ? 1 : 0;
279293
}
280294
});
295+
296+
// Human 总是在最前面
297+
return [...humanData, ...sortedOtherData];
281298
}
282299

283300
setupSorting() {

0 commit comments

Comments
 (0)