feat(rankings): remove 'all' period option from rankings and related components
This commit is contained in:
@@ -173,8 +173,6 @@ func rankingConfig(period string) (rankingPeriodConfig, error) {
|
|||||||
return rankingPeriodConfig{id: "month", duration: 30 * 24 * time.Hour, bucketSize: 24 * 3600, labelLayout: "Jan 2", hasPrevious: true}, nil
|
return rankingPeriodConfig{id: "month", duration: 30 * 24 * time.Hour, bucketSize: 24 * 3600, labelLayout: "Jan 2", hasPrevious: true}, nil
|
||||||
case "year":
|
case "year":
|
||||||
return rankingPeriodConfig{id: "year", duration: 365 * 24 * time.Hour, bucketSize: 7 * 24 * 3600, labelLayout: "Jan 2", hasPrevious: true}, nil
|
return rankingPeriodConfig{id: "year", duration: 365 * 24 * time.Hour, bucketSize: 7 * 24 * 3600, labelLayout: "Jan 2", hasPrevious: true}, nil
|
||||||
case "all":
|
|
||||||
return rankingPeriodConfig{id: "all", bucketSize: 30 * 24 * 3600, labelLayout: "Jan 2006"}, nil
|
|
||||||
default:
|
default:
|
||||||
return rankingPeriodConfig{}, fmt.Errorf("invalid ranking period: %s", period)
|
return rankingPeriodConfig{}, fmt.Errorf("invalid ranking period: %s", period)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ const PERIOD_DESCRIPTIONS: Record<RankingPeriod, string> = {
|
|||||||
week: 'Token share by model author across the past few weeks',
|
week: 'Token share by model author across the past few weeks',
|
||||||
month: 'Token share by model author across the past month',
|
month: 'Token share by model author across the past month',
|
||||||
year: 'Token share by model author across the past year',
|
year: 'Token share by model author across the past year',
|
||||||
all: 'Token share by model author since launch',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Stable colour palette for vendors, used in both the share chart and the
|
/** Stable colour palette for vendors, used in both the share chart and the
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ const PERIOD_DESCRIPTIONS: Record<RankingPeriod, string> = {
|
|||||||
week: 'Weekly token usage by model across the past few weeks',
|
week: 'Weekly token usage by model across the past few weeks',
|
||||||
month: 'Daily token usage by model across the past month',
|
month: 'Daily token usage by model across the past month',
|
||||||
year: 'Weekly token usage by model across the past year',
|
year: 'Weekly token usage by model across the past year',
|
||||||
all: 'Token usage by model since launch',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TOOLTIP_MAX_ROWS = 10
|
const TOOLTIP_MAX_ROWS = 10
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const PERIODS: { id: RankingPeriod; labelKey: string }[] = [
|
|||||||
{ id: 'week', labelKey: 'Week' },
|
{ id: 'week', labelKey: 'Week' },
|
||||||
{ id: 'month', labelKey: 'Month' },
|
{ id: 'month', labelKey: 'Month' },
|
||||||
{ id: 'year', labelKey: 'Year' },
|
{ id: 'year', labelKey: 'Year' },
|
||||||
{ id: 'all', labelKey: 'All-time' },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
type RankingsHeroProps = {
|
type RankingsHeroProps = {
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ import {
|
|||||||
import { useRankings } from './hooks/use-rankings'
|
import { useRankings } from './hooks/use-rankings'
|
||||||
import type { RankingPeriod } from './types'
|
import type { RankingPeriod } from './types'
|
||||||
|
|
||||||
const VALID_PERIODS: RankingPeriod[] = ['today', 'week', 'month', 'year', 'all']
|
const VALID_PERIODS: RankingPeriod[] = ['today', 'week', 'month', 'year']
|
||||||
|
|
||||||
export function Rankings() {
|
export function Rankings() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ For commercial licensing, please contact support@quantumnous.com
|
|||||||
//
|
//
|
||||||
// Shape of the real data shown on the /rankings page.
|
// Shape of the real data shown on the /rankings page.
|
||||||
|
|
||||||
export type RankingPeriod = 'today' | 'week' | 'month' | 'year' | 'all'
|
export type RankingPeriod = 'today' | 'week' | 'month' | 'year'
|
||||||
|
|
||||||
export type RankingCategoryId =
|
export type RankingCategoryId =
|
||||||
| 'all'
|
| 'all'
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ import { Rankings } from '@/features/rankings'
|
|||||||
|
|
||||||
const rankingsSearchSchema = z.object({
|
const rankingsSearchSchema = z.object({
|
||||||
period: z
|
period: z
|
||||||
.enum(['today', 'week', 'month', 'year', 'all'])
|
.enum(['today', 'week', 'month', 'year'])
|
||||||
.optional()
|
.optional()
|
||||||
.catch(undefined),
|
.catch(undefined),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user