From 0b738820122ad859182e4403af29ae4dacb06084 Mon Sep 17 00:00:00 2001 From: Alexander Maslov <30986874+steam3d@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:21:49 +0300 Subject: Simplify the typing of the plugin URL for users (#769) * Simplify the typing of the plugin URL for the user. Make the http/https prefix optional. * Fixed the formatting using prettier --write --- frontend/src/components/settings/pages/developer/index.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'frontend/src') diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx index 099f2610..05989806 100644 --- a/frontend/src/components/settings/pages/developer/index.tsx +++ b/frontend/src/components/settings/pages/developer/index.tsx @@ -72,7 +72,16 @@ export default function DeveloperSettings() { } icon={} > - installFromURL(pluginURL)}> + { + if (/^https?:\/\//.test(pluginURL)) { + installFromURL(pluginURL); + } else { + installFromURL('https://' + pluginURL); + } + }} + > {t('SettingsDeveloperIndex.third_party_plugins.button_install')} -- cgit v1.2.3 From 6e357ceecc86d60791eb8b8efcf6d182add36b63 Mon Sep 17 00:00:00 2001 From: shadow <81448108+shdwmtr@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:45:33 -0300 Subject: fix(deps): update @decky/ui to version 4.10.2 (#782) * fix(deps): update @decky/ui to version 4.10.1 * chore(deps): bump @decky/ui 4.8.3 -> 4.10.1 * fix(types): UIMode -> EUIMode * fix(types): bypass missing type in library.ts * fix: lint --------- Co-authored-by: AAGaming --- frontend/src/components/modals/filepicker/patches/library.ts | 2 +- frontend/src/plugin-loader.tsx | 7 ++++--- frontend/src/router-hook.tsx | 10 +++------- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/components/modals/filepicker/patches/library.ts b/frontend/src/components/modals/filepicker/patches/library.ts index 3b7fa679..b0930a5e 100644 --- a/frontend/src/components/modals/filepicker/patches/library.ts +++ b/frontend/src/components/modals/filepicker/patches/library.ts @@ -47,7 +47,7 @@ export default async function libraryPatch() { } const unlisten = History.listen(() => { - if (window.SteamClient.Apps.PromptToChangeShortcut !== patch.patchedFunction) { + if ((window.SteamClient.Apps as any).PromptToChangeShortcut !== patch.patchedFunction) { rePatch(); } }); diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index 88e85a48..df0a6956 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -1,5 +1,6 @@ import { ToastNotification } from '@decky/api'; import { + EUIMode, ModalRoot, Navigation, PanelSection, @@ -30,7 +31,7 @@ import { HiddenPluginsService } from './hidden-plugins-service'; import Logger from './logger'; import { NotificationService } from './notification-service'; import { InstallType, Plugin, PluginLoadType } from './plugin'; -import RouterHook, { UIMode } from './router-hook'; +import RouterHook from './router-hook'; import { deinitSteamFixes, initSteamFixes } from './steamfixes'; import { checkForPluginUpdates } from './store'; import TabsHook from './tabs-hook'; @@ -205,12 +206,12 @@ class PluginLoader extends Logger { let registration: any; const uiMode = await new Promise( (r) => - (registration = SteamClient.UI.RegisterForUIModeChanged((mode: UIMode) => { + (registration = SteamClient.UI.RegisterForUIModeChanged((mode: EUIMode) => { r(mode); registration.unregister(); })), ); - if (uiMode == UIMode.BigPicture) { + if (uiMode == EUIMode.GamePad) { // wait for SP window to exist before loading plugins while (!findSP()) { await sleep(100); diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx index 9612793a..b3355d76 100644 --- a/frontend/src/router-hook.tsx +++ b/frontend/src/router-hook.tsx @@ -1,4 +1,5 @@ import { + EUIMode, ErrorBoundary, Patch, afterPatch, @@ -31,11 +32,6 @@ declare global { } } -export enum UIMode { - BigPicture = 4, - Desktop = 7, -} - const isPatched = Symbol('is patched'); class RouterHook extends Logger { @@ -76,13 +72,13 @@ class RouterHook extends Logger { this.error('Failed to find router stack module'); } - this.modeChangeRegistration = SteamClient.UI.RegisterForUIModeChanged((mode: UIMode) => { + this.modeChangeRegistration = SteamClient.UI.RegisterForUIModeChanged((mode: EUIMode) => { this.debug(`UI mode changed to ${mode}`); if (this.patchedModes.has(mode)) return; this.patchedModes.add(mode); this.debug(`Patching router for UI mode ${mode}`); switch (mode) { - case UIMode.BigPicture: + case EUIMode.GamePad: this.debug('Patching gamepad router'); this.patchGamepadRouter(); break; -- cgit v1.2.3 From 414493eed2bea2ceb13c9add216d6f9e7f9c5903 Mon Sep 17 00:00:00 2001 From: marios Date: Sun, 29 Jun 2025 21:36:48 +0300 Subject: Add Decky branch switcher and updater to error boundary (#775) * Add Decky branch switcher and updater to error boundary * Linting fixup * Update DeckyErrorBoundary.tsx Allow for plugins to trigger new behavior. * Lint fixup --- frontend/src/components/DeckyErrorBoundary.tsx | 82 ++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'frontend/src') diff --git a/frontend/src/components/DeckyErrorBoundary.tsx b/frontend/src/components/DeckyErrorBoundary.tsx index 654db8a0..7a8d2b31 100644 --- a/frontend/src/components/DeckyErrorBoundary.tsx +++ b/frontend/src/components/DeckyErrorBoundary.tsx @@ -4,6 +4,8 @@ import { FunctionComponent, useEffect, useReducer, useState } from 'react'; import { uninstallPlugin } from '../plugin'; import { VerInfo, doRestart, doShutdown } from '../updater'; import { ValveReactErrorInfo, getLikelyErrorSourceFromValveReactError } from '../utils/errors'; +import { useSetting } from '../utils/hooks/useSetting'; +import { UpdateBranch } from './settings/pages/general/BranchSelect'; interface DeckyErrorBoundaryProps { error: ValveReactErrorInfo; @@ -37,6 +39,27 @@ const DeckyErrorBoundary: FunctionComponent = ({ error, if (!shouldReportToValve) DeckyPluginLoader.errorBoundaryHook.temporarilyDisableReporting(); DeckyPluginLoader.updateVersion().then(setVersionInfo); }, []); + + const [selectedBranch, setSelectedBranch] = useSetting('branch', UpdateBranch.Stable); + const [isChecking, setIsChecking] = useState(false); + const [updateProgress, setUpdateProgress] = useState(-1); + const [versionToUpdateTo, setSetVersionToUpdateTo] = useState(''); + + useEffect(() => { + const a = DeckyBackend.addEventListener('updater/update_download_percentage', (percentage) => { + setUpdateProgress(percentage); + }); + + const b = DeckyBackend.addEventListener('updater/finish_download', () => { + setUpdateProgress(-2); + }); + + return () => { + DeckyBackend.removeEventListener('updater/update_download_percentage', a); + DeckyBackend.removeEventListener('updater/finish_download', b); + }; + }, []); + return ( <> + + (
@@ -57,11 +71,11 @@ function PatchNotesModal({ versionInfo, closeModal }: { versionInfo: VerInfo | n nItemMarginX={0} initialColumn={0} autoFocus={true} - fnGetColumnWidth={() => SP.innerWidth} + fnGetColumnWidth={() => SP.innerWidth - SP.innerWidth * (10 / 100)} name={t('Updater.decky_updates') as string} /> - - + + ); } -- cgit v1.2.3