feat: add version, anti-cheat, and verified date to preset detail modal (Tasks 6.1-6.7)

This commit is contained in:
2026-05-10 05:22:53 +08:00
parent 5875595219
commit 1145ba6f51
3 changed files with 39 additions and 4 deletions
+4
View File
@@ -157,6 +157,10 @@ interface Preset {
createdAt: string
hardwareWattHours: number | null
hardwareDeviceType: string | null
versionString: string | null
buildId: string | null
gameAntiCheatName: string | null
gameAntiCheatStatus: "none" | "supported" | "unsupported" | "unknown" | null
}
interface StatsResponse {
+15
View File
@@ -182,6 +182,10 @@ export default async function GamePage({
youtubeVideoId: performanceEntries.youtubeVideoId,
customSystem: performanceEntries.customSystem,
userNotes: performanceEntries.userNotes,
versionString: gameVersions.versionString,
buildId: gameVersions.buildId,
gameAntiCheatName: gamePlatformSupport.antiCheatName,
gameAntiCheatStatus: gamePlatformSupport.antiCheatStatus,
verifiedAt: performanceEntries.verifiedAt,
isPinned: performanceEntries.isPinned,
pinnedAt: performanceEntries.pinnedAt,
@@ -190,6 +194,13 @@ export default async function GamePage({
.innerJoin(gameVersions, eq(performanceEntries.versionId, gameVersions.id))
.innerJoin(hardware, eq(performanceEntries.hardwareSlug, hardware.slug))
.innerJoin(user, eq(performanceEntries.userId, user.id))
.innerJoin(
gamePlatformSupport,
and(
eq(gamePlatformSupport.gameId, gameVersions.gameId),
eq(gamePlatformSupport.hardwareSlug, performanceEntries.hardwareSlug),
),
)
.where(
and(
eq(gameVersions.gameId, game.id),
@@ -287,6 +298,10 @@ export default async function GamePage({
hardwareDeviceType: null as string | null,
customSystem: p.customSystem ?? false,
userNotes: p.userNotes,
versionString: p.versionString ?? null,
buildId: p.buildId ?? null,
gameAntiCheatName: p.gameAntiCheatName ?? null,
gameAntiCheatStatus: p.gameAntiCheatStatus ?? null,
userId: p.userId,
userName: p.userName,
userImage: p.userImage,
+20 -4
View File
@@ -56,6 +56,10 @@ interface Preset {
isPinned: boolean
pinnedAt: string | null
createdAt: string
versionString: string | null
buildId: string | null
gameAntiCheatName: string | null
gameAntiCheatStatus: "none" | "supported" | "unsupported" | "unknown" | null
}
interface PresetDetailModalProps {
@@ -281,11 +285,11 @@ export function PresetDetailModal({
{preset.userName || "Anonymous"}
</span>
{preset.verifiedAt && (
<span
className="inline-flex items-center gap-0.5 text-green-400"
title="Verified"
>
<span className="inline-flex items-center gap-1 text-green-400">
<ShieldCheckIcon className="h-3.5 w-3.5" />
<span className="text-[10px]">
Verified on {new Date(preset.verifiedAt).toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" })}
</span>
</span>
)}
</div>
@@ -496,6 +500,18 @@ export function PresetDetailModal({
{/* Metadata */}
<div className="flex flex-col gap-3">
{preset.versionString && (
<MetaItem label="Version" value={`v${preset.versionString}`} />
)}
{preset.buildId && (
<MetaItem label="Build" value={String(preset.buildId)} />
)}
{preset.gameAntiCheatName && (
<MetaItem
label="Anti-Cheat"
value={`${preset.gameAntiCheatName} (${preset.gameAntiCheatStatus ?? "unknown"})`}
/>
)}
<MetaItem label="Proton" value={preset.protonVersion} />
<MetaItem label="OS" value={preset.osVersion} />
{preset.tdpWatts !== null && (