fix(plugin): game URL by steamAppId, inline dropdown to save vertical space

This commit is contained in:
2026-07-13 06:28:41 +08:00
parent c80c1d5775
commit d409e27a95
@@ -74,8 +74,8 @@ export default function LibraryAppPanel({ appId, title, hardwareSlug, baseUrl }:
.map((d) => ({ label: `${d.name} (${d.count})`, data: d.slug })), .map((d) => ({ label: `${d.name} (${d.count})`, data: d.slug })),
] ]
const gameUrl = data?.game?.slug const gameUrl = data?.game?.steamAppId
? `${baseUrl}/games/${data.game.slug}` ? `${baseUrl}/game/${data.game.steamAppId}`
: `${baseUrl}/games` : `${baseUrl}/games`
if (loading) { if (loading) {
@@ -110,11 +110,12 @@ export default function LibraryAppPanel({ appId, title, hardwareSlug, baseUrl }:
return ( return (
<> <>
{/* Centered stats row */} {/* Stats + device dropdown inline */}
<PanelSectionRow> <PanelSectionRow>
<div className={staticClasses.Text} style={{ padding: "4px 0", fontSize: "13px", textAlign: "center" }}> <div className={staticClasses.Text} style={{ display: "flex", alignItems: "center", justifyContent: "space-between", gap: "8px", padding: "2px 0", fontSize: "13px" }}>
<span style={{ flex: 1, textAlign: "center" }}>
{data.estFps ? ( {data.estFps ? (
<span style={{ display: "inline-flex", flexWrap: "wrap", gap: "4px 10px", justifyContent: "center" }}> <span style={{ display: "inline-flex", flexWrap: "wrap", gap: "4px 8px", justifyContent: "center" }}>
<span><strong>{data.estFps.avg}</strong> <span style={{ opacity: 0.4 }}>avg</span></span> <span><strong>{data.estFps.avg}</strong> <span style={{ opacity: 0.4 }}>avg</span></span>
{data.estFps.onePct != null && <span><strong>{data.estFps.onePct}</strong> <span style={{ opacity: 0.4 }}>1% low</span></span>} {data.estFps.onePct != null && <span><strong>{data.estFps.onePct}</strong> <span style={{ opacity: 0.4 }}>1% low</span></span>}
{data.estFps.low != null && <span><strong>{data.estFps.low}</strong> <span style={{ opacity: 0.4 }}>min</span></span>} {data.estFps.low != null && <span><strong>{data.estFps.low}</strong> <span style={{ opacity: 0.4 }}>min</span></span>}
@@ -125,16 +126,13 @@ export default function LibraryAppPanel({ appId, title, hardwareSlug, baseUrl }:
) : ( ) : (
<span style={{ opacity: 0.4, fontSize: "12px" }}>No data yet</span> <span style={{ opacity: 0.4, fontSize: "12px" }}>No data yet</span>
)} )}
</div> </span>
</PanelSectionRow>
{/* Device dropdown */}
<PanelSectionRow>
<DropdownItem <DropdownItem
rgOptions={deviceOptions} rgOptions={deviceOptions}
selectedOption={device} selectedOption={device}
onChange={(opt) => setDevice(opt.data as string)} onChange={(opt) => setDevice(opt.data as string)}
/> />
</div>
</PanelSectionRow> </PanelSectionRow>
{/* View Details button */} {/* View Details button */}