feat: add 1% low FPS field to benchmark submission wizard
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
<h3 className="text-sm font-semibold text-text">Frame Rate</h3>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-3">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3">
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-medium text-text/60">
|
||||
FPS Average <span className="text-red-400">*</span>
|
||||
@@ -59,6 +60,20 @@ export function PerformanceStep({ value, onChange }: PerformanceStepProps) {
|
||||
<p className="text-[10px] text-text/30">Required — average framerate during gameplay</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-medium text-text/60">1% Low FPS</label>
|
||||
<input
|
||||
type="text"
|
||||
inputMode="numeric"
|
||||
pattern="[0-9]*"
|
||||
value={value.fpsOnePercentLow ?? ""}
|
||||
onChange={(e) => 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"
|
||||
/>
|
||||
<p className="text-[10px] text-text/30">FPS at the 1st percentile — represents worst 1% of frametimes</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-medium text-text/60">FPS Low</label>
|
||||
<input
|
||||
|
||||
@@ -95,6 +95,7 @@ export function ReviewStep({
|
||||
<div className="rounded-lg border border-border bg-text/5 p-4">
|
||||
<SectionHeader icon={Gauge} label="Performance" />
|
||||
<SummaryRow label="FPS Average" value={formatNumber(performance.fpsAvg)} />
|
||||
<SummaryRow label="1% Low FPS" value={formatNumber(performance.fpsOnePercentLow)} />
|
||||
<SummaryRow label="FPS Low" value={formatNumber(performance.fpsLow)} />
|
||||
<SummaryRow label="FPS High" value={formatNumber(performance.fpsHigh)} />
|
||||
<SummaryRow label="Load Time SSD" value={formatNumber(performance.loadTimeSsd)} />
|
||||
|
||||
@@ -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()])),
|
||||
|
||||
@@ -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()])),
|
||||
|
||||
Reference in New Issue
Block a user