Repository navigation
fix(workbench): 焦点清空时保持引用和问题树选中项 - #2327
Merged
Merged
Conversation
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
引用和问题结果刷新时,新行在 Viva 绘制前还没有行 ID。如果键盘焦点恰好清空,旧实现会把两个空 ID 视为匹配,误选新增行,导致用户正在查看的结果跳走。
改动 / Changes
treelist包增加FocusedRow,统一用非空 Viva 焦点查找行。引用和问题树都通过它更新键盘选择。pending。origin/main(d90be7f20648703f8e0dc6d60df624b61a221c40,含 Vivabb85256c与#2355)并在合入后复审、重测全部受影响场景与竞态检查。不在本 PR 范围内 / Out of scope
无额外功能。结果排序、分组、折叠后的业务选择规则仍使用既有 Core 实现。
类型专属:fix
复现与根因
canvas.Focused()和TreeState.RowID(i),没有排除二者均为空的情况。引用路径由e45c8c049(feat(desktop): 引用工具窗口对齐 IDEA 查找用法,分组与行预览改由 Core 计算 #2097)引入,问题树路径由6a65ed2ef(feat(desktop): 问题工具窗口对齐 IDEA,树行与选中移动改由 Core 计算 #2106)引入。cc16002831ac916ec0f6c2ed98ab891de72f315f加入回归测试并先红后绿复现:树已绘制first/original,保留original选择,记录有效焦点;在下一次绘制前插入new,用空焦点调用真实面板同步函数。两个面板均失败:selection = "new" at 2 (tree 1), want "original" at 1。方向键场景在基线已经通过。origin/main后的本轮验证环境为 macOS arm64。检查项
desktop/internal/workbench/result_tree_focus_test.go。范围检查 / Scope checks
功能矩阵 / Feature matrix
references-pane.json与diagnostics-workspace.json的回归证据和验证动作。verificationStatus保持pending,没有把无头测试冒充原生验收。origin/main..HEAD功能矩阵变更门禁通过;全量校验 222 项能力数据通过,生成视图不提交。verify-test-stability.sh --base origin/main退出 0,已人工检查 Go 测试同步、等待、虚拟时钟、取消和清理;动态计时与-race结果列在下文。插件归属 / Plugin ownership
develop-lithe的宿主零依赖搜索命令执行,结果为空。UI 验证 / UI evidence
origin/main(Vivabb85256c+#2355)后在 macOS arm64 重跑TestVisualProblemsToolWindow与TestVisualReferencesToolWindow(-tags 'vivahead lithevisual'):4 种主题/语言共 8 个子场景全部通过,重新生成 20 张 PNG;已检查 8 张主图及代表性文件页/选项菜单/右键菜单图,引用保留absolute.go:5与对应预览,问题保留OrderService.java:13的警告与对应预览,渲染健康且与下方已上传截图的面板内容一致(仅原 Linux 截图与当前 macOS 窗口控制栏及状态栏显示随平台/main差异而不同)。pending。引用:失焦后保留选中行及预览,深浅主题 × 简体中文/英语
问题项目页:失焦后保留选中行及预览,深浅主题 × 简体中文/英语
统一日志系统 / Structured logging
N/A:没有新增或改动生产失败路径、用户操作终态或后台生命周期。
界面文案 / i18n
N/A:没有新增用户可见文字。现有应用语言检查与生成物检查均通过。
逻辑归属 / Logic placement
gfx.ID与ui.TreeState.RowID,属于视图焦点适配;不接受或解释业务行类型。性能与内存 / Performance and memory
设置 / Settings
N/A:没有设置项或设置读写行为变化。
插件契约 / Plugin contract
N/A:没有插件协议、宿主方法、SDK 或 Core API 变化。
发行包与资源 / Bundle and resources
N/A:没有新增运行时资源、写入路径或构建缓存;发行目录只读检查通过。
无用代码与重构 / Dead code and refactoring
验证 / Verification
合入
origin/main后本轮本地验证(macOS arm64)环境:macOS arm64,Go
1.27.4,Rust1.97.1,固定 Corebb0ad53f9100954306fcd139bf0e5003e6a515fe,固定 VivaLithe-IDEA/viva@v0.6.8-0.20261123134538-bb85256c8ffa(合入d90be7f20648703f8e0dc6d60df624b61a221c40后的 merge commitda0efe5e4d5071be527e5e4932a212b43b6f490b)。(cd desktop && gofmt -l .)、git diff --check origin/main...HEAD./scripts/desktop/desktop-go.sh vet ./...、./scripts/desktop/desktop-go.sh vet -tags dev ./..../scripts/desktop/desktop-go.sh --exec go run github.com/vivaui/viva/cmd/viva vet ./internal/treelist ./internal/workbench./scripts/desktop/desktop-go.sh test -tags 'dev vivahead' -count=1 ./internal/treelist ./internal/workbenchtreelist0.298s、workbench全包373.580s)./scripts/desktop/desktop-go.sh test -race -tags 'dev vivahead' -count=1 ./internal/treelist与受影响workbench定向竞态回归treelist1.399s、workbench定向8.683s)node .agents/skills/write-stable-tests/scripts/run-go-tests-with-timing.mjs(-tags 'dev vivahead',./internal/treelist与问题/引用定向用例)1.760s,TestResultTrees*9 项均0ms,最慢0.380s)TestVisualProblemsToolWindow、TestVisualReferencesToolWindow、TestVisualProjectTreeMissingFile(-tags 'vivahead lithevisual')8.462s生成 20 张 PNG,已查看主图与采样副图;项目树缺失文件2.221s4/4 通过)./scripts/desktop/desktop-go.sh test -count=1 -run 'Test.*(Problems|References|ReferenceLines)' ./internal/core2.596s)./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD、verify-platform-feature-matrix.sh、test-platform-feature-matrix.mjs./scripts/agent-notes/verify-agent-notes.sh、./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/main、插件零依赖rg检查verify-app-language-localization.mjs、generate-i18n.mjs --check、test-i18n.mjs、verify-runtime-bundle-immutability.sh、test-runtime-bundle-immutability.mjs、validate-pins.mjsbash -n、zsh -n、shellcheck -S warning与 CI 脚本测试(desktop-core-cache、verify-ci-gate、verify-remote-server-artifacts、package-desktop、editor-perf-report、cancel-closed-pr-runs、linux、desktop-autobuild/desktop-release)1/1、18/18、72/72、28/28)合入前原候选历史验证(Linux amd64,
f75de838cae18a5877c902158d1e4d6c39069226/ 基线cc16002831ac916ec0f6c2ed98ab891de72f315f)cc160028上先写TestResultTrees*回归:修改前两个失焦/新行场景真实失败,修改后 30/30 定向测试通过。vivahead,lithevisual两组截图测试 10/10 通过并上传 8 张主图。未能执行的检查和原因: macOS 与 Windows 原生窗口手动交互未执行;Windows 与 Linux 平台本轮未本地运行(交付 CI 与原生平台后续验证)。
提交前确认 / Final checks
origin/main(d90be7f20648703f8e0dc6d60df624b61a221c40->da0efe5e4d5071be527e5e4932a212b43b6f490b),目标分支为main。