summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 14:32:16 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 14:32:16 -0400
commitd7115074060a3e9e682d511eae3c47a1c64042b8 (patch)
tree84362580dc7ab5d72be7d3ccf811d99c66d893d5 /src/components
parent684929fe850b744ef841475f88cf2a3189fbb986 (diff)
downloaddecky-lsfg-vk-d7115074060a3e9e682d511eae3c47a1c64042b8.tar.gz
decky-lsfg-vk-d7115074060a3e9e682d511eae3c47a1c64042b8.zip
refactor: wrap only direct Flatpak shortcut targets
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ConfigurationTab.tsx12
-rw-r--r--src/components/Content.tsx7
-rw-r--r--src/components/GameConfigurationSelector.tsx2
-rw-r--r--src/components/NowPlayingTab.tsx35
-rw-r--r--src/components/SetupTab.tsx33
5 files changed, 40 insertions, 49 deletions
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({
</PanelSectionRow>
)}
</PanelSection>
- {selectedTarget?.configured && selectedTarget.transport.kind === "flatpak" && selectedTarget.flatpakSupport?.support_status !== "ready" && (
- <PanelSection>
- <PanelSectionRow>
- <ButtonItem
- layout="below"
- onClick={() => void onRepair(selectedTarget.appid)}
- >
- Repair Flatpak support
- </ButtonItem>
- </PanelSectionRow>
- </PanelSection>
- )}
{selectedTarget?.configured && (
<GameConfigurationControls
config={config}
diff --git a/src/components/Content.tsx b/src/components/Content.tsx
index 43720c0..d2093cd 100644
--- a/src/components/Content.tsx
+++ b/src/components/Content.tsx
@@ -59,11 +59,14 @@ export function Content() {
installationStatus,
losslessScalingInstalled,
losslessScalingStatus,
+ flatpakStatus,
steamBranchStatus,
isInstalling,
isUninstalling,
+ isRepairingFlatpak,
install,
uninstall,
+ repairFlatpak,
} = useInstallation(reload);
const [tab, setTab] = useState("Setup");
const [showDebugTab, setShowDebugTab] = usePersistentBoolean(DEBUG_TAB_VISIBILITY_KEY, true);
@@ -114,11 +117,14 @@ export function Content() {
installationStatus={installationStatus}
losslessScalingInstalled={losslessScalingInstalled}
losslessScalingStatus={losslessScalingStatus}
+ flatpakStatus={flatpakStatus}
steamBranchStatus={steamBranchStatus}
isInstalling={isInstalling}
isUninstalling={isUninstalling}
+ isRepairingFlatpak={isRepairingFlatpak}
onInstall={() => 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(
<ConfirmModal
strTitle="Enable all available games?"
- strDescription="Create individual LSFG-VK profiles for every available game using the plugin defaults. Flatpak targets will be provisioned as needed."
+ strDescription="Create individual LSFG-VK profiles for every available game using the plugin defaults. Flatpak support is configured globally."
strOKButtonText="Enable all"
strCancelButtonText="Cancel"
onOK={() => 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<void>;
- onRepair: (appid: string) => Promise<boolean>;
}
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 (
<Focusable>
<PanelSection title="Now Playing">
@@ -47,21 +29,6 @@ export function NowPlayingTab({
<Field label={game.name} description={targetDescription(game)} />
</PanelSectionRow>
</PanelSection>
- {supportNeedsRepair && (
- <PanelSection>
- <PanelSectionRow>
- <Field
- label="Flatpak support needs repair"
- description={game.flatpakSupport?.error || "The target runtime extension is not ready."}
- />
- </PanelSectionRow>
- <PanelSectionRow>
- <ButtonItem layout="below" disabled={busy} onClick={() => void handleRepair()}>
- {busy ? "Repairing..." : "Repair Flatpak support"}
- </ButtonItem>
- </PanelSectionRow>
- </PanelSection>
- )}
<GameConfigurationControls
config={config}
onConfigChange={onConfigChange}
diff --git a/src/components/SetupTab.tsx b/src/components/SetupTab.tsx
index d769200..0095a7b 100644
--- a/src/components/SetupTab.tsx
+++ b/src/components/SetupTab.tsx
@@ -1,5 +1,5 @@
import { ButtonItem, Field, PanelSection, PanelSectionRow } from "@decky/ui";
-import { type SteamBranchStatus } from "../api/lsfgApi";
+import { type FlatpakExtensionStatus, type SteamBranchStatus } from "../api/lsfgApi";
import t from "../i18n/i18n";
interface SetupTabProps {
@@ -7,11 +7,14 @@ interface SetupTabProps {
installationStatus: string;
losslessScalingInstalled: boolean;
losslessScalingStatus: string;
+ flatpakStatus: FlatpakExtensionStatus | null;
steamBranchStatus: SteamBranchStatus | null;
isInstalling: boolean;
isUninstalling: boolean;
+ isRepairingFlatpak: boolean;
onInstall: () => 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) {
<PanelSectionRow>
<Field label="LSFG-VK" description={installationStatus} />
</PanelSectionRow>
+ <PanelSectionRow>
+ <Field
+ label="Flatpak support"
+ description={
+ !flatpakStatus
+ ? "Status unavailable"
+ : !flatpakStatus.available
+ ? "Flatpak is not available"
+ : flatpakStatus.ready
+ ? "Configured for 23.08, 24.08, and 25.08"
+ : flatpakStatus.error || "Needs repair"
+ }
+ />
+ </PanelSectionRow>
+ {flatpakStatus?.available && !flatpakStatus.ready && (
+ <PanelSectionRow>
+ <ButtonItem
+ layout="below"
+ onClick={onRepairFlatpak}
+ disabled={isRepairingFlatpak || isInstalling || isUninstalling}
+ >
+ {isRepairingFlatpak ? "Repairing Flatpak support..." : "Repair Flatpak support"}
+ </ButtonItem>
+ </PanelSectionRow>
+ )}
{steamBranchStatus?.installed && (
<PanelSectionRow>
<Field