From 4d759160dbc608872ece30a1e4fd57eb817b928c Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Tue, 28 Apr 2026 22:43:46 +0800 Subject: [PATCH] feat: add 1% low FPS field to benchmark submission wizard --- components/wizard/game-entry-wizard.tsx | 2 ++ components/wizard/steps/performance-step.tsx | 17 ++++++++++++++++- components/wizard/steps/review-step.tsx | 1 + lib/api/performance-submit.ts | 2 ++ lib/api/performance.ts | 2 ++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/components/wizard/game-entry-wizard.tsx b/components/wizard/game-entry-wizard.tsx index dc61cb2..dc52a2f 100644 --- a/components/wizard/game-entry-wizard.tsx +++ b/components/wizard/game-entry-wizard.tsx @@ -42,6 +42,7 @@ export function GameEntryWizard({ gameId, gameVersionId, editEntry }: GameEntryW editEntry ? { fpsAvg: editEntry.fpsAvg, + fpsOnePercentLow: editEntry.fpsOnePercentLow ?? undefined, fpsLow: editEntry.fpsLow ?? undefined, fpsHigh: editEntry.fpsHigh ?? undefined, loadTimeSsd: editEntry.loadTimeSsd ?? undefined, @@ -160,6 +161,7 @@ export function GameEntryWizard({ gameId, gameVersionId, editEntry }: GameEntryW versionId: gameVersionId, hardwareSlug, fpsAvg: Number(performance.fpsAvg), + fpsOnePercentLow: performance.fpsOnePercentLow !== undefined ? Number(performance.fpsOnePercentLow) : null, fpsLow: performance.fpsLow !== undefined ? Number(performance.fpsLow) : null, fpsHigh: performance.fpsHigh !== undefined ? Number(performance.fpsHigh) : null, loadTimeSsd: performance.loadTimeSsd !== undefined ? Number(performance.loadTimeSsd) : null, diff --git a/components/wizard/steps/performance-step.tsx b/components/wizard/steps/performance-step.tsx index a4eae5f..3f10e00 100644 --- a/components/wizard/steps/performance-step.tsx +++ b/components/wizard/steps/performance-step.tsx @@ -5,6 +5,7 @@ import { Gauge, Timer } from "lucide-react" export interface PerformanceData { fpsAvg?: number + fpsOnePercentLow?: number fpsLow?: number fpsHigh?: number loadTimeSsd?: number @@ -42,7 +43,7 @@ export function PerformanceStep({ value, onChange }: PerformanceStepProps) {

Frame Rate

-
+
+
+ + update("fpsOnePercentLow", e.target.value)} + placeholder="e.g. 32" + className="w-full px-4 py-3 rounded-lg border border-border bg-text/5 text-text text-sm placeholder:text-text/40 outline-none focus:border-primary focus:ring-2 focus:ring-primary/50 transition-colors" + /> +

FPS at the 1st percentile — represents worst 1% of frametimes

+
+
+ diff --git a/lib/api/performance-submit.ts b/lib/api/performance-submit.ts index 595bd91..4b03235 100644 --- a/lib/api/performance-submit.ts +++ b/lib/api/performance-submit.ts @@ -101,6 +101,7 @@ export const performanceSubmitRoutes = new Elysia({ prefix: "/performance" }) hardwareSlug: body.hardwareSlug, userId: guard.user.id, fpsAvg: body.fpsAvg, + fpsOnePercentLow: body.fpsOnePercentLow ?? null, fpsLow: body.fpsLow ?? null, fpsHigh: body.fpsHigh ?? null, protonVersion: body.protonVersion ?? null, @@ -129,6 +130,7 @@ export const performanceSubmitRoutes = new Elysia({ prefix: "/performance" }) versionId: t.String(), hardwareSlug: t.String(), fpsAvg: t.Number(), + fpsOnePercentLow: t.Optional(t.Union([t.Number(), t.Null()])), fpsLow: t.Optional(t.Union([t.Number(), t.Null()])), fpsHigh: t.Optional(t.Union([t.Number(), t.Null()])), protonVersion: t.Optional(t.Union([t.String(), t.Null()])), diff --git a/lib/api/performance.ts b/lib/api/performance.ts index ca6b357..3d6f41d 100644 --- a/lib/api/performance.ts +++ b/lib/api/performance.ts @@ -233,6 +233,7 @@ export const performanceVerifyRoutes = new Elysia({ } if (body.fpsAvg !== undefined) updateData.fpsAvg = body.fpsAvg + if (body.fpsOnePercentLow !== undefined) updateData.fpsOnePercentLow = body.fpsOnePercentLow if (body.fpsLow !== undefined) updateData.fpsLow = body.fpsLow if (body.fpsHigh !== undefined) updateData.fpsHigh = body.fpsHigh if (body.protonVersion !== undefined) @@ -264,6 +265,7 @@ export const performanceVerifyRoutes = new Elysia({ params: t.Object({ id: t.String() }), body: t.Object({ fpsAvg: t.Optional(t.Number()), + fpsOnePercentLow: t.Optional(t.Number()), fpsLow: t.Optional(t.Number()), fpsHigh: t.Optional(t.Number()), protonVersion: t.Optional(t.Union([t.String(), t.Null()])),