diff --git a/backend/decky_loader/utilities.py b/backend/decky_loader/utilities.py index 75593fd5..c74ac5d1 100644 --- a/backend/decky_loader/utilities.py +++ b/backend/decky_loader/utilities.py @@ -82,6 +82,7 @@ def __init__(self, context: PluginManager) -> None: context.ws.add_route("utilities/_call_legacy_utility", self._call_legacy_utility) context.ws.add_route("utilities/enable_plugin", self.enable_plugin) context.ws.add_route("utilities/disable_plugin", self.disable_plugin) + context.ws.add_route("utilities/set_all_plugins_disabled", self.set_all_plugins_disabled) context.web_app.add_routes([ post("/methods/{method_name}", self._handle_legacy_server_method_call) @@ -503,4 +504,13 @@ async def enable_plugin(self, name: str): disabled_plugins.remove(name) await self.set_setting("disabled_plugins", disabled_plugins) - await self.context.plugin_loader.import_plugin(path.join(plugin_dir, "main.py"), plugin_folder) \ No newline at end of file + await self.context.plugin_loader.import_plugin(path.join(plugin_dir, "main.py"), plugin_folder) + + async def set_all_plugins_disabled(self): + disabled_plugins: List[str] = await self.get_setting("disabled_plugins", []) + + for name, _ in self.context.plugin_loader.plugins.items(): + if name not in disabled_plugins: + disabled_plugins.append(name) + + await self.set_setting("disabled_plugins", disabled_plugins) \ No newline at end of file diff --git a/frontend/src/components/DeckyErrorBoundary.tsx b/frontend/src/components/DeckyErrorBoundary.tsx index 7a8d2b31..29638521 100644 --- a/frontend/src/components/DeckyErrorBoundary.tsx +++ b/frontend/src/components/DeckyErrorBoundary.tsx @@ -1,7 +1,7 @@ -import { sleep } from '@decky/ui'; +import { joinClassNames, sleep } from '@decky/ui'; import { FunctionComponent, useEffect, useReducer, useState } from 'react'; -import { uninstallPlugin } from '../plugin'; +import { disablePlugin, uninstallPlugin } from '../plugin'; import { VerInfo, doRestart, doShutdown } from '../updater'; import { ValveReactErrorInfo, getLikelyErrorSourceFromValveReactError } from '../utils/errors'; import { useSetting } from '../utils/hooks/useSetting'; @@ -20,6 +20,26 @@ declare global { } } +const classes = { + root: 'deckyErrorBoundary', + likelyOccurred: 'likely-occured-msg', + panel: 'panel-section', + panelHeader: 'panel-header', + trace: 'trace', + rowList: 'row-list', + rowItem: 'row-item', + buttonDescRow: 'button-description-row', + flexRowWGap: 'flex-row', + marginBottom: 'margin-bottom', + swipePrompt: 'swipe-prompt', +}; + +const vars = { + scrollBarwidth: '18px', + rootMarginLeft: '15px', + panelXPadding: '20px', +}; + export const startSSH = DeckyBackend.callable('utilities/start_ssh'); export const starrCEFForwarding = DeckyBackend.callable('utilities/allow_remote_debugging'); @@ -64,39 +84,131 @@ const DeckyErrorBoundary: FunctionComponent = ({ error, <> -
-

- ⚠️ An error occured while rendering this content. -

-
+      
+
An error occurred while rendering this content.
+
           
             {identifier && `Error Reference: ${identifier}`}
             {versionInfo?.current && `\nDecky Version: ${versionInfo.current}`}
           
         
-

This error likely occured in {errorSource}.

+
+ This error likely occurred in {errorSource}. +
{actionLog?.length > 0 && (
             
@@ -106,142 +218,88 @@ const DeckyErrorBoundary: FunctionComponent = ({ error,
           
)} {actionsEnabled && ( - <> -

Actions:

-

Use the touch screen.

-
- - -
-
- - +
+
+
Actions
+
+ Use the touch screen. Solutions are listed in the recommended order. If you are still experiencing + issues, please post in the #loader-support channel at decky.xyz/discord. +
- {debugAllowed && ( -
- +
+
+ Retry the action or restart +
+ + + +
- )} - { -
- {updateProgress > -1 - ? 'Update in progress... ' + updateProgress + '%' - : updateProgress == -2 - ? 'Update complete. Restarting...' - : 'Changing your Decky Loader branch and/or \n checking for updates might help!\n'} - {updateProgress == -1 && ( -
- + Disable {errorSource} +
- )} -
- } - {wasCausedByPlugin && ( -
- {'\n'} +
+ )} +
+ Disable all plugins +
+ { +
+ {updateProgress > -1 + ? 'Update in progress... ' + updateProgress + '%' + : updateProgress == -2 + ? 'Update complete. Restarting...' + : 'Check for Decky updates'} + { +
+ {updateProgress == -1 && ( + <> + + + + )} +
+ } +
+ } +
+ Disable Decky until next boot +
- )} - + {debugAllowed && ( +
+ Enable remote debugging and SSH until next boot (for developers) + +
+ )} +
+
)} - -
-          
-            {error.error.stack}
-            {'\n\n'}
-            Component Stack:
-            {error.info.componentStack}
-          
-        
+ {actionsEnabled && ( +
+ Swipe to scroll +
+ )} +
+
Trace
+
+            
+              {error.error.stack}
+              {'\n\n'}
+              Component Stack:
+              {error.info.componentStack}
+            
+          
+
);