fix(config): add workspace and git_branch to known status bar items#4679
Closed
ttmouse wants to merge 1 commit into
Closed
fix(config): add workspace and git_branch to known status bar items#4679ttmouse wants to merge 1 commit into
ttmouse wants to merge 1 commit into
Conversation
The workspace and git_branch status bar items were added to the frontend enum and UI (SettingsPanel labels, StatusBar renderers, i18n translations) but the Go backend config didn't include them in knownDesktopStatusBarItems or defaultDesktopStatusBarItems. This caused the backend to silently filter them out, making them impossible to enable in the settings panel. Fix by adding both entries to the known map (so SetDesktopStatusBarItems accepts them) and the default list (so they appear enabled by default).
Contributor
Author
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.

问题
设置面板中新增了「工作区」(workspace) 和「Git 分支」(git_branch) 两个状态栏维度,但在设置面板中无法开启。
根因
前端代码(枚举定义、SettingsPanel 标签、StatusBar 渲染器、i18n 翻译)已完整支持 workspace 和 git_branch,但 Go 后端 的
knownDesktopStatusBarItems映射和defaultDesktopStatusBarItems列表中缺少这两项,导致后端在SetDesktopStatusBarItems()和normalizeDesktopStatusBarItems()时将其过滤掉。修复
在
internal/config/config.go中:defaultDesktopStatusBarItems添加"workspace"和"git_branch",位于"model"之后knownDesktopStatusBarItems添加对应的true条目验证
go build ./internal/config/...✅go test ./internal/config/... -run TestDesktopStatusBar✅