Skip to content

fix(viva): 同步 Viva fork、修复节点 Key 泄漏并合入 #2328 忽略测试以解除 main CI 死锁 - #2355

Merged
1lck merged 14 commits into
mainfrom
lithe-support/ci-viva-key-on-leaf-elements
Nov 23, 2026
Merged

1lck merged 14 commits into
mainfrom
lithe-support/ci-viva-key-on-leaf-elements

Conversation

@lithe-support

@lithe-support lithe-support Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

关联 Issue / Linked issue

PR 类型 / Type

  • fix:缺陷修复

改动说明 / What changes

背景 / Why

1lck/Lithe-IDEA main(c086a0b1b)同时存在两处独立阻断 CI 的基线失败,形成循环死锁(PR #2328 与 #2355 均无法单独通过 CI):

  1. Core 【建议】mac端的UI优化建议 #179 已入 main 但配套测试未合入:origin/main 已将 scripts/desktop/build-desktop-core.sh 的 PINNED_CORE_REVISION 推进到 bb0ad53f9100954306fcd139bf0e5003e6a515fe(包含 Core 【建议】mac端的UI优化建议 #179 对 .lithe/.gitignore 自忽略 /.gitignore 的更新),导致 desktop/internal/toolchain 中 TestSavePinPreservesIgnoreTextAndOvercomesLaterNegation 按旧期望失败;PR fix(desktop): 接入工具链忽略文件自忽略规则 #2328 中对应的测试、Agent Note 与功能矩阵更新尚未合入。
  2. Viva fork 落后上游及叶节点/上下文 Key 泄漏崩溃:原固定 Viva 版本(Lithe-IDEA/viva@3c6c4608)引入了 base/attrcheck_dev.go 的 unusedName / 叶节点身份检查(dev / vivadev build tag),一方面旧 ui/textview 的 ui.ContextMenuAt(c.Key("menu"), ...) 在菜单关闭早退时把 Key("menu") 泄漏到后续 Divider/Column,另一方面桌面端多处自定义组件与非消费型调用(ui.Menu、ui.Popover、ui.Effect、条件分支早退、c.KeyInt 与 c.Key 串写等)也会把身份键泄漏到叶节点(ui.Text、ui.Wrap、ui.Icon、ui.Spacer、ui.Paragraph)。原 PR fix(viva): 同步 Viva fork、修复节点 Key 泄漏并合入 #2328 忽略测试以解除 main CI 死锁 #2355 把部分 ui.Spacer(c) 改写成带 Key 的 ui.Row/ui.Column,未解决全部泄漏与 ui/textview 根因。

改动 / Changes

  • 同步并升级 Viva 依赖 pin(合并 PR Lithe-IDEA/Lithe-viva#58):
    • 将上游 vivaui/viva(471ea7ab)通过 merge commit 同步到 Lithe-IDEA/viva main(bb85256c8ffabff21983b64de2f4d4ba6e3ee631,合入 PR [Feature] 添加插件系统 #58),拉入上游 v0.6.7 及 ui/textview 修复(7ea39847)。
    • 更新 desktop/go.mod 与 desktop/go.sum:
      • require github.com/vivaui/viva v0.6.8-0.20261123124712-471ea7ab5f81
      • replace github.com/vivaui/viva => github.com/Lithe-IDEA/viva v0.6.8-0.20261123134538-bb85256c8ffa
    • Viva fork 同步报告(按 .agents/notes/implemented/process/2026-11-11-viva-fork-maintenance-and-commit-pin.md):
      • 同步前 fork 基线:3c6c4608;上游基线:471ea7ab;同步后 fork main:bb85256c8ffabff21983b64de2f4d4ba6e3ee631(merge PR:Lithe-IDEA/Lithe-viva#58)。
      • 上游变更范围:3c6c4608..471ea7ab(包含 ui/textview 重构与选择/复制测试 7ea39847、v0.6.7 及移动端后端拆分 471ea7ab 等)。
      • Fork 自有补丁:ScrollBar.Bars / PageConfig.BarStyle 保留;ui/textview/* 冲突全部采用上游实现并验证 git diff upstream/main -- ui/textview/ 为空;cmd/viva/initfiles/AGENTS.md.txt 冲突保留 Theme.Tooltip 并吸收上游修改。
      • 同步后检查 desktop/ 中未发现可删的 Viva 缺陷绕过代码(vivaui/viva#、Lithe-IDEA/viva#、Lithe-viva# 无命中);重新运行 generate-desktop-icons.sh 与 generate-desktop-file-icons.sh(后者在 icons.go / icons_tree.go 同步了 go.svg 来源注释)。
  • 合并 PR fix(desktop): 接入工具链忽略文件自忽略规则 #2328 的 4 个非 pin 文件(保持 origin/main 现有 PINNED_CORE_REVISION 不回退):
  • 修复桌面端 Viva Key 泄漏并恢复惯用 ui.Spacer(c):
    • 将此前 PR fix(viva): 同步 Viva fork、修复节点 Key 泄漏并合入 #2328 忽略测试以解除 main CI 死锁 #2355 提交中把 ui.Spacer(c) 替换成 ui.Row(k.Part("spacer")).Grow(1) / ui.Column(k.Part("spacer")).Grow(1) 的 10 处位置全部恢复为惯用的匿名 ui.Spacer(c)。
    • 清除剩余非消费调用(ui.Effect、ui.Menu、ui.Popover)及早退分支、叶节点调用链上的 Key / Part / KeyInt 泄漏:
      • settingswindow:source_settings_entries_view.go、toolchains_view.go、remote_workspace_view.go、remote_preferences_state.go、plugin_settings_model.go、build_directory_view.go 等,将 Part 移入实际创建的容器节点或在早退检查之后构造,避免泄漏到空分支、ui.Text 或后续控件。
      • workbench:run_view.go(配合 ui/textview 修复验证 TestRemoteCloseShowsTheKeptProcessesInTheRunWindow)、runconfig_dialog_view.go(drawRunConfigNewMenu 早退守卫及移除 Part("add-menu")、移动 KeyInt 到图标早退之后)、debug_view.go、build_options.go、runconfig_view.go、difftab_view.go、problems_view.go、runconfig_steps.go、git_gutter.go、search_everywhere_view.go(避免 c.KeyInt 与 c.Key 相互覆盖)、memory_monitor.go、standalone.go、remote_host_containers.go、remote_browse_view.go 等。
  • 同步功能矩阵:

不在本 PR 范围内 / Out of scope

  • 不改 Rust Core、插件契约或产品界面功能逻辑。
  • 本机环境(macOS arm64)未运行 Linux 或 Windows 实机/虚拟机验收,对应平台矩阵状态保持原有设置。

类型专属:fix

复现与根因

  • 复现步骤、实际结果、期望结果:
    • origin/main(c086a0b1b)上运行 ./scripts/desktop/desktop-go.sh test ./internal/toolchain 时,TestSavePinPreservesIgnoreTextAndOvercomesLaterNegation 因 Core 【建议】mac端的UI优化建议 #179 已自忽略 /.gitignore 而断言失败。
    • 运行 -tags dev 与 -tags vivahead 时,TestAboutPageShowsThePreviewAndCopiesTheFacts、TestWorkbenchDefaultLayout、TestRemoteCloseShowsTheKeptProcessesInTheRunWindow、TestEditRunConfigurationsCountsTheConfigurationsNoBuildPluginStarts 等崩溃,报错 ui: Key ... was given to a Text/Spacer/Icon/Paragraph, which has no identity 或 unusedName。
  • 根因(引入该行为的提交或 PR,用 git log -S 或 git blame 查):
  • 影响平台:macOS、Linux、Windows(所有 Viva 桌面端目标与 -tags dev CI 检查)。

检查项

  • 已先写回归测试,确认它在修复前失败、修复后通过;测试路径与修复前的失败输出:既有回归测试 desktop/internal/settingswindow、desktop/internal/workbench(-tags dev / -tags 'dev vivahead')与 desktop/internal/toolchain(来自 fix(desktop): 接入工具链忽略文件自忽略规则 #2328)覆盖全部失败场景,修复前分别触发上述 unusedName/Key on leaf panic 与 .gitignore 断言失败,修复后全部通过。
  • [N/A] 无法自动化时,已写明手动复现与验证步骤:上述问题均有自动化回归覆盖。
  • 已搜索被修改函数、类型、契约字段的全部调用方(含另一平台、插件、SDK、脚本和按字符串分发的调用)
  • 已检查另一平台是否有同类缺陷(有则本 PR 一并修复,或已提交 Issue):桌面端 Go/Viva 代码为跨平台共享实现,已通过全仓静态扫描 desktop/internal/ 中带 Part/Key/KeyInt 的自定义视图辅助函数并统一修复。
  • 只改了修复所需的代码,没有夹带重构;修复过程中发现的其他问题已提交 Issue:无新增顺手重构。注:desktop/internal/pluginview/render.go 有两处既有 viva vet kept-context 提示(pluginview/render.go:24,141),本次未改其所有权设计,只在本地清理了其中的多余 Key 泄漏;运行 internal/toolchain 等未修改源码以外的功能路径。
  • 修复改变了行为约束或容易复发,已在 .agents/notes/implemented/bug-fix/ 记录:自忽略规则已按 fix(desktop): 接入工具链忽略文件自忽略规则 #2328 更新至 .agents/notes/implemented/architecture/2026-11-09-viva-toolchain-settings-and-build-resolution.md。

范围检查 / Scope checks

功能矩阵 / Feature matrix

  • 已更新 shared/platform-feature-matrix/features/<id>.json:更新 plugin-injected-toolchains.json、settings-about-page.json、workbench-tool-stripe-icons.json,原有 pending 状态保持不变。
  • 已运行 ./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh;改了平台实现路径的,还运行了 ./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD
  • 没有提交 .artifacts/ 下生成的矩阵视图
  • [N/A] 没有更新矩阵的,理由:已更新。

插件归属 / Plugin ownership

  • 已在仓库根目录运行 develop-lithe 第三节“插件归属与宿主零依赖”的自查命令,结果为空
  • 新增或修改的测试只使用测试内联的合成插件、Core 契约 fixture 或插件市场索引快照;没有读取具体插件的插件包、仓库检出、构建产物或清单,没有使用真实插件 ID,没有“缺少插件时跳过”的测试
  • 没有为具体插件提供的能力新建或更新宿主功能矩阵条目;宿主条目的证据和验证动作不引用插件的测试、插件包或插件仓库
  • 插件文案没有写进 shared/i18n/;插件的构建步骤、资源路径和补丁没有写进 docs/ci-builds.md、Agent Note 或 Skill
  • [N/A] 修改了通用扩展点、可能影响已发布插件的,已在受影响插件的仓库运行它的测试,插件仓库与结果:未修改插件扩展点或协议。

UI 验证 / UI evidence

N/A:仅修复 -tags dev 下的身份键归属(将错位的 Part/Key 从叶节点、非消费调用和早退路径移除并恢复 ui.Spacer(c)),不改变视觉布局、样式、文案或交互状态;已通过无头窗口与 Metal -tags 'dev vivahead' 测试验证不崩溃且断言全过。

统一日志系统 / Structured logging

N/A:本次未新增或改动日志事件、生命周期终态、错误边界或日志文案。

界面文案 / i18n

  • [N/A] 宿主文案都走共享 i18n:未新增或修改界面文案。
  • 插件提供的文字由插件自己翻译,没有写进 shared/i18n/
  • 已运行 node scripts/i18n/verify-app-language-localization.mjs 和 node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单

逻辑归属 / Logic placement

N/A:忽略规则与自忽略编辑计划已在 Rust Core 实现;本次仅更新桌面端测试、Viva 依赖 pin 与 UI 节点 Key 归属。

性能与内存 / Performance and memory

N/A:未新增后台任务、缓存、轮询或运行时资源消耗。

设置 / Settings

N/A:未改变设置项读写来源、回显行为或设置页分组归属。

插件契约 / Plugin contract

N/A:未修改插件契约、能力版本或后端协议。

发行包与资源 / Bundle and resources

  • 运行时不向已安装的 app bundle 或 Windows 安装目录写入;已运行 ./scripts/desktop/verify/verify-runtime-bundle-immutability.sh
  • [N/A] 新增或修改宿主自身的下载、解压、生成或缓存资源的:未新增构建或缓存资源路径。

无用代码与重构 / Dead code and refactoring

  • 本次改动导致变成无用的代码已在本 PR 删除(移除未再使用的循环索引与无用局部变量,恢复 ui.Spacer(c))
  • [N/A] 本次之前就存在的无用代码或可重构之处:已就 settingswindow 中 remote_workspace_view_test.go 在并发包压力下的偶发失败现象在验证中如实记录(无额外提交重构)。

验证 / Verification

命令或操作 平台 结果
node scripts/desktop/validate-pins.mjs macOS arm64 通过(viva v0.6.8-0.20261123134538-bb85256c8ffa resolves,core bb0ad53f... is reachable)
(cd desktop && gofmt -l .)(先 gofmt -w .) macOS arm64 通过(输出为空)
./scripts/desktop/generate-desktop-icons.sh / ./scripts/desktop/generate-desktop-file-icons.sh macOS arm64 通过(后者在 icons.go / icons_tree.go 同步生成 go.svg 注释)
./scripts/desktop/desktop-go.sh vet ./... & ./scripts/desktop/desktop-go.sh vet -tags dev ./... macOS arm64 通过(exit 0)
./scripts/desktop/desktop-go.sh --exec go run github.com/vivaui/viva/cmd/viva vet ./... macOS arm64 仅报 2 条既有的 desktop/internal/pluginview/render.go:24,141 kept-context(exit 1),无新增问题
./scripts/desktop/desktop-go.sh test -tags dev -count=1 ./internal/buildinfo ./internal/settingswindow ./internal/pluginview ./internal/workbench macOS arm64 通过(buildinfo 0.402s、settingswindow 5.441s、pluginview 1.188s、workbench 359.889s;注:此前一次高负载运行中 TestRemoteWorkspaceDamagedFileIsReported 曾偶发失败 1 次,单独 -count=50 50/50 通过,最终全套复跑通过)
./scripts/desktop/desktop-go.sh test -tags 'dev vivahead' -count=1 ./internal/settingswindow ./internal/pluginview ./internal/workbench macOS arm64 通过(settingswindow 6.388s、pluginview 1.258s、workbench 351.916s)
非 DEV_TESTED 全量无标签包 ./scripts/desktop/desktop-go.sh test -count=1 "${untagged[@]}" macOS arm64 除高并行下超时与本机 Homebrew Bash 差异外其余全过(含 internal/toolchain 3.541s / 2.986s):默认 PATH 下因本机 /opt/homebrew/bin/bash(5.3.9)排在 /bin/bash 前导致 internal/localshell 2 个 bash 挂起测试失败,且 internal/cli TestCLILauncherPreservesNativeArguments(5s 子测试上限)在 80 包并行 CGO 链接期间超时;将 /bin 置于 PATH 最前复跑全包时 localshell 原 2 个用例通过,但并发压力下 TestWSLScriptStartsTheLoginShellInTheStartFolder/bash 与 TestCLILauncherPreservesNativeArguments 各自超时
PATH="/bin:/usr/bin:/usr/sbin:/sbin:$PATH" ./scripts/desktop/desktop-go.sh test -count=1 ./internal/cli ./internal/localshell macOS arm64 通过(internal/cli 1.908s、internal/localshell 7.648s,/bin/bash 3.2.57)
bash -n(13 个脚本)、zsh -n(2 个图标脚本)、shellcheck -S warning(0.11.0,13 个 bash 脚本) macOS arm64 全部通过
node scripts/i18n/verify-app-language-localization.mjs & generate-i18n.mjs --check & node --test --test-timeout=60000 scripts/i18n/test-i18n.mjs macOS arm64 通过(12628/12628 词条,62/62 测试通过)
./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh & verify-platform-feature-matrix-change.sh origin/main HEAD macOS arm64 通过(222 项能力校验通过,变更门禁通过)
./scripts/agent-notes/verify-agent-notes.sh macOS arm64 通过(203 active Agent Notes)
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh & node --test scripts/desktop/verify/test-runtime-bundle-immutability.mjs macOS arm64 通过(5/5 测试通过)
CI/打包/安装/性能节点脚本测试(desktop-ci.yml Format and script tests 两批 node --test,含 desktop-core-cache.test.mjs) macOS arm64 通过(91/91 与 28/28 全部通过)
./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/main macOS arm64 通过
rg 插件零依赖自查 macOS arm64 通过(0 命中)

未能执行的检查和原因:

  • Linux(ubuntu-latest)与 Windows(windows-latest / Parallels 虚拟机)构建、vet 与测试:当前在 macOS 宿主执行,需在 PR 就绪后的 GitHub Actions linux-test 与 windows lane 验证。
  • -tags 'vivahead lithevisual' 截图采集用例:本次运行了 -tags 'dev vivahead',未额外运行需要 LITHE_VISUAL_OUTPUT_DIR 的截图生成。

提交前确认 / Final checks

  • 分支从最新的 main 创建(已 merge 最新 origin/main c086a0b1b);目标分支:main
  • 以 Draft 提交,保持 Draft 直到审查与就绪决定;本轮只执行单次 push,不自动 gh pr ready 或 merge
  • 没有无关改动,没有提交 .build/、target/、dist/、.artifacts/ 等产物,没有凭据、个人路径和未脱敏的日志或截图
  • 本次构建、测试或预览启动的 Lithe 应用和子进程已全部关闭,没有进程残留

@ghfind-review ghfind-review Bot added the review: no-score ghfind author score missing (not zero) label Nov 23, 2026
@lithe-support

lithe-support Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Lithe Review — 最新 CI 验证(head 6817bb2a486b)

已按 Linux CI 逐个修复最初两处 Key 断言及后续同类叶节点用法,并纠正迁移中发现的未使用索引、辅助方法匿名父上下文问题。最新运行的 Vet and test on Linux 中,internal/workbench 的普通及各专项 UI 测试全部显示 ok,internal/settingswindow 的普通及专项 UI 测试也全部显示 ok;先前 Text/Spacer 的 Key panic 未再出现。 格式/脚本、版本 pin、矩阵、远端两架构构建和测试也通过。

完整 Desktop CI gate 仍为 failure,现有唯一失败 internal/toolchain/TestSavePinPreservesIgnoreTextAndOvercomesLaterNegation:源文本实际额外生成 /.gitignore 规则,与未合入的 Core 自忽略消费者 PR #2328 / Core #179 预期一致;这个文件和固定 Core 修订均不在 #2355 的 diff 中。没有通过全部门禁,也未验证 macOS/Windows(Draft 条件跳过),因此不标记 Ready、不合并。后续需先解决主线的 Core pin/回归期望一致性,再进行原生测试。

Mucheen added a commit to Mucheen/Lithe-IDEA that referenced this pull request Nov 23, 2026
Keep keys on the containers and controls that use them, and let context menus inherit their trigger identity. Start from the relevant changes in 1lck#2355 and cover the other failures found by the complete dev suite.

Pin the fork main revision from Lithe-IDEA/Lithe-viva#58 for the upstream textview menu fix.
@1lck 1lck changed the title fix(viva): 移除面包屑 Text / 工具栏 Spacer 的非法 Key,恢复 Desktop CI fix(viva): 同步 Viva fork、修复节点 Key 泄漏并合入 #2328 忽略测试以解除 main CI 死锁 Nov 23, 2026
@1lck
1lck marked this pull request as ready for review November 23, 2026 14:27
@1lck
1lck merged commit d90be7f into main Nov 23, 2026
17 of 22 checks passed
@1lck
1lck deleted the lithe-support/ci-viva-key-on-leaf-elements branch November 23, 2026 14:52
Mucheen added a commit to Mucheen/Lithe-IDEA that referenced this pull request Nov 23, 2026
Take the merged Viva CI fixes from 1lck#2355 and retain the plugin update changes. Use the current Core 1lck#187 revision, which includes the main workspace API and the delta commands.
Mucheen added a commit that referenced this pull request Nov 23, 2026
* feat(plugins): add incremental marketplace updates

* fix(plugins): serialize package changes across processes

* test(desktop): cover new bundle checks in the gate fixture

* fix(desktop): resolve Viva dev identity check failures

Keep keys on the containers and controls that use them, and let context menus inherit their trigger identity. Start from the relevant changes in #2355 and cover the other failures found by the complete dev suite.

Pin the fork main revision from Lithe-IDEA/Lithe-viva#58 for the upstream textview menu fix.

* fix(marketplace): serialize shared plugin archive cache writes

Reuse the native file lock for pruning, temporary copy and atomic publish. Limit acquisition to one second because a completed download can install without caching.

Add a deterministic two-process regression for both limits and test update delivery when the cache lock is unavailable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: no-score ghfind author score missing (not zero)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 默认忽略 .lithe/.gitignore 自身,避免进入 Git 待提交列表

1 participant