fix: suggest edit only for non-Steam games, improve preset modal, improve steam reviews error handling, update changelog
This commit is contained in:
+18
-3
@@ -11,7 +11,7 @@ All notable changes to DeckyVault will be documented in this file.
|
||||
- Anti-cheat badges on games list and search results
|
||||
- Anti-cheat filter in games list
|
||||
- Anti-cheat awareness step in benchmark submission wizard
|
||||
- Anti-cheat status shown per device in platform support section
|
||||
- Anti-cheat is game-level property (not per-device)
|
||||
|
||||
#### Steam Reviews Integration
|
||||
- Steam review score and sentiment stored on game records
|
||||
@@ -26,6 +26,7 @@ All notable changes to DeckyVault will be documented in this file.
|
||||
- Manual override capability for admins/contributors
|
||||
- Color-coded playability badges across all game views
|
||||
- "Plays Great" quick-filter in games list
|
||||
- Auto-recalculates on benchmark submission and Steam sync
|
||||
|
||||
#### Games List Revamp
|
||||
- FPS range filter (min/max)
|
||||
@@ -40,7 +41,7 @@ All notable changes to DeckyVault will be documented in this file.
|
||||
- Saved/bookmarked filter presets
|
||||
|
||||
#### Community Suggestions
|
||||
- "Suggest Edit" button on game details page
|
||||
- "Suggest Edit" button on game details page (non-Steam games only)
|
||||
- Community suggestion submission for editable fields
|
||||
- Moderation queue for pending suggestions
|
||||
- Approve/reject workflow with review notes
|
||||
@@ -60,16 +61,30 @@ All notable changes to DeckyVault will be documented in this file.
|
||||
- Report status tracking (open/reviewed/dismissed)
|
||||
- Verified badge on peer-reviewed benchmarks
|
||||
|
||||
#### Preset Detail Modal
|
||||
- Added load times (SSD/SD) display
|
||||
- Added battery life estimate display
|
||||
- Added custom system indicator
|
||||
|
||||
### Changed
|
||||
- Manage page now shows dashboard by default instead of redirecting to users
|
||||
- Games list now supports 12 filter dimensions and 7 sort options
|
||||
- Game details page now shows anti-cheat, playability, and Steam reviews
|
||||
- "Suggest Edit" only appears for non-Steam games (manual, GOG, Epic sources)
|
||||
- Anti-cheat step in wizard now shows game-level status, not per-device
|
||||
|
||||
### Fixed
|
||||
- Steam reviews component now handles missing/error data gracefully
|
||||
- Anti-cheat badge no longer shows for games without anti-cheat
|
||||
- Playability calculation only considers anti-cheat if game actually uses it
|
||||
- API routes registered correctly (removed duplicate `/api` prefix)
|
||||
- Dashboard and saved-filters routes now accessible
|
||||
|
||||
### Technical
|
||||
- Added `steamReviewScore`, `steamReviewSentiment`, `steamReviewCount` to games table
|
||||
- Added `playabilityStatus`, `playabilityOverride`, `playabilityCalculatedAt` to games and gamePlatformSupport tables
|
||||
- Created `community_suggestions` table for moderation workflow
|
||||
- Created `saved_filters` table for user filter presets
|
||||
- Added playability auto-calculation engine
|
||||
- Added playability auto-calculation engine with `recalculatePlayability()` export
|
||||
- Added Steam reviews caching API
|
||||
- Added admin dashboard stats API
|
||||
|
||||
@@ -101,6 +101,7 @@ interface PlatformSupport {
|
||||
|
||||
interface Preset {
|
||||
id: string
|
||||
gameId?: string
|
||||
hardwareSlug: string
|
||||
hardwareName: string
|
||||
upvotes: number
|
||||
@@ -117,6 +118,10 @@ interface Preset {
|
||||
protonVersion: string | null
|
||||
osVersion: string | null
|
||||
launchOptions: string | null
|
||||
loadTimeSsd: number | null
|
||||
loadTimeSd: number | null
|
||||
estimatedBatteryMin: number | null
|
||||
customSystem: boolean
|
||||
userNotes: string | null
|
||||
userId: string
|
||||
userName: string | null
|
||||
@@ -638,17 +643,19 @@ export function GamePageClient({
|
||||
Add Benchmark
|
||||
</Link>
|
||||
)}
|
||||
<CommunitySuggestionForm
|
||||
gameId={game.id}
|
||||
gameTitle={game.title}
|
||||
editableFields={[
|
||||
{ name: "title", label: "Title", currentValue: game.title },
|
||||
{ name: "description", label: "Description", currentValue: game.description || "" },
|
||||
{ name: "developer", label: "Developer", currentValue: game.developer || "" },
|
||||
{ name: "publisher", label: "Publisher", currentValue: game.publisher || "" },
|
||||
{ name: "storeUrl", label: "Store URL", currentValue: game.storeUrl || "" },
|
||||
]}
|
||||
/>
|
||||
{game.source !== "steam" && (
|
||||
<CommunitySuggestionForm
|
||||
gameId={game.id}
|
||||
gameTitle={game.title}
|
||||
editableFields={[
|
||||
{ name: "title", label: "Title", currentValue: game.title },
|
||||
{ name: "description", label: "Description", currentValue: game.description || "" },
|
||||
{ name: "developer", label: "Developer", currentValue: game.developer || "" },
|
||||
{ name: "publisher", label: "Publisher", currentValue: game.publisher || "" },
|
||||
{ name: "storeUrl", label: "Store URL", currentValue: game.storeUrl || "" },
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,10 @@ interface Preset {
|
||||
protonVersion: string | null
|
||||
osVersion: string | null
|
||||
launchOptions: string | null
|
||||
loadTimeSsd: number | null
|
||||
loadTimeSd: number | null
|
||||
estimatedBatteryMin: number | null
|
||||
customSystem: boolean
|
||||
userNotes: string | null
|
||||
userId: string
|
||||
userName: string | null
|
||||
@@ -346,6 +350,18 @@ export function PresetDetailModal({
|
||||
}
|
||||
/>
|
||||
<MetaItem label="Launch Options" value={preset.launchOptions} />
|
||||
{preset.loadTimeSsd !== null && (
|
||||
<MetaItem label="Load Time (SSD)" value={`${preset.loadTimeSsd}s`} />
|
||||
)}
|
||||
{preset.loadTimeSd !== null && (
|
||||
<MetaItem label="Load Time (SD)" value={`${preset.loadTimeSd}s`} />
|
||||
)}
|
||||
{preset.estimatedBatteryMin !== null && (
|
||||
<MetaItem label="Battery Life" value={`${preset.estimatedBatteryMin} min`} />
|
||||
)}
|
||||
{preset.customSystem && (
|
||||
<MetaItem label="Custom System" value="Yes" />
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="h-px bg-border" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { ThumbsUp, ThumbsDown, ExternalLink } from "lucide-react";
|
||||
import { ThumbsUp, ThumbsDown, ExternalLink, MessageSquare } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface SteamReview {
|
||||
@@ -51,7 +51,10 @@ export function SteamReviews({ gameId, steamAppId, className }: SteamReviewsProp
|
||||
`/api/steam-reviews/${gameId}?offset=${newOffset}&limit=5&language=english`
|
||||
);
|
||||
|
||||
if (!res.ok) throw new Error("Failed to load reviews");
|
||||
if (!res.ok) {
|
||||
const errData = await res.json().catch(() => null);
|
||||
throw new Error(errData?.error || `HTTP ${res.status}`);
|
||||
}
|
||||
|
||||
const result = await res.json();
|
||||
setData(result);
|
||||
@@ -67,6 +70,7 @@ export function SteamReviews({ gameId, steamAppId, className }: SteamReviewsProp
|
||||
fetchReviews(0);
|
||||
}, [gameId]);
|
||||
|
||||
// Loading skeleton
|
||||
if (loading && !data) {
|
||||
return (
|
||||
<div className={cn("animate-pulse space-y-4", className)}>
|
||||
@@ -80,15 +84,46 @@ export function SteamReviews({ gameId, steamAppId, className }: SteamReviewsProp
|
||||
);
|
||||
}
|
||||
|
||||
// Error state
|
||||
if (error) {
|
||||
return (
|
||||
<div className={cn("rounded-lg border border-zinc-800 p-4", className)}>
|
||||
<p className="text-sm text-zinc-400">Failed to load Steam reviews</p>
|
||||
<div className="flex items-center gap-2 text-zinc-400">
|
||||
<MessageSquare className="h-4 w-4" />
|
||||
<p className="text-sm">Steam reviews unavailable</p>
|
||||
</div>
|
||||
<p className="mt-1 text-xs text-zinc-500">{error}</p>
|
||||
<a
|
||||
href={`https://store.steampowered.com/app/${steamAppId}#app_reviews_hash`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-2 inline-flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300"
|
||||
>
|
||||
View on Steam <ExternalLink className="h-3 w-3" />
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!data?.query_summary) return null;
|
||||
// No data or no summary
|
||||
if (!data?.query_summary) {
|
||||
return (
|
||||
<div className={cn("rounded-lg border border-zinc-800 p-4", className)}>
|
||||
<div className="flex items-center gap-2 text-zinc-400">
|
||||
<MessageSquare className="h-4 w-4" />
|
||||
<p className="text-sm">No Steam reviews available</p>
|
||||
</div>
|
||||
<a
|
||||
href={`https://store.steampowered.com/app/${steamAppId}#app_reviews_hash`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-2 inline-flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300"
|
||||
>
|
||||
View on Steam <ExternalLink className="h-3 w-3" />
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const { query_summary: summary } = data;
|
||||
const totalReviews = summary.total_reviews ?? 0;
|
||||
@@ -98,6 +133,26 @@ export function SteamReviews({ gameId, steamAppId, className }: SteamReviewsProp
|
||||
? Math.round((totalPositive / totalReviews) * 100)
|
||||
: 0;
|
||||
|
||||
// No reviews case
|
||||
if (totalReviews === 0) {
|
||||
return (
|
||||
<div className={cn("rounded-lg border border-zinc-800 p-4", className)}>
|
||||
<div className="flex items-center gap-2 text-zinc-400">
|
||||
<MessageSquare className="h-4 w-4" />
|
||||
<p className="text-sm">No reviews yet</p>
|
||||
</div>
|
||||
<a
|
||||
href={`https://store.steampowered.com/app/${steamAppId}#app_reviews_hash`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-2 inline-flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300"
|
||||
>
|
||||
Be the first to review on Steam <ExternalLink className="h-3 w-3" />
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cn("space-y-4", className)}>
|
||||
{/* Summary header */}
|
||||
@@ -155,22 +210,27 @@ export function SteamReviews({ gameId, steamAppId, className }: SteamReviewsProp
|
||||
</div>
|
||||
|
||||
{/* Pagination */}
|
||||
<div className="flex justify-between">
|
||||
<button
|
||||
onClick={() => fetchReviews(Math.max(0, offset - 5))}
|
||||
disabled={offset === 0 || loading}
|
||||
className="rounded-md border border-zinc-700 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50"
|
||||
>
|
||||
Previous
|
||||
</button>
|
||||
<button
|
||||
onClick={() => fetchReviews(offset + 5)}
|
||||
disabled={loading}
|
||||
className="rounded-md border border-zinc-700 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50"
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
{totalReviews > 5 && (
|
||||
<div className="flex justify-between">
|
||||
<button
|
||||
onClick={() => fetchReviews(Math.max(0, offset - 5))}
|
||||
disabled={offset === 0 || loading}
|
||||
className="rounded-md border border-zinc-700 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50"
|
||||
>
|
||||
Previous
|
||||
</button>
|
||||
<span className="text-xs text-zinc-500 self-center">
|
||||
Showing {offset + 1}-{Math.min(offset + 5, totalReviews)} of {totalReviews}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => fetchReviews(offset + 5)}
|
||||
disabled={offset + 5 >= totalReviews || loading}
|
||||
className="rounded-md border border-zinc-700 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50"
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user