Task 17: Revamp Games List with New Filters & Badges
- Add new filter state variables (min/max FPS, FSR, Proton/Native, anti-cheat, playability, Steam review score, free-to-play, multiplayer) - Expand sort options to include performance, popularity, release_date, steam_reviews - Add Performance, Compatibility, and Other filter UI sections with inputs - Integrate SavedFilters component for saving/loading filter presets - Add PlayabilityBadge and AntiCheatBadge to game cards - Update API listing to return antiCheatRelevant/antiCheatStatus per game - Update server-side games page to include new fields in initialGames - Update clear-filters logic across filter panel and empty state
This commit is contained in:
@@ -313,12 +313,15 @@ export const gamesListingRoutes = new Elysia({ prefix: "/games/listing" }).get(
|
||||
|
||||
// Fetch platform support for the returned games (prioritise Steam Deck)
|
||||
const platformMap = new Map<string, string>()
|
||||
const antiCheatMap = new Map<string, { antiCheatRelevant: boolean; antiCheatStatus: string | null }>()
|
||||
if (gameIds.length > 0) {
|
||||
const platformRows = await db
|
||||
.select({
|
||||
gameId: gamePlatformSupport.gameId,
|
||||
hardwareSlug: gamePlatformSupport.hardwareSlug,
|
||||
protonStatus: gamePlatformSupport.protonStatus,
|
||||
antiCheatRelevant: gamePlatformSupport.antiCheatRelevant,
|
||||
antiCheatStatus: gamePlatformSupport.antiCheatStatus,
|
||||
})
|
||||
.from(gamePlatformSupport)
|
||||
.where(inArray(gamePlatformSupport.gameId, gameIds))
|
||||
@@ -329,6 +332,16 @@ export const gamesListingRoutes = new Elysia({ prefix: "/games/listing" }).get(
|
||||
if (!existing || (!existing.startsWith("steamdeck") && isSteamDeck)) {
|
||||
platformMap.set(row.gameId, row.protonStatus)
|
||||
}
|
||||
|
||||
const existingAc = antiCheatMap.get(row.gameId)
|
||||
if (row.antiCheatRelevant) {
|
||||
if (!existingAc || (!existingAc.antiCheatRelevant && isSteamDeck) || (!existingAc.antiCheatRelevant)) {
|
||||
antiCheatMap.set(row.gameId, {
|
||||
antiCheatRelevant: row.antiCheatRelevant,
|
||||
antiCheatStatus: row.antiCheatStatus,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,6 +362,8 @@ export const gamesListingRoutes = new Elysia({ prefix: "/games/listing" }).get(
|
||||
onlineMultiplayerStatus: g.onlineMultiplayerStatus,
|
||||
benchmarkCount: benchmarkMap.get(g.id) ?? 0,
|
||||
deckStatus: platformMap.get(g.id) ?? null,
|
||||
antiCheatRelevant: antiCheatMap.get(g.id)?.antiCheatRelevant ?? false,
|
||||
antiCheatStatus: antiCheatMap.get(g.id)?.antiCheatStatus ?? null,
|
||||
}))
|
||||
|
||||
// If sorting by benchmarks, re-sort the enriched data
|
||||
|
||||
Reference in New Issue
Block a user