From ebd762568c83e7ab51574eab484011ba7d3f7ea2 Mon Sep 17 00:00:00 2001 From: abose Date: Wed, 27 May 2026 22:49:43 +0530 Subject: [PATCH 1/3] fix: allow npm install to succeed when node binary was previously extracted The adm-zip extractEntryTo call in downloadNodeBinary.js did not pass the overwrite flag, causing postinstall to fail with "Target file already exists" on repeat runs. Co-Authored-By: Claude Opus 4.7 (1M context) --- src-build/downloadNodeBinary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-build/downloadNodeBinary.js b/src-build/downloadNodeBinary.js index 2568517e..445d8e71 100644 --- a/src-build/downloadNodeBinary.js +++ b/src-build/downloadNodeBinary.js @@ -187,7 +187,7 @@ function unzipFile(zipFilePath, extractPath) { } if (!zipEntry.isDirectory) { - zip.extractEntryTo(zipEntry.entryName, extractPath); + zip.extractEntryTo(zipEntry.entryName, extractPath, /*maintainEntryPath*/true, /*overwrite*/true); } }); From 476a24a8d6c61024b5b4770409f895f3e218b8f1 Mon Sep 17 00:00:00 2001 From: abose Date: Wed, 27 May 2026 22:50:38 +0530 Subject: [PATCH 2/3] fix(tauri): correct screenshot rect on Windows under DPI scaling GDI APIs (GetClientRect, PrintWindow, GetDIBits) operate in physical pixels for DPI-aware processes, but the JS caller sends the capture rect in CSS pixels (scaled only by the webview zoom factor, not the OS DPI). At Windows display scaling >100%, this produced screenshots that were both shifted and undersized. Multiply the incoming rect by window.scale_factor() (the OS DPI scale, e.g. 1.25 at 125% scaling) before clamping to the physical client area. macOS is unaffected because WKSnapshotConfiguration.setRect takes view points, which map 1:1 to CSS pixels. Electron (Linux) is unaffected because capturePage already accepts CSS-pixel rects. --- src-tauri/src/main.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 03ca5d0c..1947585d 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -538,6 +538,11 @@ fn capture_page_windows(window: tauri::Window, rect: Option) -> Res }; use winapi::shared::windef::{RECT, HGDIOBJ}; + // GDI works in physical pixels, but the JS caller sends the rect in CSS pixels + // (scaled only by the webview zoom factor, not by the OS DPI). Convert by + // multiplying with the window's OS scale factor (1.25 at Windows 125% scaling). + let dpi_scale = window.scale_factor().unwrap_or(1.0); + unsafe { let hwnd = window.hwnd().map_err(|e| e.to_string())?; let hwnd = hwnd.0 as winapi::shared::windef::HWND; @@ -584,12 +589,13 @@ fn capture_page_windows(window: tauri::Window, rect: Option) -> Res chunk.swap(0, 2); } - // Extract the requested region (or full image) + // Extract the requested region (or full image). Convert the incoming + // CSS-pixel rect into physical pixels using the OS DPI scale factor. let (cap_x, cap_y, cap_w, cap_h) = if let Some(r) = &rect { - let x = (r.x as i32).max(0).min(full_width); - let y = (r.y as i32).max(0).min(full_height); - let w = (r.width as i32).min(full_width - x).max(0); - let h = (r.height as i32).min(full_height - y).max(0); + let x = ((r.x * dpi_scale).round() as i32).max(0).min(full_width); + let y = ((r.y * dpi_scale).round() as i32).max(0).min(full_height); + let w = ((r.width * dpi_scale).round() as i32).min(full_width - x).max(0); + let h = ((r.height * dpi_scale).round() as i32).min(full_height - y).max(0); (x, y, w, h) } else { (0, 0, full_width, full_height) From d7428c3b1447c9f85c2c7107a617216553bd49c7 Mon Sep 17 00:00:00 2001 From: abose Date: Wed, 27 May 2026 22:51:26 +0530 Subject: [PATCH 3/3] ci: sync lock files with version 5.1.21 Co-Authored-By: Claude Opus 4.7 (1M context) --- package-lock.json | 4 ++-- src-electron/package-lock.json | 4 ++-- src-tauri/Cargo.lock | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a260352..88ca6de9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "phoenix-code-ide", - "version": "5.1.8", + "version": "5.1.21", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "phoenix-code-ide", - "version": "5.1.8", + "version": "5.1.21", "hasInstallScript": true, "devDependencies": { "@tauri-apps/cli": "1.6.3", diff --git a/src-electron/package-lock.json b/src-electron/package-lock.json index 776f661f..d0ffd691 100644 --- a/src-electron/package-lock.json +++ b/src-electron/package-lock.json @@ -1,12 +1,12 @@ { "name": "phoenix-code-electron-shell", - "version": "5.1.8", + "version": "5.1.21", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "phoenix-code-electron-shell", - "version": "5.1.8", + "version": "5.1.21", "dependencies": { "keytar": "^7.9.0" }, diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index dfa1a4cd..bd7c6be2 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -3398,7 +3398,7 @@ dependencies = [ [[package]] name = "phoenix-code-ide" -version = "5.1.4" +version = "5.1.21" dependencies = [ "aes-gcm", "backtrace",