feat: add TDP and YouTube video inputs to benchmark submission wizard
This commit is contained in:
@@ -94,6 +94,7 @@ export function GameEntryWizard({ gameId, gameVersions, defaultVersionId, editEn
|
|||||||
fpsHigh: editEntry.fpsHigh ?? undefined,
|
fpsHigh: editEntry.fpsHigh ?? undefined,
|
||||||
loadTimeSsd: editEntry.loadTimeSsd ?? undefined,
|
loadTimeSsd: editEntry.loadTimeSsd ?? undefined,
|
||||||
loadTimeSd: editEntry.loadTimeSd ?? undefined,
|
loadTimeSd: editEntry.loadTimeSd ?? undefined,
|
||||||
|
tdpWatts: editEntry.tdpWatts ?? undefined,
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
)
|
)
|
||||||
@@ -115,6 +116,7 @@ export function GameEntryWizard({ gameId, gameVersions, defaultVersionId, editEn
|
|||||||
launchOptions: editEntry.launchOptions ?? undefined,
|
launchOptions: editEntry.launchOptions ?? undefined,
|
||||||
estimatedBatteryMin: editEntry.estimatedBatteryMin ?? undefined,
|
estimatedBatteryMin: editEntry.estimatedBatteryMin ?? undefined,
|
||||||
customSystem: editEntry.customSystem ?? false,
|
customSystem: editEntry.customSystem ?? false,
|
||||||
|
youtubeVideoId: editEntry.youtubeVideoId ?? undefined,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
upscalerType: "none",
|
upscalerType: "none",
|
||||||
@@ -259,6 +261,8 @@ export function GameEntryWizard({ gameId, gameVersions, defaultVersionId, editEn
|
|||||||
fpsHigh: performance.fpsHigh !== undefined ? Number(performance.fpsHigh) : null,
|
fpsHigh: performance.fpsHigh !== undefined ? Number(performance.fpsHigh) : null,
|
||||||
loadTimeSsd: performance.loadTimeSsd !== undefined ? Number(performance.loadTimeSsd) : null,
|
loadTimeSsd: performance.loadTimeSsd !== undefined ? Number(performance.loadTimeSsd) : null,
|
||||||
loadTimeSd: performance.loadTimeSd !== undefined ? Number(performance.loadTimeSd) : null,
|
loadTimeSd: performance.loadTimeSd !== undefined ? Number(performance.loadTimeSd) : null,
|
||||||
|
tdpWatts: performance.tdpWatts !== undefined ? Number(performance.tdpWatts) : null,
|
||||||
|
youtubeVideoId: environment.youtubeVideoId || null,
|
||||||
protonVersion: environment.protonVersion || null,
|
protonVersion: environment.protonVersion || null,
|
||||||
osVersion: environment.osVersion || null,
|
osVersion: environment.osVersion || null,
|
||||||
upscalerType: environment.upscalerType ?? "none",
|
upscalerType: environment.upscalerType ?? "none",
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export interface EnvironmentData {
|
|||||||
launchOptions?: string
|
launchOptions?: string
|
||||||
estimatedBatteryMin?: number
|
estimatedBatteryMin?: number
|
||||||
customSystem?: boolean
|
customSystem?: boolean
|
||||||
|
youtubeVideoId?: string // NEW
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EnvironmentStepProps {
|
interface EnvironmentStepProps {
|
||||||
@@ -307,6 +308,31 @@ export function EnvironmentStep({ value, onChange }: EnvironmentStepProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { useMemo } from "react"
|
import { useMemo } from "react"
|
||||||
import { Gauge, Timer } from "lucide-react"
|
import { Gauge, Timer, Zap } from "lucide-react"
|
||||||
|
|
||||||
export interface PerformanceData {
|
export interface PerformanceData {
|
||||||
fpsAvg?: number
|
fpsAvg?: number
|
||||||
@@ -10,6 +10,7 @@ export interface PerformanceData {
|
|||||||
fpsHigh?: number
|
fpsHigh?: number
|
||||||
loadTimeSsd?: number
|
loadTimeSsd?: number
|
||||||
loadTimeSd?: number
|
loadTimeSd?: number
|
||||||
|
tdpWatts?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PerformanceStepProps {
|
interface PerformanceStepProps {
|
||||||
@@ -141,6 +142,34 @@ export function PerformanceStep({ value, onChange }: PerformanceStepProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ export function ReviewStep({
|
|||||||
<SummaryRow label="FPS High" value={formatNumber(performance.fpsHigh)} />
|
<SummaryRow label="FPS High" value={formatNumber(performance.fpsHigh)} />
|
||||||
<SummaryRow label="Load Time SSD" value={formatNumber(performance.loadTimeSsd)} />
|
<SummaryRow label="Load Time SSD" value={formatNumber(performance.loadTimeSsd)} />
|
||||||
<SummaryRow label="Load Time SD" value={formatNumber(performance.loadTimeSd)} />
|
<SummaryRow label="Load Time SD" value={formatNumber(performance.loadTimeSd)} />
|
||||||
|
<SummaryRow label="TDP (Watts)" value={formatNumber(performance.tdpWatts)} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Environment */}
|
{/* Environment */}
|
||||||
@@ -141,6 +142,7 @@ export function ReviewStep({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
<SummaryRow label="YouTube Video" value={environment.youtubeVideoId || "Not set"} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Settings */}
|
{/* Settings */}
|
||||||
|
|||||||
Reference in New Issue
Block a user