feat(排名): 排名页重做成领奖台加全班赛道,一眼看出自己第几、该追谁、谁在追自己
Deploy / deploy (push) Canceled after 0s

- 一张榜两个开关:本班 / 本年级 / 全服 × 这周 / 这学期 / 全部,默认本班 · 这学期。
  原来最大那张全服 Top100 里,这学期在用的 25 级学生一个都进不去
- 做对一样多的不再按「提交少的在前」排,改成先做到的在前;名次旁边写比周一升降了几名
- 「你」那张卡:第几名、再做对几道上领奖台,要追的人早你几秒、追你的人晚你几秒
- 本年级 / 全服只列前面一段和你附近一段,中间折起来,点开再看
- 班级对抗按人均做对比,另有我和对手的名次走势、这周本班、每周冠军
- 老师不上榜,选班看;每行「⋯」能把怀疑抄代码的学生设成不计入排名(新增 user.rank_hidden_at,
  首页周榜同样不算他),随时能恢复
- 去掉全服 Top10、日活两张图、在线人数和班级详情弹框里的统计词,以及它们背后的旧接口

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-10 07:26:15 +08:00
1 parent 0cee4ef779
commit 1c6e2b9d82
31 files changed
+6633 -1392

No files matched your search

+1 -25
View File
@@ -1,6 +1,6 @@
import { z } from "zod"
import { paginatedSchema, sampleUserSchema } from "./common"
import { sampleUserSchema } from "./common"
import { userProfileSchema } from "./auth"
export const registerRequestSchema = z.object({
@@ -37,27 +37,6 @@ export const rankProfileSchema = z.object({
isOnline: z.boolean().nullable().default(null),
})
/**
* 榜单里「我」的位置。`rank` 是**全服名次**,与当前翻到第几页无关 ——
* 前 100 名之外的学生也拿得到,页面靠它单独显示一行。
*
* 名次口径与列表的排序完全一致(AC 降序 → 提交数升序 → id 升序),
* 所以「我的名次」和「我在表格里的行号」永远对得上;三个键都相同才算并列。
*/
export const myRankSchema = rankProfileSchema.extend({
rank: z.number().int().positive(),
})
export const userRankSchema = paginatedSchema(rankProfileSchema).extend({
/** 未登录、或身份不入榜(教师/超管)时为 null */
me: myRankSchema.nullable(),
})
export const activityRankItemSchema = z.object({
username: z.string(),
count: z.number().int().nonnegative(),
})
/**
* 周榜的一行。`solvedCount` 是**本周首次 AC 的题目数** —— 不是「本周 AC 过的去重题数」。
* 后者会把上周就做出来的题重交一次也算成本周成绩,等于给刷榜留了个口子;
@@ -99,9 +78,6 @@ export type RegisterRequest = z.infer<typeof registerRequestSchema>
export type UpdateProfileRequest = z.infer<typeof updateProfileRequestSchema>
export type ProblemRank = z.infer<typeof problemRankSchema>
export type RankProfile = z.infer<typeof rankProfileSchema>
export type UserRank = z.infer<typeof userRankSchema>
export type MyRank = z.infer<typeof myRankSchema>
export type ActivityRankItem = z.infer<typeof activityRankItemSchema>
export type WeeklyRankItem = z.infer<typeof weeklyRankItemSchema>
export type WeeklyRank = z.infer<typeof weeklyRankSchema>
export type Metrics = z.infer<typeof metricsSchema>