feat: add TDP and YouTube video inputs to benchmark submission wizard

This commit is contained in:
2026-05-09 23:25:30 +08:00
parent b5d9f0e19b
commit bb45599fe9
4 changed files with 62 additions and 1 deletions
@@ -31,6 +31,7 @@ export interface EnvironmentData {
launchOptions?: string
estimatedBatteryMin?: number
customSystem?: boolean
youtubeVideoId?: string // NEW
}
interface EnvironmentStepProps {
@@ -307,6 +308,31 @@ export function EnvironmentStep({ value, onChange }: EnvironmentStepProps) {
</div>
</div>
</div>
<div className="space-y-1.5 pt-2">
<label className="text-xs font-medium text-text/60">
YouTube Video
<span className="text-xs text-text/40 ml-1">Optional link a gameplay video</span>
</label>
<input
type="text"
value={value.youtubeVideoId ?? ""}
onChange={(e) => {
const val = e.target.value
// Accept full URLs or just the 11-char ID
let videoId = val
const ytMatch = val.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/)
if (ytMatch) videoId = ytMatch[1]
onChange({ ...value, youtubeVideoId: videoId || undefined })
}}
placeholder="YouTube video ID or URL"
maxLength={200}
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"
/>
{value.youtubeVideoId && !/^[a-zA-Z0-9_-]{11}$/.test(value.youtubeVideoId) && (
<p className="text-xs text-red-400 mt-1">Invalid YouTube video ID (must be 11 characters)</p>
)}
</div>
</div>
)
}
+30 -1
View File
@@ -1,7 +1,7 @@
"use client"
import { useMemo } from "react"
import { Gauge, Timer } from "lucide-react"
import { Gauge, Timer, Zap } from "lucide-react"
export interface PerformanceData {
fpsAvg?: number
@@ -10,6 +10,7 @@ export interface PerformanceData {
fpsHigh?: number
loadTimeSsd?: number
loadTimeSd?: number
tdpWatts?: number
}
interface PerformanceStepProps {
@@ -141,6 +142,34 @@ export function PerformanceStep({ value, onChange }: PerformanceStepProps) {
</div>
</div>
</div>
{/* Power Section */}
<div className="space-y-3">
<div className="flex items-center gap-2">
<Zap className="h-4 w-4 text-primary" />
<h3 className="text-sm font-semibold text-text">Power</h3>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div className="space-y-1.5">
<label className="text-xs font-medium text-text/60">
TDP (Watts)
<span className="text-xs text-text/40 ml-1">Optional thermal design power cap during benchmark</span>
</label>
<input
type="text"
inputMode="decimal"
value={value.tdpWatts ?? ""}
onChange={(e) => {
const val = e.target.value.replace(/[^0-9.]/g, "").replace(/(\..*)\./g, "$1")
const num = val === "" || val === "." ? undefined : Number(val)
onChange({ ...value, tdpWatts: num })
}}
placeholder="e.g. 10"
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"
/>
</div>
</div>
</div>
</div>
)
}
+2
View File
@@ -120,6 +120,7 @@ export function ReviewStep({
<SummaryRow label="FPS High" value={formatNumber(performance.fpsHigh)} />
<SummaryRow label="Load Time SSD" value={formatNumber(performance.loadTimeSsd)} />
<SummaryRow label="Load Time SD" value={formatNumber(performance.loadTimeSd)} />
<SummaryRow label="TDP (Watts)" value={formatNumber(performance.tdpWatts)} />
</div>
{/* Environment */}
@@ -141,6 +142,7 @@ export function ReviewStep({
}
/>
)}
<SummaryRow label="YouTube Video" value={environment.youtubeVideoId || "Not set"} />
</div>
{/* Settings */}