chore: fix lint/type issues from seven-feature integration

This commit is contained in:
2026-05-09 23:35:21 +08:00
parent 085ebb54d4
commit 5ed60ef3cc
6 changed files with 18 additions and 31 deletions
-12
View File
@@ -276,9 +276,6 @@ function HeroInfo({
stats, stats,
session, session,
counts, counts,
coverImage,
imgError,
handleImgError,
platformSupport, platformSupport,
protonDbUrl, protonDbUrl,
steamDbUrl, steamDbUrl,
@@ -290,9 +287,6 @@ function HeroInfo({
stats: StatsResponse | null stats: StatsResponse | null
session: { user?: { id?: string } } | null session: { user?: { id?: string } } | null
counts: Counts counts: Counts
coverImage: string | null
imgError: boolean
handleImgError: () => void
platformSupport: PlatformSupport[] platformSupport: PlatformSupport[]
protonDbUrl: string | null protonDbUrl: string | null
steamDbUrl: string | null steamDbUrl: string | null
@@ -776,9 +770,6 @@ export function GamePageClient({
stats={stats} stats={stats}
session={session} session={session}
counts={counts} counts={counts}
coverImage={coverImage}
imgError={imgError}
handleImgError={handleImgError}
platformSupport={platformSupport} platformSupport={platformSupport}
protonDbUrl={protonDbUrl} protonDbUrl={protonDbUrl}
steamDbUrl={steamDbUrl} steamDbUrl={steamDbUrl}
@@ -817,9 +808,6 @@ export function GamePageClient({
stats={stats} stats={stats}
session={session} session={session}
counts={counts} counts={counts}
coverImage={coverImage}
imgError={imgError}
handleImgError={handleImgError}
platformSupport={platformSupport} platformSupport={platformSupport}
protonDbUrl={protonDbUrl} protonDbUrl={protonDbUrl}
steamDbUrl={steamDbUrl} steamDbUrl={steamDbUrl}
+6 -6
View File
@@ -284,9 +284,9 @@ export default async function GamePage({
estimatedBatteryMin: p.estimatedBatteryMin ?? null, estimatedBatteryMin: p.estimatedBatteryMin ?? null,
tdpWatts: p.tdpWatts ?? null, tdpWatts: p.tdpWatts ?? null,
youtubeVideoId: p.youtubeVideoId ?? null, youtubeVideoId: p.youtubeVideoId ?? null,
screenshots: null, screenshots: null as Array<{ id: string; url: string; width: number; height: number; orderIndex: number }> | null,
hardwareWattHours: null, hardwareWattHours: null as number | null,
hardwareDeviceType: null, hardwareDeviceType: null as string | null,
customSystem: p.customSystem ?? false, customSystem: p.customSystem ?? false,
userNotes: p.userNotes, userNotes: p.userNotes,
userId: p.userId, userId: p.userId,
@@ -319,7 +319,7 @@ export default async function GamePage({
width: ss.width, width: ss.width,
height: ss.height, height: ss.height,
orderIndex: ss.orderIndex, orderIndex: ss.orderIndex,
})) as any }))
const [hw] = await db const [hw] = await db
.select({ .select({
@@ -330,8 +330,8 @@ export default async function GamePage({
.where(eq(hardware.slug, preset.hardwareSlug)) .where(eq(hardware.slug, preset.hardwareSlug))
.limit(1) .limit(1)
preset.hardwareWattHours = hw?.wattHours ? Number(hw.wattHours) : null as any preset.hardwareWattHours = hw?.wattHours ? Number(hw.wattHours) : null
preset.hardwareDeviceType = (hw?.deviceType ?? null) as any preset.hardwareDeviceType = hw?.deviceType ?? null
} }
return ( return (
+3 -5
View File
@@ -269,8 +269,7 @@ export function GamesPageClient({
) )
} }
function FilterPanelContent() { const filterPanelContent = (
return (
<> <>
{/* Device filter */} {/* Device filter */}
<div> <div>
@@ -492,7 +491,6 @@ export function GamesPageClient({
</> </>
) )
}
return ( return (
<section ref={pageRef} className={`w-full flex flex-col gap-8 py-8 ${isGamepadActive ? "gamepad-focus" : ""}`}> <section ref={pageRef} className={`w-full flex flex-col gap-8 py-8 ${isGamepadActive ? "gamepad-focus" : ""}`}>
@@ -608,7 +606,7 @@ export function GamesPageClient({
{/* Mobile drawer */} {/* Mobile drawer */}
<FilterDrawer isOpen={showFilters} onClose={() => setShowFilters(false)}> <FilterDrawer isOpen={showFilters} onClose={() => setShowFilters(false)}>
<div className="flex flex-col gap-3"> <div className="flex flex-col gap-3">
<FilterPanelContent /> {filterPanelContent}
</div> </div>
</FilterDrawer> </FilterDrawer>
@@ -620,7 +618,7 @@ export function GamesPageClient({
exit={{ opacity: 0, height: 0 }} exit={{ opacity: 0, height: 0 }}
className="hidden lg:flex flex-col gap-3 pt-1" className="hidden lg:flex flex-col gap-3 pt-1"
> >
<FilterPanelContent /> {filterPanelContent}
</motion.div> </motion.div>
)} )}
</div> </div>
+5 -4
View File
@@ -32,7 +32,7 @@ export function BatteryLifeChart({ data, deviceNames }: BatteryLifeChartProps) {
} }
// Build trend lines: for each device, compute wattHours / tdp = hours for a range of TDPs // Build trend lines: for each device, compute wattHours / tdp = hours for a range of TDPs
const series: any[] = [] const series: Array<Record<string, unknown>> = []
let seriesIdx = 0 let seriesIdx = 0
for (const [slug, points] of deviceGroups.entries()) { for (const [slug, points] of deviceGroups.entries()) {
@@ -70,9 +70,10 @@ export function BatteryLifeChart({ data, deviceNames }: BatteryLifeChartProps) {
const option = { const option = {
tooltip: { tooltip: {
trigger: "item" as const, trigger: "item" as const,
formatter: (params: any) => { formatter: (params: unknown) => {
if (params.seriesName.includes("(est.)")) return "" const p = params as { seriesName?: string; value?: [number, number] }
return `${params.seriesName}<br/>TDP: ${params.value[0]}W<br/>Battery: ~${params.value[1]}h` if (!p.seriesName || p.seriesName.includes("(est.)")) return ""
return `${p.seriesName}<br/>TDP: ${p.value?.[0]}W<br/>Battery: ~${p.value?.[1]}h`
}, },
}, },
legend: { legend: {
+1 -1
View File
@@ -1,6 +1,6 @@
import { db } from "@/lib/db/index" import { db } from "@/lib/db/index"
import { performanceEntries } from "@/lib/db/schema" import { performanceEntries } from "@/lib/db/schema"
import { eq, and } from "drizzle-orm" import { eq } from "drizzle-orm"
/** /**
* Auto-pin check: an entry is eligible for auto-pinning when: * Auto-pin check: an entry is eligible for auto-pinning when:
+1 -1
View File
@@ -167,7 +167,7 @@ export const screenshotRoutes = new Elysia({ prefix: "/performance" })
// ── List screenshots ──────────────────────────────────────────── // ── List screenshots ────────────────────────────────────────────
.get( .get(
"/:id/screenshots", "/:id/screenshots",
async ({ params, set }) => { async ({ params }) => {
const screenshots = await db const screenshots = await db
.select({ .select({
id: entryScreenshots.id, id: entryScreenshots.id,