From d7115074060a3e9e682d511eae3c47a1c64042b8 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Thu, 10 Sep 2026 14:32:16 -0400 Subject: refactor: wrap only direct Flatpak shortcut targets --- src/components/ConfigurationTab.tsx | 12 ---------- src/components/Content.tsx | 7 +++++- src/components/GameConfigurationSelector.tsx | 2 +- src/components/NowPlayingTab.tsx | 35 +--------------------------- src/components/SetupTab.tsx | 33 +++++++++++++++++++++++++- 5 files changed, 40 insertions(+), 49 deletions(-) (limited to 'src/components') diff --git a/src/components/ConfigurationTab.tsx b/src/components/ConfigurationTab.tsx index 4e2d93d..4031a9a 100644 --- a/src/components/ConfigurationTab.tsx +++ b/src/components/ConfigurationTab.tsx @@ -182,18 +182,6 @@ export function ConfigurationTab({ )} - {selectedTarget?.configured && selectedTarget.transport.kind === "flatpak" && selectedTarget.flatpakSupport?.support_status !== "ready" && ( - - - void onRepair(selectedTarget.appid)} - > - Repair Flatpak support - - - - )} {selectedTarget?.configured && ( void install()} onUninstall={() => void uninstall()} + onRepairFlatpak={() => void repairFlatpak()} /> ); @@ -132,7 +138,6 @@ export function Content() { game={runningGame} config={config} onConfigChange={(field, value) => handleConfigChange(field, value)} - onRepair={repair} /> ), }] : []), diff --git a/src/components/GameConfigurationSelector.tsx b/src/components/GameConfigurationSelector.tsx index 92eacba..8e0e3be 100644 --- a/src/components/GameConfigurationSelector.tsx +++ b/src/components/GameConfigurationSelector.tsx @@ -137,7 +137,7 @@ export function GameConfigurationSelector({ showModal( void onEnableAll()} diff --git a/src/components/NowPlayingTab.tsx b/src/components/NowPlayingTab.tsx index 57858db..9a69060 100644 --- a/src/components/NowPlayingTab.tsx +++ b/src/components/NowPlayingTab.tsx @@ -1,5 +1,4 @@ -import { ButtonItem, Field, Focusable, PanelSection, PanelSectionRow } from "@decky/ui"; -import { useState } from "react"; +import { Field, Focusable, PanelSection, PanelSectionRow } from "@decky/ui"; import { ConfigurationData } from "../config/configSchema"; import { GameTarget } from "../hooks/useGameConfiguration"; import { GameConfigurationControls } from "./GameConfigurationControls"; @@ -11,7 +10,6 @@ interface Props { fieldName: keyof ConfigurationData, value: boolean | number | string | string[], ) => Promise; - onRepair: (appid: string) => Promise; } function targetDescription(game: GameTarget): string { @@ -23,23 +21,7 @@ export function NowPlayingTab({ game, config, onConfigChange, - onRepair, }: Props) { - const [busy, setBusy] = useState(false); - const supportNeedsRepair = - game.transport.kind === "flatpak" && - game.flatpakSupport?.support_status !== "ready"; - - const handleRepair = async () => { - if (busy) return; - setBusy(true); - try { - await onRepair(game.appid); - } finally { - setBusy(false); - } - }; - return ( @@ -47,21 +29,6 @@ export function NowPlayingTab({ - {supportNeedsRepair && ( - - - - - - void handleRepair()}> - {busy ? "Repairing..." : "Repair Flatpak support"} - - - - )} void; onUninstall: () => void; + onRepairFlatpak: () => void; } export function SetupTab(props: SetupTabProps) { @@ -20,11 +23,14 @@ export function SetupTab(props: SetupTabProps) { installationStatus, losslessScalingInstalled, losslessScalingStatus, + flatpakStatus, steamBranchStatus, isInstalling, isUninstalling, + isRepairingFlatpak, onInstall, onUninstall, + onRepairFlatpak, } = props; const losslessScalingAppInstalled = losslessScalingInstalled || steamBranchStatus?.installed === true; const buttonLabel = isInstalling @@ -46,6 +52,31 @@ export function SetupTab(props: SetupTabProps) { + + + + {flatpakStatus?.available && !flatpakStatus.ready && ( + + + {isRepairingFlatpak ? "Repairing Flatpak support..." : "Repair Flatpak support"} + + + )} {steamBranchStatus?.installed && (