From d1f8263bf9f22753ad53e1b0105172a3bd0faf5f Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
Date: Sun, 6 Sep 2026 23:12:28 -0400
Subject: feat: organize game profiles and focus enabled settings

---
 src/components/ConfigurationTab.tsx | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

(limited to 'src/components/ConfigurationTab.tsx')

diff --git a/src/components/ConfigurationTab.tsx b/src/components/ConfigurationTab.tsx
index dab6f19..6c4a99a 100644
--- a/src/components/ConfigurationTab.tsx
+++ b/src/components/ConfigurationTab.tsx
@@ -1,5 +1,5 @@
 import { ButtonItem, Field, Focusable, PanelSection, PanelSectionRow } from "@decky/ui";
-import { useEffect, useRef, useState } from "react";
+import { useCallback, useEffect, useRef, useState } from "react";
 import { ConfigurationData } from "../config/configSchema";
 import { GameTarget } from "../hooks/useGameConfiguration";
 import { GameConfigurationControls } from "./GameConfigurationControls";
@@ -27,7 +27,13 @@ export function ConfigurationTab({
   onResetAll,
 }: ConfigurationTabProps) {
   const [detailAppId, setDetailAppId] = useState<string | null>(null);
+  const [focusFpsMultiplier, setFocusFpsMultiplier] = useState(false);
   const promptedRunningAppId = useRef<string | null>(null);
+  const closeDetails = useCallback(() => {
+    setFocusFpsMultiplier(false);
+    setDetailAppId(null);
+  }, []);
+  const clearFpsFocusRequest = useCallback(() => setFocusFpsMultiplier(false), []);
 
   useEffect(() => {
     if (!runningGame || runningGame.configured) {
@@ -59,22 +65,28 @@ export function ConfigurationTab({
   }
 
   const profileLabel = selectedTarget?.name || "Game profile";
-  const running = selectedTarget?.appid === runningGame?.appid;
   const profileDescription = selectedTarget
-    ? `${selectedTarget.nonSteam ? "Non-Steam" : "Steam"} · App ID ${selectedTarget.appid} · ${selectedTarget.configured ? running && !runningGame?.configured ? "Profile saved · applies next launch" : "Profile active" : "Not configured · changes apply next launch"}`
+    ? `${selectedTarget.nonSteam ? "Non-Steam" : "Steam"} · App ID ${selectedTarget.appid} · ${selectedTarget.configured ? "Configured" : "Not configured"}`
     : "Game is no longer available";
 
   return (
-    <Focusable onCancelButton={() => setDetailAppId(null)}>
+    <Focusable onCancelButton={closeDetails}>
       <PanelSection title="Game Profile">
         <PanelSectionRow>
           <Field label={profileLabel} description={profileDescription} />
         </PanelSectionRow>
         <PanelSectionRow>
-          <ButtonItem layout="below" onClick={() => setDetailAppId(null)}>Back to games</ButtonItem>
+          <ButtonItem layout="below" onClick={closeDetails}>Back to games</ButtonItem>
         </PanelSectionRow>
       </PanelSection>
-      <GameConfigurationControls config={config} onConfigChange={onConfigChange} />
+      {selectedTarget?.configured && (
+        <GameConfigurationControls
+          config={config}
+          onConfigChange={onConfigChange}
+          autoFocusFpsMultiplier={focusFpsMultiplier}
+          onFpsMultiplierFocused={clearFpsFocusRequest}
+        />
+      )}
       <PanelSectionRow>
         <ButtonItem
           layout="below"
@@ -82,9 +94,9 @@ export function ConfigurationTab({
             if (selectedTarget?.configured) {
               promptedRunningAppId.current = detailAppId;
               await onReset();
-              setDetailAppId(null);
+              closeDetails();
             } else if (detailAppId) {
-              await onEnable(detailAppId);
+              if (await onEnable(detailAppId)) setFocusFpsMultiplier(true);
             }
           }}
         >
-- 
cgit v1.2.3

