summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorÁlvaro Cuesta <1827495+alvaro-cuesta@users.noreply.github.com>2025-01-02 20:38:40 +0100
committerGitHub <noreply@github.com>2025-01-02 11:38:40 -0800
commitf6144f9634482d6bd0ed88a31495c6c6c88add96 (patch)
tree21797e504d62c33c1514870a457e36d3b4f3cbac /backend
parent79bb62a3c4f69dbd57dc037da1269285cae1b26d (diff)
downloaddecky-loader-f6144f9634482d6bd0ed88a31495c6c6c88add96.tar.gz
decky-loader-f6144f9634482d6bd0ed88a31495c6c6c88add96.zip
feat: sync with local plugin status in store (#733)v3.1.0-pre1
* fix: useDeckyState proper type and safety * refactor: plugin list Avoids unneeded re-renders. See https://react.dev/learn/you-might-not-need-an-effect#caching-expensive-calculations * feat: sync with local plugin status in store Adds some QoL changes to the plugin store browser: - Add ✓ icon to currently installed plugin version in version selector - Change install button label depending on the install type that the button would trigger - Adds icon to install button for clarity The goal is to make it clear to the user what the current state of the installed plugin is, and what would be the impact of installing the selected version. Resolves #360 * lint: prettier * fix: add missing translations * refactor: safer translation strings on install Prefer using `t(...)` instead of `TranslationHelper` since it ensures that the translation keys are not missing in the locale files when running the `extractext` task. By adding comments with `t(...)` calls, `i18next-parser` will generate the strings as if they were present as literals in the code (see https://github.com/i18next/i18next-parser#caveats). This does _not_ suppress the warnings (since `i18next-parser` does not have access to TS types, so it cannot infer template literals) but it at least makes it less likely that a translation will be missed by mistake, have typos, etc.
Diffstat (limited to 'backend')
-rw-r--r--backend/decky_loader/browser.py4
-rw-r--r--backend/decky_loader/locales/en-US.json25
2 files changed, 27 insertions, 2 deletions
diff --git a/backend/decky_loader/browser.py b/backend/decky_loader/browser.py
index aa108c59..64ecfb78 100644
--- a/backend/decky_loader/browser.py
+++ b/backend/decky_loader/browser.py
@@ -29,6 +29,8 @@ class PluginInstallType(IntEnum):
INSTALL = 0
REINSTALL = 1
UPDATE = 2
+ DOWNGRADE = 3
+ OVERWRITE = 4
class PluginInstallRequest(TypedDict):
name: str
@@ -323,5 +325,5 @@ class PluginBrowser:
if name in plugin_order:
plugin_order.remove(name)
self.settings.setSetting("pluginOrder", plugin_order)
-
+
logger.debug("Removed any settings for plugin %s", name)
diff --git a/backend/decky_loader/locales/en-US.json b/backend/decky_loader/locales/en-US.json
index 23566026..7cbc2a8b 100644
--- a/backend/decky_loader/locales/en-US.json
+++ b/backend/decky_loader/locales/en-US.json
@@ -52,7 +52,9 @@
"MultiplePluginsInstallModal": {
"confirm": "Are you sure you want to make the following modifications?",
"description": {
+ "downgrade": "Downgrade {{name}} to {{version}}",
"install": "Install {{name}} {{version}}",
+ "overwrite": "Overwrite {{name}} with {{version}}",
"reinstall": "Reinstall {{name}} {{version}}",
"update": "Update {{name}} to {{version}}"
},
@@ -61,10 +63,14 @@
"loading": "Working"
},
"title": {
+ "downgrade_one": "Downgrade 1 plugin",
+ "downgrade_other": "Downgrade {{count}} plugins",
"install_one": "Install 1 plugin",
"install_other": "Install {{count}} plugins",
"mixed_one": "Modify {{count}} plugin",
"mixed_other": "Modify {{count}} plugins",
+ "overwrite_one": "Overwrite 1 plugin",
+ "overwrite_other": "Overwrite {{count}} plugins",
"reinstall_one": "Reinstall 1 plugin",
"reinstall_other": "Reinstall {{count}} plugins",
"update_one": "Update 1 plugin",
@@ -72,12 +78,22 @@
}
},
"PluginCard": {
+ "plugin_downgrade": "Downgrade",
"plugin_full_access": "This plugin has full access to your Steam Deck.",
"plugin_install": "Install",
"plugin_no_desc": "No description provided.",
+ "plugin_overwrite": "Overwrite",
+ "plugin_reinstall": "Reinstall",
+ "plugin_update": "Update",
"plugin_version_label": "Plugin Version"
},
"PluginInstallModal": {
+ "downgrade": {
+ "button_idle": "Downgrade",
+ "button_processing": "Downgrading",
+ "desc": "Are you sure you want to downgrade {{artifact}} to version {{version}}?",
+ "title": "Downgrade {{artifact}}"
+ },
"install": {
"button_idle": "Install",
"button_processing": "Installing",
@@ -85,6 +101,13 @@
"title": "Install {{artifact}}"
},
"no_hash": "This plugin does not have a hash, you are installing it at your own risk.",
+ "not_installed": "(not installed)",
+ "overwrite": {
+ "button_idle": "Overwrite",
+ "button_processing": "Overwriting",
+ "desc": "Are you sure you want to overwrite {{artifact}} with version {{version}}?",
+ "title": "Overwrite {{artifact}}"
+ },
"reinstall": {
"button_idle": "Reinstall",
"button_processing": "Reinstalling",
@@ -94,7 +117,7 @@
"update": {
"button_idle": "Update",
"button_processing": "Updating",
- "desc": "Are you sure you want to update {{artifact}} {{version}}?",
+ "desc": "Are you sure you want to update {{artifact}} to version {{version}}?",
"title": "Update {{artifact}}"
}
},