From 00b7ffd2d7accb7d969b37ffda9e5ddc15228b6e Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Sat, 14 Nov 2026 11:20:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?chore(desktop):=20Core=20=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=94=B9=E5=88=B0=20Lithe-core-rust#31=20?= =?UTF-8?q?=E7=9A=84=E5=90=88=E5=B9=B6=E6=8F=90=E4=BA=A4=2062b8a08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1889 合入 preview 时固定的是 Lithe-core-rust#30 分支的 head 5efe90b,它不在 Core main 上。 #31 已 squash 合入 main(62b8a08),代码与 5efe90b 完全相同,改用这个合并提交,并把注释里 "尚未合入" 的说明改成已合入。 --- scripts/desktop/build-desktop-core.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/desktop/build-desktop-core.sh b/scripts/desktop/build-desktop-core.sh index 4ebe2e2ca4..733ded48d5 100755 --- a/scripts/desktop/build-desktop-core.sh +++ b/scripts/desktop/build-desktop-core.sh @@ -28,15 +28,15 @@ native_path() { } PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git" -# The head of Lithe-core-rust #30, not yet merged, stacked on #28, not yet merged either; replace -# it with the merge commit once both are in main. #30 adds the host rules the desktop no longer -# keeps itself (processLifecycle gracefulStopRule, network.proxyPolicy exclusionRules, +# Lithe-core-rust #31, squash-merged into main. It re-lands #30, which was merged into the branch +# of #28 after #28 itself had gone into main, and adds the host rules the desktop no longer keeps +# itself (processLifecycle gracefulStopRule, network.proxyPolicy exclusionRules, # git.changedFileGroups, git.worktrees states and git.worktreeCreationPreview, # plugins.installed.lifecycle, editor.groupLayout.*, workspace.rowSelection.reduce and -# workspace.projectTree.rows) in four new rule crates (50 in the workspace). #28 splits 34 -# more crates out of lithe-core (46 in the workspace); command names, JSON, error codes and the -# C header are unchanged, except that a build system's -# source:"hostIntegration" is now refused as plugin.manifest.invalid. It is on top of #29 (cold +# workspace.projectTree.rows) in four new rule crates (50 in the workspace). It is on top of #28 +# (34 more crates split out of lithe-core, 46 in the workspace; command names, JSON, error codes +# and the C header unchanged, except that a build system's source:"hostIntegration" is now +# refused as plugin.manifest.invalid), squash-merged into main, on top of #29 (cold # managed runtimes may finish LSP initialization), squash-merged into main, on top of # #27 (protocol, network, terminal, process, diff and github split into their own # crates, keymap and action search moved into lithe-core-rules; command names, JSON, error codes @@ -56,7 +56,7 @@ PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git" # the contract, plugin guides, reference and SDKs live only in shared/plugins; on top of #16 (reported Git queries folded in the console), # #15 (git.write cherryPick, revert and reset fields), #14 (word-level changed ranges of diff # rows), #13, #8, #7, #6 and #4. -PINNED_CORE_REVISION="5efe90b4c6adfb831c13c38059aab0c77c5b5263" +PINNED_CORE_REVISION="62b8a08fe41cd3d67f0f32d72653392410e6aa37" PROFILE="debug" while [[ $# -gt 0 ]]; do case "$1" in From 0ce9c2dc53a5808011a998d138d263f72aa0997d Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Sat, 14 Nov 2026 11:40:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(test):=20=E4=BF=AE=E5=A5=BD=20preview?= =?UTF-8?q?=20=E4=B8=8A=20Linux/Windows=20=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TestStripeBackgroundButtonOpensThePopoverThatChoosesTheImage:frontLabeled 取最后声明的 同名控件。Windows 和 Linux 上 Viva 在最上层(math.MaxUint16)自绘窗口按钮,窗口的关闭 按钮也叫“关闭”,测试点中的是它,弹窗没有关闭。现在跳过窗口按钮所在的层。 - TestWindowsShellReportsDirectoryAfterChangingIt/powershell.exe:Windows PowerShell 5.1 在 CI 上启动约 9 秒,有时超过 12 秒的期限。等待第一次提示符的期限改为 45 秒,cd 之后 仍然是 12 秒。 --- .../internal/localshell/integration_windows_test.go | 12 ++++++++---- .../internal/workbench/workbench_background_test.go | 11 +++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/desktop/internal/localshell/integration_windows_test.go b/desktop/internal/localshell/integration_windows_test.go index 20a02136ef..053c766dac 100644 --- a/desktop/internal/localshell/integration_windows_test.go +++ b/desktop/internal/localshell/integration_windows_test.go @@ -37,9 +37,13 @@ func TestWindowsShellReportsDirectoryAfterChangingIt(t *testing.T) { screen.SetPromptToken("test-token") started := false screen.SetPromptStart(func() { started = true }) - wait := func(want string) { + // The first prompt waits for the shell to start. Windows PowerShell 5.1 takes about 9 s + // to start on the Windows CI runners and sometimes more than 12 s; the prompt after a + // directory change comes much sooner. + const startDeadline, promptDeadline = 45 * time.Second, 12 * time.Second + wait := func(want string, limit time.Duration) { t.Helper() - deadline := time.NewTimer(12 * time.Second) + deadline := time.NewTimer(limit) defer deadline.Stop() for { screen.Write(shell.Drain(nil)) @@ -54,7 +58,7 @@ func TestWindowsShellReportsDirectoryAfterChangingIt(t *testing.T) { } } } - wait(home) + wait(home, startDeadline) command := "Set-Location -LiteralPath '" + strings.ReplaceAll(target, "'", "''") + "'\r" if strings.EqualFold(filepath.Base(program), "cmd.exe") { command = "cd /d \"" + target + "\"\r" @@ -62,7 +66,7 @@ func TestWindowsShellReportsDirectoryAfterChangingIt(t *testing.T) { if !shell.Write([]byte(command)) { t.Fatal("shell refused input") } - wait(target) + wait(target, promptDeadline) }) } } diff --git a/desktop/internal/workbench/workbench_background_test.go b/desktop/internal/workbench/workbench_background_test.go index dd26f04040..a896692337 100644 --- a/desktop/internal/workbench/workbench_background_test.go +++ b/desktop/internal/workbench/workbench_background_test.go @@ -124,14 +124,21 @@ func (h *harness) veilAlpha() float32 { func near(a, b float32) bool { return math.Abs(float64(a-b)) < 0.002 } +// windowControlsLayer is the layer of the minimize, maximize and close buttons Viva draws in the +// custom title bar on Windows and Linux: above every layer an application uses, and declared +// last. They are not workbench controls. +const windowControlsLayer = math.MaxUint16 + // frontLabeled is where the front-most control named label was laid out in the last frame: // a popover's buttons are declared after the workbench under it, whose controls may share -// their names. +// their names. The title bar's window buttons are skipped. On Windows and Linux they are +// declared after the popover, and the window's close button has the same name as the +// popover's (关闭), so taking it instead would click the window's close button. func (h *harness) frontLabeled(label string) gfx.Rect { h.t.Helper() hits := h.driver.Snapshot().Hits for i := len(hits) - 1; i >= 0; i-- { - if hit := hits[i]; hit.Label == label && !hit.IsLabel && !hit.Backdrop { + if hit := hits[i]; hit.Label == label && !hit.IsLabel && !hit.Backdrop && hit.Layer != windowControlsLayer { return hit.Bounds } } From d4d8d5fcea18dda1ea8172035c06c899cc45dc15 Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Sat, 14 Nov 2026 11:48:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?test(matrix):=20=E8=AE=B0=E5=BD=95=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E5=9B=BE=E5=BC=B9=E7=AA=97=E5=92=8C=20Windows=20Shell?= =?UTF-8?q?=20=E7=9B=AE=E5=BD=95=E4=B8=A4=E6=9D=A1=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E7=9A=84=E8=A6=86=E7=9B=96=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit workbench-background-image:说明 Windows 和 Linux 上弹窗测试跳过 Viva 自绘窗口按钮所在的层。 terminal-shell:Windows 证据加入 integration_windows_test.go,说明首个提示符 45 秒、进入目录后 12 秒的期限。 --- shared/platform-feature-matrix/features/terminal-shell.json | 5 +++-- .../features/workbench-background-image.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/shared/platform-feature-matrix/features/terminal-shell.json b/shared/platform-feature-matrix/features/terminal-shell.json index e3b4f3bc53..de9db2b982 100644 --- a/shared/platform-feature-matrix/features/terminal-shell.json +++ b/shared/platform-feature-matrix/features/terminal-shell.json @@ -24,11 +24,12 @@ "desktop/internal/localshell/discovery.go", "desktop/internal/settingswindow/terminal_view.go", "desktop/internal/workbench/terminal_env.go", - "desktop/internal/workbench/terminals.go" + "desktop/internal/workbench/terminals.go", + "desktop/internal/localshell/integration_windows_test.go" ] }, "owner": "Terminal", - "verification": "验证设置页默认 Shell 选项与终端「新建终端」菜单检测到的 Shell 一致、可选 Git Bash 并生效;macOS 新建终端下拉框复用 Project 下拉框的共享菜单样式,菜单操作与原有 Shell 选择、重新检测功能一致;验证环境变量、工作目录和不可用 Shell 的提示。 设置页终端分组新增回滚行数配置(默认 2000,范围 100–50000,步进 500),读取、写入、恢复默认均做上下限夹取,对新建会话生效(TerminalScrollbackSettingsTests);设置搜索按界面名称 Terminal scrollback/终端回滚行数/行数 均可命中终端页(SettingsSearchVocabularyTests)。 macOS 终端环境随 TERM_PROGRAM=Lithe 一并导出 TERM_PROGRAM_VERSION(取应用打包版本,无法取得时不写入),与 Windows 端一致,供工具按版本门控终端能力(TerminalModuleTests);按当前外观导出 COLORFGBG(浅色 0;15、深色 15;0,宿主无法判定时不写入),TUI 无需 OSC 查询即可选择配色(TerminalModuleTests)。终端会话在启动前剥离从宿主进程继承的 NO_COLOR、FORCE_COLOR、CLICOLOR_FORCE、CI、GITHUB_ACTIONS 和 CONTINUOUS_INTEGRATION,并设置 CLICOLOR=1;显式 environmentChanges 仍可覆盖,避免 Codex 和 Claude Code 因父进程环境退化为黑白。", + "verification": "验证设置页默认 Shell 选项与终端「新建终端」菜单检测到的 Shell 一致、可选 Git Bash 并生效;macOS 新建终端下拉框复用 Project 下拉框的共享菜单样式,菜单操作与原有 Shell 选择、重新检测功能一致;验证环境变量、工作目录和不可用 Shell 的提示。 设置页终端分组新增回滚行数配置(默认 2000,范围 100–50000,步进 500),读取、写入、恢复默认均做上下限夹取,对新建会话生效(TerminalScrollbackSettingsTests);设置搜索按界面名称 Terminal scrollback/终端回滚行数/行数 均可命中终端页(SettingsSearchVocabularyTests)。 macOS 终端环境随 TERM_PROGRAM=Lithe 一并导出 TERM_PROGRAM_VERSION(取应用打包版本,无法取得时不写入),与 Windows 端一致,供工具按版本门控终端能力(TerminalModuleTests);按当前外观导出 COLORFGBG(浅色 0;15、深色 15;0,宿主无法判定时不写入),TUI 无需 OSC 查询即可选择配色(TerminalModuleTests)。终端会话在启动前剥离从宿主进程继承的 NO_COLOR、FORCE_COLOR、CLICOLOR_FORCE、CI、GITHUB_ACTIONS 和 CONTINUOUS_INTEGRATION,并设置 CLICOLOR=1;显式 environmentChanges 仍可覆盖,避免 Codex 和 Claude Code 因父进程环境退化为黑白。 Windows 运行 TestWindowsShellReportsDirectoryAfterChangingIt:cmd.exe、powershell.exe、pwsh.exe 各自启动后报告起始目录,进入含中文、空格、分号和百分号的目录后报告新目录;等第一个提示符的期限是 45 秒(Windows PowerShell 5.1 在 CI 上冷启动约 9 秒,偶尔超过 12 秒),进入目录后的提示符仍是 12 秒。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": { diff --git a/shared/platform-feature-matrix/features/workbench-background-image.json b/shared/platform-feature-matrix/features/workbench-background-image.json index 9686ef6e65..02d0f42586 100644 --- a/shared/platform-feature-matrix/features/workbench-background-image.json +++ b/shared/platform-feature-matrix/features/workbench-background-image.json @@ -24,6 +24,6 @@ ] }, "owner": "Workbench", - "verification": "在 macOS 与 Windows 的浅色、深色主题下分别验证:未选图片时,侧边按钮条背景弹窗和 设置 → 外观 都显示“未选择背景图片”和“选择图片…”,不显示图片可见度与移除;从弹窗选择 PNG 或 JPEG 后,打开的项目窗口整窗显示按比例裁切居中的图片,欢迎页不显示;设置页缩略图与工作台裁切一致,在设置页切换淡、中、浓,工作台遮罩随之变化,弹窗显示同一档位;项目树、编辑区、终端、Git 日志、差异与 Markdown 预览透出图片且文字可读,菜单、弹窗、通知与输入框保持实底;多个项目标签共用同一背景;移动或删除原图片后重启,背景仍在;选择损坏或超大的图片时显示原因且原背景不变;移除后恢复主题底色、数据目录中的副本被删除;整个流程中应用包或安装目录的文件清单与哈希不变。", + "verification": "在 macOS 与 Windows 的浅色、深色主题下分别验证:未选图片时,侧边按钮条背景弹窗和 设置 → 外观 都显示“未选择背景图片”和“选择图片…”,不显示图片可见度与移除;从弹窗选择 PNG 或 JPEG 后,打开的项目窗口整窗显示按比例裁切居中的图片,欢迎页不显示;设置页缩略图与工作台裁切一致,在设置页切换淡、中、浓,工作台遮罩随之变化,弹窗显示同一档位;项目树、编辑区、终端、Git 日志、差异与 Markdown 预览透出图片且文字可读,菜单、弹窗、通知与输入框保持实底;多个项目标签共用同一背景;移动或删除原图片后重启,背景仍在;选择损坏或超大的图片时显示原因且原背景不变;移除后恢复主题底色、数据目录中的副本被删除;整个流程中应用包或安装目录的文件清单与哈希不变。 运行 TestStripeBackgroundButtonOpensThePopoverThatChoosesTheImage,确认侧边按钮条的背景按钮打开弹窗、弹窗的关闭按钮能关掉弹窗。Windows 和 Linux 上 Viva 在最上层(math.MaxUint16)自绘窗口的最小化、最大化和关闭按钮,窗口关闭按钮和弹窗关闭按钮都叫“关闭”,测试按名字找弹窗按钮时跳过这一层,不能点到窗口的关闭按钮;该回归在 Linux 和 Windows 的 CI 上执行,macOS 用系统红绿灯,没有这一层。", "notes": "Viva:两端共用 desktop/ 实现。所选文件经 store.WriteFile 复制到用户数据目录,设置只保存原文件名与档位;读取、校验、解码图片以及写入、删除副本都在窗口线程外进行,图片一次缩到最长边 2560 像素以内;新图片的副本写好后才替换当前背景,写入失败时保留原背景并提示。图片作为窗口 0 层整窗绘制,其上按档位叠主题底色遮罩(淡 0.92、中 0.80、浓 0.62),面板、外框、编辑区和终端不再画实底。只在打开项目时显示。图片可见度在没有图片时不显示。" }