From e01328896702528d496988335f51e6e991009b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E9=94=8B?= Date: Thu, 12 Mar 2026 19:23:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A7=20fix(ci/release-winget):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Node20=20=E5=BC=83=E7=94=A8=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E5=B9=B6=E5=BC=BA=E5=88=B6=E5=90=AF=E7=94=A8=20Node24?= =?UTF-8?q?=20=E8=BF=90=E8=A1=8C=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 release-winget workflow 增加 FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true - 与现有 release/test workflow 的 Node24 配置保持一致 - 避免 actions/checkout、setup-go、setup-node 触发 Node20 弃用告警 --- .github/workflows/release-winget.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-winget.yml b/.github/workflows/release-winget.yml index e4604b3..632c11e 100644 --- a/.github/workflows/release-winget.yml +++ b/.github/workflows/release-winget.yml @@ -10,6 +10,9 @@ on: description: 'Tag of release you want to publish' type: string +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" + jobs: publish: runs-on: windows-latest From 1dabac1a6504bd1d9584f56c626e24b3ff4121cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E9=94=8B?= Date: Thu, 12 Mar 2026 19:38:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=A7=20fix(window):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DWindows=E5=90=AF=E5=8A=A8=E5=85=A8=E5=B1=8F=E9=94=81?= =?UTF-8?q?=E6=AD=BB=E5=B9=B6=E8=A1=A5=E9=BD=90=E6=A0=87=E9=A2=98=E6=A0=8F?= =?UTF-8?q?=E9=80=80=E5=87=BA=E5=85=A8=E5=B1=8F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json.md5 | 2 +- frontend/src/App.tsx | 45 ++++++++++++++++++++++++++++----------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index 0f8f4fe..a7661c0 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -5b8157374dae5f9340e31b2d0bd2c00e \ No newline at end of file +d0f9366af59a6367ad3c7e2d4185ead4 \ No newline at end of file diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index ce1832e..58b3a96 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useMemo } from 'react'; import { Layout, Button, ConfigProvider, theme, Dropdown, MenuProps, message, Modal, Spin, Slider, Progress, Switch, Input, InputNumber, Select } from 'antd'; import zhCN from 'antd/locale/zh_CN'; import { PlusOutlined, ConsoleSqlOutlined, UploadOutlined, DownloadOutlined, CloudDownloadOutlined, BugOutlined, ToolOutlined, GlobalOutlined, InfoCircleOutlined, GithubOutlined, SkinOutlined, CheckOutlined, MinusOutlined, BorderOutlined, CloseOutlined, SettingOutlined, LinkOutlined, BgColorsOutlined, AppstoreOutlined } from '@ant-design/icons'; -import { BrowserOpenURL, Environment, EventsOn, Quit, WindowFullscreen, WindowGetSize, WindowIsFullscreen, WindowIsMaximised, WindowMaximise, WindowMinimise, WindowSetSize, WindowToggleMaximise } from '../wailsjs/runtime'; +import { BrowserOpenURL, Environment, EventsOn, Quit, WindowFullscreen, WindowGetSize, WindowIsFullscreen, WindowIsMaximised, WindowMaximise, WindowMinimise, WindowSetSize, WindowToggleMaximise, WindowUnfullscreen } from '../wailsjs/runtime'; import Sidebar from './components/Sidebar'; import TabManager from './components/TabManager'; import ConnectionModal from './components/ConnectionModal'; @@ -218,6 +218,7 @@ function App() { const maxApplyAttempts = 6; const applyRetryDelayMs = 400; const settleDelayMs = 160; + const useMaximiseForStartup = isWindowsPlatform(); const checkStartupPreferenceApplied = async (): Promise => { try { @@ -253,15 +254,21 @@ function App() { if (await checkStartupPreferenceApplied()) { return; } - // 优先尝试全屏,若当前平台/时机不生效,后续走最大化兜底。 + // Windows 使用最大化,避免进入真正全屏后无法通过标题栏交互退出。 + // 其他平台保持全屏优先、最大化兜底。 try { - await WindowFullscreen(); - await new Promise((resolve) => window.setTimeout(resolve, settleDelayMs)); - if (await checkStartupPreferenceApplied()) { - return; + if (useMaximiseForStartup) { + await WindowMaximise(); + await new Promise((resolve) => window.setTimeout(resolve, settleDelayMs)); + } else { + await WindowFullscreen(); + await new Promise((resolve) => window.setTimeout(resolve, settleDelayMs)); + if (await checkStartupPreferenceApplied()) { + return; + } + await WindowMaximise(); + await new Promise((resolve) => window.setTimeout(resolve, settleDelayMs)); } - await WindowMaximise(); - await new Promise((resolve) => window.setTimeout(resolve, settleDelayMs)); } catch (e) { console.warn("Wails Window APIs unavailable", e); } @@ -640,6 +647,8 @@ function App() { const isMacRuntime = runtimePlatform === 'darwin' || (runtimePlatform === '' && /mac/i.test(detectNavigatorPlatform())); + const isWindowsRuntime = runtimePlatform === 'windows' + || (runtimePlatform === '' && isWindowsPlatform()); const formatBytes = (bytes?: number) => { if (!bytes || bytes <= 0) return '0 B'; @@ -1075,12 +1084,24 @@ function App() { setIsDriverModalOpen(true); }; + const handleTitleBarWindowToggle = async () => { + try { + if (await WindowIsFullscreen()) { + await WindowUnfullscreen(); + return; + } + await WindowToggleMaximise(); + } catch (_) { + // ignore + } + }; + const handleTitleBarDoubleClick = (e: React.MouseEvent) => { const target = e.target as HTMLElement | null; if (target?.closest('[data-no-titlebar-toggle="true"]')) { return; } - try { WindowToggleMaximise(); } catch(e) {} + void handleTitleBarWindowToggle(); }; // Sidebar Resizing @@ -1447,7 +1468,7 @@ function App() { type="text" icon={} style={{ height: '100%', borderRadius: 0, width: titleBarButtonWidth }} - onClick={WindowToggleMaximise} + onClick={() => { void handleTitleBarWindowToggle(); }} />