+
+
+ );
+}
diff --git a/src/components/README.md b/src/components/README.md
new file mode 100644
index 0000000..19c50a7
--- /dev/null
+++ b/src/components/README.md
@@ -0,0 +1,55 @@
+# Components Structure
+
+This directory contains the organized component structure for the Decky Framegen plugin.
+
+## Component Hierarchy
+
+### Main Orchestrator
+- **`OptiScalerControls.tsx`** - Main component that orchestrates all OptiScaler functionality and state management
+
+### Sub-components (Logical Sections)
+- **`InstallationStatus.tsx`** - Shows installation status and setup button when mod is not installed
+- **`OptiScalerHeader.tsx`** - Displays the OptiScaler logo/image when installed
+- **`ClipboardCommands.tsx`** - Contains the patch/unpatch command copy buttons
+- **`InstructionCard.tsx`** - Shows usage instructions and help text
+- **`OptiScalerWiki.tsx`** - Wiki documentation button
+- **`UninstallButton.tsx`** - Red remove/uninstall button
+
+### Utility Components
+- **`SmartClipboardButton.tsx`** - Reusable clipboard copy button component
+- **`ResultDisplay.tsx`** - Display component for operation results
+
+### Other Components
+- **`InstalledGamesSection.tsx`** - Games section component (currently commented out)
+
+## State Management
+
+All state is managed in the main `OptiScalerControls` component:
+- `pathExists` - Whether the mod is installed
+- `installing` - Installation progress state
+- `uninstalling` - Uninstallation progress state
+- `installResult` - Result of installation operation
+- `uninstallResult` - Result of uninstallation operation
+
+## Component Flow
+
+1. **Not Installed State**: Shows `InstallationStatus` with setup button
+2. **Installed State**: Shows all components in order:
+ - OptiScaler header image
+ - Clipboard command buttons
+ - Instruction card
+ - Wiki button
+ - Uninstall button (red)
+
+## Benefits of This Structure
+
+- **Separation of Concerns**: Each component has a single responsibility
+- **Reusability**: Components can be easily reused or rearranged
+- **Maintainability**: Easier to find and modify specific functionality
+- **Testability**: Smaller components are easier to test
+- **State Management**: Centralized state in the orchestrator component
+- **Clean Imports**: Barrel exports through `index.ts` for cleaner imports
+
+## Clean Architecture
+
+All legacy components have been removed and replaced with this organized structure. The codebase is now clean and follows modern React patterns.
diff --git a/src/components/UninstallButton.tsx b/src/components/UninstallButton.tsx
new file mode 100644
index 0000000..1f55548
--- /dev/null
+++ b/src/components/UninstallButton.tsx
@@ -0,0 +1,29 @@
+import { PanelSectionRow, ButtonItem } from "@decky/ui";
+import { MESSAGES } from "../utils/constants";
+
+interface UninstallButtonProps {
+ pathExists: boolean | null;
+ uninstalling: boolean;
+ onUninstallClick: () => void;
+}
+
+export function UninstallButton({ pathExists, uninstalling, onUninstallClick }: UninstallButtonProps) {
+ if (pathExists !== true) return null;
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/components/index.ts b/src/components/index.ts
new file mode 100644
index 0000000..3f67341
--- /dev/null
+++ b/src/components/index.ts
@@ -0,0 +1,10 @@
+// Component exports for cleaner imports
+export { OptiScalerControls } from './OptiScalerControls';
+export { InstallationStatus } from './InstallationStatus';
+export { OptiScalerHeader } from './OptiScalerHeader';
+export { ClipboardCommands } from './ClipboardCommands';
+export { InstructionCard } from './InstructionCard';
+export { OptiScalerWiki } from './OptiScalerWiki';
+export { UninstallButton } from './UninstallButton';
+export { SmartClipboardButton } from './SmartClipboardButton';
+export { ResultDisplay } from './ResultDisplay';
diff --git a/src/exports.ts b/src/exports.ts
index a95f7b6..56c2292 100644
--- a/src/exports.ts
+++ b/src/exports.ts
@@ -1,5 +1,5 @@
// Re-export components
-export { FGModInstallerSection } from './components/FGModInstallerSection';
+export { OptiScalerControls } from './components';
export { InstalledGamesSection } from './components/InstalledGamesSection';
export { ResultDisplay } from './components/ResultDisplay';
diff --git a/src/index.tsx b/src/index.tsx
index 5cf59e4..0ea93e0 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,9 +1,8 @@
import { definePlugin } from "@decky/api";
import { MdOutlineAutoAwesomeMotion } from "react-icons/md";
import { useState, useEffect } from "react";
-import { FGModInstallerSection } from "./components/FGModInstallerSection";
+import { OptiScalerControls } from "./components";
// import { InstalledGamesSection } from "./components/InstalledGamesSection";
-import { DocumentationButton } from "./components/DocumentationButton";
import { checkFGModPath } from "./api";
import { safeAsyncOperation } from "./utils";
import { TIMEOUTS } from "./utils/constants";
@@ -27,11 +26,10 @@ function MainContent() {
return (
<>
-
+
{pathExists === true ? (
<>
{/* */}
-
>
) : null}
>
@@ -39,12 +37,12 @@ function MainContent() {
}
export default definePlugin(() => ({
- name: "Framegen Plugin",
+ name: "Decky Framegen",
titleView:
Decky Framegen
,
alwaysRender: true,
content: ,
icon: ,
onDismount() {
- console.log("Framegen Plugin unmounted");
+ console.log("Decky Framegen Plugin unmounted");
},
}));
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index c406e5b..1f583c0 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -62,5 +62,5 @@ export const MESSAGES = {
installSuccess: "✅ OptiScaler mod setup successfully!",
uninstallSuccess: "✅ OptiScaler mod removed successfully.",
instructionTitle: "How to Use:",
- instructionText: "Click 'Copy Patch Command' or 'Copy Unpatch Command', then go to your game's properties, and paste the command into the Launch Options field.\n\nIn-game: Enable DLSS in graphics settings, or assign a back button to keyboard's 'Insert' key for extended OptiScaler options."
+ instructionText: "Click 'Copy Patch Command' or 'Copy Unpatch Command', then go to your game's properties, and paste the command into the Launch Options field.\n\nIn-game: Enable DLSS in graphics settings to unlock FSR 3.1/XeSS 2.0 in DirectX12 Games.\n\nFor extended OptiScaler options, assign a back button to a keyboard's 'Insert' key."
};
--
cgit v1.2.3