Repository navigation
feat(desktop): 状态栏左侧改为导航路径,跟随编辑器、项目树和问题窗口的当前项 - #2111
Merged
Merged
Conversation
点进编辑器后指针停在编辑器上,悬停请求要等 300 ms 才发出,每次点击都让 settle 多等 300 ms。夹具把 hoverDelay 设为立即,原合并测试拆成“跟随编辑器与项目树”和“终端保持来源、项目外文件只显示文件名”两项,各自远低于 1 秒告警线。功能矩阵的自动化说明补上新测试名。
xiaoyumuxi
marked this pull request as ready for review
November 17, 2026 13:28
28 of 34 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
状态栏左侧只显示项目名,用户在项目树、编辑器或问题窗口里换位置时它不跟着变,看不出当前项在项目里的哪一层。IntelliJ IDEA / GoLand 在这里显示导航路径“项目 › 目录 › … › 文件”,跟随用户最后点击的区域。例如在 Problems 窗口选中一条问题时显示“□ awesomeProject › main.go”。本 PR 把 Lithe 的状态栏左侧改成同样的导航路径。
改动 / Changes
状态栏导航路径(
status_path.go、status_path_view.go)noteStatusPathFocus)。焦点落在终端、按钮、工具栏等没有当前项的区域时,沿用上一个来源。Status.Path词条。strings.Cut取子串。接线与小重构
chrome_view.go:statusBar改为调用statusPathView,不再直接画项目名。app.go:App新增statusPath状态字段。document_autosave.go:noteEditorFocus里“哪个文档的编辑器持有焦点”的循环抽成project.documentOwning,状态栏路径复用它,行为不变。测试、截图与功能矩阵
status_path_test.go有四项测试:TestStatusPathFollowsTheEditorAndTheProjectTree:编辑器与项目树切换、根行。TestStatusPathKeepsItsItemAndNamesAFileOutsideTheProject:终端获得焦点时保持来源;项目外的文件只显示文件名。TestStatusPathFollowsTheProblemsSelection:问题行与文件节点。TestStatusPathReusesItsStringsWhileThePathStays:用AllocsPerRun断言同一路径重复绘制时零分配。semantics.hoverDelay设为立即发出。点进编辑器后指针停在编辑器上,否则每次点击都要等 300 ms 的悬停请求,单项测试会越过 1 秒告警线。status_path_visual_test.go(vivahead && lithevisual):TestVisualStatusPath生成编辑器、项目树、问题窗口三个场景 × 明暗主题 × 中英文的无头截图。docs/assets/status-bar-navigation-path/存放改动前后的状态栏裁剪图和两张整窗截图。workbench-status-bar-navigation-path。两端都是implemented/pending,因为两端跑的是同一份 Viva 代码,原生窗口验收还没做。不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
pending。platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/workbench-status-bar-navigation-path.json:两端都是implemented/pending,证据是 5 个桌面端文件,owner 为 Workbench,并写明了验证动作。./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(validated 198 platform capabilities)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(passed).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空src/main.go、notes.txt),问题窗口测试复用已有的合成夹具problemsTreeFixture;没有读取任何插件包、检出或清单UI 验证 / UI evidence
LITHE_VISUAL_OUTPUT_DIR=<dir> scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/workbench/ -run TestVisualStatusPath -count=1src/main.go;项目树选中src;问题窗口选中问题行。en/zh-Hans,窗口 1440×900(2x)。origin/main上用同一测试生成。docs/assets/status-bar-navigation-path/)编辑器(暗色,zh-Hans):改动前只有项目名,改动后显示“项目 › src › main.go”。
编辑器(亮色,en)
项目树选中
src(暗色 zh-Hans / 亮色 en):显示“项目 › src”,末项带文件夹图标。问题窗口选中问题行(暗色 zh-Hans / 亮色 en):显示问题所在的文件。
整窗(改动后)
问题窗口选中问题行,暗色 zh-Hans:
项目树选中
src,亮色 en:统一日志系统 / Structured logging
N/A:只改状态栏的呈现,没有新增生命周期里程碑、用户操作终态、降级、恢复或失败路径。
界面文案 / i18n
Status.Path词条,路径各段是项目名、目录名和文件名,属于用户内容,不翻译node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,都通过;没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
projectRelative把绝对路径换成项目相对路径,用于呈现。没有新的可共享业务规则。性能与内存 / Performance and memory
TestStatusPathReusesItsStringsWhileThePathStays断言重复绘制零分配。设置 / Settings
N/A:没有新增或修改设置项、设置页或对话框选项。
插件契约 / Plugin contract
N/A:不涉及插件契约、能力版本、插件函数协议或宿主方法。
发行包与资源 / Bundle and resources
N/A:不新增运行时资源、缓存或下载物。截图只是仓库内的验收材料。已运行
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,macOS 和 Windows 源码的静态检查都通过。无用代码与重构 / Dead code and refactoring
noteEditorFocus里查找持有焦点的文档的循环抽成project.documentOwning,与状态栏路径共用,没有留下重复逻辑。验证 / Verification
scripts/desktop/desktop-go.sh test -count=1 -run 'TestStatusPath|TestProblems' ./internal/workbench/(rebase 到 #2110 后)scripts/desktop/desktop-go.sh test -count=1 ./internal/workbench/...(rebase 后)scripts/desktop/desktop-go.sh test -race ./internal/workbench/(rebase 到 #2102 后)scripts/desktop/desktop-go.sh test ./...(rebase 前)scripts/desktop/desktop-go.sh vet ./internal/workbench/./.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/workbench --filter 'StatusPath'./.agents/skills/write-stable-tests/scripts/verify-test-stability.shTestVisualStatusPath(vivahead lithevisual),改动前在origin/main上运行,改动后在本分支运行node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/desktop/verify/verify-runtime-bundle-immutability.shrg命令gofmt -l desktop/internal/workbench/未能执行的检查和原因:
pending。提交前确认 / Final checks
main创建,已 rebase 到origin/main(5c2a0912c,feat(desktop): 问题预览按严重程度着色并可直接编辑,选中色加深 #2110);目标分支main.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图