From c22c11714150d53701016efe2daeb5cd02ae02a3 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Fri, 26 Sep 2025 20:38:49 -0400 Subject: ui cleanup --- justfile | 2 +- src/components/CustomPathOverride.tsx | 36 ++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/justfile b/justfile index 4407567..3059bf9 100644 --- a/justfile +++ b/justfile @@ -8,5 +8,5 @@ test: scp "out/Decky Framegen.zip" deck@192.168.0.6:~/Desktop clean: - rm -rf node_modules dist + sudo rm -rf node_modules dist sudo rm -rf /tmp/decky \ No newline at end of file diff --git a/src/components/CustomPathOverride.tsx b/src/components/CustomPathOverride.tsx index b28a8de..26e5c8f 100644 --- a/src/components/CustomPathOverride.tsx +++ b/src/components/CustomPathOverride.tsx @@ -61,6 +61,7 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = const [isPatching, setIsPatching] = useState(false); const [isUnpatching, setIsUnpatching] = useState(false); const [operationResult, setOperationResult] = useState(null); + const [lastOperation, setLastOperation] = useState<"patch" | "unpatch" | null>(null); useEffect(() => { let cancelled = false; @@ -94,6 +95,7 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = setEnabled(false); setPickerState(INITIAL_PICKER_STATE); setOperationResult(null); + setLastOperation(null); } }, [isAvailable]); @@ -101,6 +103,13 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = const selectedPath = pickerState.selectedPath; const statusMessage = useMemo(() => formatResultMessage(operationResult), [operationResult]); const wasSuccessful = operationResult?.status === "success"; + const statusLabel = useMemo(() => { + if (!operationResult || !lastOperation) return null; + if (operationResult.status === "success") { + return lastOperation === "patch" ? "Game patched" : "Game unpatched"; + } + return lastOperation === "patch" ? "Patch failed" : "Unpatch failed"; + }, [lastOperation, operationResult]); const openDirectoryPicker = useCallback(async () => { const candidates = [ @@ -146,6 +155,7 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = if (!selectedPath) return; const setBusy = action === "patch" ? setIsPatching : setIsUnpatching; + setLastOperation(action); setBusy(true); setOperationResult(null); @@ -177,6 +187,7 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = if (!value) { setPickerState(INITIAL_PICKER_STATE); setOperationResult(null); + setLastOperation(null); } }; @@ -204,9 +215,7 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = Select directory @@ -230,7 +239,21 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = label="Target directory" description="OptiScaler files will be copied here." > - {selectedPath} +
+ {selectedPath} +
@@ -259,10 +282,9 @@ export const ManualPatchControls = ({ isAvailable }: ManualPatchControlsProps) = {operationResult && ( - {statusMessage} + {!wasSuccessful && statusMessage ? statusMessage : null} )} -- cgit v1.2.3