Skip to content

Commit 7e9e3fe

Browse files
committed
feat(ranking table): add sorting for all columns
1 parent 7460d99 commit 7e9e3fe

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

frontend/src/pages/ModelRankingPage.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ const columns: ColumnsType<RankingEntry> = [
6464
dataIndex: 'median_coverage',
6565
key: 'median_coverage',
6666
render: (v: number) => v.toFixed(4),
67+
sorter: (a, b) => b.mean_coverage - a.mean_coverage,
6768
},
6869
{
6970
title: 'Total Tests',
7071
dataIndex: 'total_tests',
7172
key: 'total_tests',
73+
sorter: (a, b) => b.mean_coverage - a.mean_coverage,
7274
},
7375
{
7476
title: 'Errors',
@@ -77,18 +79,21 @@ const columns: ColumnsType<RankingEntry> = [
7779
render: (v: number) => (
7880
<span style={{ color: v > 0 ? '#ff4d4f' : 'inherit' }}>{v}</span>
7981
),
82+
sorter: (a, b) => b.mean_coverage - a.mean_coverage,
8083
},
8184
{
8285
title: 'Time (s)',
8386
dataIndex: 'total_time_sec',
8487
key: 'total_time_sec',
8588
render: (v: number) => v.toFixed(2),
89+
sorter: (a, b) => b.mean_coverage - a.mean_coverage,
8690
},
8791
{
8892
title: 'Published',
8993
dataIndex: 'created_at',
9094
key: 'created_at',
9195
render: (v: string) => new Date(v).toLocaleDateString(),
96+
sorter: (a, b) => b.mean_coverage - a.mean_coverage,
9297
},
9398
];
9499

0 commit comments

Comments
 (0)