From 1145ba6f51fe71e808076515cc7c2a9d4d013bca Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Sun, 10 May 2026 05:22:53 +0800 Subject: [PATCH] feat: add version, anti-cheat, and verified date to preset detail modal (Tasks 6.1-6.7) --- app/game/[id]/game-page-client.tsx | 4 ++++ app/game/[id]/page.tsx | 15 +++++++++++++++ app/game/[id]/preset-detail-modal.tsx | 24 ++++++++++++++++++++---- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/app/game/[id]/game-page-client.tsx b/app/game/[id]/game-page-client.tsx index 17b0755..5230ffd 100644 --- a/app/game/[id]/game-page-client.tsx +++ b/app/game/[id]/game-page-client.tsx @@ -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 { diff --git a/app/game/[id]/page.tsx b/app/game/[id]/page.tsx index 93db355..0a20bd5 100644 --- a/app/game/[id]/page.tsx +++ b/app/game/[id]/page.tsx @@ -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, diff --git a/app/game/[id]/preset-detail-modal.tsx b/app/game/[id]/preset-detail-modal.tsx index bf92084..e99ed5c 100644 --- a/app/game/[id]/preset-detail-modal.tsx +++ b/app/game/[id]/preset-detail-modal.tsx @@ -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"} {preset.verifiedAt && ( - + + + Verified on {new Date(preset.verifiedAt).toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" })} + )} @@ -496,6 +500,18 @@ export function PresetDetailModal({ {/* Metadata */}
+ {preset.versionString && ( + + )} + {preset.buildId && ( + + )} + {preset.gameAntiCheatName && ( + + )} {preset.tdpWatts !== null && (