Repository navigation
feat(desktop): 问题工具窗口对齐 IDEA,树行与选中移动改由 Core 计算 - #2106
Merged
Merged
Conversation
问题工具窗口按 IDEA 的 Problems 窗口重做: - 标题栏加“文件 N / 项目 N”标签,默认打开文件标签;N 按显示选项统计当前编辑器 文件和整个项目的问题数,没有问题时只显示标签名;没有打开的文件时提示“没有打开的文件。” - 原来堆在上方的复选框和“分组”按钮改为左侧竖排操作列:视图选项(菜单里勾选显示错误、 警告、信息,选择按文件、按严重程度或不分组)、全部展开、全部收起、编辑器预览开关。 - 列表改为树:文件节点显示文件图标、文件名、灰色目录和问题数,严重程度节点显示级别名; 问题行显示严重程度图标、描述、来源和“:行号”,不按文件分组时行号前加文件名。 宽度不够时先截断描述,来源保持完整。 - 节点可展开收起;开启预览时单击只选中并在右侧只读源码显示所在行,双击或 Enter 打开文件 定位;关闭预览时单击直接定位。查询进行中用户新选的行在答案回来后保留。 - 可见行、节点展开状态、被折叠或消失时选中移到哪一行,都由 Core 的 lsp.problems.query (rows / selected / selectedRow)返回,宿主只绘制。PINNED_CORE_REVISION 固定到 Core 分支 feat/problems-tree 的 e270b7b,Core PR 合入后改为 main 上的合入提交。 i18n 新增标签、视图选项、显示/分组小标题、严重程度名和无打开文件提示,删除不再使用的 desktop.problems.groupBy。测试改写为覆盖标签计数、树节点、折叠后选中移动、视图选项和预览; 新增 TestVisualProblemsToolWindow 无头截图,截图放在 docs/assets/problems-tree/after。 功能矩阵 diagnostics-workspace 更新证据、验收说明和备注(之前误写为没有编辑器预览)。
# Conflicts: # scripts/desktop/build-desktop-core.sh
21 of 29 tasks
23 of 25 tasks
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
问题工具窗口和 IDEA 的 Problems 窗口差距明显:顶部堆着四个复选框和一个分组按钮,没有“当前文件 / 整个项目”两个范围,列表是平铺的,文件不能展开收起,问题行也没有行号。可见行和选中的规则写在 Go 界面层,按逻辑归属应由 Core 计算。
改动 / Changes
标签:标题栏放“文件 N / 项目 N”,默认打开文件标签(同 IDEA)。N 按显示选项统计当前编辑器文件和整个项目的问题数,没有问题时只显示标签名;没有打开文件时显示“没有打开的文件。”。第二个标签叫“项目”而不是 IDEA 的“项目错误”,因为它也列警告和信息。
左侧操作列:替换原来的复选框和“分组”按钮。从上到下依次是:视图选项菜单(勾选显示错误、警告、信息;选按文件、按严重程度或不分组)、全部展开、全部收起、编辑器预览开关。
树:
交互:
Core:可见行、节点展开状态,以及节点被折叠或问题消失后选中移到哪一行,都由
lsp.problems.query返回(rows、selected、selectedRow,文件分组带name、folder),宿主只发折叠键和选中键并绘制。desktop/internal/core/problems.go:ProblemsQuery加Collapsed、Selected;新增ProblemsRow;ProblemsGroup加Name、Folder。PINNED_CORE_REVISION升到 Core main cf2f260(CI:文件校验脚本的添加对注释修改的豁免 CI 流程 #82,基于 add: add comments to the rust core #81 的 18a370d)。文件:
problems.go:状态、两次查询(项目计数、树)、选中和展开。problems_view.go:操作列、树行、标签。problems_preview.go:预览取选中行对应的问题。shell_view.go:标题栏放标签。i18n:新增标签、视图选项、“显示”/“分组”小标题、严重程度名、无打开文件提示;删除不再使用的
desktop.problems.groupBy。测试:
problems_test.go改写,覆盖:新增无头截图测试
TestVisualProblemsToolWindow,截图放在docs/assets/problems-tree/after/。功能矩阵:
diagnostics-workspace更新证据、验收说明和备注。不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/diagnostics-workspace.json:证据路径和验证说明如实填写,未做的原生验收保持原状态./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(197 条通过)和verify-platform-feature-matrix-change对origin/main HEAD(通过).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空shared/i18n/;没有写插件构建步骤UI 验证 / UI evidence
TestVisualProblemsToolWindow(-tags 'vivahead lithevisual',1440×900,暗/亮 × 中文/英文)。场景:项目 shop,两个 Java 文件共 4 条诊断。截图分三组:文件标签、项目标签加预览、视图选项菜单。文件标签(默认)
项目标签,开启预览并选中一条问题
视图选项菜单
统一日志系统 / Structured logging
N/A:沿用已有的
operationFailed("plugin_problems_query")和performed(...),没有新增或改动生命周期、终态或失败路径。界面文案 / i18n
shared/i18n/补齐中英词条并运行generate-i18n.mjs提交生成结果;Viva 代码通过desktop/internal/i18n/读取verify-app-language-localization.mjs和generate-i18n.mjs --check(11434/11434),没有放宽脚本逻辑归属 / Logic placement
rows性能与内存 / Performance and memory
TestProblemsPanelVirtualizesLongList);关闭面板时丢弃查询缓存(TestProblemsCacheIsDroppedWhenThePanelCloses)设置 / Settings
N/A:没有新增或修改设置项。
插件契约 / Plugin contract
N/A:Core #82 没有改
shared/plugins/、能力版本或plugin-rpc,没有新增宿主方法。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh(通过)无用代码与重构 / Dead code and refactoring
desktop.problems.groupBy和旧的平铺行代码已删除验证 / Verification
desktop-go.sh vet ./...desktop-go.sh test ./...(链接 Core 分支 e270b7b)localshell的TestClosingAnIntegratedShellRightAfterACommandHangsUpItsJobs首轮失败,单独重跑通过,是已知偶发用例desktop-go.sh test ./internal/core/ ./internal/workbench/ -run 'Problems|Memory|ProcessMemory'(链接 Core 4d0dc1c,与 main cf2f260 同树)TestVisualProblemsToolWindow(vivahead lithevisual)verify-app-language-localization.mjs、generate-i18n.mjs --check、test-i18n.mjsverify-platform-feature-matrix.sh、test-platform-feature-matrix.mjs、verify-platform-feature-matrix-change.mjs origin/main HEADverify-runtime-bundle-immutability.sh未能执行的检查和原因:
test ./...中途停止,只重跑了 Problems、内存和 Core 桥接测试;完整套件交给本 PR 的 CI。提交前确认 / Final checks
main创建,已 merge 最新main(fix(desktop): 内存详情的 CPU/GPU 占用至少按 1 秒计算 #2103);目标分支main