Repository navigation
fix(desktop): 八组宿主规则改由 Core 计算,AI 代码移到 internal/ai(重新提交 #1888 到 preview) - #1889
Merged
Merged
Conversation
* fix(desktop): 停止等待时间的规则改读 Core 的 gracefulStopRule,删除三次探测 Closes #1830 * fix(desktop): 代理排除项由 Core 解析,测试连接提示被忽略的条目 network.proxyPolicy 返回 exclusionRules 和 invalidExclusions;netproxy 删掉 自己解析排除项的 Excluded,改为 Bypasses 只做契约规定的比较,并回放 Core 的 network/proxy-bypass-v1.json。设置页测试连接的结果后面列出 Core 无法识别、 不会生效的排除项。 Closes #1829 * fix(desktop): group changed files of commits, stashes and shelves through Core The Log tab's commit files, the Stash tab and the Shelf tab grouped files by folder with path.Dir and strings.Compare, so v0.1.12 sorted before v0.1.4 and the top folder was ".". They now ask Core's git.changedFileGroups once when a list loads, in the background task that reads it, and test whether a folder holds the selected file from Core's grouping instead of path.Dir. The top folder is "". stashCommitFiles is gone with the old grouping. Closes #1814 * fix(desktop): worktree states, blocked writes and the creation dialog follow Core The Worktrees tab shows the states and blocked-write reasons Core derives, counts every checkout's changes with one countChanges listing, and the new worktree dialog takes its choices, branch name, destination and readiness from git.worktreeCreationPreview instead of rules of its own. Closes #1817 * fix(desktop): Diff 查找改用 Core editor.find Diff 页签的查找栏不再自己用 Go 转小写匹配(遇到小写后字节变长的字符就退回区分大小写), 改为在后台对两侧编辑器的快照逐个调用 Core 的 editor.find,与编辑器查找栏同一套规则: Unicode 大小写折叠、匹配上限 10000 处(计数显示 n+)。新查询或关闭查找栏会取消进行中的 查找;两侧文本在查找期间变化时丢弃结果并重新查找;匹配会在两侧编辑器里高亮。 Closes #1847 * refactor(desktop): 插件启用规则和生命周期步骤改由 Core 决定 - 新增 core.PlanPluginLifecycle,调用 plugins.installed.lifecycle: Core 按插件回答启用状态,并为确认安装、启用、禁用、卸载给出有序步骤 - pluginstate 只保存用户选择,去掉 Enabled、EnableUnlessChosen - pluginmanager.Manager.Apply 按步骤执行删版本、删批准记录、忘记选择、 删状态目录和停止插件程序,未安装插件报 ErrUnknownPlugin - pluginservice 的 Uninstall、Disable 改走 Apply,停止程序由调用方传入 - 更新安装即启用、卸载清理状态的 Agent Note Closes #1842 * fix(desktop): 编辑分组的打开、拖放与空组移除改由 Core editor.groupLayout 计算 - 新增 core.ReduceEditorLayout(editor.groupLayout.reduce):分组与布局树一起归约, 打开页签、拖放页签(合并、拆分、空编辑区)、移除空组都由 Core 返回新状态、新布局、 被移除的组和页签所在组;拖到已关闭的页签或已消失的组时返回 stale,不会变成别的移动 - 新增 core.EditorDropTargets(editor.groupLayout.dropTargets):拖动开始时取一次 每个组可接受的位置,宿主只按画出的区域命中测试 - 工作台删掉自写的 moveTab、moveIntoNewGroup、splitTab、placeInEmptyEditor、 splitLeaf、removeLeaf 和 dropRestoredGroup;adoptLayout 按 split 编号复用分隔条比例 - 会话恢复只创建布局里有的组,结束时用 RemoveEmptyEditorGroups 去掉空组 - 更新编辑分组拆分与停靠的 Agent Note Closes #1806 * fix(desktop): 项目树可见行、选择修正与多选改由 Core 计算 - 树的形状变化后(目录打开/关闭、列表返回、节点消失)调用一次 workspace.projectTree.rows,由 Core 给出显示的行、修正后的选择和视口顶端行; 不再每帧在 Go 里展平,缩放和重绘不调用 Core(1000 行缩放 397→394µs/op,分配不变)。 - 删除 Go 里的选择修正、视口锚点恢复、扩选范围和“已被标记目录包含”判断; 普通/Cmd/Shift 点击与批量结束走 workspace.rowSelection.reduce,批量目标用 Core 的 targets。 - Commit 窗口改动行的多选使用同一个归约。 - 同名目录被文件替换时选择跟随路径,选中顶层文件被删时选择回到根节点。 - 更新项目树 Agent Note,补选择归约和改动行多选的回归测试。 Closes #1800 * refactor(desktop): 把 AI 代码抽成独立包 internal/ai - 新包 desktop/internal/ai 与 Core 的 lithe-ai crate 对应:Core AI 命令 (ai.configuration.*、ai.planCommit、ai.decodeCommitMessage、ai.inlineEdit.*、 ai.pullRequest.*)以及 git.commitMessageContext 的封装,Codex/Claude 服务商 发现与凭据定位,HTTP 请求(45 秒、不跟随重定向、2 MiB 上限),提交信息、 行内编辑、PR 描述三条生成流程。 - desktop/internal/core 删除 ai_generation.go、ai_configuration.go、 ai_pull_request.go,只保留 IDE API(IDEHostControl 并入 ide_host.go)。 - workbench 删除 ai_provider.go、aicommit_http.go 和 AIKernel/CoreAIKernel, 只保留界面状态与本地化错误文案,Options.AIKernel 改为 ai.Kernel。 - 测试随代码迁到 internal/ai;去掉没有调用方的 AICommitInputBudget 封装。 - 功能矩阵三条 AI 能力、Agent 对话删除 Note、viva-migration 改到新路径。 * chore(desktop): Core 固定到 Lithe-core-rust #30 的 head 5efe90b #30 叠在 #28 上,提供本分支接入的宿主规则命令:gracefulStopRule、 代理 exclusionRules、git.changedFileGroups、工作树状态与 git.worktreeCreationPreview、plugins.installed.lifecycle、 editor.groupLayout.*、workspace.rowSelection.reduce 和 workspace.projectTree.rows。两者合入 main 后改成合并 commit。 * docs: 功能矩阵和项目树笔记改写为规则已在 Core 项目树、Diff 查找、Git 改动文件分组、工作树和代理排除项的说明还写着 “仍在 Go、下沉跟踪 #18xx”,改为现在由哪条 Core 命令计算。git-history 去掉“文件保持 Git 返回的顺序”,现在按自然顺序。
21 of 26 tasks
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 03:18
This was referenced Nov 14, 2026
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 14, 2026
…失败的两个测试 (#1891) * chore(desktop): Core 固定版本改到 Lithe-core-rust#31 的合并提交 62b8a08 #1889 合入 preview 时固定的是 Lithe-core-rust#30 分支的 head 5efe90b,它不在 Core main 上。 #31 已 squash 合入 main(62b8a08),代码与 5efe90b 完全相同,改用这个合并提交,并把注释里 "尚未合入" 的说明改成已合入。 * fix(test): 修好 preview 上 Linux/Windows 失败的两个测试 - TestStripeBackgroundButtonOpensThePopoverThatChoosesTheImage:frontLabeled 取最后声明的 同名控件。Windows 和 Linux 上 Viva 在最上层(math.MaxUint16)自绘窗口按钮,窗口的关闭 按钮也叫“关闭”,测试点中的是它,弹窗没有关闭。现在跳过窗口按钮所在的层。 - TestWindowsShellReportsDirectoryAfterChangingIt/powershell.exe:Windows PowerShell 5.1 在 CI 上启动约 9 秒,有时超过 12 秒的期限。等待第一次提示符的期限改为 45 秒,cd 之后 仍然是 12 秒。 * test(matrix): 记录背景图弹窗和 Windows Shell 目录两条回归的覆盖范围 workbench-background-image:说明 Windows 和 Linux 上弹窗测试跳过 Viva 自绘窗口按钮所在的层。 terminal-shell:Windows 证据加入 integration_windows_test.go,说明首个提示符 45 秒、进入目录后 12 秒的期限。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
为什么重新提交: #1887 在 03:00:36 合入了
preview,#1888 在 03:00:57 才合入,而且合进的是 #1887 原来的分支chore/core-split-crate-paths,没有进preview。Core 一侧也是这样:Lithe-core-rust#30 在 Lithe-core-rust#28 合入main之后,才合入 #28 原来的分支,所以重新提交为 Lithe-core-rust#31。本 PR 从最新的preview(bd0ba5419)开分支,只摘取 #1888 的 squash 提交 87e92d2,没有冲突,内容与 #1888 相同。Viva 桌面端(Go)里有八组规则本该由 Core 决定,但宿主一直自己写一份:停止等待时间的上下限、代理排除项的写法、Git 改动文件的分组、工作树状态与新建对话框、插件启用与卸载步骤、编辑分组的拆分与拖放、项目树可见行与多选、Diff 内查找。将来换 UI 壳子,这些规则还得再写一遍,而且已经造成了几个可见的问题:
strings.Compare排序,v0.1.12排在v0.1.4前面,顶层目录显示成.。这几条规则已经在 Lithe-core-rust#31 中由 Core 实现(与 Lithe-core-rust#30 相同,叠在已合入的 Lithe-core-rust#28 上)。本 PR 让桌面端改用这些 Core 命令,删除 Go 里的同名规则,宿主只负责 I/O 和绘制。
另外,应维护者要求,把 AI 相关的 Go 代码移到独立的包
desktop/internal/ai,以后单独维护。下面按 #1888 原来的 11 个提交逐条列出改动。在本 PR 里,它们已合成 #1888 的一个 squash 提交。
改动 / Changes
按提交列出:
core.ProcessLifecycle读取processLifecycle.resolve新增的gracefulStopRule(defaultSeconds、minSeconds、maxSeconds)。workbench/process_exit.go删除三次越界探测,设置页的上下限直接取 Core 给出的值。network.proxyPolicy返回的exclusionRules和invalidExclusions在core/network.go中解码。netproxy删除自己解析排除项的Excluded。新的Bypasses只做契约规定的比较:同一地址族内比较,忽略 IPv6 zone。netproxy_test.go回放 Core 的 fixturenetwork/proxy-bypass-v1.json。desktop.settings.network.ignoredExclusions,中英文都已补齐。git.changedFileGroups。""。path.Dir。stashCommitFiles。git.worktrees给出的状态(missing、locked、modified、current、available),以及被禁止的写操作和原因。countChanges列出统计。git.worktreeCreationPreview。editor.find,规则和编辑器查找栏相同:Unicode 大小写折叠,最多 10000 处,计数显示n+。core.PlanPluginLifecycle,调用plugins.installed.lifecycle。Core 返回每个插件的启用状态,并为确认安装、启用、禁用、卸载给出有序步骤。pluginstate只保存用户的选择,删除Enabled和EnableUnlessChosen。pluginmanager.Manager.Apply按步骤执行:删除版本、删除批准记录、清除选择、删除状态目录、停止插件程序。对未安装的插件返回ErrUnknownPlugin。pluginservice的Uninstall和Disable改走Apply,停止程序由调用方传入。2026-11-13-viva-plugin-install-enables-and-uninstall-cleans-state.md。core.ReduceEditorLayout(editor.groupLayout.reduce),分组和布局树一起归约,覆盖打开页签、拖放页签(合并、拆分、拖到空编辑区)和移除空组。stale,不会变成别的移动。core.EditorDropTargets(editor.groupLayout.dropTargets),拖动开始时取一次每个分组接受的落点;宿主只对画出的区域做命中测试。moveTab、moveIntoNewGroup、splitTab、placeInEmptyEditor、splitLeaf、removeLeaf和dropRestoredGroup。adoptLayout按 split 编号复用分隔条比例。RemoveEmptyEditorGroups去掉空组;终端分组也走同一个归约。2026-10-12-editor-tab-split-docking.md。workspace.projectTree.rows,由 Core 给出可见行、修正后的选择和视口顶端行。缩放和重绘不调用 Core。workspace.rowSelection.reduce,批量操作的对象取 Core 的targets。changelists_select.go)。2026-10-19-lazy-project-tree.md。desktop/internal/ailithe-aicrate,包括:ai.configuration.*、ai.planCommit、ai.decodeCommitMessage、ai.inlineEdit.*、ai.pullRequest.*,以及git.commitMessageContext;desktop/internal/core删除ai_generation.go、ai_configuration.go和ai_pull_request.go,只保留 IDE API(IDEHostControl并入ide_host.go)。core/doc.go写明,单独维护的功能在自己的包里封装命令。workbench删除ai_provider.go、aicommit_http.go和AIKernel/CoreAIKernel,只保留界面状态和本地化错误文案。Options.AIKernel的类型改为ai.Kernel。internal/ai,删除没有调用方的AICommitInputBudget封装。2026-11-12-viva-agent-conversation-removed.md和docs/viva-migration.md中的路径。scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION改为5efe90b4c6adfb831c13c38059aab0c77c5b5263(Lithe-core-rust#30 的 head,代码与 Lithe-core-rust#31 相同)。Lithe-core-rust#31 合入main后,会加一个提交改成合并 commit,然后再标记为 ready。file-explorer、git-diff-review、git-history、git-worktrees和network-proxy-settings中还写着“仍在 Go、下沉跟踪 #18xx”的句子,改为写明现在由哪条 Core 命令计算。git-history删除“文件保持 Git 返回的顺序”,现在按自然顺序排列。2026-10-05-project-tree-selection-and-moves.md同样改为已在 Core。不在本 PR 范围内 / Out of scope
main。它合入后,本 PR 加一个提交,把PINNED_CORE_REVISION改成合并 commit,不改写历史。.state写死在三处。类型专属:fix
复现与根因
v0.1.4和v0.1.12的提交:实际v0.1.12在前、顶层目录显示.;期望按自然顺序v0.1.4在前,顶层没有目录名。Ⱥ,从 2 字节变成 3 字节),在 Diff 页签里查找abc:实际整侧退回区分大小写,ABC不再算匹配;期望和编辑器查找栏一样做 Unicode 大小写折叠。检查项
gitlog_files_test.go(自然顺序、顶层"")、difftab_test.go(Core 查找)、process_exit_test.go、netproxy_test.go(回放proxy-bypass-v1.json)、network_check_test.go、network_view_test.go、gitworktree_test.go、pluginmanager_test.go、pluginstate_test.go、pluginservice/*_test.go、core/editor_layout_test.go、editorgroups_test.go、core/project_tree_test.go、filetree_test.go。pluginstate.Enabled、EnableUnlessChosen、netproxy.Excluded、stashCommitFiles、AIKernel、CoreAIKernel和编辑分组的旧函数都已删除,vet和全部测试通过。internal/ai,放在单独的提交 55cd13e 中。没有建新的 Issue:维护者要求一次处理完、少开单。.agents/notes/implemented/记录行为约束:architecture/2026-10-19-lazy-project-tree.md、architecture/2026-10-12-editor-tab-split-docking.md、bug-fix/2026-11-13-viva-plugin-install-enables-and-uninstall-cleans-state.md、bug-fix/2026-10-05-project-tree-selection-and-moves.md。范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/下的这些文件:file-explorer、git-diff-review、git-history、git-worktrees、network-proxy-settings、ai-commit-generation、ai-inline-edit、ai-pull-request-description。只改了说明和证据路径,没有改实现状态或验证状态;没在实机上验证的仍是pending。./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(222 项能力)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD,都通过。.artifacts/下的矩阵视图。统一日志系统 / Structured logging
N/A:本 PR 没有新增或修改日志事件,失败仍走原有的
notifyError和 Core 错误路径。模板里的scripts/logging/*.mjs在当前仓库中不存在(Viva 日志生成和使用门禁跟踪 #1802),所以没有运行。界面文案 / i18n
desktop.settings.network.ignoredExclusions已在shared/i18n/补齐中英文,并运行node scripts/i18n/generate-i18n.mjs提交了生成结果(desktop/internal/i18n/shared.generated.go),没有手改。node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,都通过。没有放宽脚本或扩大豁免名单。逻辑归属 / Logic placement
性能与内存 / Performance and memory
workspace.projectTree.rows只在树的形状变化时调用,不是每帧调用。filetree_bench_test.go)。本 PR 没有改 Viva 编辑器模块(desktop/internal/editor/**、editorview/**),所以没有运行editor-bench.sh。设置 / Settings
gracefulStopRule,与resolve共用同一组常量。插件契约 / Plugin contract
N/A:没有改插件契约、能力版本或插件函数协议,也没有新增或修改宿主方法和通知。
plugins.installed.lifecycle是宿主内部命令,不属于插件契约。PINNED_CORE_REVISION目前是5efe90b(代码与 Lithe-core-rust#31 相同),Lithe-core-rust#31 合入后改成合并 commit;桌面端测试读取的就是这个检出里的 fixture。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,通过。无用代码与重构 / Dead code and refactoring
netproxy.Excluded;stashCommitFiles和旧的分组;pluginstate.Enabled和EnableUnlessChosen;moveTab、moveIntoNewGroup、splitTab、placeInEmptyEditor、splitLeaf、removeLeaf、dropRestoredGroup;AIKernel、CoreAIKernel、AICommitInputBudget;验证 / Verification
以下命令在本 PR 的 head 上运行,也就是 #1888 的改动加上最新
preview(含 #1877、#1878)。LITHE_CORE_RUST_DIR指向 Lithe-core-rust#31 的 head 4c0a66e,它的代码与 5efe90b 完全相同。cd desktop && ../scripts/desktop/desktop-go.sh vet ./...cd desktop && ../scripts/desktop/desktop-go.sh test ./...gofmt -l(改动的 Go 文件)node scripts/i18n/verify-app-language-localization.mjsnode scripts/i18n/generate-i18n.mjs --check./scripts/desktop/verify/verify-runtime-bundle-immutability.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD./scripts/agent-notes/verify-agent-notes.shcargo fmt、注释检查、cargo clippy(macOS 和 Windows target)、cargo test --workspace、verify-docs.mjs、sdk-e2e.mjs未能执行的检查和原因:
提交前确认 / Final checks
preview(bd0ba5419)创建,目标分支为preview。