Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions assets/pr1213-before-after.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/components/leaderboard/MinerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ export const MinerCard: React.FC<MinerCardProps> = ({
>
{formatRank(rank)}
</Typography>
{miner.viewRank != null && miner.viewRank !== miner.rank && (
<Typography
component="span"
sx={(theme) => ({
fontFamily: FONTS.mono,
fontSize: '0.58rem',
fontWeight: 500,
color: theme.palette.text.tertiary,
lineHeight: 1,
flexShrink: 0,
ml: 0.75,
})}
>
·{miner.viewRank} in view
</Typography>
)}
</Box>
)}

Expand Down
19 changes: 18 additions & 1 deletion src/components/leaderboard/MinersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,24 @@ export const MinersList: React.FC<MinersListProps> = ({
header: 'Rank',
width: '60px',
cellSx: { pr: 0 },
renderCell: (miner) => <RankIcon rank={miner.rank ?? 0} />,
renderCell: (miner) => (
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75 }}>
<RankIcon rank={miner.rank ?? 0} />
{miner.viewRank != null && miner.viewRank !== miner.rank && (
<Typography
component="span"
sx={{
fontSize: '0.6rem',
color: 'text.tertiary',
fontWeight: 500,
lineHeight: 1,
}}
>
·{miner.viewRank}
</Typography>
)}
</Box>
),
},
{
key: 'miner',
Expand Down
11 changes: 11 additions & 0 deletions src/components/leaderboard/TopMinersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,17 @@ const TopMinersTable: React.FC<TopMinersTableProps> = ({
return passesSingleProgramEligibility(m, eligibleOssFilter);
});

const hasActiveFilter =
searchQuery !== '' ||
eligibleOssFilter !== 'all' ||
eligibleDiscoveryFilter !== 'all';
if (hasActiveFilter) {
result = result.map((miner, index) => ({
...miner,
viewRank: index + 1,
}));
}

return result;
}, [
rankedMiners,
Expand Down
4 changes: 4 additions & 0 deletions src/components/leaderboard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export interface MinerStats {
linesDeleted: number;
hotkey: string;
rank?: number;
/** Position in the current filtered subset (1-indexed). Only populated
* when a search or eligibility filter is active, so the UI layer can
* show a "· N in view" indicator beside the global rank. */
viewRank?: number;
uniqueReposCount?: number;
credibility?: number;
isEligible?: boolean;
Expand Down
Loading