From b3749ecc4b094a46d2ab9f638ee810f70840f67a Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 8 Sep 2026 11:31:46 -0400 Subject: update layout and config and hash --- src/components/ConfigurationTab.tsx | 33 +++++++++++++++++-------- src/components/GameConfigurationSelector.tsx | 23 +++++++++++------ src/components/NowPlayingTab.tsx | 1 - src/components/ProfileDetails.tsx | 37 ++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 18 deletions(-) create mode 100644 src/components/ProfileDetails.tsx (limited to 'src/components') diff --git a/src/components/ConfigurationTab.tsx b/src/components/ConfigurationTab.tsx index b94522a..6ba8f5d 100644 --- a/src/components/ConfigurationTab.tsx +++ b/src/components/ConfigurationTab.tsx @@ -1,10 +1,11 @@ -import { ButtonItem, DialogButton, Field, Focusable, PanelSection, PanelSectionRow } from "@decky/ui"; +import { ButtonItem, DialogButton, Focusable, PanelSection, PanelSectionRow, gamepadDialogClasses } from "@decky/ui"; import { useCallback, useEffect, useRef, useState } from "react"; import { FaArrowLeft } from "react-icons/fa"; import { ConfigurationData } from "../config/configSchema"; import { GameTarget } from "../hooks/useGameConfiguration"; import { GameConfigurationControls } from "./GameConfigurationControls"; import { GameConfigurationSelector } from "./GameConfigurationSelector"; +import { ProfileDetails } from "./ProfileDetails"; interface ConfigurationTabProps { config: ConfigurationData; @@ -105,21 +106,35 @@ export function ConfigurationTab({ - +
+ - + +
+ {profileLabel} +
+
- - - {!selectedTarget?.configured && selectedTarget && ( @@ -141,9 +156,7 @@ export function ConfigurationTab({ Remove profile )} - - - +
); } diff --git a/src/components/GameConfigurationSelector.tsx b/src/components/GameConfigurationSelector.tsx index 15f2465..5f23b91 100644 --- a/src/components/GameConfigurationSelector.tsx +++ b/src/components/GameConfigurationSelector.tsx @@ -11,15 +11,15 @@ interface Props { onResetAll: () => Promise; } -const CONFIGURED_COLLAPSED_KEY = "lsfg-configured-games-collapsed-v2"; -const AVAILABLE_COLLAPSED_KEY = "lsfg-available-games-collapsed"; +const CONFIGURED_COLLAPSED_KEY = "lsfg-configured-games-collapsed-v3"; +const AVAILABLE_COLLAPSED_KEY = "lsfg-available-games-collapsed-v2"; function usePersistentCollapsed(key: string) { const [collapsed, setCollapsed] = useState(() => { try { - return localStorage.getItem(key) === "true"; + return localStorage.getItem(key) !== "false"; } catch { - return false; + return true; } }); @@ -65,9 +65,9 @@ function GameGroup({ onClick={onToggle} > {collapsed ? ( - + ) : ( - + )} @@ -132,7 +132,16 @@ export function GameConfigurationSelector({ targets, runningGame, onSelect, onEn {` .LSFG_GameGroupCollapseButton_Container > div > div > div > button, .LSFG_GameGroupCollapseButton_Container > div > div > div > div > button { - height: 10px !important; + height: 24px !important; + padding: 0 !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + } + + .LSFG_GameGroupCollapseButton_Container svg { + display: block; + margin: 0; } `} diff --git a/src/components/NowPlayingTab.tsx b/src/components/NowPlayingTab.tsx index 8d2d779..2ec12ca 100644 --- a/src/components/NowPlayingTab.tsx +++ b/src/components/NowPlayingTab.tsx @@ -16,7 +16,6 @@ export function NowPlayingTab({ game, config, onConfigChange }: Props) { diff --git a/src/components/ProfileDetails.tsx b/src/components/ProfileDetails.tsx new file mode 100644 index 0000000..056abbb --- /dev/null +++ b/src/components/ProfileDetails.tsx @@ -0,0 +1,37 @@ +import { ButtonItem, Field, Focusable, PanelSectionRow } from "@decky/ui"; +import { useEffect, useRef, useState } from "react"; +import { RiArrowDownSFill, RiArrowUpSFill } from "react-icons/ri"; + +interface ProfileDetailsProps { + description: string; +} + +export function ProfileDetails({ description }: ProfileDetailsProps) { + const [expanded, setExpanded] = useState(false); + const detailsRef = useRef(null); + + useEffect(() => { + if (!expanded) return; + const frame = requestAnimationFrame(() => detailsRef.current?.scrollIntoView({ block: "nearest" })); + return () => cancelAnimationFrame(frame); + }, [expanded]); + + return ( + + + setExpanded((value) => !value)} + > + {expanded ? : } Details + + + {expanded && ( + + + + )} + + ); +} -- cgit v1.2.3