feat: display 1% low FPS in presets, stats API, and game details

This commit is contained in:
2026-04-28 22:56:43 +08:00
parent 4d759160db
commit 741c19e840
4 changed files with 48 additions and 3 deletions
+21 -3
View File
@@ -15,6 +15,7 @@ import {
Plus,
ThumbsUpIcon,
ThumbsDownIcon,
GaugeIcon,
} from "lucide-react"
import Link from "next/link"
import { useSession } from "@/lib/auth-client"
@@ -81,6 +82,7 @@ interface Preset {
fpsAvg: number | null
fpsLow: number | null
fpsHigh: number | null
fpsOnePercentLow: number | null
upscalerType: string | null
upscalerVersion: string | null
frameGenMethod: string | null
@@ -102,6 +104,8 @@ interface StatsResponse {
bestDevice: string
verifiedCount: number
versionCount: number
avgStability: number | null
bestOnePercentLow: number | null
}
isRawPerformer: boolean
isPoorPerformance: boolean
@@ -111,6 +115,7 @@ interface StatsResponse {
min: number
q1: number
median: number
onePercentLow?: number
q3: number
max: number
}>
@@ -136,6 +141,7 @@ interface StatsResponse {
fpsLow: number
fpsAvg: number
fpsHigh: number
fpsOnePercentLow: number | null
isRawPerformer: boolean
}>
deviceBreakdown: Array<{
@@ -840,11 +846,16 @@ export function GamePageClient({
{" "}
avg
</span>
{preset.fpsLow !== null && (
{preset.fpsOnePercentLow !== null && (
<span className='text-text/40'>
{" "}
({preset.fpsLow}
{preset.fpsHigh})
· {preset.fpsOnePercentLow} 1% low
</span>
)}
{preset.fpsLow !== null && preset.fpsHigh !== null && !preset.fpsOnePercentLow && (
<span className='text-text/40'>
{" "}
({preset.fpsLow}{preset.fpsHigh})
</span>
)}
</div>
@@ -953,6 +964,13 @@ export function GamePageClient({
)}
icon={DatabaseIcon}
/>
{filteredStats.summary.avgStability !== null && (
<StatCard
label='Avg Stability'
value={`${Math.round(filteredStats.summary.avgStability * 100)}%`}
icon={GaugeIcon}
/>
)}
</div>
</div>
)}
+2
View File
@@ -219,6 +219,7 @@ export default async function GamePage({
fpsAvg: performanceEntries.fpsAvg,
fpsLow: performanceEntries.fpsLow,
fpsHigh: performanceEntries.fpsHigh,
fpsOnePercentLow: performanceEntries.fpsOnePercentLow,
upscalerType: performanceEntries.upscalerType,
upscalerVersion: performanceEntries.upscalerVersion,
frameGenMethod: performanceEntries.frameGenMethod,
@@ -292,6 +293,7 @@ export default async function GamePage({
fpsAvg: p.fpsAvg,
fpsLow: p.fpsLow,
fpsHigh: p.fpsHigh,
fpsOnePercentLow: p.fpsOnePercentLow ?? null,
upscalerType: p.upscalerType,
upscalerVersion: p.upscalerVersion,
frameGenMethod: p.frameGenMethod,
+9
View File
@@ -33,6 +33,7 @@ interface Preset {
fpsAvg: number | null
fpsLow: number | null
fpsHigh: number | null
fpsOnePercentLow: number | null
upscalerType: string | null
upscalerVersion: string | null
frameGenMethod: string | null
@@ -295,6 +296,14 @@ export function PresetDetailModal({
</div>
</div>
)}
{preset.fpsOnePercentLow !== null && (
<div className="flex flex-col gap-1">
<span className="text-[10px] text-text/50 uppercase tracking-wider">1% Low FPS</span>
<span className="text-sm font-semibold tabular-nums text-text">
{preset.fpsOnePercentLow} fps
</span>
</div>
)}
<div className="h-px bg-border" />