From ed20f9a142a5d2419817e3e1e08aa5ab23b9995b Mon Sep 17 00:00:00 2001 From: Huakun Date: Sat, 22 Feb 2025 04:36:44 -0500 Subject: [PATCH] Fix: linux extension loading (#188) * fix: change escape key behavior to navigate home instead of back * feat: load custom ui extension with http server on Linux Linux now uses the same loading approach as Windows due to a bug https://github.com/tauri-apps/tauri/issues/12767 * feat: add tauri-plugin-system-info-api dependency to deno.lock --- apps/desktop/package.json | 2 +- apps/desktop/src/lib/cmds/ext.ts | 3 ++- apps/desktop/src/routes/app/extension/store/+page.svelte | 2 +- deno.lock | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 0ef9fc8..daaa5f9 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@kksh/desktop", - "version": "0.1.24", + "version": "0.1.25", "description": "", "type": "module", "scripts": { diff --git a/apps/desktop/src/lib/cmds/ext.ts b/apps/desktop/src/lib/cmds/ext.ts index fe49456..8eea4bf 100644 --- a/apps/desktop/src/lib/cmds/ext.ts +++ b/apps/desktop/src/lib/cmds/ext.ts @@ -163,7 +163,8 @@ export async function onCustomUiCmdSelect( extPath: ext.extPath, dist: cmd.dist }) - if (platform() === "windows" && !useDevMain) { + const _platform = platform() + if ((_platform === "windows" || _platform === "linux") && !useDevMain) { const addr = await spawnExtensionFileServer(winLabel) // addr has format "127.0.0.1:" console.log("Extension file server address: ", addr) const newUrl = `http://${addr}` diff --git a/apps/desktop/src/routes/app/extension/store/+page.svelte b/apps/desktop/src/routes/app/extension/store/+page.svelte index 7e8918b..ca08cf1 100644 --- a/apps/desktop/src/routes/app/extension/store/+page.svelte +++ b/apps/desktop/src/routes/app/extension/store/+page.svelte @@ -111,7 +111,7 @@ function onkeydown(e: KeyboardEvent) { if (e.key === "Escape") { if (document.activeElement === listviewInputRef) { - goBack() + goHome() } } } diff --git a/deno.lock b/deno.lock index b32769c..5180460 100644 --- a/deno.lock +++ b/deno.lock @@ -181,6 +181,7 @@ "npm:tauri-api-adapter@~0.3.20": "0.3.20_typescript@5.6.3", "npm:tauri-plugin-clipboard-api@^2.1.11": "2.1.11_typescript@5.6.3", "npm:tauri-plugin-shellx-api@^2.0.14": "2.0.14", + "npm:tauri-plugin-system-info-api@2.0.8": "2.0.8_typescript@5.6.3", "npm:ts-proto@^2.3.0": "2.6.1", "npm:tslib@^2.8.1": "2.8.1", "npm:turbo@^2.3.4": "2.4.0",